mirror of
https://github.com/redstrate/Novus.git
synced 2025-04-23 04:27:45 +00:00
20 lines
448 B
GLSL
20 lines
448 B
GLSL
#version 450
|
|
|
|
layout(location = 0) in vec3 inNormal;
|
|
layout(location = 1) in vec3 inFragPos;
|
|
layout(location = 2) in vec2 inUV;
|
|
|
|
layout(location = 0) out vec4 outColor;
|
|
|
|
layout(binding = 3) uniform sampler2D tex;
|
|
|
|
void main() {
|
|
const vec3 lightPos = vec3(3);
|
|
|
|
vec3 norm = normalize(inNormal);
|
|
vec3 lightDir = normalize(lightPos - inFragPos);
|
|
|
|
float diff = max(dot(norm, lightDir), 0.0);
|
|
|
|
outColor = texture(tex, inUV) * diff;
|
|
}
|