summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class1
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2013-03-29 16:13:36 -0500
committerDave Parks <davep@lindenlab.com>2013-03-29 16:13:36 -0500
commitfc4869fb7871632b95dd293157b9965fb2edcb73 (patch)
treef752e158bb12f116730a48ca7b9ca84cd27fdf4f /indra/newview/app_settings/shaders/class1
parent7c4fd34dce346171be603d6fe6e88cf56ebe2208 (diff)
NORSPEC-65 Hook up texture offset/scale/rotation for normal and specular maps.
Diffstat (limited to 'indra/newview/app_settings/shaders/class1')
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/materialF.glsl7
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/materialV.glsl15
2 files changed, 20 insertions, 2 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl b/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl
index fdaad550f7..e406bf14a9 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl
@@ -44,6 +44,8 @@ uniform sampler2D bumpMap;
#if HAS_SPECULAR_MAP
uniform sampler2D specularMap;
uniform float env_intensity;
+
+VARYING vec2 vary_texcoord2;
#endif
uniform vec4 specular_color;
@@ -56,6 +58,7 @@ uniform float minimum_alpha;
VARYING vec3 vary_mat0;
VARYING vec3 vary_mat1;
VARYING vec3 vary_mat2;
+VARYING vec2 vary_texcoord1;
#else
VARYING vec3 vary_normal;
#endif
@@ -77,13 +80,13 @@ void main()
#endif
#if HAS_SPECULAR_MAP
- vec4 spec = texture2D(specularMap, vary_texcoord0.xy);
+ vec4 spec = texture2D(specularMap, vary_texcoord2.xy);
#else
vec4 spec = specular_color;
#endif
#if HAS_NORMAL_MAP
- vec4 norm = texture2D(bumpMap, vary_texcoord0.xy);
+ vec4 norm = texture2D(bumpMap, vary_texcoord1.xy);
norm.xyz = norm.xyz * 2 - 1;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/materialV.glsl b/indra/newview/app_settings/shaders/class1/deferred/materialV.glsl
index f92ad63100..744f79c0c9 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/materialV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/materialV.glsl
@@ -34,14 +34,22 @@ ATTRIBUTE vec2 texcoord0;
#if HAS_NORMAL_MAP
ATTRIBUTE vec3 binormal;
+ATTRIBUTE vec2 texcoord1;
VARYING vec3 vary_mat0;
VARYING vec3 vary_mat1;
VARYING vec3 vary_mat2;
+
+VARYING vec2 vary_texcoord1;
#else
VARYING vec3 vary_normal;
#endif
+#if HAS_SPECULAR_MAP
+ATTRIBUTE vec2 texcoord2;
+VARYING vec2 vary_texcoord2;
+#endif
+
VARYING vec4 vertex_color;
VARYING vec2 vary_texcoord0;
@@ -51,6 +59,13 @@ void main()
gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
+#if HAS_NORMAL_MAP
+ vary_texcoord1 = (texture_matrix0 * vec4(texcoord1,0,1)).xy;
+#endif
+
+#if HAS_SPECULAR_MAP
+ vary_texcoord2 = (texture_matrix0 * vec4(texcoord2,0,1)).xy;
+#endif
vec3 n = normalize(normal_matrix * normal);
#if HAS_NORMAL_MAP