summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class1
diff options
context:
space:
mode:
authorGraham Madarasz <graham@lindenlab.com>2013-04-18 05:30:44 -0700
committerGraham Madarasz <graham@lindenlab.com>2013-04-18 05:30:44 -0700
commitf76b3d7e7d778fec7f082c46491197cac9867a50 (patch)
treee03fa2b4f83f244cd81d77712df0cfdf9456acef /indra/newview/app_settings/shaders/class1
parent1c3c737a83d9634fd0c47502b4c94b7613280d53 (diff)
NORSPEC-125 fiddle with ifdefs in alpha shaders again in hopes of linking on mobile geforce macs
Diffstat (limited to 'indra/newview/app_settings/shaders/class1')
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl20
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl24
2 files changed, 23 insertions, 21 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
index 057c0a1ec9..713aae9187 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
@@ -25,10 +25,6 @@
#extension GL_ARB_texture_rectangle : enable
-#define INDEXED 1
-#define NON_INDEXED 2
-#define NON_INDEXED_NO_COLOR 3
-
#ifdef DEFINE_GL_FRAGCOLOR
out vec4 frag_color;
#else
@@ -37,11 +33,13 @@ out vec4 frag_color;
uniform sampler2DRect depthMap;
-#if !INDEX_MODE || INDEX_MODE_NO_COLOR
+#ifndef INDEX_MODE
+#ifndef INDEX_MODE_USE_COLOR
uniform sampler2D diffuseMap;
#endif
+#endif
-#if INDEX_MODE
+#ifdef INDEX_MODE
vec4 diffuseLookup(vec2 texcoord);
#endif
@@ -61,7 +59,7 @@ VARYING vec2 vary_texcoord2;
VARYING vec3 vary_norm;
VARYING mat3 vary_rotation;
-#if !INDEX_MODE_NO_COLOR
+#ifdef INDEX_MODE_USE_COLOR
VARYING vec4 vertex_color;
#endif
@@ -124,16 +122,16 @@ void main()
vec4 pos = vec4(vary_position, 1.0);
-#if INDEX_MODE
+#ifdef INDEX_MODE
vec4 diff= diffuseLookup(vary_texcoord0.xy);
#else
vec4 diff = texture2D(diffuseMap,vary_texcoord0.xy);
#endif
-#if INDEX_MODE_NO_COLOR
- float vertex_color_alpha = 1.0;
-#else
+#ifdef INDEX_MODE_USE_COLOR
float vertex_color_alpha = vertex_color.a;
+#else
+ float vertex_color_alpha = 1.0;
#endif
vec3 normal = texture2D(bumpMap, vary_texcoord1.xy).xyz * 2 - 1;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl
index 7506123a94..55d15ce847 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
+#ifdef INDEX_MODE
void passTextureIndex();
#endif
ATTRIBUTE vec3 normal;
@@ -44,7 +44,7 @@ ATTRIBUTE vec3 binormal;
ATTRIBUTE vec2 texcoord1;
ATTRIBUTE vec2 texcoord2;
-#if HAS_SKIN
+#ifdef HAS_SKIN
mat4 getObjectSkinnedTransform();
#elif IS_AVATAR_SKIN
mat4 getSkinnedTransform();
@@ -66,7 +66,7 @@ VARYING vec3 vary_fragcoord;
VARYING vec3 vary_position;
VARYING vec3 vary_pointlight_col;
-#if !INDEX_MODE_NO_COLOR
+#ifdef INDEX_MODE_USE_COLOR
VARYING vec4 vertex_color;
#endif
@@ -127,7 +127,7 @@ void main()
vec4 pos;
vec3 norm;
//transform vertex
-#if HAS_SKIN
+#ifdef HAS_SKIN
mat4 trans = getObjectSkinnedTransform();
trans = modelview_matrix * trans;
@@ -137,7 +137,8 @@ void main()
norm = normalize((trans * vec4(norm, 1.0)).xyz - pos.xyz);
vec4 frag_pos = projection_matrix * pos;
gl_Position = frag_pos;
-#elif IS_AVATAR_SKIN
+#else
+#ifdef IS_AVATAR_SKIN
mat4 trans = getSkinnedTransform();
vec4 pos_in = vec4(position.xyz, 1.0);
pos.x = dot(trans[0], pos_in);
@@ -158,10 +159,12 @@ void main()
pos = (modelview_matrix * vert);
gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0);
#endif
+#endif
vary_texcoord1 = (texture_matrix0 * vec4(texcoord1,0,1)).xy;
vary_texcoord2 = (texture_matrix0 * vec4(texcoord2,0,1)).xy;
-#if INDEX_MODE
+
+#ifdef INDEX_MODE
passTextureIndex();
vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
#else
@@ -197,17 +200,18 @@ void main()
vary_directional.rgb = atmosAffectDirectionalLight(1.0f);
col.rgb = col.rgb*diffuse_color.rgb;
-#if !INDEX_MODE_NO_COLOR
+#ifdef INDEX_MODE_USE_COLOR
vertex_color = col;
#endif
-#if HAS_SKIN
+#ifdef HAS_SKIN
vary_fragcoord.xyz = frag_pos.xyz + vec3(0,0,near_clip);
-#elif IS_AVATAR_SKIN
+#else
+#ifdef IS_AVATAR_SKIN
vary_fragcoord.xyz = pos.xyz + vec3(0,0,near_clip);
#else
pos = modelview_projection_matrix * vert;
vary_fragcoord.xyz = pos.xyz + vec3(0,0,near_clip);
#endif
-
+#endif
}