OpenGL2: remove lightmap support from generic glsl shader.
This path was barely used and doing this compiles fewer shaders.
This commit is contained in:
parent
1d016e6ff5
commit
b1821e303d
6 changed files with 3 additions and 238 deletions
|
@ -1,45 +1,12 @@
|
|||
uniform sampler2D u_DiffuseMap;
|
||||
|
||||
#if defined(USE_LIGHTMAP)
|
||||
uniform sampler2D u_LightMap;
|
||||
|
||||
uniform int u_Texture1Env;
|
||||
#endif
|
||||
|
||||
varying vec2 var_DiffuseTex;
|
||||
|
||||
#if defined(USE_LIGHTMAP)
|
||||
varying vec2 var_LightTex;
|
||||
#endif
|
||||
|
||||
varying vec4 var_Color;
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
vec4 color = texture2D(u_DiffuseMap, var_DiffuseTex);
|
||||
#if defined(USE_LIGHTMAP)
|
||||
vec4 color2 = texture2D(u_LightMap, var_LightTex);
|
||||
#if defined(RGBM_LIGHTMAP)
|
||||
color2.rgb *= color2.a;
|
||||
color2.a = 1.0;
|
||||
#endif
|
||||
|
||||
if (u_Texture1Env == TEXENV_MODULATE)
|
||||
{
|
||||
color *= color2;
|
||||
}
|
||||
else if (u_Texture1Env == TEXENV_ADD)
|
||||
{
|
||||
color += color2;
|
||||
}
|
||||
else if (u_Texture1Env == TEXENV_REPLACE)
|
||||
{
|
||||
color = color2;
|
||||
}
|
||||
|
||||
//color = color * (u_Texture1Env.xxxx + color2 * u_Texture1Env.z) + color2 * u_Texture1Env.y;
|
||||
#endif
|
||||
|
||||
gl_FragColor = color * var_Color;
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@ attribute vec3 attr_Normal2;
|
|||
attribute vec4 attr_Color;
|
||||
attribute vec4 attr_TexCoord0;
|
||||
|
||||
#if defined(USE_LIGHTMAP) || defined(USE_TCGEN)
|
||||
#if defined(USE_TCGEN)
|
||||
attribute vec4 attr_TexCoord1;
|
||||
#endif
|
||||
|
||||
|
@ -57,9 +57,6 @@ uniform float u_VertexLerp;
|
|||
#endif
|
||||
|
||||
varying vec2 var_DiffuseTex;
|
||||
#if defined(USE_LIGHTMAP)
|
||||
varying vec2 var_LightTex;
|
||||
#endif
|
||||
varying vec4 var_Color;
|
||||
|
||||
#if defined(USE_DEFORM_VERTEXES)
|
||||
|
@ -230,10 +227,6 @@ void main()
|
|||
var_DiffuseTex = tex;
|
||||
#endif
|
||||
|
||||
#if defined(USE_LIGHTMAP)
|
||||
var_LightTex = attr_TexCoord1.st;
|
||||
#endif
|
||||
|
||||
#if defined(USE_RGBAGEN)
|
||||
var_Color = CalcColor(position, normal);
|
||||
#else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue