1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2024-12-28 18:18:52 +00:00
OpenMW/files/shaders/compatibility/debug.frag
2023-02-25 11:03:39 -08:00

24 lines
428 B
GLSL

#version 120
#include "vertexcolors.glsl"
varying vec3 vertexNormal;
uniform bool useAdvancedShader = false;
void main()
{
vec3 lightDir = normalize(vec3(-1., -0.5, -2.));
float lightAttenuation = dot(-lightDir, vertexNormal) * 0.5 + 0.5;
if(!useAdvancedShader)
{
gl_FragData[0] = getDiffuseColor();
}
else
{
gl_FragData[0] = vec4(passColor.xyz * lightAttenuation, 1.);
}
}