summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class1/deferred/materialV.glsl
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/app_settings/shaders/class1/deferred/materialV.glsl')
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/materialV.glsl55
1 files changed, 26 insertions, 29 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/materialV.glsl b/indra/newview/app_settings/shaders/class1/deferred/materialV.glsl
index 7e29ada205..7cdddfe8db 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/materialV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/materialV.glsl
@@ -1,5 +1,5 @@
/**
- * @file bumpV.glsl
+ * @file materialV.glsl
*
* $LicenseInfo:firstyear=2007&license=viewerlgpl$
* Second Life Viewer Source Code
@@ -43,38 +43,38 @@ uniform mat4 modelview_projection_matrix;
uniform mat4 modelview_matrix;
#endif
-VARYING vec3 vary_position;
+out vec3 vary_position;
#endif
uniform mat4 texture_matrix0;
-ATTRIBUTE vec3 position;
-ATTRIBUTE vec4 diffuse_color;
-ATTRIBUTE vec3 normal;
-ATTRIBUTE vec2 texcoord0;
+in vec3 position;
+in vec4 diffuse_color;
+in vec3 normal;
+in vec2 texcoord0;
#ifdef HAS_NORMAL_MAP
-ATTRIBUTE vec4 tangent;
-ATTRIBUTE vec2 texcoord1;
+in vec4 tangent;
+in vec2 texcoord1;
-VARYING vec3 vary_mat0;
-VARYING vec3 vary_mat1;
-VARYING vec3 vary_mat2;
+out vec3 vary_tangent;
+flat out float vary_sign;
+out vec3 vary_normal;
-VARYING vec2 vary_texcoord1;
+out vec2 vary_texcoord1;
#else
-VARYING vec3 vary_normal;
+out vec3 vary_normal;
#endif
#ifdef HAS_SPECULAR_MAP
-ATTRIBUTE vec2 texcoord2;
-VARYING vec2 vary_texcoord2;
+in vec2 texcoord2;
+out vec2 vary_texcoord2;
#endif
-VARYING vec4 vertex_color;
-VARYING vec2 vary_texcoord0;
+out vec4 vertex_color;
+out vec2 vary_texcoord0;
void main()
{
@@ -111,24 +111,21 @@ void main()
vec3 n = normalize((mat*vec4(normal.xyz+position.xyz,1.0)).xyz-pos.xyz);
#ifdef HAS_NORMAL_MAP
vec3 t = normalize((mat*vec4(tangent.xyz+position.xyz,1.0)).xyz-pos.xyz);
- vec3 b = cross(n, t)*tangent.w;
-
- vary_mat0 = vec3(t.x, b.x, n.x);
- vary_mat1 = vec3(t.y, b.y, n.y);
- vary_mat2 = vec3(t.z, b.z, n.z);
+
+ vary_tangent = t;
+ vary_sign = tangent.w;
+ vary_normal = n;
#else //HAS_NORMAL_MAP
-vary_normal = n;
+ vary_normal = n;
#endif //HAS_NORMAL_MAP
#else //HAS_SKIN
vec3 n = normalize(normal_matrix * normal);
#ifdef HAS_NORMAL_MAP
vec3 t = normalize(normal_matrix * tangent.xyz);
- vec3 b = cross(n,t)*tangent.w;
- //vec3 t = cross(b,n) * binormal.w;
-
- vary_mat0 = vec3(t.x, b.x, n.x);
- vary_mat1 = vec3(t.y, b.y, n.y);
- vary_mat2 = vec3(t.z, b.z, n.z);
+
+ vary_tangent = t;
+ vary_sign = tangent.w;
+ vary_normal = n;
#else //HAS_NORMAL_MAP
vary_normal = n;
#endif //HAS_NORMAL_MAP