1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-03 17:37:18 +00:00

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

This commit is contained in:
scrawl 2017-02-08 18:39:24 +01:00
parent 206e2bf975
commit 45ae8d5ffa
2 changed files with 7 additions and 1 deletions

View File

@ -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";

View File

@ -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