Grafika2023/PlanetCreator/cw 6/shaders/shader_biomes.frag

19 lines
357 B
GLSL
Raw Normal View History

2024-01-11 23:37:20 +01:00
#version 430 core
float AMBIENT = 0.1;
uniform vec3 lightPos;
in vec3 vecNormal;
in vec3 worldPos;
vec3 color;
out vec4 outColor;
void main()
{
vec3 lightDir = normalize(lightPos-worldPos);
vec3 normal = normalize(vecNormal);
float diffuse=max(0,dot(normal,lightDir));
color=vec3(vecNormal.x,vecNormal.y,vecNormal.z);
outColor = vec4(color, 1.0);
}