mirror of https://github.com/OpenMW/openmw.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
428 B
GLSL
24 lines
428 B
GLSL
4 years ago
|
#version 120
|
||
|
|
||
3 years ago
|
#include "vertexcolors.glsl"
|
||
4 years ago
|
|
||
2 years ago
|
varying vec3 vertexNormal;
|
||
|
|
||
2 years ago
|
uniform bool useAdvancedShader = false;
|
||
2 years ago
|
|
||
4 years ago
|
void main()
|
||
|
{
|
||
2 years ago
|
vec3 lightDir = normalize(vec3(-1., -0.5, -2.));
|
||
|
|
||
|
float lightAttenuation = dot(-lightDir, vertexNormal) * 0.5 + 0.5;
|
||
|
|
||
2 years ago
|
if(!useAdvancedShader)
|
||
2 years ago
|
{
|
||
|
gl_FragData[0] = getDiffuseColor();
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
gl_FragData[0] = vec4(passColor.xyz * lightAttenuation, 1.);
|
||
|
}
|
||
4 years ago
|
}
|