mirror of
https://github.com/OpenMW/openmw.git
synced 2025-04-01 21:36:42 +00:00
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
23 lines
451 B
GLSL
23 lines
451 B
GLSL
#version 120
|
|
#include "vertexcolors.glsl"
|
|
|
|
varying vec3 vertexColor;
|
|
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(vertexColor * lightAttenuation, 1.);
|
|
}
|
|
}
|