diff --git a/components/shader/shadervisitor.cpp b/components/shader/shadervisitor.cpp index 041b568df..799781303 100644 --- a/components/shader/shadervisitor.cpp +++ b/components/shader/shadervisitor.cpp @@ -272,6 +272,9 @@ namespace Shader { switch (reqs.mVertexColorMode) { + case GL_AMBIENT: + defineMap["colorMode"] = "3"; + break; default: case GL_AMBIENT_AND_DIFFUSE: defineMap["colorMode"] = "2"; diff --git a/files/shaders/lighting.glsl b/files/shaders/lighting.glsl index d62b61b52..7b8486fbe 100644 --- a/files/shaders/lighting.glsl +++ b/files/shaders/lighting.glsl @@ -5,7 +5,10 @@ vec4 doLighting(vec3 viewPos, vec3 viewNormal, vec4 vertexColor) vec3 lightDir; float d; -#if @colorMode == 2 +#if @colorMode == 3 + vec4 diffuse = gl_FrontMaterial.diffuse; + vec3 ambient = vertexColor.xyz; +#elif @colorMode == 2 vec4 diffuse = vertexColor; vec3 ambient = vertexColor.xyz; #else