1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-25 15:35:23 +00:00
OpenMW/files/shaders/debug_fragment.glsl
florent.teppe 21971c08ba debug draw shader uses the generic functions
renamed files

roundabout way to change case with windows noticing

fixed type

fix filename in cmakelist.txt

ported shader and c++ code so glsl 120 can be used instead of 330

new debug shader and old one are almost unified

for some reason, even though I get no compilation issue, old debug draws don't work, only the new one implemented by this MR

remove useless const cast
2022-09-11 17:53:59 +02:00

24 lines
428 B
GLSL

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