Add support for GL_AMBIENT colorMode to shaders as required by particle systems

pull/145/head
scrawl 8 years ago
parent 206e2bf975
commit 45ae8d5ffa

@ -272,6 +272,9 @@ namespace Shader
{ {
switch (reqs.mVertexColorMode) switch (reqs.mVertexColorMode)
{ {
case GL_AMBIENT:
defineMap["colorMode"] = "3";
break;
default: default:
case GL_AMBIENT_AND_DIFFUSE: case GL_AMBIENT_AND_DIFFUSE:
defineMap["colorMode"] = "2"; defineMap["colorMode"] = "2";

@ -5,7 +5,10 @@ vec4 doLighting(vec3 viewPos, vec3 viewNormal, vec4 vertexColor)
vec3 lightDir; vec3 lightDir;
float d; float d;
#if @colorMode == 2 #if @colorMode == 3
vec4 diffuse = gl_FrontMaterial.diffuse;
vec3 ambient = vertexColor.xyz;
#elif @colorMode == 2
vec4 diffuse = vertexColor; vec4 diffuse = vertexColor;
vec3 ambient = vertexColor.xyz; vec3 ambient = vertexColor.xyz;
#else #else

Loading…
Cancel
Save