diff options
author | Graham Madarasz <graham@lindenlab.com> | 2013-04-17 16:50:03 -0700 |
---|---|---|
committer | Graham Madarasz <graham@lindenlab.com> | 2013-04-17 16:50:03 -0700 |
commit | 8ed49bb828dc785684bd2c9764e34aa53d077c93 (patch) | |
tree | 28228de78efc52e390500024049f83629a79ffa4 | |
parent | 83f3fd0dd68092b2f8917342ac45f31d322674c5 (diff) |
Simplify ifdefs in alpha shaders for Mac
5 files changed, 19 insertions, 18 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl index e8cbf318a1..057c0a1ec9 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl @@ -37,11 +37,11 @@ out vec4 frag_color; uniform sampler2DRect depthMap; -#if INDEX_MODE != INDEXED +#if !INDEX_MODE || INDEX_MODE_NO_COLOR uniform sampler2D diffuseMap; #endif -#if INDEX_MODE == INDEXED +#if INDEX_MODE vec4 diffuseLookup(vec2 texcoord); #endif @@ -61,7 +61,7 @@ VARYING vec2 vary_texcoord2; VARYING vec3 vary_norm; VARYING mat3 vary_rotation; -#if INDEX_MODE != NON_INDEXED_NO_COLOR +#if !INDEX_MODE_NO_COLOR VARYING vec4 vertex_color; #endif @@ -124,13 +124,13 @@ void main() vec4 pos = vec4(vary_position, 1.0); -#if INDEX_MODE == INDEXED +#if INDEX_MODE vec4 diff= diffuseLookup(vary_texcoord0.xy); #else vec4 diff = texture2D(diffuseMap,vary_texcoord0.xy); #endif -#if INDEX_MODE == NON_INDEXED_NO_COLOR +#if INDEX_MODE_NO_COLOR float vertex_color_alpha = 1.0; #else float vertex_color_alpha = vertex_color.a; diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl index b9cd611105..7506123a94 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl @@ -34,7 +34,7 @@ uniform mat4 modelview_matrix; uniform mat4 modelview_projection_matrix; ATTRIBUTE vec3 position; -#if INDEX_MODE == INDEXED +#if INDEX_MODE void passTextureIndex(); #endif ATTRIBUTE vec3 normal; @@ -66,7 +66,7 @@ VARYING vec3 vary_fragcoord; VARYING vec3 vary_position; VARYING vec3 vary_pointlight_col; -#if INDEX_MODE != NON_INDEXED_NO_COLOR +#if !INDEX_MODE_NO_COLOR VARYING vec4 vertex_color; #endif @@ -161,7 +161,7 @@ void main() vary_texcoord1 = (texture_matrix0 * vec4(texcoord1,0,1)).xy; vary_texcoord2 = (texture_matrix0 * vec4(texcoord2,0,1)).xy; -#if INDEX_MODE == INDEXED +#if INDEX_MODE passTextureIndex(); vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy; #else @@ -197,7 +197,7 @@ void main() vary_directional.rgb = atmosAffectDirectionalLight(1.0f); col.rgb = col.rgb*diffuse_color.rgb; -#if INDEX_MODE != NON_INDEXED_NO_COLOR +#if !INDEX_MODE_NO_COLOR vertex_color = col; #endif diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl index 69bcca88b5..e2fd52b8ad 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl @@ -41,7 +41,7 @@ uniform sampler2DShadow shadowMap2; uniform sampler2DShadow shadowMap3; uniform sampler2DRect depthMap; -#if INDEX_MODE != INDEXED +#if !INDEX_MODE || INDEX_MODE_NO_COLOR uniform sampler2D diffuseMap; #endif @@ -62,7 +62,7 @@ VARYING vec2 vary_texcoord2; VARYING vec3 vary_norm; VARYING mat3 vary_rotation; -#if INDEX_MODE != NON_INDEXED_NO_COLOR +#if !INDEX_MODE_NO_COLOR VARYING vec4 vertex_color; #endif @@ -210,13 +210,13 @@ void main() } vec4 diff; -#if INDEX_MODE == INDEXED +#if INDEX_MODE diff = diffuseLookup(vary_texcoord0.xy); #else diff = texture2D(diffuseMap,vary_texcoord0.xy); #endif -#if INDEX_MODE == NON_INDEXED_NO_COLOR +#if INDEX_MODE_NO_COLOR float vertex_color_alpha = 1.0; #else float vertex_color_alpha = vertex_color.a; diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl index 5f2961c90e..7c71e605c7 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl @@ -34,7 +34,7 @@ uniform mat4 modelview_matrix; uniform mat4 modelview_projection_matrix; ATTRIBUTE vec3 position; -#if INDEX_MODE == INDEXED +#if INDEX_MODE void passTextureIndex(); #endif ATTRIBUTE vec3 normal; @@ -67,7 +67,7 @@ VARYING vec3 vary_fragcoord; VARYING vec3 vary_position; VARYING vec3 vary_pointlight_col; -#if INDEX_MODE != NON_INDEXED_NO_COLOR +#if !INDEX_MODE_NO_COLOR VARYING vec4 vertex_color; #endif @@ -162,7 +162,7 @@ void main() #endif vary_texcoord1 = (texture_matrix0 * vec4(texcoord1,0,1)).xy; vary_texcoord2 = (texture_matrix0 * vec4(texcoord2,0,1)).xy; -#if INDEX_MODE == INDEXED +#if INDEX_MODE passTextureIndex(); vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy; #else @@ -198,7 +198,7 @@ void main() col.rgb = col.rgb*diffuse_color.rgb; -#if INDEX_MODE != NON_INDEXED_NO_COLOR +#if !INDEX_MODE_NO_COLOR vertex_color = col; #endif diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index c7e422139d..92533f64ab 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -1221,7 +1221,8 @@ BOOL LLViewerShaderMgr::loadShadersDeferred() gDeferredSkinnedAlphaProgram.mShaderFiles.push_back(make_pair("deferred/alphaV.glsl", GL_VERTEX_SHADER_ARB)); gDeferredSkinnedAlphaProgram.mShaderFiles.push_back(make_pair("deferred/alphaF.glsl", GL_FRAGMENT_SHADER_ARB)); gDeferredSkinnedAlphaProgram.mShaderLevel = mVertexShaderLevel[SHADER_DEFERRED]; - gDeferredSkinnedAlphaProgram.addPermutation("INDEX_MODE", "2"); + gDeferredSkinnedAlphaProgram.addPermutation("INDEX_MODE", "0"); + gDeferredSkinnedAlphaProgram.addPermutation("INDEX_MODE_NO_COLOR", "0"); gDeferredSkinnedAlphaProgram.addPermutation("HAS_SKIN", "1"); gDeferredSkinnedAlphaProgram.addPermutation("IS_AVATAR_SKIN", "0"); success = gDeferredSkinnedAlphaProgram.createShader(NULL, NULL); |