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.
openmw/files/shaders/vertexcolors.glsl

39 lines
883 B
GLSL

centroid varying vec4 passColor;
uniform int colorMode;
const int ColorMode_None = 0;
const int ColorMode_Emission = 1;
const int ColorMode_AmbientAndDiffuse = 2;
const int ColorMode_Ambient = 3;
const int ColorMode_Diffuse = 4;
const int ColorMode_Specular = 5;
vec4 getEmissionColor()
{
if (colorMode == ColorMode_Emission)
return passColor;
return gl_FrontMaterial.emission;
}
vec4 getAmbientColor()
{
if (colorMode == ColorMode_AmbientAndDiffuse || colorMode == ColorMode_Ambient)
return passColor;
return gl_FrontMaterial.ambient;
}
vec4 getDiffuseColor()
{
if (colorMode == ColorMode_AmbientAndDiffuse || colorMode == ColorMode_Diffuse)
return passColor;
return gl_FrontMaterial.diffuse;
}
vec4 getSpecularColor()
{
if (colorMode == ColorMode_Specular)
return passColor;
return gl_FrontMaterial.specular;
}