tes-tiger/resources/thread.fragment

18 lines
443 B
Plaintext
Raw Normal View History

2018-06-14 19:41:30 +00:00
#version 460 core
in vec3 fNormal;
in vec2 fTextureCoordinates;
in vec3 fColor;
uniform sampler2D sampler;
out vec4 color;
const vec3 lightDirection = normalize(vec3(0.0f, 0.0f, -1.0f));
void main() {
vec3 sampleColor = texture(sampler, fTextureCoordinates).rgb;
float intensity = clamp(dot(lightDirection, -normalize(fNormal)), 0.0f, 1.0f);
color = vec4(intensity * sampleColor * fColor + vec3(0.15f, 0.15f, 0.15f), 1.0f);
}