1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-03-25 16:43:33 +00:00
OpenMW/files/shaders/debugDraw_fragment.glsl
florent.teppe bd1bbc0ab8 removes mutex, and uses double buffering to avoid writing on a resource that will be read by the draw thread
changes when the buffers are reset -> at the end of the draw, because that's when we are certain the data isn't needed anymore

removed useless variable
fixed typo
include osg::vec3 instead of osg vec3f

compile linux

compile ?

applied clang format to the new files
2022-09-11 17:53:56 +02:00

16 lines
293 B
GLSL

#version 330 compatibility
in vec3 vertexColor;
in vec3 vertexNormal;
out vec4 fragColor;
void main()
{
vec3 lightDir = normalize(vec3(-1., -0.5, -2.));
float lightAttenuation = dot(-lightDir, vertexNormal) * 0.5 + 0.5;
fragColor = vec4(vertexColor * lightAttenuation, 1.);
}