summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2011-08-08 15:29:23 -0500
committerDave Parks <davep@lindenlab.com>2011-08-08 15:29:23 -0500
commit14f6bbadef2c39e58a3b54c0c6212949acf50e45 (patch)
tree295c3bd149b343cd334885133f101963219d7f39 /indra/newview/app_settings
parent333608e889827342c79d3eee2006b1a704985740 (diff)
SH-2242 Work in progress migrating to glVertexAttrib everywhere
Diffstat (limited to 'indra/newview/app_settings')
-rw-r--r--indra/newview/app_settings/logcontrol.xml2
-rw-r--r--indra/newview/app_settings/settings.xml2
-rw-r--r--indra/newview/app_settings/shaders/class1/avatar/avatarSkinV.glsl3
-rw-r--r--indra/newview/app_settings/shaders/class1/avatar/avatarV.glsl24
-rw-r--r--indra/newview/app_settings/shaders/class1/avatar/eyeballV.glsl15
-rw-r--r--indra/newview/app_settings/shaders/class1/avatar/pickAvatarV.glsl16
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/alphaSkinnedV.glsl20
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl29
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/attachmentShadowV.glsl10
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl32
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/avatarEyesV.glsl12
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/avatarShadowV.glsl23
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/avatarV.glsl25
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/blurLightV.glsl6
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/bumpSkinnedV.glsl16
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/bumpV.glsl16
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl11
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/diffuseSkinnedV.glsl15
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/diffuseV.glsl14
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/fullbrightV.glsl16
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/giV.glsl12
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/impostorV.glsl10
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/luminanceV.glsl12
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/multiPointLightV.glsl6
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/pointLightV.glsl12
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/postDeferredV.glsl6
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/postgiV.glsl5
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskV.glsl10
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/shadowV.glsl4
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/skyV.glsl11
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl6
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/softenLightV.glsl13
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/starsV.glsl10
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/sunLightV.glsl16
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/terrainV.glsl14
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/treeV.glsl12
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/waterV.glsl23
-rw-r--r--indra/newview/app_settings/shaders/class1/effects/glowExtractF.glsl2
-rw-r--r--indra/newview/app_settings/shaders/class1/effects/glowExtractV.glsl6
-rw-r--r--indra/newview/app_settings/shaders/class1/effects/glowV.glsl21
-rw-r--r--indra/newview/app_settings/shaders/class1/environment/terrainV.glsl23
-rw-r--r--indra/newview/app_settings/shaders/class1/environment/waterV.glsl13
-rw-r--r--indra/newview/app_settings/shaders/class1/interface/customalphaV.glsl9
-rw-r--r--indra/newview/app_settings/shaders/class1/interface/glowcombineV.glsl9
-rw-r--r--indra/newview/app_settings/shaders/class1/interface/highlightF.glsl4
-rw-r--r--indra/newview/app_settings/shaders/class1/interface/highlightV.glsl18
-rw-r--r--indra/newview/app_settings/shaders/class1/interface/occlusionV.glsl4
-rw-r--r--indra/newview/app_settings/shaders/class1/interface/solidcolorV.glsl10
-rw-r--r--indra/newview/app_settings/shaders/class1/interface/twotextureaddV.glsl9
-rw-r--r--indra/newview/app_settings/shaders/class1/interface/uiV.glsl10
-rw-r--r--indra/newview/app_settings/shaders/class1/objects/bumpV.glsl13
-rw-r--r--indra/newview/app_settings/shaders/class1/objects/fullbrightShinySkinnedV.glsl14
-rw-r--r--indra/newview/app_settings/shaders/class1/objects/fullbrightShinyV.glsl14
-rw-r--r--indra/newview/app_settings/shaders/class1/objects/fullbrightSkinnedV.glsl14
-rw-r--r--indra/newview/app_settings/shaders/class1/objects/fullbrightV.glsl13
-rw-r--r--indra/newview/app_settings/shaders/class1/objects/shinySimpleSkinnedV.glsl15
-rw-r--r--indra/newview/app_settings/shaders/class1/objects/shinyV.glsl13
-rw-r--r--indra/newview/app_settings/shaders/class1/objects/simpleSkinnedV.glsl15
-rw-r--r--indra/newview/app_settings/shaders/class1/objects/simpleV.glsl18
-rw-r--r--indra/newview/app_settings/shaders/class2/avatar/eyeballV.glsl16
-rw-r--r--indra/newview/app_settings/shaders/class2/deferred/alphaSkinnedV.glsl27
-rw-r--r--indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl31
-rw-r--r--indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl31
-rw-r--r--indra/newview/app_settings/shaders/class2/deferred/edgeV.glsl5
-rw-r--r--indra/newview/app_settings/shaders/class2/deferred/softenLightV.glsl12
-rw-r--r--indra/newview/app_settings/shaders/class2/deferred/sunLightV.glsl15
-rw-r--r--indra/newview/app_settings/shaders/class2/effects/blurV.glsl6
-rw-r--r--indra/newview/app_settings/shaders/class2/effects/drawQuadV.glsl10
-rw-r--r--indra/newview/app_settings/shaders/class2/environment/terrainV.glsl22
-rw-r--r--indra/newview/app_settings/shaders/class2/lighting/sumLightsV.glsl2
-rw-r--r--indra/newview/app_settings/shaders/class2/objects/fullbrightShinyV.glsl19
-rw-r--r--indra/newview/app_settings/shaders/class2/objects/fullbrightV.glsl18
-rw-r--r--indra/newview/app_settings/shaders/class2/objects/shinyV.glsl18
-rw-r--r--indra/newview/app_settings/shaders/class2/objects/simpleV.glsl20
-rw-r--r--indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl11
-rw-r--r--indra/newview/app_settings/shaders/class2/windlight/skyV.glsl10
-rw-r--r--indra/newview/app_settings/shaders/class3/avatar/avatarV.glsl27
-rw-r--r--indra/newview/app_settings/shaders/class3/deferred/giDownsampleV.glsl6
-rw-r--r--indra/newview/app_settings/shaders/class3/deferred/giFinalV.glsl5
-rw-r--r--indra/newview/app_settings/shaders/class3/deferred/giV.glsl12
-rw-r--r--indra/newview/app_settings/shaders/class3/deferred/luminanceV.glsl12
-rw-r--r--indra/newview/app_settings/shaders/class3/deferred/postDeferredV.glsl6
-rw-r--r--indra/newview/app_settings/shaders/class3/deferred/postgiV.glsl6
-rw-r--r--indra/newview/app_settings/shaders/class3/deferred/softenLightV.glsl11
-rw-r--r--indra/newview/app_settings/shaders/class3/lighting/sumLightsV.glsl1
85 files changed, 649 insertions, 466 deletions
diff --git a/indra/newview/app_settings/logcontrol.xml b/indra/newview/app_settings/logcontrol.xml
index ae72dee900..a76eb3cd37 100644
--- a/indra/newview/app_settings/logcontrol.xml
+++ b/indra/newview/app_settings/logcontrol.xml
@@ -43,7 +43,7 @@
<key>tags</key>
<array>
<!-- sample entry for debugging a specific item -->
-<!-- <string>Voice</string> -->
+<!-- <string>Voice</string> -->
</array>
</map>
</array>
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 9bb320d882..ed1e3c2057 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -7565,7 +7565,7 @@
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
- <integer>0</integer>
+ <integer>1</integer>
</map>
<key>RenderDebugNormalScale</key>
<map>
diff --git a/indra/newview/app_settings/shaders/class1/avatar/avatarSkinV.glsl b/indra/newview/app_settings/shaders/class1/avatar/avatarSkinV.glsl
index d9f29ced4f..81b632e7fa 100644
--- a/indra/newview/app_settings/shaders/class1/avatar/avatarSkinV.glsl
+++ b/indra/newview/app_settings/shaders/class1/avatar/avatarSkinV.glsl
@@ -6,8 +6,7 @@
*/
-
-attribute vec4 weight; //1
+attribute vec4 weight;
uniform vec4 matrixPalette[45];
diff --git a/indra/newview/app_settings/shaders/class1/avatar/avatarV.glsl b/indra/newview/app_settings/shaders/class1/avatar/avatarV.glsl
index 2796222c68..ec7359d565 100644
--- a/indra/newview/app_settings/shaders/class1/avatar/avatarV.glsl
+++ b/indra/newview/app_settings/shaders/class1/avatar/avatarV.glsl
@@ -5,7 +5,9 @@
* $/LicenseInfo$
*/
-
+attribute vec3 position;
+attribute vec3 normal;
+attribute vec2 texcoord0;
vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
mat4 getSkinnedTransform();
@@ -13,31 +15,33 @@ void calcAtmospherics(vec3 inPositionEye);
void main()
{
- gl_TexCoord[0] = gl_MultiTexCoord0;
+ gl_TexCoord[0] = vec4(texcoord0,0,1);
vec4 pos;
vec3 norm;
+ vec4 pos_in = vec4(position.xyz, 1.0);
+
mat4 trans = getSkinnedTransform();
- pos.x = dot(trans[0], gl_Vertex);
- pos.y = dot(trans[1], gl_Vertex);
- pos.z = dot(trans[2], gl_Vertex);
+ pos.x = dot(trans[0], pos_in);
+ pos.y = dot(trans[1], pos_in);
+ pos.z = dot(trans[2], pos_in);
pos.w = 1.0;
- norm.x = dot(trans[0].xyz, gl_Normal);
- norm.y = dot(trans[1].xyz, gl_Normal);
- norm.z = dot(trans[2].xyz, gl_Normal);
+ norm.x = dot(trans[0].xyz, normal);
+ norm.y = dot(trans[1].xyz, normal);
+ norm.z = dot(trans[2].xyz, normal);
norm = normalize(norm);
gl_Position = gl_ProjectionMatrix * pos;
- //gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+ //gl_Position = gl_ModelViewProjectionMatrix * position;
gl_FogFragCoord = length(pos.xyz);
calcAtmospherics(pos.xyz);
- vec4 color = calcLighting(pos.xyz, norm, gl_Color, vec4(0,0,0,0));
+ vec4 color = calcLighting(pos.xyz, norm, vec4(1,1,1,1), vec4(0,0,0,0));
gl_FrontColor = color;
}
diff --git a/indra/newview/app_settings/shaders/class1/avatar/eyeballV.glsl b/indra/newview/app_settings/shaders/class1/avatar/eyeballV.glsl
index 2eb814bd91..0b075feef5 100644
--- a/indra/newview/app_settings/shaders/class1/avatar/eyeballV.glsl
+++ b/indra/newview/app_settings/shaders/class1/avatar/eyeballV.glsl
@@ -6,6 +6,10 @@
*/
+attribute vec3 position;
+attribute vec4 diffuse_color;
+attribute vec3 normal;
+attribute vec2 texcoord0;
vec4 calcLightingSpecular(vec3 pos, vec3 norm, vec4 color, inout vec4 specularColor, vec4 baseCol);
void calcAtmospherics(vec3 inPositionEye);
@@ -13,16 +17,17 @@ void calcAtmospherics(vec3 inPositionEye);
void main()
{
//transform vertex
- gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
- gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
+ vec3 pos = (gl_ModelViewMatrix * vec4(position.xyz, 1.0)).xyz;
+ gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+ gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
- vec3 pos = (gl_ModelViewMatrix * gl_Vertex).xyz;
- vec3 norm = normalize(gl_NormalMatrix * gl_Normal);
+
+ vec3 norm = normalize(gl_NormalMatrix * normal);
calcAtmospherics(pos.xyz);
vec4 specular = vec4(1.0);
- vec4 color = calcLightingSpecular(pos, norm, gl_Color, specular, vec4(0.0));
+ vec4 color = calcLightingSpecular(pos, norm, diffuse_color, specular, vec4(0.0));
gl_FrontColor = color;
}
diff --git a/indra/newview/app_settings/shaders/class1/avatar/pickAvatarV.glsl b/indra/newview/app_settings/shaders/class1/avatar/pickAvatarV.glsl
index 86b189b282..dcc891b16f 100644
--- a/indra/newview/app_settings/shaders/class1/avatar/pickAvatarV.glsl
+++ b/indra/newview/app_settings/shaders/class1/avatar/pickAvatarV.glsl
@@ -5,21 +5,23 @@
* $/LicenseInfo$
*/
-
+attribute vec3 position;
+attribute vec4 diffuse_color;
+attribute vec2 texcoord0;
mat4 getSkinnedTransform();
void main()
{
vec4 pos;
-
+ vec4 pos_in = vec4(position, 1.0);
mat4 trans = getSkinnedTransform();
- pos.x = dot(trans[0], gl_Vertex);
- pos.y = dot(trans[1], gl_Vertex);
- pos.z = dot(trans[2], gl_Vertex);
+ pos.x = dot(trans[0], pos_in);
+ pos.y = dot(trans[1], pos_in);
+ pos.z = dot(trans[2], pos_in);
pos.w = 1.0;
- gl_FrontColor = gl_Color;
- gl_TexCoord[0] = gl_MultiTexCoord0;
+ gl_FrontColor = diffuse_color;
+ gl_TexCoord[0] = vec4(texcoord0,0,1);
gl_Position = gl_ProjectionMatrix * pos;
}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaSkinnedV.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaSkinnedV.glsl
index ac3f7189c2..eeebae4464 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/alphaSkinnedV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/alphaSkinnedV.glsl
@@ -6,6 +6,10 @@
*/
+attribute vec3 position;
+attribute vec3 normal;
+attribute vec4 diffuse_color;
+attribute vec2 texcoord0;
vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
mat4 getObjectSkinnedTransform();
@@ -59,7 +63,7 @@ float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, floa
void main()
{
- gl_TexCoord[0] = gl_MultiTexCoord0;
+ gl_TexCoord[0] = vec4(texcoord0,0,1);
vec4 pos;
vec3 norm;
@@ -67,9 +71,9 @@ void main()
mat4 trans = getObjectSkinnedTransform();
trans = gl_ModelViewMatrix * trans;
- pos = trans * gl_Vertex;
+ pos = trans * vec4(position.xyz, 1.0);
- norm = gl_Vertex.xyz + gl_Normal.xyz;
+ norm = position.xyz + normal.xyz;
norm = normalize(( trans*vec4(norm, 1.0) ).xyz-pos.xyz);
vec4 frag_pos = gl_ProjectionMatrix * pos;
@@ -80,7 +84,7 @@ void main()
calcAtmospherics(pos.xyz);
- vec4 col = vec4(0.0, 0.0, 0.0, gl_Color.a);
+ vec4 col = vec4(0.0, 0.0, 0.0, diffuse_color.a);
// Collect normal lights
col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].quadraticAttenuation, gl_LightSource[2].specular.a);
@@ -90,17 +94,17 @@ void main()
col.rgb += gl_LightSource[6].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[6].position, gl_LightSource[6].spotDirection.xyz, gl_LightSource[6].linearAttenuation, gl_LightSource[6].quadraticAttenuation, gl_LightSource[6].specular.a);
col.rgb += gl_LightSource[7].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[7].position, gl_LightSource[7].spotDirection.xyz, gl_LightSource[7].linearAttenuation, gl_LightSource[7].quadraticAttenuation, gl_LightSource[7].specular.a);
- vary_pointlight_col = col.rgb*gl_Color.rgb;
+ vary_pointlight_col = col.rgb*diffuse_color.rgb;
col.rgb = vec3(0,0,0);
// Add windlight lights
col.rgb = atmosAmbient(vec3(0.));
- vary_ambient = col.rgb*gl_Color.rgb;
- vary_directional = gl_Color.rgb*atmosAffectDirectionalLight(max(calcDirectionalLight(norm, gl_LightSource[0].position.xyz), (1.0-gl_Color.a)*(1.0-gl_Color.a)));
+ vary_ambient = col.rgb*diffuse_color.rgb;
+ vary_directional = diffuse_color.rgb*atmosAffectDirectionalLight(max(calcDirectionalLight(norm, gl_LightSource[0].position.xyz), (1.0-diffuse_color.a)*(1.0-diffuse_color.a)));
- col.rgb = min(col.rgb*gl_Color.rgb, 1.0);
+ col.rgb = min(col.rgb*diffuse_color.rgb, 1.0);
gl_FrontColor = col;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl
index 44cb78e914..3a17f6a709 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl
@@ -5,7 +5,10 @@
* $/LicenseInfo$
*/
-
+attribute vec4 position;
+attribute vec3 normal;
+attribute vec4 diffuse_color;
+attribute vec2 texcoord0;
vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
void calcAtmospherics(vec3 inPositionEye);
@@ -62,22 +65,22 @@ float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, floa
void main()
{
//transform vertex
- vec4 vert = vec4(gl_Vertex.xyz, 1.0);
- vary_texture_index = gl_Vertex.w;
- gl_Position = gl_ModelViewProjectionMatrix * vert;
+ 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);
- gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
+ gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
- vec4 pos = (gl_ModelViewMatrix * vert);
- vec3 norm = normalize(gl_NormalMatrix * gl_Normal);
+ vec3 norm = normalize(gl_NormalMatrix * 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;
calcAtmospherics(pos.xyz);
- //vec4 color = calcLighting(pos.xyz, norm, gl_Color, vec4(0.));
- vec4 col = vec4(0.0, 0.0, 0.0, gl_Color.a);
+ //vec4 color = calcLighting(pos.xyz, norm, diffuse_color, vec4(0.));
+ vec4 col = vec4(0.0, 0.0, 0.0, diffuse_color.a);
// Collect normal lights
col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].quadraticAttenuation, gl_LightSource[2].specular.a);
@@ -87,7 +90,7 @@ void main()
col.rgb += gl_LightSource[6].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[6].position, gl_LightSource[6].spotDirection.xyz, gl_LightSource[6].linearAttenuation, gl_LightSource[6].quadraticAttenuation, gl_LightSource[6].specular.a);
col.rgb += gl_LightSource[7].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[7].position, gl_LightSource[7].spotDirection.xyz, gl_LightSource[7].linearAttenuation, gl_LightSource[7].quadraticAttenuation, gl_LightSource[7].specular.a);
- vary_pointlight_col = col.rgb*gl_Color.rgb;
+ vary_pointlight_col = col.rgb*diffuse_color.rgb;
col.rgb = vec3(0,0,0);
@@ -96,10 +99,10 @@ void main()
vary_light = gl_LightSource[0].position.xyz;
- vary_ambient = col.rgb*gl_Color.rgb;
- vary_directional.rgb = gl_Color.rgb*atmosAffectDirectionalLight(max(calcDirectionalLight(norm, gl_LightSource[0].position.xyz), (1.0-gl_Color.a)*(1.0-gl_Color.a)));
+ vary_ambient = col.rgb*diffuse_color.rgb;
+ vary_directional.rgb = diffuse_color.rgb*atmosAffectDirectionalLight(max(calcDirectionalLight(norm, gl_LightSource[0].position.xyz), (1.0-diffuse_color.a)*(1.0-diffuse_color.a)));
- col.rgb = col.rgb*gl_Color.rgb;
+ col.rgb = col.rgb*diffuse_color.rgb;
gl_FrontColor = col;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowV.glsl b/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowV.glsl
index c7a4f86727..df61785aa1 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/attachmentShadowV.glsl
@@ -5,21 +5,23 @@
* $License$
*/
-
+attribute vec3 position;
+attribute vec4 diffuse_color;
+attribute vec2 texcoord0;
mat4 getObjectSkinnedTransform();
void main()
{
//transform vertex
- gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
+ gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
mat4 mat = getObjectSkinnedTransform();
mat = gl_ModelViewMatrix * mat;
- vec3 pos = (mat*gl_Vertex).xyz;
+ vec3 pos = (mat*vec4(position.xyz, 1.0)).xyz;
- gl_FrontColor = gl_Color;
+ gl_FrontColor = diffuse_color;
vec4 p = gl_ProjectionMatrix * vec4(pos, 1.0);
p.z = max(p.z, -p.w+0.01);
diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl
index 68e4055cf2..842931ec17 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl
@@ -5,7 +5,10 @@
* $/LicenseInfo$
*/
-
+attribute vec3 position;
+attribute vec3 normal;
+attribute vec4 diffuse_color;
+attribute vec2 texcoord0;
vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
mat4 getSkinnedTransform();
@@ -59,20 +62,21 @@ float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, floa
void main()
{
- gl_TexCoord[0] = gl_MultiTexCoord0;
+ gl_TexCoord[0] = vec4(texcoord0,0,1);
vec4 pos;
vec3 norm;
mat4 trans = getSkinnedTransform();
- pos.x = dot(trans[0], gl_Vertex);
- pos.y = dot(trans[1], gl_Vertex);
- pos.z = dot(trans[2], gl_Vertex);
+ vec4 pos_in = vec4(position.xyz, 1.0);
+ pos.x = dot(trans[0], pos_in);
+ pos.y = dot(trans[1], pos_in);
+ pos.z = dot(trans[2], pos_in);
pos.w = 1.0;
- norm.x = dot(trans[0].xyz, gl_Normal);
- norm.y = dot(trans[1].xyz, gl_Normal);
- norm.z = dot(trans[2].xyz, gl_Normal);
+ norm.x = dot(trans[0].xyz, normal);
+ norm.y = dot(trans[1].xyz, normal);
+ norm.z = dot(trans[2].xyz, normal);
norm = normalize(norm);
vec4 frag_pos = gl_ProjectionMatrix * pos;
@@ -82,9 +86,9 @@ void main()
calcAtmospherics(pos.xyz);
- //vec4 color = calcLighting(pos.xyz, norm, gl_Color, vec4(0.));
+ //vec4 color = calcLighting(pos.xyz, norm, diffuse_color, vec4(0.));
- vec4 col = vec4(0.0, 0.0, 0.0, gl_Color.a);
+ vec4 col = vec4(0.0, 0.0, 0.0, diffuse_color.a);
// Collect normal lights
col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].quadraticAttenuation, gl_LightSource[2].specular.a);
@@ -94,17 +98,17 @@ void main()
col.rgb += gl_LightSource[6].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[6].position, gl_LightSource[6].spotDirection.xyz, gl_LightSource[6].linearAttenuation, gl_LightSource[6].quadraticAttenuation, gl_LightSource[6].specular.a);
col.rgb += gl_LightSource[7].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[7].position, gl_LightSource[7].spotDirection.xyz, gl_LightSource[7].linearAttenuation, gl_LightSource[7].quadraticAttenuation, gl_LightSource[7].specular.a);
- vary_pointlight_col = col.rgb*gl_Color.rgb;
+ vary_pointlight_col = col.rgb*diffuse_color.rgb;
col.rgb = vec3(0,0,0);
// Add windlight lights
col.rgb = atmosAmbient(vec3(0.));
- vary_ambient = col.rgb*gl_Color.rgb;
- vary_directional = gl_Color.rgb*atmosAffectDirectionalLight(max(calcDirectionalLight(norm, gl_LightSource[0].position.xyz), (1.0-gl_Color.a)*(1.0-gl_Color.a)));
+ vary_ambient = col.rgb*diffuse_color.rgb;
+ vary_directional = diffuse_color.rgb*atmosAffectDirectionalLight(max(calcDirectionalLight(norm, gl_LightSource[0].position.xyz), (1.0-diffuse_color.a)*(1.0-diffuse_color.a)));
- col.rgb = min(col.rgb*gl_Color.rgb, 1.0);
+ col.rgb = min(col.rgb*diffuse_color.rgb, 1.0);
gl_FrontColor = col;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarEyesV.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarEyesV.glsl
index 7bc78fe407..bdea3d2b57 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/avatarEyesV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/avatarEyesV.glsl
@@ -6,16 +6,20 @@
*/
+attribute vec3 position;
+attribute vec3 normal;
+attribute vec4 diffuse_color;
+attribute vec2 texcoord0;
varying vec3 vary_normal;
void main()
{
//transform vertex
- gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
- gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
+ gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+ gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
- vary_normal = normalize(gl_NormalMatrix * gl_Normal);
+ vary_normal = normalize(gl_NormalMatrix * normal);
- gl_FrontColor = gl_Color;
+ 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 f177fcd8f1..cf6fc1c0ed 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/avatarShadowV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/avatarShadowV.glsl
@@ -9,26 +9,31 @@
mat4 getSkinnedTransform();
-attribute vec4 weight;
+attribute vec3 position;
+attribute vec3 normal;
+attribute vec4 diffuse_color;
+attribute vec2 texcoord0;
+
varying vec4 post_pos;
void main()
{
- gl_TexCoord[0] = gl_MultiTexCoord0;
+ gl_TexCoord[0] = vec4(texcoord0,0,1);
vec4 pos;
vec3 norm;
+ vec4 pos_in = vec4(position.xyz, 1.0);
mat4 trans = getSkinnedTransform();
- pos.x = dot(trans[0], gl_Vertex);
- pos.y = dot(trans[1], gl_Vertex);
- pos.z = dot(trans[2], gl_Vertex);
+ pos.x = dot(trans[0], pos_in);
+ pos.y = dot(trans[1], pos_in);
+ pos.z = dot(trans[2], pos_in);
pos.w = 1.0;
- norm.x = dot(trans[0].xyz, gl_Normal);
- norm.y = dot(trans[1].xyz, gl_Normal);
- norm.z = dot(trans[2].xyz, gl_Normal);
+ norm.x = dot(trans[0].xyz, normal);
+ norm.y = dot(trans[1].xyz, normal);
+ norm.z = dot(trans[2].xyz, normal);
norm = normalize(norm);
pos = gl_ProjectionMatrix * pos;
@@ -36,7 +41,7 @@ void main()
gl_Position = vec4(pos.x, pos.y, pos.w*0.5, pos.w);
- gl_FrontColor = gl_Color;
+ gl_FrontColor = diffuse_color;
}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/avatarV.glsl b/indra/newview/app_settings/shaders/class1/deferred/avatarV.glsl
index 7eac11287a..e66f8c8483 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/avatarV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/avatarV.glsl
@@ -5,7 +5,10 @@
* $/LicenseInfo$
*/
-
+attribute vec3 position;
+attribute vec4 diffuse_color;
+attribute vec3 normal;
+attribute vec2 texcoord0;
mat4 getSkinnedTransform();
@@ -15,28 +18,28 @@ varying vec3 vary_normal;
void main()
{
- gl_TexCoord[0] = gl_MultiTexCoord0;
+ gl_TexCoord[0] = vec4(texcoord0,0,1);
vec4 pos;
vec3 norm;
+ vec4 pos_in = vec4(position.xyz, 1.0);
mat4 trans = getSkinnedTransform();
- pos.x = dot(trans[0], gl_Vertex);
- pos.y = dot(trans[1], gl_Vertex);
- pos.z = dot(trans[2], gl_Vertex);
+ pos.x = dot(trans[0], pos_in);
+ pos.y = dot(trans[1], pos_in);
+ pos.z = dot(trans[2], pos_in);
pos.w = 1.0;
- norm.x = dot(trans[0].xyz, gl_Normal);
- norm.y = dot(trans[1].xyz, gl_Normal);
- norm.z = dot(trans[2].xyz, gl_Normal);
+ norm.x = dot(trans[0].xyz, normal);
+ norm.y = dot(trans[1].xyz, normal);
+ norm.z = dot(trans[2].xyz, normal);
norm = normalize(norm);
vary_normal = norm;
gl_Position = gl_ProjectionMatrix * pos;
- //gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
-
- gl_FrontColor = gl_Color;
+
+ gl_FrontColor = diffuse_color;
}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/blurLightV.glsl b/indra/newview/app_settings/shaders/class1/deferred/blurLightV.glsl
index 862f809de5..016b5e1008 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/blurLightV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/blurLightV.glsl
@@ -5,7 +5,7 @@
* $/LicenseInfo$
*/
-
+attribute vec3 position;
varying vec2 vary_fragcoord;
uniform vec2 screen_res;
@@ -13,7 +13,7 @@ uniform vec2 screen_res;
void main()
{
//transform vertex
- gl_Position = ftransform();
- vec4 pos = gl_ModelViewProjectionMatrix * gl_Vertex;
+ vec4 pos = gl_ModelViewProjectionMatrix * 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 dc69519a85..93e00fe523 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/bumpSkinnedV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/bumpSkinnedV.glsl
@@ -5,7 +5,11 @@
* $License$
*/
-
+attribute vec3 position;
+attribute vec4 diffuse_color;
+attribute vec3 normal;
+attribute vec2 texcoord0;
+attribute vec2 texcoord2;
varying vec3 vary_mat0;
varying vec3 vary_mat1;
@@ -15,17 +19,17 @@ mat4 getObjectSkinnedTransform();
void main()
{
- gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
+ gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
mat4 mat = getObjectSkinnedTransform();
mat = gl_ModelViewMatrix * mat;
- vec3 pos = (mat*gl_Vertex).xyz;
+ vec3 pos = (mat*vec4(position.xyz, 1.0)).xyz;
- vec3 n = normalize((mat * vec4(gl_Normal.xyz+gl_Vertex.xyz, 1.0)).xyz-pos.xyz);
- vec3 b = normalize((mat * vec4(gl_MultiTexCoord2.xyz+gl_Vertex.xyz, 1.0)).xyz-pos.xyz);
+ vec3 n = normalize((mat * vec4(normal.xyz+position.xyz, 1.0)).xyz-pos.xyz);
+ vec3 b = normalize((mat * vec4(vec4(texcoord2,0,1).xyz+position.xyz, 1.0)).xyz-pos.xyz);
vec3 t = cross(b, n);
vary_mat0 = vec3(t.x, b.x, n.x);
@@ -33,5 +37,5 @@ void main()
vary_mat2 = vec3(t.z, b.z, n.z);
gl_Position = gl_ProjectionMatrix*vec4(pos, 1.0);
- gl_FrontColor = gl_Color;
+ 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 5b6726488b..3c28776045 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/bumpV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/bumpV.glsl
@@ -5,7 +5,11 @@
* $/LicenseInfo$
*/
-
+attribute vec3 position;
+attribute vec4 diffuse_color;
+attribute vec3 normal;
+attribute vec2 texcoord0;
+attribute vec2 texcoord2;
varying vec3 vary_mat0;
varying vec3 vary_mat1;
@@ -14,16 +18,16 @@ varying vec3 vary_mat2;
void main()
{
//transform vertex
- gl_Position = ftransform();
- gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
+ gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+ gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
- vec3 n = normalize(gl_NormalMatrix * gl_Normal);
- vec3 b = normalize(gl_NormalMatrix * gl_MultiTexCoord2.xyz);
+ vec3 n = normalize(gl_NormalMatrix * normal);
+ vec3 b = normalize(gl_NormalMatrix * vec4(texcoord2,0,1).xyz);
vec3 t = cross(b, n);
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);
- gl_FrontColor = gl_Color;
+ gl_FrontColor = diffuse_color;
}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl b/indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl
index 3eac63076c..9ba5e97a95 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/cloudsV.glsl
@@ -5,7 +5,8 @@
* $/LicenseInfo$
*/
-
+attribute vec3 position;
+attribute vec2 texcoord0;
//////////////////////////////////////////////////////////////////////////
// The vertex shader for creating the atmospheric sky
@@ -41,12 +42,12 @@ void main()
{
// World / view / projection
- gl_Position = ftransform();
+ gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
- gl_TexCoord[0] = gl_MultiTexCoord0;
+ gl_TexCoord[0] = vec4(texcoord0,0,1);
// Get relative position
- vec3 P = gl_Vertex.xyz - camPosLocal.xyz + vec3(0,50,0);
+ vec3 P = position.xyz - camPosLocal.xyz + vec3(0,50,0);
// Set altitude
if (P.y > 0.)
@@ -142,7 +143,7 @@ void main()
// Texture coords
- gl_TexCoord[0] = gl_MultiTexCoord0;
+ gl_TexCoord[0] = vec4(texcoord0,0,1);
gl_TexCoord[0].xy -= 0.5;
gl_TexCoord[0].xy /= cloud_scale.x;
gl_TexCoord[0].xy += 0.5;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/diffuseSkinnedV.glsl b/indra/newview/app_settings/shaders/class1/deferred/diffuseSkinnedV.glsl
index 2c4caea109..fadbe5b9ef 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/diffuseSkinnedV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseSkinnedV.glsl
@@ -7,27 +7,32 @@
+attribute vec3 position;
+attribute vec4 diffuse_color;
+attribute vec3 normal;
+attribute vec2 texcoord0;
+
varying vec3 vary_normal;
mat4 getObjectSkinnedTransform();
void main()
{
- gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
+ gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
mat4 mat = getObjectSkinnedTransform();
mat = gl_ModelViewMatrix * mat;
- vec3 pos = (mat*gl_Vertex).xyz;
+ vec3 pos = (mat*vec4(position.xyz, 1.0)).xyz;
- vec4 norm = gl_Vertex;
- norm.xyz += gl_Normal.xyz;
+ vec4 norm = vec4(position.xyz, 1.0);
+ norm.xyz += normal.xyz;
norm.xyz = (mat*norm).xyz;
norm.xyz = normalize(norm.xyz-pos.xyz);
vary_normal = norm.xyz;
- gl_FrontColor = gl_Color;
+ gl_FrontColor = diffuse_color;
gl_Position = gl_ProjectionMatrix*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 b56d1493c3..e424737702 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/diffuseV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/diffuseV.glsl
@@ -6,6 +6,10 @@
*/
+attribute vec4 position;
+attribute vec4 diffuse_color;
+attribute vec3 normal;
+attribute vec2 texcoord0;
varying vec3 vary_normal;
varying float vary_texture_index;
@@ -13,11 +17,11 @@ varying float vary_texture_index;
void main()
{
//transform vertex
- gl_Position = gl_ModelViewProjectionMatrix * vec4(gl_Vertex.xyz, 1.0);
- gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
+ gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+ gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
- vary_texture_index = gl_Vertex.w;
- vary_normal = normalize(gl_NormalMatrix * gl_Normal);
+ vary_texture_index = position.w;
+ vary_normal = normalize(gl_NormalMatrix * normal);
- gl_FrontColor = gl_Color;
+ gl_FrontColor = diffuse_color;
}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/fullbrightV.glsl b/indra/newview/app_settings/shaders/class1/deferred/fullbrightV.glsl
index 2eed044b7c..3e5fc7a36b 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/fullbrightV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/fullbrightV.glsl
@@ -6,6 +6,9 @@
*/
+attribute vec4 position;
+attribute vec4 diffuse_color;
+attribute vec2 texcoord0;
void calcAtmospherics(vec3 inPositionEye);
@@ -19,18 +22,17 @@ varying float vary_texture_index;
void main()
{
//transform vertex
- vec4 vert = vec4(gl_Vertex.xyz, 1.0);
- vary_texture_index = gl_Vertex.w;
+ vec4 vert = vec4(position.xyz, 1.0);
+ vec4 pos = (gl_ModelViewMatrix * vert);
+ vary_texture_index = position.w;
- gl_Position = gl_ModelViewProjectionMatrix*vert;
+ gl_Position = gl_ModelViewProjectionMatrix*vec4(position.xyz, 1.0);
- gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
+ gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
- vec4 pos = (gl_ModelViewMatrix * vert);
-
calcAtmospherics(pos.xyz);
- gl_FrontColor = gl_Color;
+ gl_FrontColor = diffuse_color;
gl_FogFragCoord = pos.z;
}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/giV.glsl b/indra/newview/app_settings/shaders/class1/deferred/giV.glsl
index e86f2896da..d97d7ea82d 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/giV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/giV.glsl
@@ -5,6 +5,9 @@
* $/LicenseInfo$
*/
+attribute vec3 position;
+attribute vec4 diffuse_color;
+attribute vec2 texcoord0;
varying vec2 vary_fragcoord;
@@ -14,11 +17,12 @@ uniform vec2 screen_res;
void main()
{
//transform vertex
- gl_Position = ftransform();
- vec4 pos = gl_ModelViewProjectionMatrix * gl_Vertex;
+ vec4 pos = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+ gl_Position = pos;
+
vary_fragcoord = (pos.xy * 0.5 + 0.5)*screen_res;
- vec4 tex = gl_MultiTexCoord0;
+ vec4 tex = vec4(texcoord0,0,1);
tex.w = 1.0;
- gl_FrontColor = gl_Color;
+ gl_FrontColor = diffuse_color;
}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/impostorV.glsl b/indra/newview/app_settings/shaders/class1/deferred/impostorV.glsl
index 723777bd3a..cb47f62bbf 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/impostorV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/impostorV.glsl
@@ -5,13 +5,15 @@
* $/LicenseInfo$
*/
-
+attribute vec3 position;
+attribute vec4 diffuse_color;
+attribute vec2 texcoord0;
void main()
{
//transform vertex
- gl_Position = ftransform();
- gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
+ gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+ gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
- gl_FrontColor = gl_Color;
+ 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 4baf1fc65a..6a53644723 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/luminanceV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/luminanceV.glsl
@@ -5,8 +5,9 @@
* $/LicenseInfo$
*/
-
-
+
+attribute vec3 position;
+attribute vec4 diffuse_color;
varying vec2 vary_fragcoord;
@@ -15,9 +16,10 @@ uniform vec2 screen_res;
void main()
{
//transform vertex
- gl_Position = ftransform();
- vec4 pos = gl_ModelViewProjectionMatrix * gl_Vertex;
+ vec4 pos = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+ gl_Position = pos;
+
vary_fragcoord = (pos.xy * 0.5 + 0.5)*screen_res;
- gl_FrontColor = gl_Color;
+ gl_FrontColor = diffuse_color;
}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/multiPointLightV.glsl b/indra/newview/app_settings/shaders/class1/deferred/multiPointLightV.glsl
index 434fb6f534..7db577c07a 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/multiPointLightV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/multiPointLightV.glsl
@@ -6,15 +6,17 @@
*/
+attribute vec3 position;
+attribute vec4 diffuse_color;
varying vec4 vary_fragcoord;
void main()
{
//transform vertex
- vec4 pos = gl_ModelViewProjectionMatrix * gl_Vertex;
+ vec4 pos = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
vary_fragcoord = pos;
gl_Position = pos;
- gl_FrontColor = gl_Color;
+ gl_FrontColor = diffuse_color;
}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/pointLightV.glsl b/indra/newview/app_settings/shaders/class1/deferred/pointLightV.glsl
index c510d8ad77..ac3170d16d 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/pointLightV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/pointLightV.glsl
@@ -5,7 +5,9 @@
* $/LicenseInfo$
*/
-
+attribute vec3 position;
+attribute vec4 diffuse_color;
+attribute vec2 texcoord0;
varying vec4 vary_light;
varying vec4 vary_fragcoord;
@@ -13,15 +15,15 @@ varying vec4 vary_fragcoord;
void main()
{
//transform vertex
- vec4 pos = gl_ModelViewProjectionMatrix * gl_Vertex;
+ vec4 pos = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
vary_fragcoord = pos;
- vec4 tex = gl_MultiTexCoord0;
+ vec4 tex = vec4(texcoord0,0,1);
tex.w = 1.0;
- vary_light = gl_MultiTexCoord0;
+ vary_light = vec4(texcoord0,0,1);
gl_Position = pos;
- gl_FrontColor = gl_Color;
+ gl_FrontColor = diffuse_color;
}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredV.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredV.glsl
index 876f65ee3a..30dbe3f75e 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredV.glsl
@@ -5,7 +5,7 @@
* $/LicenseInfo$
*/
-
+attribute vec3 position;
varying vec2 vary_fragcoord;
uniform vec2 screen_res;
@@ -13,7 +13,7 @@ uniform vec2 screen_res;
void main()
{
//transform vertex
- gl_Position = ftransform();
- vec4 pos = gl_ModelViewProjectionMatrix * gl_Vertex;
+ vec4 pos = gl_ModelViewProjectionMatrix * 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/postgiV.glsl b/indra/newview/app_settings/shaders/class1/deferred/postgiV.glsl
index eebe930666..38525044ba 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/postgiV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/postgiV.glsl
@@ -5,6 +5,7 @@
* $/LicenseInfo$
*/
+attribute vec3 position;
varying vec2 vary_fragcoord;
@@ -13,7 +14,7 @@ uniform vec2 screen_res;
void main()
{
//transform vertex
- gl_Position = ftransform();
- vec4 pos = gl_ModelViewProjectionMatrix * gl_Vertex;
+ vec4 pos = gl_ModelViewProjectionMatrix * 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 58e9bcec58..6bbbfdd8ee 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/shadowAlphaMaskV.glsl
@@ -5,19 +5,21 @@
* $/LicenseInfo$
*/
-
+attribute vec3 position;
+attribute vec4 diffuse_color;
+attribute vec2 texcoord0;
varying vec4 post_pos;
void main()
{
//transform vertex
- vec4 pos = gl_ModelViewProjectionMatrix*gl_Vertex;
+ vec4 pos = gl_ModelViewProjectionMatrix*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] * gl_MultiTexCoord0;
- gl_FrontColor = gl_Color;
+ gl_TexCoord[0] = gl_TextureMatrix[0] * 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 d40c2d9f78..7a8ac14f5e 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/shadowV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/shadowV.glsl
@@ -5,14 +5,14 @@
* $/LicenseInfo$
*/
-
+attribute vec3 position;
varying vec4 post_pos;
void main()
{
//transform vertex
- vec4 pos = gl_ModelViewProjectionMatrix*gl_Vertex;
+ vec4 pos = gl_ModelViewProjectionMatrix*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 1ea00f723a..8dfb466e88 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/skyV.glsl
@@ -5,7 +5,8 @@
* $/LicenseInfo$
*/
-
+attribute vec3 position;
+attribute vec2 texcoord0;
// SKY ////////////////////////////////////////////////////////////////////////
// The vertex shader for creating the atmospheric sky
@@ -39,12 +40,12 @@ void main()
{
// World / view / projection
- gl_Position = ftransform();
- gl_TexCoord[0] = gl_MultiTexCoord0;
+ gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+ gl_TexCoord[0] = vec4(texcoord0,0,1);
// Get relative position
- vec3 P = gl_Vertex.xyz - camPosLocal.xyz + vec3(0,50,0);
- //vec3 P = gl_Vertex.xyz + vec3(0,50,0);
+ vec3 P = position.xyz - camPosLocal.xyz + vec3(0,50,0);
+ //vec3 P = position.xyz + vec3(0,50,0);
// Set altitude
if (P.y > 0.)
diff --git a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
index d327216a0c..3ba5ee5bd2 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
@@ -45,7 +45,7 @@ uniform vec3 env_mat[3];
//uniform vec4 shadow_clip;
uniform mat3 ssao_effect_mat;
-varying vec4 vary_light;
+uniform vec3 sun_dir;
varying vec2 vary_fragcoord;
vec3 vary_PositionEye;
@@ -265,7 +265,7 @@ void main()
norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm
//vec3 nz = texture2D(noiseMap, vary_fragcoord.xy/128.0).xyz;
- float da = max(dot(norm.xyz, vary_light.xyz), 0.0);
+ float da = max(dot(norm.xyz, sun_dir.xyz), 0.0);
vec4 diffuse = texture2DRect(diffuseRect, tc);
vec4 spec = texture2DRect(specularRect, vary_fragcoord.xy);
@@ -286,7 +286,7 @@ void main()
// the old infinite-sky shiny reflection
//
vec3 refnormpersp = normalize(reflect(pos.xyz, norm.xyz));
- float sa = dot(refnormpersp, vary_light.xyz);
+ float sa = dot(refnormpersp, sun_dir.xyz);
vec3 dumbshiny = vary_SunlitColor*texture2D(lightFunc, vec2(sa, spec.a)).a;
// add the two types of shiny together
diff --git a/indra/newview/app_settings/shaders/class1/deferred/softenLightV.glsl b/indra/newview/app_settings/shaders/class1/deferred/softenLightV.glsl
index 745cc01992..5b3f655edf 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/softenLightV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightV.glsl
@@ -6,21 +6,16 @@
*/
+attribute vec3 position;
uniform vec2 screen_res;
-varying vec4 vary_light;
varying vec2 vary_fragcoord;
void main()
{
//transform vertex
- gl_Position = ftransform();
-
- vec4 pos = gl_ModelViewProjectionMatrix * gl_Vertex;
- vary_fragcoord = (pos.xy*0.5+0.5)*screen_res;
+ vec4 pos = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+ gl_Position = pos;
- vec4 tex = gl_MultiTexCoord0;
- tex.w = 1.0;
-
- vary_light = gl_MultiTexCoord0;
+ 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 c43125dad9..7cdfe445df 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/starsV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/starsV.glsl
@@ -6,12 +6,14 @@
*/
-
+attribute vec3 position;
+attribute vec4 diffuse_color;
+attribute vec2 texcoord0;
void main()
{
//transform vertex
- gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
- gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
- gl_FrontColor = gl_Color;
+ gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+ gl_TexCoord[0] = gl_TextureMatrix[0] * 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 814deb3677..65fa288e88 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/sunLightV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/sunLightV.glsl
@@ -5,7 +5,10 @@
* $/LicenseInfo$
*/
-
+attribute vec3 position;
+attribute vec3 normal;
+attribute vec4 diffuse_color;
+attribute vec2 texcoord0;
varying vec4 vary_light;
varying vec2 vary_fragcoord;
@@ -15,13 +18,14 @@ uniform vec2 screen_res;
void main()
{
//transform vertex
- gl_Position = ftransform();
- vec4 pos = gl_ModelViewProjectionMatrix * gl_Vertex;
+ vec4 pos = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+ gl_Position = pos;
+
vary_fragcoord = (pos.xy * 0.5 + 0.5)*screen_res;
- vec4 tex = gl_MultiTexCoord0;
+ vec4 tex = vec4(texcoord0,0,1);
tex.w = 1.0;
- vary_light = gl_MultiTexCoord0;
+ vary_light = vec4(texcoord0,0,1);
- gl_FrontColor = gl_Color;
+ gl_FrontColor = diffuse_color;
}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/terrainV.glsl b/indra/newview/app_settings/shaders/class1/deferred/terrainV.glsl
index 3038fd2966..33b379d70c 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/terrainV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/terrainV.glsl
@@ -5,7 +5,11 @@
* $/LicenseInfo$
*/
-
+attribute vec3 position;
+attribute vec3 normal;
+attribute vec4 diffuse_color;
+attribute vec2 texcoord0;
+attribute vec2 texcoord1;
varying vec3 vary_normal;
@@ -26,14 +30,14 @@ vec4 texgen_object(vec4 vpos, vec4 tc, mat4 mat, vec4 tp0, vec4 tp1)
void main()
{
//transform vertex
- gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+ gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
- vary_normal = normalize(gl_NormalMatrix * gl_Normal);
+ vary_normal = normalize(gl_NormalMatrix * normal);
// Transform and pass tex coords
- gl_TexCoord[0].xy = texgen_object(gl_Vertex, gl_MultiTexCoord0, gl_TextureMatrix[0], gl_ObjectPlaneS[0], gl_ObjectPlaneT[0]).xy;
+ gl_TexCoord[0].xy = texgen_object(vec4(position, 1.0), vec4(texcoord0,0,1), gl_TextureMatrix[0], gl_ObjectPlaneS[0], gl_ObjectPlaneT[0]).xy;
- vec4 t = gl_MultiTexCoord1;
+ vec4 t = vec4(texcoord1,0,1);
gl_TexCoord[0].zw = t.xy;
gl_TexCoord[1].xy = t.xy-vec2(2.0, 0.0);
diff --git a/indra/newview/app_settings/shaders/class1/deferred/treeV.glsl b/indra/newview/app_settings/shaders/class1/deferred/treeV.glsl
index a9bef4292d..07e56e84db 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/treeV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/treeV.glsl
@@ -6,16 +6,20 @@
*/
+attribute vec3 position;
+attribute vec3 normal;
+attribute vec2 texcoord0;
+
varying vec3 vary_normal;
void main()
{
//transform vertex
- gl_Position = ftransform();
- gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
+ gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+ gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
- vary_normal = normalize(gl_NormalMatrix * gl_Normal);
+ vary_normal = normalize(gl_NormalMatrix * normal);
- gl_FrontColor = gl_Color;
+ 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 5397290b11..b5869e6cb2 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/waterV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/waterV.glsl
@@ -6,6 +6,8 @@
*/
+attribute vec3 position;
+
void calcAtmospherics(vec3 inPositionEye);
@@ -29,25 +31,25 @@ float wave(vec2 v, float t, float f, vec2 d, float s)
void main()
{
//transform vertex
- vec4 position = gl_Vertex;
+ vec4 pos = vec4(position.xyz, 1.0);
mat4 modelViewProj = gl_ModelViewProjectionMatrix;
vec4 oPosition;
//get view vector
vec3 oEyeVec;
- oEyeVec.xyz = position.xyz-eyeVec;
+ oEyeVec.xyz = pos.xyz-eyeVec;
float d = length(oEyeVec.xy);
float ld = min(d, 2560.0);
- position.xy = eyeVec.xy + oEyeVec.xy/d*ld;
+ pos.xy = eyeVec.xy + oEyeVec.xy/d*ld;
view.xyz = oEyeVec;
d = clamp(ld/1536.0-0.5, 0.0, 1.0);
d *= d;
- oPosition = position;
+ oPosition = vec4(position, 1.0);
oPosition.z = mix(oPosition.z, max(eyeVec.z*0.75, 0.0), d);
vary_position = gl_ModelViewMatrix * oPosition;
oPosition = modelViewProj * oPosition;
@@ -55,17 +57,16 @@ void main()
refCoord.xyz = oPosition.xyz + vec3(0,0,0.2);
//get wave position parameter (create sweeping horizontal waves)
- vec3 v = position.xyz;
+ vec3 v = pos.xyz;
v.x += (cos(v.x*0.08/*+time*0.01*/)+sin(v.y*0.02))*6.0;
//push position for further horizon effect.
- position.xyz = oEyeVec.xyz*(waterHeight/oEyeVec.z);
- position.w = 1.0;
- position = position*gl_ModelViewMatrix;
-
- calcAtmospherics((gl_ModelViewMatrix * gl_Vertex).xyz);
-
+ pos.xyz = oEyeVec.xyz*(waterHeight/oEyeVec.z);
+ pos.w = 1.0;
+ pos = gl_ModelViewMatrix*pos;
+ calcAtmospherics(pos.xyz);
+
//pass wave parameters to pixel shader
vec2 bigWave = (v.xy) * vec2(0.04,0.04) + d1 * time * 0.055;
//get two normal map (detail map) texture coordinates
diff --git a/indra/newview/app_settings/shaders/class1/effects/glowExtractF.glsl b/indra/newview/app_settings/shaders/class1/effects/glowExtractF.glsl
index 32f5f5f236..1ec0836dcc 100644
--- a/indra/newview/app_settings/shaders/class1/effects/glowExtractF.glsl
+++ b/indra/newview/app_settings/shaders/class1/effects/glowExtractF.glsl
@@ -19,7 +19,6 @@ uniform float warmthAmount;
void main()
{
vec4 col = texture2DRect(diffuseMap, gl_TexCoord[0].xy);
-
/// CALCULATING LUMINANCE (Using NTSC lum weights)
/// http://en.wikipedia.org/wiki/Luma_%28video%29
float lum = smoothstep(minLuminance, minLuminance+1.0, dot(col.rgb, lumWeights ) );
@@ -27,4 +26,5 @@ void main()
gl_FragColor.rgb = col.rgb;
gl_FragColor.a = max(col.a, mix(lum, warmth, warmthAmount) * maxExtractAlpha);
+
}
diff --git a/indra/newview/app_settings/shaders/class1/effects/glowExtractV.glsl b/indra/newview/app_settings/shaders/class1/effects/glowExtractV.glsl
index 76736fed53..b8881e0b19 100644
--- a/indra/newview/app_settings/shaders/class1/effects/glowExtractV.glsl
+++ b/indra/newview/app_settings/shaders/class1/effects/glowExtractV.glsl
@@ -5,11 +5,13 @@
* $/LicenseInfo$
*/
+attribute vec3 position;
+attribute vec2 texcoord0;
void main()
{
- gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+ gl_Position = gl_ModelViewProjectionMatrix * vec4(position, 1.0);
- gl_TexCoord[0].xy = gl_MultiTexCoord0.xy;
+ gl_TexCoord[0].xy = texcoord0;
}
diff --git a/indra/newview/app_settings/shaders/class1/effects/glowV.glsl b/indra/newview/app_settings/shaders/class1/effects/glowV.glsl
index 9bb41626ae..a05449a77c 100644
--- a/indra/newview/app_settings/shaders/class1/effects/glowV.glsl
+++ b/indra/newview/app_settings/shaders/class1/effects/glowV.glsl
@@ -5,20 +5,21 @@
* $/LicenseInfo$
*/
-
+attribute vec3 position;
+attribute vec2 texcoord0;
uniform vec2 glowDelta;
void main()
{
- gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+ gl_Position = gl_ModelViewProjectionMatrix * vec4(position, 1.0);
- gl_TexCoord[0].xy = gl_MultiTexCoord0.xy + glowDelta*(-3.5);
- gl_TexCoord[1].xy = gl_MultiTexCoord0.xy + glowDelta*(-2.5);
- gl_TexCoord[2].xy = gl_MultiTexCoord0.xy + glowDelta*(-1.5);
- gl_TexCoord[3].xy = gl_MultiTexCoord0.xy + glowDelta*(-0.5);
- gl_TexCoord[0].zw = gl_MultiTexCoord0.xy + glowDelta*(0.5);
- gl_TexCoord[1].zw = gl_MultiTexCoord0.xy + glowDelta*(1.5);
- gl_TexCoord[2].zw = gl_MultiTexCoord0.xy + glowDelta*(2.5);
- gl_TexCoord[3].zw = gl_MultiTexCoord0.xy + glowDelta*(3.5);
+ gl_TexCoord[0].xy = texcoord0 + glowDelta*(-3.5);
+ gl_TexCoord[1].xy = texcoord0 + glowDelta*(-2.5);
+ gl_TexCoord[2].xy = texcoord0 + glowDelta*(-1.5);
+ gl_TexCoord[3].xy = texcoord0 + glowDelta*(-0.5);
+ gl_TexCoord[0].zw = texcoord0 + glowDelta*(0.5);
+ gl_TexCoord[1].zw = texcoord0 + glowDelta*(1.5);
+ gl_TexCoord[2].zw = texcoord0 + glowDelta*(2.5);
+ gl_TexCoord[3].zw = texcoord0 + glowDelta*(3.5);
}
diff --git a/indra/newview/app_settings/shaders/class1/environment/terrainV.glsl b/indra/newview/app_settings/shaders/class1/environment/terrainV.glsl
index 8af981915b..d0d8aed67e 100644
--- a/indra/newview/app_settings/shaders/class1/environment/terrainV.glsl
+++ b/indra/newview/app_settings/shaders/class1/environment/terrainV.glsl
@@ -5,6 +5,13 @@
* $/LicenseInfo$
*/
+attribute vec3 position;
+attribute vec3 normal;
+attribute vec4 diffuse_color;
+attribute vec2 texcoord0;
+attribute vec2 texcoord1;
+attribute vec2 texcoord2;
+attribute vec2 texcoord3;
vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
@@ -26,17 +33,17 @@ vec4 texgen_object(vec4 vpos, vec4 tc, mat4 mat, vec4 tp0, vec4 tp1)
void main()
{
//transform vertex
- gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+ gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
- vec4 pos = gl_ModelViewMatrix * gl_Vertex;
- vec3 norm = normalize(gl_NormalMatrix * gl_Normal);
+ vec4 pos = gl_ModelViewMatrix * position;
+ vec3 norm = normalize(gl_NormalMatrix * normal);
- vec4 color = calcLighting(pos.xyz, norm, vec4(1,1,1,1), gl_Color);
+ vec4 color = calcLighting(pos.xyz, norm, vec4(1,1,1,1), diffuse_color);
gl_FrontColor = color;
- gl_TexCoord[0] = texgen_object(gl_Vertex,gl_MultiTexCoord0,gl_TextureMatrix[0],gl_ObjectPlaneS[0],gl_ObjectPlaneT[0]);
- gl_TexCoord[1] = gl_TextureMatrix[1]*gl_MultiTexCoord1;
- gl_TexCoord[2] = texgen_object(gl_Vertex,gl_MultiTexCoord2,gl_TextureMatrix[2],gl_ObjectPlaneS[2],gl_ObjectPlaneT[2]);
- gl_TexCoord[3] = gl_TextureMatrix[3]*gl_MultiTexCoord3;
+ gl_TexCoord[0] = texgen_object(vec4(position.xyz, 1.0),vec4(texcoord0,0,1),gl_TextureMatrix[0],gl_ObjectPlaneS[0],gl_ObjectPlaneT[0]);
+ gl_TexCoord[1] = gl_TextureMatrix[1]*vec4(texcoord1,0,1);
+ gl_TexCoord[2] = texgen_object(vec4(position.xyz, 1.0),vec4(texcoord2,0,1),gl_TextureMatrix[2],gl_ObjectPlaneS[2],gl_ObjectPlaneT[2]);
+ gl_TexCoord[3] = gl_TextureMatrix[3]*vec4(texcoord3,0,1);
}
diff --git a/indra/newview/app_settings/shaders/class1/environment/waterV.glsl b/indra/newview/app_settings/shaders/class1/environment/waterV.glsl
index 831d6a761c..92d4759fe8 100644
--- a/indra/newview/app_settings/shaders/class1/environment/waterV.glsl
+++ b/indra/newview/app_settings/shaders/class1/environment/waterV.glsl
@@ -6,6 +6,7 @@
*/
+attribute vec3 position;
void calcAtmospherics(vec3 inPositionEye);
@@ -27,7 +28,6 @@ float wave(vec2 v, float t, float f, vec2 d, float s)
void main()
{
//transform vertex
- vec4 position = gl_Vertex;
mat4 modelViewProj = gl_ModelViewProjectionMatrix;
vec4 oPosition;
@@ -45,7 +45,7 @@ void main()
d = clamp(ld/1536.0-0.5, 0.0, 1.0);
d *= d;
- oPosition = position;
+ oPosition = vec4(position, 1.0);
oPosition.z = mix(oPosition.z, max(eyeVec.z*0.75, 0.0), d);
oPosition = modelViewProj * oPosition;
refCoord.xyz = oPosition.xyz + vec3(0,0,0.2);
@@ -55,11 +55,12 @@ void main()
v.x += (cos(v.x*0.08/*+time*0.01*/)+sin(v.y*0.02))*6.0;
//push position for further horizon effect.
- position.xyz = oEyeVec.xyz*(waterHeight/oEyeVec.z);
- position.w = 1.0;
- position = position*gl_ModelViewMatrix;
+ vec4 pos;
+ pos.xyz = oEyeVec.xyz*(waterHeight/oEyeVec.z);
+ pos.w = 1.0;
+ pos = gl_ModelViewMatrix*pos;
- calcAtmospherics((gl_ModelViewMatrix * gl_Vertex).xyz);
+ calcAtmospherics(pos.xyz);
//pass wave parameters to pixel shader
diff --git a/indra/newview/app_settings/shaders/class1/interface/customalphaV.glsl b/indra/newview/app_settings/shaders/class1/interface/customalphaV.glsl
index 04bfff22c1..22095bc611 100644
--- a/indra/newview/app_settings/shaders/class1/interface/customalphaV.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/customalphaV.glsl
@@ -5,12 +5,15 @@
* $/LicenseInfo$
*/
+attribute vec3 position;
+attribute vec4 diffuse_color;
+attribute vec2 texcoord0;
void main()
{
- gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
- gl_TexCoord[0] = gl_MultiTexCoord0;
- gl_FrontColor = gl_Color;
+ gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+ gl_TexCoord[0] = vec4(texcoord0,0,1);
+ gl_FrontColor = diffuse_color;
}
diff --git a/indra/newview/app_settings/shaders/class1/interface/glowcombineV.glsl b/indra/newview/app_settings/shaders/class1/interface/glowcombineV.glsl
index ce183ec154..46be1c45d3 100644
--- a/indra/newview/app_settings/shaders/class1/interface/glowcombineV.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/glowcombineV.glsl
@@ -5,11 +5,14 @@
* $/LicenseInfo$
*/
+attribute vec3 position;
+attribute vec2 texcoord0;
+attribute vec2 texcoord1;
void main()
{
- gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
- gl_TexCoord[0] = gl_MultiTexCoord0;
- gl_TexCoord[1] = gl_MultiTexCoord1;
+ gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+ gl_TexCoord[0] = vec4(texcoord0,0,1);
+ gl_TexCoord[1] = vec4(texcoord1,0,1);
}
diff --git a/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl b/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl
index f6c6d945de..a0cbdaafb8 100644
--- a/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/highlightF.glsl
@@ -6,10 +6,10 @@
*/
-
+uniform vec4 highlight_color;
uniform sampler2D diffuseMap;
void main()
{
- gl_FragColor = gl_Color*texture2D(diffuseMap, gl_TexCoord[0].xy);
+ gl_FragColor = highlight_color*texture2D(diffuseMap, gl_TexCoord[0].xy);
}
diff --git a/indra/newview/app_settings/shaders/class1/interface/highlightV.glsl b/indra/newview/app_settings/shaders/class1/interface/highlightV.glsl
index f114f766bf..0547c44093 100644
--- a/indra/newview/app_settings/shaders/class1/interface/highlightV.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/highlightV.glsl
@@ -5,23 +5,13 @@
* $/LicenseInfo$
*/
-
+attribute vec3 position;
+attribute vec2 texcoord0;
void main()
{
//transform vertex
- gl_Position = ftransform();
- vec3 pos = (gl_ModelViewMatrix * gl_Vertex).xyz;
- pos = normalize(pos);
- float d = dot(pos, normalize(gl_NormalMatrix * gl_Normal));
- d *= d;
- d = 1.0 - d;
- d *= d;
-
- d = min(d, gl_Color.a*2.0);
-
- gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
- gl_FrontColor.rgb = gl_Color.rgb;
- gl_FrontColor.a = max(d, gl_Color.a);
+ gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+ gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
}
diff --git a/indra/newview/app_settings/shaders/class1/interface/occlusionV.glsl b/indra/newview/app_settings/shaders/class1/interface/occlusionV.glsl
index 5a5d0ec506..9c528750eb 100644
--- a/indra/newview/app_settings/shaders/class1/interface/occlusionV.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/occlusionV.glsl
@@ -5,8 +5,10 @@
* $/LicenseInfo$
*/
+attribute vec3 position;
+
void main()
{
- gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+ gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
}
diff --git a/indra/newview/app_settings/shaders/class1/interface/solidcolorV.glsl b/indra/newview/app_settings/shaders/class1/interface/solidcolorV.glsl
index 8401208e28..18c8e394c6 100644
--- a/indra/newview/app_settings/shaders/class1/interface/solidcolorV.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/solidcolorV.glsl
@@ -5,12 +5,14 @@
* $/LicenseInfo$
*/
-
+attribute vec3 position;
+attribute vec4 diffuse_color;
+attribute vec2 texcoord0;
void main()
{
- gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
- gl_FrontColor = gl_Color;
- gl_TexCoord[0] = gl_MultiTexCoord0;
+ gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+ gl_FrontColor = diffuse_color;
+ gl_TexCoord[0] = vec4(texcoord0,0,1);
}
diff --git a/indra/newview/app_settings/shaders/class1/interface/twotextureaddV.glsl b/indra/newview/app_settings/shaders/class1/interface/twotextureaddV.glsl
index f685b112b4..dde4e87c63 100644
--- a/indra/newview/app_settings/shaders/class1/interface/twotextureaddV.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/twotextureaddV.glsl
@@ -6,11 +6,14 @@
*/
+attribute vec3 position;
+attribute vec2 texcoord0;
+attribute vec2 texcoord1;
void main()
{
- gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
- gl_TexCoord[0] = gl_MultiTexCoord0;
- gl_TexCoord[1] = gl_MultiTexCoord1;
+ gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+ gl_TexCoord[0] = vec4(texcoord0,0,1);
+ gl_TexCoord[1] = vec4(texcoord1,0,1);
}
diff --git a/indra/newview/app_settings/shaders/class1/interface/uiV.glsl b/indra/newview/app_settings/shaders/class1/interface/uiV.glsl
index 9ca6cae5c5..ebf2361da4 100644
--- a/indra/newview/app_settings/shaders/class1/interface/uiV.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/uiV.glsl
@@ -6,11 +6,15 @@
*/
+attribute vec3 position;
+attribute vec4 diffuse_color;
+attribute vec2 texcoord0;
+
void main()
{
- gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
- gl_TexCoord[0] = gl_MultiTexCoord0;
- gl_FrontColor = gl_Color;
+ gl_Position = gl_ModelViewProjectionMatrix * vec4(position, 1);
+ gl_TexCoord[0] = vec4(texcoord0,0,1);
+ gl_FrontColor = diffuse_color;
}
diff --git a/indra/newview/app_settings/shaders/class1/objects/bumpV.glsl b/indra/newview/app_settings/shaders/class1/objects/bumpV.glsl
index 056d1a9582..438a9bec85 100644
--- a/indra/newview/app_settings/shaders/class1/objects/bumpV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/bumpV.glsl
@@ -6,11 +6,16 @@
*/
+attribute vec3 position;
+attribute vec4 diffuse_color;
+attribute vec2 texcoord0;
+attribute vec2 texcoord1;
+
void main()
{
//transform vertex
- gl_Position = gl_ModelViewProjectionMatrix*gl_Vertex;
- gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
- gl_TexCoord[1] = gl_TextureMatrix[1] * gl_MultiTexCoord1;
- gl_FrontColor = gl_Color;
+ gl_Position = gl_ModelViewProjectionMatrix*vec4(position.xyz, 1.0);
+ gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
+ gl_TexCoord[1] = gl_TextureMatrix[1] * vec4(texcoord1,0,1);
+ gl_FrontColor = diffuse_color;
}
diff --git a/indra/newview/app_settings/shaders/class1/objects/fullbrightShinySkinnedV.glsl b/indra/newview/app_settings/shaders/class1/objects/fullbrightShinySkinnedV.glsl
index 5283e80407..5ed2b38f42 100644
--- a/indra/newview/app_settings/shaders/class1/objects/fullbrightShinySkinnedV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/fullbrightShinySkinnedV.glsl
@@ -6,6 +6,10 @@
*/
+attribute vec3 position;
+attribute vec3 normal;
+attribute vec4 diffuse_color;
+attribute vec2 texcoord0;
void calcAtmospherics(vec3 inPositionEye);
mat4 getObjectSkinnedTransform();
@@ -15,21 +19,21 @@ void main()
mat4 mat = getObjectSkinnedTransform();
mat = gl_ModelViewMatrix * mat;
- vec3 pos = (mat*gl_Vertex).xyz;
+ vec3 pos = (mat*vec4(position.xyz, 1.0)).xyz;
- vec4 norm = gl_Vertex;
- norm.xyz += gl_Normal.xyz;
+ vec4 norm = vec4(position.xyz, 1.0);
+ norm.xyz += normal.xyz;
norm.xyz = (mat*norm).xyz;
norm.xyz = normalize(norm.xyz-pos.xyz);
vec3 ref = reflect(pos.xyz, -norm.xyz);
- gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
+ gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
gl_TexCoord[1] = gl_TextureMatrix[1]*vec4(ref,1.0);
calcAtmospherics(pos.xyz);
- gl_FrontColor = gl_Color;
+ gl_FrontColor = diffuse_color;
gl_Position = gl_ProjectionMatrix*vec4(pos, 1.0);
diff --git a/indra/newview/app_settings/shaders/class1/objects/fullbrightShinyV.glsl b/indra/newview/app_settings/shaders/class1/objects/fullbrightShinyV.glsl
index 31e0f0a429..4063294c51 100644
--- a/indra/newview/app_settings/shaders/class1/objects/fullbrightShinyV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/fullbrightShinyV.glsl
@@ -6,6 +6,10 @@
*/
+attribute vec3 position;
+attribute vec4 diffuse_color;
+attribute vec3 normal;
+attribute vec2 texcoord0;
void calcAtmospherics(vec3 inPositionEye);
@@ -14,18 +18,18 @@ uniform vec4 origin;
void main()
{
//transform vertex
- gl_Position = ftransform();
+ gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
- vec4 pos = (gl_ModelViewMatrix * gl_Vertex);
- vec3 norm = normalize(gl_NormalMatrix * gl_Normal);
+ vec3 norm = normalize(gl_NormalMatrix * normal);
vec3 ref = reflect(pos.xyz, -norm);
- gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
+ gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
gl_TexCoord[1] = gl_TextureMatrix[1]*vec4(ref,1.0);
+ vec4 pos = (gl_ModelViewMatrix * vec4(position.xyz, 1.0));
calcAtmospherics(pos.xyz);
- gl_FrontColor = gl_Color;
+ gl_FrontColor = diffuse_color;
gl_FogFragCoord = pos.z;
}
diff --git a/indra/newview/app_settings/shaders/class1/objects/fullbrightSkinnedV.glsl b/indra/newview/app_settings/shaders/class1/objects/fullbrightSkinnedV.glsl
index 1db79791de..316c93c36a 100644
--- a/indra/newview/app_settings/shaders/class1/objects/fullbrightSkinnedV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/fullbrightSkinnedV.glsl
@@ -6,6 +6,9 @@
*/
+attribute vec3 position;
+attribute vec4 diffuse_color;
+attribute vec2 texcoord0;
void calcAtmospherics(vec3 inPositionEye);
mat4 getObjectSkinnedTransform();
@@ -13,21 +16,16 @@ mat4 getObjectSkinnedTransform();
void main()
{
//transform vertex
- gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
+ gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
mat4 mat = getObjectSkinnedTransform();
mat = gl_ModelViewMatrix * mat;
- vec3 pos = (mat*gl_Vertex).xyz;
+ vec3 pos = (mat*vec4(position.xyz, 1.0)).xyz;
- vec4 norm = gl_Vertex;
- norm.xyz += gl_Normal.xyz;
- norm.xyz = (mat*norm).xyz;
- norm.xyz = normalize(norm.xyz-pos.xyz);
-
calcAtmospherics(pos.xyz);
- gl_FrontColor = gl_Color;
+ gl_FrontColor = diffuse_color;
gl_Position = gl_ProjectionMatrix*vec4(pos, 1.0);
diff --git a/indra/newview/app_settings/shaders/class1/objects/fullbrightV.glsl b/indra/newview/app_settings/shaders/class1/objects/fullbrightV.glsl
index 3382384c99..d88612765c 100644
--- a/indra/newview/app_settings/shaders/class1/objects/fullbrightV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/fullbrightV.glsl
@@ -5,21 +5,24 @@
* $/LicenseInfo$
*/
-
+attribute vec3 position;
+attribute vec4 diffuse_color;
+attribute vec2 texcoord0;
void calcAtmospherics(vec3 inPositionEye);
void main()
{
//transform vertex
- gl_Position = ftransform();
- gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
+ vec4 pos = (gl_ModelViewMatrix * vec4(position.xyz, 1.0));
+ gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+ gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
- vec4 pos = (gl_ModelViewMatrix * gl_Vertex);
+
calcAtmospherics(pos.xyz);
- gl_FrontColor = gl_Color;
+ gl_FrontColor = diffuse_color;
gl_FogFragCoord = pos.z;
}
diff --git a/indra/newview/app_settings/shaders/class1/objects/shinySimpleSkinnedV.glsl b/indra/newview/app_settings/shaders/class1/objects/shinySimpleSkinnedV.glsl
index eea41bb4f0..41a9cd2fe6 100644
--- a/indra/newview/app_settings/shaders/class1/objects/shinySimpleSkinnedV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/shinySimpleSkinnedV.glsl
@@ -5,7 +5,10 @@
* $License$
*/
-
+attribute vec3 position;
+attribute vec3 normal;
+attribute vec4 diffuse_color;
+attribute vec2 texcoord0;
vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
void calcAtmospherics(vec3 inPositionEye);
@@ -16,21 +19,21 @@ void main()
mat4 mat = getObjectSkinnedTransform();
mat = gl_ModelViewMatrix * mat;
- vec3 pos = (mat*gl_Vertex).xyz;
+ vec3 pos = (mat*vec4(position.xyz, 1.0)).xyz;
- vec4 norm = gl_Vertex;
- norm.xyz += gl_Normal.xyz;
+ vec4 norm = vec4(position.xyz, 1.0);
+ norm.xyz += normal.xyz;
norm.xyz = (mat*norm).xyz;
norm.xyz = normalize(norm.xyz-pos.xyz);
vec3 ref = reflect(pos.xyz, -norm.xyz);
- gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
+ gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
gl_TexCoord[1] = gl_TextureMatrix[1]*vec4(ref,1.0);
calcAtmospherics(pos.xyz);
- vec4 color = calcLighting(pos.xyz, norm.xyz, gl_Color, vec4(0.));
+ vec4 color = calcLighting(pos.xyz, norm.xyz, diffuse_color, vec4(0.));
gl_FrontColor = color;
gl_Position = gl_ProjectionMatrix*vec4(pos, 1.0);
diff --git a/indra/newview/app_settings/shaders/class1/objects/shinyV.glsl b/indra/newview/app_settings/shaders/class1/objects/shinyV.glsl
index 68a086dbc1..4757295470 100644
--- a/indra/newview/app_settings/shaders/class1/objects/shinyV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/shinyV.glsl
@@ -5,7 +5,10 @@
* $/LicenseInfo$
*/
-
+attribute vec3 position;
+attribute vec3 normal;
+attribute vec4 diffuse_color;
+attribute vec2 texcoord0;
void calcAtmospherics(vec3 inPositionEye);
@@ -14,14 +17,14 @@ uniform vec4 origin;
void main()
{
//transform vertex
- gl_Position = ftransform();
+ vec4 pos = (gl_ModelViewMatrix * vec4(position.xyz, 1.0));
+ gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
- vec4 pos = (gl_ModelViewMatrix * gl_Vertex);
- vec3 norm = normalize(gl_NormalMatrix * gl_Normal);
+ vec3 norm = normalize(gl_NormalMatrix * normal);
calcAtmospherics(pos.xyz);
- gl_FrontColor = gl_Color;
+ gl_FrontColor = diffuse_color;
vec3 ref = reflect(pos.xyz, -norm);
diff --git a/indra/newview/app_settings/shaders/class1/objects/simpleSkinnedV.glsl b/indra/newview/app_settings/shaders/class1/objects/simpleSkinnedV.glsl
index af92e5e002..fbda2e70d2 100644
--- a/indra/newview/app_settings/shaders/class1/objects/simpleSkinnedV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/simpleSkinnedV.glsl
@@ -5,7 +5,10 @@
* $License$
*/
-
+attribute vec3 position;
+attribute vec3 normal;
+attribute vec4 diffuse_color;
+attribute vec2 texcoord0;
vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
void calcAtmospherics(vec3 inPositionEye);
@@ -14,21 +17,21 @@ mat4 getObjectSkinnedTransform();
void main()
{
//transform vertex
- gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
+ gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
mat4 mat = getObjectSkinnedTransform();
mat = gl_ModelViewMatrix * mat;
- vec3 pos = (mat*gl_Vertex).xyz;
+ vec3 pos = (mat*vec4(position.xyz, 1.0)).xyz;
- vec4 norm = gl_Vertex;
- norm.xyz += gl_Normal.xyz;
+ vec4 norm = vec4(position.xyz, 1.0);
+ norm.xyz += normal.xyz;
norm.xyz = (mat*norm).xyz;
norm.xyz = normalize(norm.xyz-pos.xyz);
calcAtmospherics(pos.xyz);
- vec4 color = calcLighting(pos.xyz, norm.xyz, gl_Color, vec4(0.));
+ vec4 color = calcLighting(pos.xyz, norm.xyz, diffuse_color, vec4(0.));
gl_FrontColor = color;
gl_Position = gl_ProjectionMatrix*vec4(pos, 1.0);
diff --git a/indra/newview/app_settings/shaders/class1/objects/simpleV.glsl b/indra/newview/app_settings/shaders/class1/objects/simpleV.glsl
index b493f76fcc..39fad42acb 100644
--- a/indra/newview/app_settings/shaders/class1/objects/simpleV.glsl
+++ b/indra/newview/app_settings/shaders/class1/objects/simpleV.glsl
@@ -5,7 +5,10 @@
* $/LicenseInfo$
*/
-
+attribute vec3 position;
+attribute vec3 normal;
+attribute vec4 diffuse_color;
+attribute vec2 texcoord0;
vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
void calcAtmospherics(vec3 inPositionEye);
@@ -13,16 +16,15 @@ void calcAtmospherics(vec3 inPositionEye);
void main()
{
//transform vertex
- gl_Position = ftransform();
- gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
-
- vec4 pos = (gl_ModelViewMatrix * gl_Vertex);
-
- vec3 norm = normalize(gl_NormalMatrix * gl_Normal);
+ vec4 pos = (gl_ModelViewMatrix * vec4(position.xyz, 1.0));
+ gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+ gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
+
+ vec3 norm = normalize(gl_NormalMatrix * normal);
calcAtmospherics(pos.xyz);
- vec4 color = calcLighting(pos.xyz, norm, gl_Color, vec4(0.));
+ vec4 color = calcLighting(pos.xyz, norm, diffuse_color, vec4(0.));
gl_FrontColor = color;
gl_FogFragCoord = pos.z;
diff --git a/indra/newview/app_settings/shaders/class2/avatar/eyeballV.glsl b/indra/newview/app_settings/shaders/class2/avatar/eyeballV.glsl
index 3e8b719f93..e6d5c00c4d 100644
--- a/indra/newview/app_settings/shaders/class2/avatar/eyeballV.glsl
+++ b/indra/newview/app_settings/shaders/class2/avatar/eyeballV.glsl
@@ -6,6 +6,10 @@
*/
+attribute vec3 position;
+attribute vec4 diffuse_color;
+attribute vec3 normal;
+attribute vec2 texcoord0;
vec4 calcLightingSpecular(vec3 pos, vec3 norm, vec4 color, inout vec4 specularColor, vec4 baseCol);
void calcAtmospherics(vec3 inPositionEye);
@@ -13,17 +17,17 @@ void calcAtmospherics(vec3 inPositionEye);
void main()
{
//transform vertex
- gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
- gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
-
- vec3 pos = (gl_ModelViewMatrix * gl_Vertex).xyz;
- vec3 norm = normalize(gl_NormalMatrix * gl_Normal);
+ vec3 pos = (gl_ModelViewMatrix * vec4(position.xyz, 1.0)).xyz;
+ gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+ gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
+
+ vec3 norm = normalize(gl_NormalMatrix * normal);
calcAtmospherics(pos.xyz);
// vec4 specular = specularColor;
vec4 specular = vec4(1.0);
- vec4 color = calcLightingSpecular(pos, norm, gl_Color, specular, vec4(0.0));
+ vec4 color = calcLightingSpecular(pos, norm, diffuse_color, specular, vec4(0.0));
gl_FrontColor = color;
gl_FogFragCoord = pos.z;
diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaSkinnedV.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaSkinnedV.glsl
index 948a52da5b..97fe7029e1 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/alphaSkinnedV.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/alphaSkinnedV.glsl
@@ -5,7 +5,10 @@
* $License$
*/
-
+attribute vec3 position;
+attribute vec3 normal;
+attribute vec4 diffuse_color;
+attribute vec2 texcoord0;
vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
void calcAtmospherics(vec3 inPositionEye);
@@ -59,18 +62,18 @@ float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, floa
void main()
{
- gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
+ gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
mat4 mat = getObjectSkinnedTransform();
mat = gl_ModelViewMatrix * mat;
- vec3 pos = (mat*gl_Vertex).xyz;
+ vec3 pos = (mat*position).xyz;
gl_Position = gl_ProjectionMatrix * vec4(pos, 1.0);
- vec4 n = gl_Vertex;
- n.xyz += gl_Normal.xyz;
+ vec4 n = position;
+ n.xyz += normal.xyz;
n.xyz = (mat*n).xyz;
n.xyz = normalize(n.xyz-pos.xyz);
@@ -81,8 +84,8 @@ void main()
calcAtmospherics(pos.xyz);
- //vec4 color = calcLighting(pos.xyz, norm, gl_Color, vec4(0.));
- vec4 col = vec4(0.0, 0.0, 0.0, gl_Color.a);
+ //vec4 color = calcLighting(pos.xyz, norm, diffuse_color, vec4(0.));
+ vec4 col = vec4(0.0, 0.0, 0.0, diffuse_color.a);
// Collect normal lights
col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].quadraticAttenuation, gl_LightSource[2].specular.a);
@@ -92,23 +95,23 @@ void main()
col.rgb += gl_LightSource[6].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[6].position, gl_LightSource[6].spotDirection.xyz, gl_LightSource[6].linearAttenuation, gl_LightSource[6].quadraticAttenuation, gl_LightSource[6].specular.a);
col.rgb += gl_LightSource[7].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[7].position, gl_LightSource[7].spotDirection.xyz, gl_LightSource[7].linearAttenuation, gl_LightSource[7].quadraticAttenuation, gl_LightSource[7].specular.a);
- vary_pointlight_col = col.rgb*gl_Color.rgb;
+ vary_pointlight_col = col.rgb*diffuse_color.rgb;
col.rgb = vec3(0,0,0);
// Add windlight lights
col.rgb = atmosAmbient(vec3(0.));
- vary_ambient = col.rgb*gl_Color.rgb;
- vary_directional.rgb = gl_Color.rgb*atmosAffectDirectionalLight(max(calcDirectionalLight(norm, gl_LightSource[0].position.xyz), (1.0-gl_Color.a)*(1.0-gl_Color.a)));
+ vary_ambient = col.rgb*diffuse_color.rgb;
+ vary_directional.rgb = diffuse_color.rgb*atmosAffectDirectionalLight(max(calcDirectionalLight(norm, gl_LightSource[0].position.xyz), (1.0-diffuse_color.a)*(1.0-diffuse_color.a)));
- col.rgb = min(col.rgb*gl_Color.rgb, 1.0);
+ col.rgb = min(col.rgb*diffuse_color.rgb, 1.0);
gl_FrontColor = col;
gl_FogFragCoord = pos.z;
- pos.xyz = (gl_ModelViewProjectionMatrix * gl_Vertex).xyz;
+ pos.xyz = (gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0)).xyz;
vary_fragcoord.xyz = pos.xyz + vec3(0,0,near_clip);
}
diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl
index f616ecc872..91dcca4607 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl
@@ -5,7 +5,10 @@
* $/LicenseInfo$
*/
-
+attribute vec4 position;
+attribute vec3 normal;
+attribute vec4 diffuse_color;
+attribute vec2 texcoord0;
vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
void calcAtmospherics(vec3 inPositionEye);
@@ -61,22 +64,22 @@ float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, floa
void main()
{
//transform vertex
- vec4 vert = vec4(gl_Vertex.xyz, 1.0);
- vary_texture_index = gl_Vertex.w;
- gl_Position = gl_ModelViewProjectionMatrix * vert;
-
- gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
-
+ vec4 vert = vec4(position.xyz, 1.0);
+ vary_texture_index = position.w;
vec4 pos = (gl_ModelViewMatrix * vert);
- vec3 norm = normalize(gl_NormalMatrix * gl_Normal);
+ gl_Position = gl_ModelViewProjectionMatrix*vec4(position.xyz, 1.0);
+
+ gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
+
+ vec3 norm = normalize(gl_NormalMatrix * 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;
calcAtmospherics(pos.xyz);
- //vec4 color = calcLighting(pos.xyz, norm, gl_Color, vec4(0.));
- vec4 col = vec4(0.0, 0.0, 0.0, gl_Color.a);
+ //vec4 color = calcLighting(pos.xyz, norm, diffuse_color, vec4(0.));
+ vec4 col = vec4(0.0, 0.0, 0.0, diffuse_color.a);
// Collect normal lights
col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].quadraticAttenuation, gl_LightSource[2].specular.a);
@@ -86,17 +89,17 @@ void main()
col.rgb += gl_LightSource[6].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[6].position, gl_LightSource[6].spotDirection.xyz, gl_LightSource[6].linearAttenuation, gl_LightSource[6].quadraticAttenuation, gl_LightSource[6].specular.a);
col.rgb += gl_LightSource[7].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[7].position, gl_LightSource[7].spotDirection.xyz, gl_LightSource[7].linearAttenuation, gl_LightSource[7].quadraticAttenuation, gl_LightSource[7].specular.a);
- vary_pointlight_col = col.rgb*gl_Color.rgb;
+ vary_pointlight_col = col.rgb*diffuse_color.rgb;
col.rgb = vec3(0,0,0);
// Add windlight lights
col.rgb = atmosAmbient(vec3(0.));
- vary_ambient = col.rgb*gl_Color.rgb;
- vary_directional.rgb = gl_Color.rgb*atmosAffectDirectionalLight(max(calcDirectionalLight(norm, gl_LightSource[0].position.xyz), (1.0-gl_Color.a)*(1.0-gl_Color.a)));
+ vary_ambient = col.rgb*diffuse_color.rgb;
+ vary_directional.rgb = diffuse_color.rgb*atmosAffectDirectionalLight(max(calcDirectionalLight(norm, gl_LightSource[0].position.xyz), (1.0-diffuse_color.a)*(1.0-diffuse_color.a)));
- col.rgb = col.rgb*gl_Color.rgb;
+ col.rgb = col.rgb*diffuse_color.rgb;
gl_FrontColor = col;
diff --git a/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl b/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl
index 01e40afc4f..65c3e5da10 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl
@@ -6,6 +6,10 @@
*/
+attribute vec3 position;
+attribute vec3 normal;
+attribute vec4 diffuse_color;
+attribute vec2 texcoord0;
vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
mat4 getSkinnedTransform();
@@ -61,20 +65,21 @@ float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, floa
void main()
{
- gl_TexCoord[0] = gl_MultiTexCoord0;
+ gl_TexCoord[0] = vec4(texcoord0,0,1);
vec4 pos;
vec3 norm;
mat4 trans = getSkinnedTransform();
- pos.x = dot(trans[0], gl_Vertex);
- pos.y = dot(trans[1], gl_Vertex);
- pos.z = dot(trans[2], gl_Vertex);
+ vec4 pos_in = vec4(position.xyz, 1.0);
+ pos.x = dot(trans[0], pos_in);
+ pos.y = dot(trans[1], pos_in);
+ pos.z = dot(trans[2], pos_in);
pos.w = 1.0;
- norm.x = dot(trans[0].xyz, gl_Normal);
- norm.y = dot(trans[1].xyz, gl_Normal);
- norm.z = dot(trans[2].xyz, gl_Normal);
+ norm.x = dot(trans[0].xyz, normal);
+ norm.y = dot(trans[1].xyz, normal);
+ norm.z = dot(trans[2].xyz, normal);
norm = normalize(norm);
gl_Position = gl_ProjectionMatrix * pos;
@@ -84,9 +89,9 @@ void main()
calcAtmospherics(pos.xyz);
- //vec4 color = calcLighting(pos.xyz, norm, gl_Color, vec4(0.));
+ //vec4 color = calcLighting(pos.xyz, norm, diffuse_color, vec4(0.));
- vec4 col = vec4(0.0, 0.0, 0.0, gl_Color.a);
+ vec4 col = vec4(0.0, 0.0, 0.0, diffuse_color.a);
// Collect normal lights
col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].quadraticAttenuation, gl_LightSource[2].specular.a);
@@ -96,17 +101,17 @@ void main()
col.rgb += gl_LightSource[6].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[6].position, gl_LightSource[6].spotDirection.xyz, gl_LightSource[6].linearAttenuation, gl_LightSource[6].quadraticAttenuation, gl_LightSource[6].specular.a);
col.rgb += gl_LightSource[7].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[7].position, gl_LightSource[7].spotDirection.xyz, gl_LightSource[7].linearAttenuation, gl_LightSource[7].quadraticAttenuation, gl_LightSource[7].specular.a);
- vary_pointlight_col = col.rgb*gl_Color.rgb;
+ vary_pointlight_col = col.rgb*diffuse_color.rgb;
col.rgb = vec3(0,0,0);
// Add windlight lights
col.rgb = atmosAmbient(vec3(0.));
- vary_ambient = col.rgb*gl_Color.rgb;
- vary_directional = gl_Color.rgb*atmosAffectDirectionalLight(max(calcDirectionalLight(norm, gl_LightSource[0].position.xyz), (1.0-gl_Color.a)*(1.0-gl_Color.a)));
+ vary_ambient = col.rgb*diffuse_color.rgb;
+ vary_directional = diffuse_color.rgb*atmosAffectDirectionalLight(max(calcDirectionalLight(norm, gl_LightSource[0].position.xyz), (1.0-diffuse_color.a)*(1.0-diffuse_color.a)));
- col.rgb = min(col.rgb*gl_Color.rgb, 1.0);
+ col.rgb = min(col.rgb*diffuse_color.rgb, 1.0);
gl_FrontColor = col;
diff --git a/indra/newview/app_settings/shaders/class2/deferred/edgeV.glsl b/indra/newview/app_settings/shaders/class2/deferred/edgeV.glsl
index 393084a3db..5e19a3b043 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/edgeV.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/edgeV.glsl
@@ -6,6 +6,7 @@
*/
+attribute vec3 position;
varying vec2 vary_fragcoord;
uniform vec2 screen_res;
@@ -13,7 +14,7 @@ uniform vec2 screen_res;
void main()
{
//transform vertex
- gl_Position = ftransform();
- vec4 pos = gl_ModelViewProjectionMatrix * gl_Vertex;
+ vec4 pos = gl_ModelViewProjectionMatrix * 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/class2/deferred/softenLightV.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightV.glsl
index 745cc01992..d2e3415d91 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/softenLightV.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightV.glsl
@@ -6,6 +6,8 @@
*/
+attribute vec3 position;
+attribute vec2 texcoord0;
uniform vec2 screen_res;
@@ -14,13 +16,11 @@ varying vec2 vary_fragcoord;
void main()
{
//transform vertex
- gl_Position = ftransform();
+ vec4 pos = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+ gl_Position = pos;
+
- vec4 pos = gl_ModelViewProjectionMatrix * gl_Vertex;
vary_fragcoord = (pos.xy*0.5+0.5)*screen_res;
- vec4 tex = gl_MultiTexCoord0;
- tex.w = 1.0;
-
- vary_light = gl_MultiTexCoord0;
+ vary_light = vec4(texcoord0,0,1);
}
diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightV.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightV.glsl
index 814deb3677..6795b55dc6 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/sunLightV.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightV.glsl
@@ -5,6 +5,10 @@
* $/LicenseInfo$
*/
+attribute vec3 position;
+attribute vec3 normal;
+attribute vec4 diffuse_color;
+attribute vec2 texcoord0;
varying vec4 vary_light;
@@ -15,13 +19,14 @@ uniform vec2 screen_res;
void main()
{
//transform vertex
- gl_Position = ftransform();
- vec4 pos = gl_ModelViewProjectionMatrix * gl_Vertex;
+ vec4 pos = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+ gl_Position = pos;
+
vary_fragcoord = (pos.xy * 0.5 + 0.5)*screen_res;
- vec4 tex = gl_MultiTexCoord0;
+ vec4 tex = vec4(texcoord0,0,1);
tex.w = 1.0;
- vary_light = gl_MultiTexCoord0;
+ vary_light = vec4(texcoord0,0,1);
- gl_FrontColor = gl_Color;
+ gl_FrontColor = diffuse_color;
}
diff --git a/indra/newview/app_settings/shaders/class2/effects/blurV.glsl b/indra/newview/app_settings/shaders/class2/effects/blurV.glsl
index de469542f9..68f79fba82 100644
--- a/indra/newview/app_settings/shaders/class2/effects/blurV.glsl
+++ b/indra/newview/app_settings/shaders/class2/effects/blurV.glsl
@@ -6,6 +6,8 @@
*/
+attribute vec3 position;
+attribute vec2 texcoord0;
uniform vec2 texelSize;
uniform vec2 blurDirection;
@@ -14,10 +16,10 @@ uniform float blurWidth;
void main(void)
{
// Transform vertex
- gl_Position = ftransform();
+ gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
vec2 blurDelta = texelSize * blurDirection * vec2(blurWidth, blurWidth);
- vec2 s = gl_MultiTexCoord0.st - (blurDelta * 3.0);
+ vec2 s = vec4(texcoord0,0,1).st - (blurDelta * 3.0);
// for (int i = 0; i < 7; i++) {
// gl_TexCoord[i].st = s + (i * blurDelta);
diff --git a/indra/newview/app_settings/shaders/class2/effects/drawQuadV.glsl b/indra/newview/app_settings/shaders/class2/effects/drawQuadV.glsl
index 9c52b8dd5d..7dd2ead200 100644
--- a/indra/newview/app_settings/shaders/class2/effects/drawQuadV.glsl
+++ b/indra/newview/app_settings/shaders/class2/effects/drawQuadV.glsl
@@ -6,11 +6,15 @@
*/
+attribute vec3 position;
+attribute vec2 texcoord0;
+attribute vec2 texcoord1;
+
void main(void)
{
//transform vertex
- gl_Position = ftransform();
- gl_TexCoord[0] = gl_MultiTexCoord0;
- gl_TexCoord[1] = gl_MultiTexCoord1;
+ gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+ gl_TexCoord[0] = vec4(texcoord0,0,1);
+ gl_TexCoord[1] = vec4(texcoord1,0,1);
}
diff --git a/indra/newview/app_settings/shaders/class2/environment/terrainV.glsl b/indra/newview/app_settings/shaders/class2/environment/terrainV.glsl
index 2658bee88d..b5367b5dae 100644
--- a/indra/newview/app_settings/shaders/class2/environment/terrainV.glsl
+++ b/indra/newview/app_settings/shaders/class2/environment/terrainV.glsl
@@ -6,6 +6,12 @@
*/
+attribute vec3 position;
+attribute vec3 normal;
+attribute vec4 diffuse_color;
+attribute vec2 texcoord0;
+attribute vec2 texcoord1;
+
void calcAtmospherics(vec3 inPositionEye);
@@ -28,24 +34,24 @@ vec4 texgen_object(vec4 vpos, vec4 tc, mat4 mat, vec4 tp0, vec4 tp1)
void main()
{
//transform vertex
- gl_Position = ftransform();
+ gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+
+ vec4 pos = gl_ModelViewMatrix * vec4(position.xyz, 1.0);
+ vec3 norm = normalize(gl_NormalMatrix * normal);
- vec4 pos = gl_ModelViewMatrix * gl_Vertex;
- vec3 norm = normalize(gl_NormalMatrix * gl_Normal);
+ calcAtmospherics(pos.xyz);
/// Potentially better without it for water.
pos /= pos.w;
- calcAtmospherics((gl_ModelViewMatrix * gl_Vertex).xyz);
-
- vec4 color = calcLighting(pos.xyz, norm, gl_Color, vec4(0));
+ vec4 color = calcLighting(pos.xyz, norm, diffuse_color, vec4(0));
gl_FrontColor = color;
// Transform and pass tex coords
- gl_TexCoord[0].xy = texgen_object(gl_Vertex, gl_MultiTexCoord0, gl_TextureMatrix[0], gl_ObjectPlaneS[0], gl_ObjectPlaneT[0]).xy;
+ gl_TexCoord[0].xy = texgen_object(vec4(position.xyz, 1.0), vec4(texcoord0,0,1), gl_TextureMatrix[0], gl_ObjectPlaneS[0], gl_ObjectPlaneT[0]).xy;
- vec4 t = gl_MultiTexCoord1;
+ vec4 t = vec4(texcoord1,0,1);
gl_TexCoord[0].zw = t.xy;
gl_TexCoord[1].xy = t.xy-vec2(2.0, 0.0);
diff --git a/indra/newview/app_settings/shaders/class2/lighting/sumLightsV.glsl b/indra/newview/app_settings/shaders/class2/lighting/sumLightsV.glsl
index 3d43a1813a..bc927cfdb6 100644
--- a/indra/newview/app_settings/shaders/class2/lighting/sumLightsV.glsl
+++ b/indra/newview/app_settings/shaders/class2/lighting/sumLightsV.glsl
@@ -5,8 +5,6 @@
* $/LicenseInfo$
*/
-
-
float calcDirectionalLight(vec3 n, vec3 l);
float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float is_pointlight);
diff --git a/indra/newview/app_settings/shaders/class2/objects/fullbrightShinyV.glsl b/indra/newview/app_settings/shaders/class2/objects/fullbrightShinyV.glsl
index f49e74406f..72a18c6858 100644
--- a/indra/newview/app_settings/shaders/class2/objects/fullbrightShinyV.glsl
+++ b/indra/newview/app_settings/shaders/class2/objects/fullbrightShinyV.glsl
@@ -13,23 +13,28 @@ uniform vec4 origin;
varying float vary_texture_index;
+attribute vec4 position;
+attribute vec3 normal;
+attribute vec4 diffuse_color;
+attribute vec2 texcoord0;
+
void main()
{
//transform vertex
- vec4 vert = vec4(gl_Vertex.xyz,1.0);
- vary_texture_index = gl_Vertex.w;
- gl_Position = gl_ModelViewProjectionMatrix*vert;
-
+ vec4 vert = vec4(position.xyz,1.0);
+ vary_texture_index = position.w;
vec4 pos = (gl_ModelViewMatrix * vert);
- vec3 norm = normalize(gl_NormalMatrix * gl_Normal);
+ gl_Position = gl_ModelViewProjectionMatrix*vec4(position.xyz, 1.0);
+
+ vec3 norm = normalize(gl_NormalMatrix * normal);
vec3 ref = reflect(pos.xyz, -norm);
- gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
+ gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
gl_TexCoord[1] = gl_TextureMatrix[1]*vec4(ref,1.0);
calcAtmospherics(pos.xyz);
- gl_FrontColor = gl_Color;
+ gl_FrontColor = diffuse_color;
gl_FogFragCoord = pos.z;
}
diff --git a/indra/newview/app_settings/shaders/class2/objects/fullbrightV.glsl b/indra/newview/app_settings/shaders/class2/objects/fullbrightV.glsl
index 3076fa3260..cf8ea23c36 100644
--- a/indra/newview/app_settings/shaders/class2/objects/fullbrightV.glsl
+++ b/indra/newview/app_settings/shaders/class2/objects/fullbrightV.glsl
@@ -5,6 +5,11 @@
* $/LicenseInfo$
*/
+
+attribute vec4 position;
+attribute vec2 texcoord0;
+attribute vec3 normal;
+attribute vec4 diffuse_color;
void calcAtmospherics(vec3 inPositionEye);
@@ -14,16 +19,15 @@ varying float vary_texture_index;
void main()
{
//transform vertex
- vec4 vert = vec4(gl_Vertex.xyz,1.0);
- vary_texture_index = gl_Vertex.w;
- gl_Position = gl_ModelViewProjectionMatrix*vert;
- gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
-
+ 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);
+ gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
+
calcAtmospherics(pos.xyz);
- gl_FrontColor = gl_Color;
+ gl_FrontColor = diffuse_color;
gl_FogFragCoord = pos.z;
}
diff --git a/indra/newview/app_settings/shaders/class2/objects/shinyV.glsl b/indra/newview/app_settings/shaders/class2/objects/shinyV.glsl
index 49992d3535..5d633f53d5 100644
--- a/indra/newview/app_settings/shaders/class2/objects/shinyV.glsl
+++ b/indra/newview/app_settings/shaders/class2/objects/shinyV.glsl
@@ -6,6 +6,10 @@
*/
+attribute vec4 position;
+attribute vec2 texcoord0;
+attribute vec3 normal;
+attribute vec4 diffuse_color;
vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
@@ -18,20 +22,20 @@ uniform vec4 origin;
void main()
{
//transform vertex
- vec4 vert = vec4(gl_Vertex.xyz,1.0);
- vary_texture_index = gl_Vertex.w;
- gl_Position = gl_ModelViewProjectionMatrix*vert;
-
+ vec4 vert = vec4(position.xyz,1.0);
+ vary_texture_index = position.w;
vec4 pos = (gl_ModelViewMatrix * vert);
- vec3 norm = normalize(gl_NormalMatrix * gl_Normal);
+ gl_Position = gl_ModelViewProjectionMatrix*vec4(position.xyz, 1.0);
+
+ vec3 norm = normalize(gl_NormalMatrix * normal);
vec3 ref = reflect(pos.xyz, -norm);
- gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
+ gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1);
gl_TexCoord[1] = gl_TextureMatrix[1]*vec4(ref,1.0);
calcAtmospherics(pos.xyz);
- gl_FrontColor = calcLighting(pos.xyz, norm, gl_Color, vec4(0.0));
+ gl_FrontColor = calcLighting(pos.xyz, norm, diffuse_color, vec4(0.0));
gl_FogFragCoord = pos.z;
}
diff --git a/indra/newview/app_settings/shaders/class2/objects/simpleV.glsl b/indra/newview/app_settings/shaders/class2/objects/simpleV.glsl
index 5e02391767..4f53cde40c 100644
--- a/indra/newview/app_settings/shaders/class2/objects/simpleV.glsl
+++ b/indra/newview/app_settings/shaders/class2/objects/simpleV.glsl
@@ -7,6 +7,11 @@
+attribute vec4 position;
+attribute vec2 texcoord0;
+attribute vec3 normal;
+attribute vec4 diffuse_color;
+
vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
void calcAtmospherics(vec3 inPositionEye);
@@ -15,18 +20,19 @@ varying float vary_texture_index;
void main()
{
//transform vertex
- vec4 vert = vec4(gl_Vertex.xyz,1.0);
- vary_texture_index = gl_Vertex.w;
- gl_Position = gl_ModelViewProjectionMatrix*vert;
- gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
-
+ 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);
+ gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0, 0, 1);
+
+
- vec3 norm = normalize(gl_NormalMatrix * gl_Normal);
+ vec3 norm = normalize(gl_NormalMatrix * normal);
calcAtmospherics(pos.xyz);
- vec4 color = calcLighting(pos.xyz, norm, gl_Color, vec4(0.));
+ vec4 color = calcLighting(pos.xyz, norm, diffuse_color, vec4(0.));
gl_FrontColor = color;
gl_FogFragCoord = pos.z;
diff --git a/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl b/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl
index 3eac63076c..9ba5e97a95 100644
--- a/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl
+++ b/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl
@@ -5,7 +5,8 @@
* $/LicenseInfo$
*/
-
+attribute vec3 position;
+attribute vec2 texcoord0;
//////////////////////////////////////////////////////////////////////////
// The vertex shader for creating the atmospheric sky
@@ -41,12 +42,12 @@ void main()
{
// World / view / projection
- gl_Position = ftransform();
+ gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
- gl_TexCoord[0] = gl_MultiTexCoord0;
+ gl_TexCoord[0] = vec4(texcoord0,0,1);
// Get relative position
- vec3 P = gl_Vertex.xyz - camPosLocal.xyz + vec3(0,50,0);
+ vec3 P = position.xyz - camPosLocal.xyz + vec3(0,50,0);
// Set altitude
if (P.y > 0.)
@@ -142,7 +143,7 @@ void main()
// Texture coords
- gl_TexCoord[0] = gl_MultiTexCoord0;
+ gl_TexCoord[0] = vec4(texcoord0,0,1);
gl_TexCoord[0].xy -= 0.5;
gl_TexCoord[0].xy /= cloud_scale.x;
gl_TexCoord[0].xy += 0.5;
diff --git a/indra/newview/app_settings/shaders/class2/windlight/skyV.glsl b/indra/newview/app_settings/shaders/class2/windlight/skyV.glsl
index 1ea00f723a..31c995a542 100644
--- a/indra/newview/app_settings/shaders/class2/windlight/skyV.glsl
+++ b/indra/newview/app_settings/shaders/class2/windlight/skyV.glsl
@@ -6,6 +6,8 @@
*/
+attribute vec3 position;
+attribute vec2 texcoord0;
// SKY ////////////////////////////////////////////////////////////////////////
// The vertex shader for creating the atmospheric sky
@@ -39,12 +41,12 @@ void main()
{
// World / view / projection
- gl_Position = ftransform();
- gl_TexCoord[0] = gl_MultiTexCoord0;
+ gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+ gl_TexCoord[0] = vec4(texcoord0,0,1);
// Get relative position
- vec3 P = gl_Vertex.xyz - camPosLocal.xyz + vec3(0,50,0);
- //vec3 P = gl_Vertex.xyz + vec3(0,50,0);
+ vec3 P = position.xyz - camPosLocal.xyz + vec3(0,50,0);
+ //vec3 P = position.xyz + vec3(0,50,0);
// Set altitude
if (P.y > 0.)
diff --git a/indra/newview/app_settings/shaders/class3/avatar/avatarV.glsl b/indra/newview/app_settings/shaders/class3/avatar/avatarV.glsl
index 3d970d252c..f65dfff42f 100644
--- a/indra/newview/app_settings/shaders/class3/avatar/avatarV.glsl
+++ b/indra/newview/app_settings/shaders/class3/avatar/avatarV.glsl
@@ -5,38 +5,39 @@
* $/LicenseInfo$
*/
-
+attribute vec3 position;
+attribute vec3 normal;
+attribute vec2 texcoord0;
+attribute vec4 clothing;
vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);
mat4 getSkinnedTransform();
void calcAtmospherics(vec3 inPositionEye);
-attribute vec4 clothing; //4
-
-attribute vec4 gWindDir; //7
-attribute vec4 gSinWaveParams; //3
-attribute vec4 gGravity; //5
+uniform vec4 gWindDir;
+uniform vec4 gSinWaveParams;
+uniform vec4 gGravity;
const vec4 gMinMaxConstants = vec4(1.0, 0.166666, 0.0083143, .00018542); // #minimax-generated coefficients
const vec4 gPiConstants = vec4(0.159154943, 6.28318530, 3.141592653, 1.5707963); // # {1/2PI, 2PI, PI, PI/2}
void main()
{
- gl_TexCoord[0] = gl_MultiTexCoord0;
+ gl_TexCoord[0] = vec4(texcoord0,0,1);
vec4 pos;
mat4 trans = getSkinnedTransform();
vec3 norm;
- norm.x = dot(trans[0].xyz, gl_Normal);
- norm.y = dot(trans[1].xyz, gl_Normal);
- norm.z = dot(trans[2].xyz, gl_Normal);
+ norm.x = dot(trans[0].xyz, normal);
+ norm.y = dot(trans[1].xyz, normal);
+ norm.z = dot(trans[2].xyz, normal);
norm = normalize(norm);
//wind
vec4 windEffect;
windEffect = vec4(dot(norm, gWindDir.xyz));
- pos.x = dot(trans[2].xyz, gl_Vertex.xyz);
+ pos.x = dot(trans[2].xyz, position.xyz);
windEffect.xyz = pos.x * vec3(0.015, 0.015, 0.015)
+ windEffect.xyz;
windEffect.w = windEffect.w * 2.0 + 1.0; // move wind offset value to [-1, 3]
@@ -83,7 +84,7 @@ void main()
sinWave.xyz = max(sinWave.xyz, vec3(-1.0, -1.0, -1.0)); // clamp to underlying body shape
offsetPos = clothing * sinWave.x; // multiply wind effect times clothing displacement
temp2 = gWindDir*sinWave.z + vec4(norm,0); // calculate normal offset due to wind oscillation
- offsetPos = vec4(1.0,1.0,1.0,0.0)*offsetPos+gl_Vertex; // add to offset vertex position, and zero out effect from w
+ offsetPos = vec4(1.0,1.0,1.0,0.0)*offsetPos+vec4(position.xyz, 1.0); // add to offset vertex position, and zero out effect from w
norm += temp2.xyz*2.0; // add sin wave effect on normals (exaggerated)
//add "backlighting" effect
@@ -101,7 +102,7 @@ void main()
calcAtmospherics(pos.xyz);
- vec4 color = calcLighting(pos.xyz, norm, gl_Color, vec4(0.0));
+ vec4 color = calcLighting(pos.xyz, norm, vec4(1,1,1,1), vec4(0.0));
gl_FrontColor = color;
gl_Position = gl_ProjectionMatrix * pos;
diff --git a/indra/newview/app_settings/shaders/class3/deferred/giDownsampleV.glsl b/indra/newview/app_settings/shaders/class3/deferred/giDownsampleV.glsl
index eebe930666..b769e1ee1d 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/giDownsampleV.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/giDownsampleV.glsl
@@ -5,7 +5,7 @@
* $/LicenseInfo$
*/
-
+attribute vec3 position;
varying vec2 vary_fragcoord;
uniform vec2 screen_res;
@@ -13,7 +13,7 @@ uniform vec2 screen_res;
void main()
{
//transform vertex
- gl_Position = ftransform();
- vec4 pos = gl_ModelViewProjectionMatrix * gl_Vertex;
+ vec4 pos = gl_ModelViewProjectionMatrix * 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/class3/deferred/giFinalV.glsl b/indra/newview/app_settings/shaders/class3/deferred/giFinalV.glsl
index 7e20d71529..057d36ed22 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/giFinalV.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/giFinalV.glsl
@@ -5,6 +5,7 @@
* $/LicenseInfo$
*/
+attribute vec3 position;
varying vec2 vary_fragcoord;
@@ -13,7 +14,7 @@ uniform vec2 screen_res;
void main()
{
//transform vertex
- gl_Position = ftransform();
- vec4 pos = gl_ModelViewProjectionMatrix * gl_Vertex;
+ vec4 pos = gl_ModelViewProjectionMatrix * 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/class3/deferred/giV.glsl b/indra/newview/app_settings/shaders/class3/deferred/giV.glsl
index e86f2896da..d97d7ea82d 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/giV.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/giV.glsl
@@ -5,6 +5,9 @@
* $/LicenseInfo$
*/
+attribute vec3 position;
+attribute vec4 diffuse_color;
+attribute vec2 texcoord0;
varying vec2 vary_fragcoord;
@@ -14,11 +17,12 @@ uniform vec2 screen_res;
void main()
{
//transform vertex
- gl_Position = ftransform();
- vec4 pos = gl_ModelViewProjectionMatrix * gl_Vertex;
+ vec4 pos = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+ gl_Position = pos;
+
vary_fragcoord = (pos.xy * 0.5 + 0.5)*screen_res;
- vec4 tex = gl_MultiTexCoord0;
+ vec4 tex = vec4(texcoord0,0,1);
tex.w = 1.0;
- gl_FrontColor = gl_Color;
+ gl_FrontColor = diffuse_color;
}
diff --git a/indra/newview/app_settings/shaders/class3/deferred/luminanceV.glsl b/indra/newview/app_settings/shaders/class3/deferred/luminanceV.glsl
index 9afeac6ddf..5bdb69fb6f 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/luminanceV.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/luminanceV.glsl
@@ -5,18 +5,20 @@
* $/LicenseInfo$
*/
-
-
varying vec2 vary_fragcoord;
uniform vec2 screen_res;
+attribute vec3 position;
+attribute vec4 diffuse_color;
+
void main()
{
//transform vertex
- gl_Position = ftransform();
- vec4 pos = gl_ModelViewProjectionMatrix * gl_Vertex;
+ vec4 pos = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+ gl_Position = pos;
+
vary_fragcoord = (pos.xy * 0.5 + 0.5)*screen_res;
- gl_FrontColor = gl_Color;
+ gl_FrontColor = diffuse_color;
}
diff --git a/indra/newview/app_settings/shaders/class3/deferred/postDeferredV.glsl b/indra/newview/app_settings/shaders/class3/deferred/postDeferredV.glsl
index 876f65ee3a..2581098609 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/postDeferredV.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/postDeferredV.glsl
@@ -5,7 +5,7 @@
* $/LicenseInfo$
*/
-
+attribute vec3 position;
varying vec2 vary_fragcoord;
uniform vec2 screen_res;
@@ -13,7 +13,7 @@ uniform vec2 screen_res;
void main()
{
//transform vertex
- gl_Position = ftransform();
- vec4 pos = gl_ModelViewProjectionMatrix * gl_Vertex;
+ vec4 pos = gl_ModelViewProjectionMatrix * 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/class3/deferred/postgiV.glsl b/indra/newview/app_settings/shaders/class3/deferred/postgiV.glsl
index eebe930666..ed6fd1ee80 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/postgiV.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/postgiV.glsl
@@ -5,7 +5,7 @@
* $/LicenseInfo$
*/
-
+attribute vec3 position;
varying vec2 vary_fragcoord;
uniform vec2 screen_res;
@@ -13,7 +13,7 @@ uniform vec2 screen_res;
void main()
{
//transform vertex
- gl_Position = ftransform();
- vec4 pos = gl_ModelViewProjectionMatrix * gl_Vertex;
+ vec4 pos = gl_ModelViewProjectionMatrix * 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/class3/deferred/softenLightV.glsl b/indra/newview/app_settings/shaders/class3/deferred/softenLightV.glsl
index 745cc01992..9872c9f366 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/softenLightV.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/softenLightV.glsl
@@ -6,6 +6,8 @@
*/
+attribute vec3 position;
+attribute vec2 texcoord0;
uniform vec2 screen_res;
@@ -14,13 +16,10 @@ varying vec2 vary_fragcoord;
void main()
{
//transform vertex
- gl_Position = ftransform();
+ vec4 pos = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0);
+ gl_Position = pos;
- vec4 pos = gl_ModelViewProjectionMatrix * gl_Vertex;
vary_fragcoord = (pos.xy*0.5+0.5)*screen_res;
- vec4 tex = gl_MultiTexCoord0;
- tex.w = 1.0;
-
- vary_light = gl_MultiTexCoord0;
+ vary_light = vec4(texcoord0,0,1);
}
diff --git a/indra/newview/app_settings/shaders/class3/lighting/sumLightsV.glsl b/indra/newview/app_settings/shaders/class3/lighting/sumLightsV.glsl
index 24bbc0a1a1..9144b8361f 100644
--- a/indra/newview/app_settings/shaders/class3/lighting/sumLightsV.glsl
+++ b/indra/newview/app_settings/shaders/class3/lighting/sumLightsV.glsl
@@ -6,7 +6,6 @@
*/
-
float calcDirectionalLight(vec3 n, vec3 l);
float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float is_pointlight);