Grafika2023/PlanetCreator/cw 6/shaders/shader_5_sun.frag
2024-01-11 17:57:31 +01:00

19 lines
316 B
GLSL

#version 430 core
float AMBIENT = 0.1;
uniform vec3 color;
uniform vec3 lightPos;
in vec3 vecNormal;
in vec3 worldPos;
out vec4 outColor;
void main()
{
vec3 lightDir = normalize(lightPos-worldPos);
vec3 normal = normalize(vecNormal);
float diffuse=max(0,dot(normal,lightDir));
outColor = vec4(color, 1.0);
}