summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class1/deferred
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/app_settings/shaders/class1/deferred')
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/alphaSkinnedV.glsl10
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl15
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/attachmentShadowV.glsl10
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl6
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/avatarEyesV.glsl11
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/avatarShadowV.glsl4
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/avatarV.glsl4
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/blurLightV.glsl6
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/bumpSkinnedV.glsl10
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/bumpV.glsl14
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl6
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/diffuseNoColorV.glsl31
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/diffuseSkinnedV.glsl10
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/diffuseV.glsl11
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/emissiveV.glsl31
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/fullbrightV.glsl12
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/giV.glsl6
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/impostorV.glsl9
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/luminanceV.glsl3
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/multiPointLightV.glsl3
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/pointLightV.glsl4
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/postDeferredV.glsl6
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/postgiV.glsl4
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskV.glsl9
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/shadowV.glsl6
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/skyV.glsl6
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/softenLightV.glsl3
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/starsV.glsl8
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/sunLightV.glsl4
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/terrainV.glsl12
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/treeShadowV.glsl27
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/treeV.glsl11
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/waterV.glsl10
33 files changed, 229 insertions, 93 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaSkinnedV.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaSkinnedV.glsl
index 2c2b58d59b..9deb9a701e 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/alphaSkinnedV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/alphaSkinnedV.glsl
@@ -21,7 +21,9 @@
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
-
+
+uniform mat4 projection_matrix;
+uniform mat4 modelview_matrix;
attribute vec3 position;
attribute vec3 normal;
@@ -86,14 +88,14 @@ void main()
vec3 norm;
mat4 trans = getObjectSkinnedTransform();
- trans = gl_ModelViewMatrix * trans;
+ trans = modelview_matrix * trans;
pos = trans * vec4(position.xyz, 1.0);
norm = position.xyz + normal.xyz;
- norm = normalize(( trans*vec4(norm, 1.0) ).xyz-pos.xyz);
+ norm = normalize(( trans*vec4(norojrm, 1.0) ).xyz-pos.xyz);
- vec4 frag_pos = gl_ProjectionMatrix * pos;
+ vec4 frag_pos = projection_matrix * pos;
gl_Position = frag_pos;
vary_position = pos.xyz;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl
index 7a2f34ca1d..51e7c0780d 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl
@@ -23,6 +23,11 @@
* $/LicenseInfo$
*/
+uniform mat3 normal_matrix;
+uniform mat4 texture_matrix0;
+uniform mat4 modelview_matrix;
+uniform mat4 modelview_projection_matrix;
+
attribute vec4 position;
attribute vec3 normal;
attribute vec4 diffuse_color;
@@ -85,12 +90,12 @@ void main()
//transform vertex
vec4 vert = vec4(position.xyz, 1.0);
vary_texture_index = position.w;
- vec4 pos = (gl_ModelViewMatrix * vert);
- gl_Position = gl_ModelViewProjectionMatrix*vec4(position.xyz, 1.0);
+ vec4 pos = (modelview_matrix * vert);
+ gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0);
- gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
+ gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
- vec3 norm = normalize(gl_NormalMatrix * normal);
+ vec3 norm = normalize(normal_matrix * normal);
float dp_directional_light = max(0.0, dot(norm, gl_LightSource[0].position.xyz));
vary_position = pos.xyz + gl_LightSource[0].position.xyz * (1.0-dp_directional_light)*shadow_offset;
@@ -126,7 +131,7 @@ void main()
gl_FogFragCoord = pos.z;
- pos = gl_ModelViewProjectionMatrix * vert;
+ pos = modelview_projection_matrix * vert;
vary_fragcoord.xyz = pos.xyz + vec3(0,0,near_clip);
}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowV.glsl b/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowV.glsl
index e03615eebb..fc055e555d 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowV.glsl
@@ -22,6 +22,10 @@
* $/LicenseInfo$
*/
+uniform mat4 projection_matrix;
+uniform mat4 modelview_matrix;
+uniform mat4 texture_matrix0;
+
attribute vec3 position;
attribute vec4 diffuse_color;
attribute vec2 texcoord0;
@@ -31,16 +35,16 @@ mat4 getObjectSkinnedTransform();
void main()
{
//transform vertex
- gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
+ gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
mat4 mat = getObjectSkinnedTransform();
- mat = gl_ModelViewMatrix * mat;
+ mat = modelview_matrix * mat;
vec3 pos = (mat*vec4(position.xyz, 1.0)).xyz;
gl_FrontColor = diffuse_color;
- vec4 p = gl_ProjectionMatrix * vec4(pos, 1.0);
+ vec4 p = projection_matrix * vec4(pos, 1.0);
p.z = max(p.z, -p.w+0.01);
gl_Position = p;
}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl
index e15727f6f7..df4de4f432 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl
@@ -22,7 +22,9 @@
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
-
+
+uniform mat4 projection_matrix;
+
attribute vec3 position;
attribute vec3 normal;
attribute vec2 texcoord0;
@@ -96,7 +98,7 @@ void main()
norm.z = dot(trans[2].xyz, normal);
norm = normalize(norm);
- vec4 frag_pos = gl_ProjectionMatrix * pos;
+ vec4 frag_pos = projection_matrix * pos;
gl_Position = frag_pos;
vary_position = pos.xyz;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarEyesV.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarEyesV.glsl
index 58efa47567..d5c20a22d9 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/avatarEyesV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/avatarEyesV.glsl
@@ -22,7 +22,10 @@
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
-
+
+uniform mat3 normal_matrix;
+uniform mat4 texture_matrix0;
+uniform mat4 modelview_projection_matrix;
attribute vec3 position;
attribute vec3 normal;
@@ -34,10 +37,10 @@ varying vec3 vary_normal;
void main()
{
//transform vertex
- gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
- gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
+ gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
+ gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
- vary_normal = normalize(gl_NormalMatrix * normal);
+ vary_normal = normalize(normal_matrix * normal);
gl_FrontColor = diffuse_color;
}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarShadowV.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarShadowV.glsl
index 543e998def..6835b9c021 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/avatarShadowV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/avatarShadowV.glsl
@@ -23,7 +23,7 @@
* $/LicenseInfo$
*/
-
+uniform mat4 projection_matrix;
mat4 getSkinnedTransform();
@@ -52,7 +52,7 @@ void main()
norm.z = dot(trans[2].xyz, normal);
norm = normalize(norm);
- pos = gl_ProjectionMatrix * pos;
+ pos = projection_matrix * pos;
post_pos = pos;
gl_Position = vec4(pos.x, pos.y, pos.w*0.5, pos.w);
diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarV.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarV.glsl
index 66e9119e28..704845d310 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/avatarV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/avatarV.glsl
@@ -23,6 +23,8 @@
* $/LicenseInfo$
*/
+uniform mat4 projection_matrix;
+
attribute vec3 position;
attribute vec3 normal;
attribute vec2 texcoord0;
@@ -54,7 +56,7 @@ void main()
vary_normal = norm;
- gl_Position = gl_ProjectionMatrix * pos;
+ gl_Position = projection_matrix * pos;
}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/blurLightV.glsl b/indra/newview/app_settings/shaders/class1/deferred/blurLightV.glsl
index 0168c40ae5..5339e38018 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/blurLightV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/blurLightV.glsl
@@ -22,7 +22,9 @@
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
-
+
+uniform mat4 modelview_projection_matrix;
+
attribute vec3 position;
varying vec2 vary_fragcoord;
@@ -31,7 +33,7 @@ uniform vec2 screen_res;
void main()
{
//transform vertex
- vec4 pos = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+ vec4 pos = modelview_projection_matrix * vec4(position.xyz, 1.0);
gl_Position = pos;
vary_fragcoord = (pos.xy*0.5+0.5)*screen_res;
}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/bumpSkinnedV.glsl b/indra/newview/app_settings/shaders/class1/deferred/bumpSkinnedV.glsl
index 421299d4a7..cf93430217 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/bumpSkinnedV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/bumpSkinnedV.glsl
@@ -22,6 +22,10 @@
* $/LicenseInfo$
*/
+uniform mat4 projection_matrix;
+uniform mat4 texture_matrix0;
+uniform mat4 modelview_matrix;
+
attribute vec3 position;
attribute vec4 diffuse_color;
attribute vec3 normal;
@@ -36,11 +40,11 @@ mat4 getObjectSkinnedTransform();
void main()
{
- gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
+ gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
mat4 mat = getObjectSkinnedTransform();
- mat = gl_ModelViewMatrix * mat;
+ mat = modelview_matrix * mat;
vec3 pos = (mat*vec4(position.xyz, 1.0)).xyz;
@@ -53,6 +57,6 @@ void main()
vary_mat1 = vec3(t.y, b.y, n.y);
vary_mat2 = vec3(t.z, b.z, n.z);
- gl_Position = gl_ProjectionMatrix*vec4(pos, 1.0);
+ gl_Position = projection_matrix*vec4(pos, 1.0);
gl_FrontColor = diffuse_color;
}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/bumpV.glsl b/indra/newview/app_settings/shaders/class1/deferred/bumpV.glsl
index b724def93d..9ec31383ac 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/bumpV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/bumpV.glsl
@@ -22,7 +22,11 @@
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
-
+
+uniform mat3 normal_matrix;
+uniform mat4 texture_matrix0;
+uniform mat4 modelview_projection_matrix;
+
attribute vec3 position;
attribute vec4 diffuse_color;
attribute vec3 normal;
@@ -36,11 +40,11 @@ varying vec3 vary_mat2;
void main()
{
//transform vertex
- gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
- gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
+ gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
+ gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
- vec3 n = normalize(gl_NormalMatrix * normal);
- vec3 b = normalize(gl_NormalMatrix * binormal);
+ vec3 n = normalize(normal_matrix * normal);
+ vec3 b = normalize(normal_matrix * binormal);
vec3 t = cross(b, n);
vary_mat0 = vec3(t.x, b.x, n.x);
diff --git a/indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl b/indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl
index 297b3904a6..67b5e7fb83 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl
@@ -22,7 +22,9 @@
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
-
+
+uniform mat4 modelview_projection_matrix;
+
attribute vec3 position;
attribute vec2 texcoord0;
@@ -60,7 +62,7 @@ void main()
{
// World / view / projection
- gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+ gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
gl_TexCoord[0] = vec4(texcoord0,0,1);
diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseNoColorV.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseNoColorV.glsl
index ff9578e253..37864578ec 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/diffuseNoColorV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseNoColorV.glsl
@@ -1,10 +1,31 @@
/**
* @file diffuseNoColorV.glsl
*
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+ * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2007, Linden Research, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
-
+
+uniform mat3 normal_matrix;
+uniform mat4 texture_matrix0;
+uniform mat4 modelview_projection_matrix;
attribute vec3 position;
attribute vec3 normal;
@@ -16,8 +37,8 @@ varying float vary_texture_index;
void main()
{
//transform vertex
- gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
- gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
+ gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
+ gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
- vary_normal = normalize(gl_NormalMatrix * normal);
+ vary_normal = normalize(normal_matrix * normal);
}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseSkinnedV.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseSkinnedV.glsl
index 02fb34af32..880a7ea0a2 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/diffuseSkinnedV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseSkinnedV.glsl
@@ -22,7 +22,9 @@
* $/LicenseInfo$
*/
-
+uniform mat4 projection_matrix;
+uniform mat4 texture_matrix0;
+uniform mat4 modelview_matrix;
attribute vec3 position;
attribute vec4 diffuse_color;
@@ -35,11 +37,11 @@ mat4 getObjectSkinnedTransform();
void main()
{
- gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
+ gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
mat4 mat = getObjectSkinnedTransform();
- mat = gl_ModelViewMatrix * mat;
+ mat = modelview_matrix * mat;
vec3 pos = (mat*vec4(position.xyz, 1.0)).xyz;
vec4 norm = vec4(position.xyz, 1.0);
@@ -51,5 +53,5 @@ void main()
gl_FrontColor = diffuse_color;
- gl_Position = gl_ProjectionMatrix*vec4(pos, 1.0);
+ gl_Position = projection_matrix*vec4(pos, 1.0);
}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseV.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseV.glsl
index 553cfff52f..e158df13f7 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/diffuseV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseV.glsl
@@ -22,7 +22,10 @@
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
-
+
+uniform mat3 normal_matrix;
+uniform mat4 texture_matrix0;
+uniform mat4 modelview_projection_matrix;
attribute vec4 position;
attribute vec4 diffuse_color;
@@ -35,11 +38,11 @@ varying float vary_texture_index;
void main()
{
//transform vertex
- gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
- gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
+ gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
+ gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
vary_texture_index = position.w;
- vary_normal = normalize(gl_NormalMatrix * normal);
+ vary_normal = normalize(normal_matrix * normal);
gl_FrontColor = diffuse_color;
}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/emissiveV.glsl b/indra/newview/app_settings/shaders/class1/deferred/emissiveV.glsl
index 9841943fe6..fccf8554d2 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/emissiveV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/emissiveV.glsl
@@ -1,10 +1,31 @@
/**
* @file emissiveV.glsl
*
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+ * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2007, Linden Research, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
-
+
+uniform mat4 texture_matrix0;
+uniform mat4 modelview_matrix;
+uniform mat4 modelview_projection_matrix;
attribute vec4 position;
attribute float emissive;
@@ -23,12 +44,12 @@ void main()
{
//transform vertex
vec4 vert = vec4(position.xyz, 1.0);
- vec4 pos = (gl_ModelViewMatrix * vert);
+ vec4 pos = (modelview_matrix * vert);
vary_texture_index = position.w;
- gl_Position = gl_ModelViewProjectionMatrix*vec4(position.xyz, 1.0);
+ gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0);
- gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
+ gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
calcAtmospherics(pos.xyz);
diff --git a/indra/newview/app_settings/shaders/class1/deferred/fullbrightV.glsl b/indra/newview/app_settings/shaders/class1/deferred/fullbrightV.glsl
index 93571058dc..2759165471 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/fullbrightV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/fullbrightV.glsl
@@ -22,7 +22,11 @@
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
-
+
+uniform mat4 texture_matrix0;
+uniform mat4 modelview_matrix;
+uniform mat4 modelview_projection_matrix;
+
attribute vec4 position;
attribute vec4 diffuse_color;
@@ -41,12 +45,12 @@ void main()
{
//transform vertex
vec4 vert = vec4(position.xyz, 1.0);
- vec4 pos = (gl_ModelViewMatrix * vert);
+ vec4 pos = (modelview_matrix * vert);
vary_texture_index = position.w;
- gl_Position = gl_ModelViewProjectionMatrix*vec4(position.xyz, 1.0);
+ gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0);
- gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
+ gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
calcAtmospherics(pos.xyz);
diff --git a/indra/newview/app_settings/shaders/class1/deferred/giV.glsl b/indra/newview/app_settings/shaders/class1/deferred/giV.glsl
index 1a23be349e..2766691bd0 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/giV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/giV.glsl
@@ -22,7 +22,9 @@
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
-
+
+uniform mat4 modelview_projection_matrix;
+
attribute vec3 position;
attribute vec4 diffuse_color;
attribute vec2 texcoord0;
@@ -35,7 +37,7 @@ uniform vec2 screen_res;
void main()
{
//transform vertex
- vec4 pos = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+ vec4 pos = modelview_projection_matrix * vec4(position.xyz, 1.0);
gl_Position = pos;
vary_fragcoord = (pos.xy * 0.5 + 0.5)*screen_res;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/impostorV.glsl b/indra/newview/app_settings/shaders/class1/deferred/impostorV.glsl
index 28ba2c432d..645b0d793a 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/impostorV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/impostorV.glsl
@@ -22,7 +22,10 @@
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
-
+
+uniform mat4 texture_matrix0;
+uniform mat4 modelview_projection_matrix;
+
attribute vec3 position;
attribute vec4 diffuse_color;
attribute vec2 texcoord0;
@@ -30,8 +33,8 @@ attribute vec2 texcoord0;
void main()
{
//transform vertex
- gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
- gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
+ gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
+ gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
gl_FrontColor = diffuse_color;
}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/luminanceV.glsl b/indra/newview/app_settings/shaders/class1/deferred/luminanceV.glsl
index 3f2e07cf08..dafc55a6ff 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/luminanceV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/luminanceV.glsl
@@ -23,6 +23,7 @@
* $/LicenseInfo$
*/
+uniform mat4 modelview_projection_matrix;
attribute vec3 position;
attribute vec4 diffuse_color;
@@ -34,7 +35,7 @@ uniform vec2 screen_res;
void main()
{
//transform vertex
- vec4 pos = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+ vec4 pos = modelview_projection_matrix * vec4(position.xyz, 1.0);
gl_Position = pos;
vary_fragcoord = (pos.xy * 0.5 + 0.5)*screen_res;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/multiPointLightV.glsl b/indra/newview/app_settings/shaders/class1/deferred/multiPointLightV.glsl
index 39e60b6cc8..1d54d7bede 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/multiPointLightV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/multiPointLightV.glsl
@@ -23,6 +23,7 @@
* $/LicenseInfo$
*/
+uniform mat4 modelview_projection_matrix;
attribute vec3 position;
@@ -31,7 +32,7 @@ varying vec4 vary_fragcoord;
void main()
{
//transform vertex
- vec4 pos = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+ vec4 pos = modelview_projection_matrix * vec4(position.xyz, 1.0);
vary_fragcoord = pos;
gl_Position = pos;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/pointLightV.glsl b/indra/newview/app_settings/shaders/class1/deferred/pointLightV.glsl
index afaf58020b..cab9817583 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/pointLightV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/pointLightV.glsl
@@ -23,6 +23,8 @@
* $/LicenseInfo$
*/
+uniform mat4 modelview_projection_matrix;
+
attribute vec3 position;
varying vec4 vary_fragcoord;
@@ -30,7 +32,7 @@ varying vec4 vary_fragcoord;
void main()
{
//transform vertex
- vec4 pos = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+ vec4 pos = modelview_projection_matrix * vec4(position.xyz, 1.0);
vary_fragcoord = pos;
gl_Position = pos;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredV.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredV.glsl
index 74a9df64e0..b11f26fbae 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredV.glsl
@@ -22,7 +22,9 @@
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
-
+
+uniform mat4 modelview_projection_matrix;
+
attribute vec3 position;
varying vec2 vary_fragcoord;
@@ -35,7 +37,7 @@ uniform vec2 screen_res;
void main()
{
//transform vertex
- vec4 pos = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+ vec4 pos = modelview_projection_matrix * vec4(position.xyz, 1.0);
gl_Position = pos;
vary_tc = (pos.xy*0.5+0.5)*tc_scale;
vary_fragcoord = (pos.xy*0.5+0.5)*screen_res;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/postgiV.glsl b/indra/newview/app_settings/shaders/class1/deferred/postgiV.glsl
index a3751be1fb..61c6393648 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/postgiV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/postgiV.glsl
@@ -22,6 +22,8 @@
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
+
+uniform mat4 modelview_projection_matrix;
attribute vec3 position;
@@ -32,7 +34,7 @@ uniform vec2 screen_res;
void main()
{
//transform vertex
- vec4 pos = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+ vec4 pos = modelview_projection_matrix * vec4(position.xyz, 1.0);
gl_Position = pos;
vary_fragcoord = (pos.xy*0.5+0.5)*screen_res;
}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskV.glsl b/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskV.glsl
index bbd7516337..f7bed00214 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskV.glsl
@@ -22,7 +22,10 @@
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
-
+
+uniform mat4 texture_matrix0;
+uniform mat4 modelview_projection_matrix;
+
attribute vec3 position;
attribute vec4 diffuse_color;
attribute vec2 texcoord0;
@@ -32,12 +35,12 @@ varying vec4 post_pos;
void main()
{
//transform vertex
- vec4 pos = gl_ModelViewProjectionMatrix*vec4(position.xyz, 1.0);
+ vec4 pos = modelview_projection_matrix*vec4(position.xyz, 1.0);
post_pos = pos;
gl_Position = vec4(pos.x, pos.y, pos.w*0.5, pos.w);
- gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
+ gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
gl_FrontColor = diffuse_color;
}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/shadowV.glsl b/indra/newview/app_settings/shaders/class1/deferred/shadowV.glsl
index 1ac3dbd5de..190cac9e2c 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/shadowV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/shadowV.glsl
@@ -22,7 +22,9 @@
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
-
+
+uniform mat4 modelview_projection_matrix;
+
attribute vec3 position;
varying vec4 post_pos;
@@ -30,7 +32,7 @@ varying vec4 post_pos;
void main()
{
//transform vertex
- vec4 pos = gl_ModelViewProjectionMatrix*vec4(position.xyz, 1.0);
+ vec4 pos = modelview_projection_matrix*vec4(position.xyz, 1.0);
post_pos = pos;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl b/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl
index 23171fe940..e97d3e0828 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl
@@ -22,7 +22,9 @@
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
-
+
+uniform mat4 modelview_projection_matrix;
+
attribute vec3 position;
attribute vec2 texcoord0;
@@ -58,7 +60,7 @@ void main()
{
// World / view / projection
- gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+ gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
gl_TexCoord[0] = vec4(texcoord0,0,1);
// Get relative position
diff --git a/indra/newview/app_settings/shaders/class1/deferred/softenLightV.glsl b/indra/newview/app_settings/shaders/class1/deferred/softenLightV.glsl
index 4b6b3c242e..7d1e99b4aa 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/softenLightV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightV.glsl
@@ -23,6 +23,7 @@
* $/LicenseInfo$
*/
+uniform mat4 modelview_projection_matrix;
attribute vec3 position;
@@ -32,7 +33,7 @@ varying vec2 vary_fragcoord;
void main()
{
//transform vertex
- vec4 pos = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+ vec4 pos = modelview_projection_matrix * vec4(position.xyz, 1.0);
gl_Position = pos;
vary_fragcoord = (pos.xy*0.5+0.5)*screen_res;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/starsV.glsl b/indra/newview/app_settings/shaders/class1/deferred/starsV.glsl
index dbd2b5595a..1fcb05ef2c 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/starsV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/starsV.glsl
@@ -22,7 +22,9 @@
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
-
+
+uniform mat4 texture_matrix0;
+uniform mat4 modelview_projection_matrix;
attribute vec3 position;
attribute vec4 diffuse_color;
@@ -31,7 +33,7 @@ attribute vec2 texcoord0;
void main()
{
//transform vertex
- gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
- gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
+ gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
+ gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
gl_FrontColor = diffuse_color;
}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/sunLightV.glsl b/indra/newview/app_settings/shaders/class1/deferred/sunLightV.glsl
index d19e67b67d..10751304ae 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/sunLightV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/sunLightV.glsl
@@ -22,6 +22,8 @@
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
+
+uniform mat4 modelview_projection_matrix;
attribute vec3 position;
@@ -32,7 +34,7 @@ uniform vec2 screen_res;
void main()
{
//transform vertex
- vec4 pos = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+ vec4 pos = modelview_projection_matrix * vec4(position.xyz, 1.0);
gl_Position = pos;
vary_fragcoord = (pos.xy * 0.5 + 0.5)*screen_res;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/terrainV.glsl b/indra/newview/app_settings/shaders/class1/deferred/terrainV.glsl
index 793106f2cf..7f84ef1cff 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/terrainV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/terrainV.glsl
@@ -22,7 +22,11 @@
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
-
+
+uniform mat3 normal_matrix;
+uniform mat4 texture_matrix0;
+uniform mat4 modelview_projection_matrix;
+
attribute vec3 position;
attribute vec3 normal;
attribute vec4 diffuse_color;
@@ -48,12 +52,12 @@ vec4 texgen_object(vec4 vpos, vec4 tc, mat4 mat, vec4 tp0, vec4 tp1)
void main()
{
//transform vertex
- gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+ gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
- vary_normal = normalize(gl_NormalMatrix * normal);
+ vary_normal = normalize(normal_matrix * normal);
// Transform and pass tex coords
- gl_TexCoord[0].xy = texgen_object(vec4(position, 1.0), vec4(texcoord0,0,1), gl_TextureMatrix[0], gl_ObjectPlaneS[0], gl_ObjectPlaneT[0]).xy;
+ gl_TexCoord[0].xy = texgen_object(vec4(position, 1.0), vec4(texcoord0,0,1), texture_matrix0, gl_ObjectPlaneS[0], gl_ObjectPlaneT[0]).xy;
vec4 t = vec4(texcoord1,0,1);
diff --git a/indra/newview/app_settings/shaders/class1/deferred/treeShadowV.glsl b/indra/newview/app_settings/shaders/class1/deferred/treeShadowV.glsl
index 42ce2f5226..c695d374ac 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/treeShadowV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/treeShadowV.glsl
@@ -1,9 +1,30 @@
/**
* @file treeShadowV.glsl
*
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+ * $LicenseInfo:firstyear=2007&license=viewerlgpl$
+ * Second Life Viewer Source Code
+ * Copyright (C) 2007, Linden Research, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation;
+ * version 2.1 of the License only.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
+
+uniform mat4 texture_matrix0;
+uniform mat4 modelview_projection_matrix;
attribute vec3 position;
attribute vec2 texcoord0;
@@ -13,11 +34,11 @@ varying vec4 post_pos;
void main()
{
//transform vertex
- vec4 pos = gl_ModelViewProjectionMatrix*vec4(position.xyz, 1.0);
+ vec4 pos = modelview_projection_matrix*vec4(position.xyz, 1.0);
post_pos = pos;
gl_Position = vec4(pos.x, pos.y, pos.w*0.5, pos.w);
- gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
+ gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/treeV.glsl b/indra/newview/app_settings/shaders/class1/deferred/treeV.glsl
index 2ec7398024..45bfc0ce09 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/treeV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/treeV.glsl
@@ -22,7 +22,10 @@
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
-
+
+uniform mat4 texture_matrix0;
+uniform mat4 modelview_projection_matrix;
+uniform mat3 normal_matrix;
attribute vec3 position;
attribute vec3 normal;
@@ -33,10 +36,10 @@ varying vec3 vary_normal;
void main()
{
//transform vertex
- gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
- gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
+ gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
+ gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1);
- vary_normal = normalize(gl_NormalMatrix * normal);
+ vary_normal = normalize(normal_matrix * normal);
gl_FrontColor = vec4(1,1,1,1);
}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/waterV.glsl b/indra/newview/app_settings/shaders/class1/deferred/waterV.glsl
index 2f808b25db..ac51cb1741 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/waterV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/waterV.glsl
@@ -22,7 +22,9 @@
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
-
+
+uniform mat4 modelview_matrix;
+uniform mat4 modelview_projection_matrix;
attribute vec3 position;
@@ -50,7 +52,7 @@ void main()
{
//transform vertex
vec4 pos = vec4(position.xyz, 1.0);
- mat4 modelViewProj = gl_ModelViewProjectionMatrix;
+ mat4 modelViewProj = modelview_projection_matrix;
vec4 oPosition;
@@ -69,7 +71,7 @@ void main()
oPosition = vec4(position, 1.0);
oPosition.z = mix(oPosition.z, max(eyeVec.z*0.75, 0.0), d);
- vary_position = gl_ModelViewMatrix * oPosition;
+ vary_position = modelview_matrix * oPosition;
oPosition = modelViewProj * oPosition;
refCoord.xyz = oPosition.xyz + vec3(0,0,0.2);
@@ -81,7 +83,7 @@ void main()
//push position for further horizon effect.
pos.xyz = oEyeVec.xyz*(waterHeight/oEyeVec.z);
pos.w = 1.0;
- pos = gl_ModelViewMatrix*pos;
+ pos = modelview_matrix*pos;
calcAtmospherics(pos.xyz);