summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class3
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2011-08-19 16:34:34 -0500
committerDave Parks <davep@lindenlab.com>2011-08-19 16:34:34 -0500
commit233e42b3314c17b2e24334587d960af6e3dc963c (patch)
tree480e571bf913bb0743c3c6c6ce846a69aa405504 /indra/newview/app_settings/shaders/class3
parent0e496309d6cb7581c9f69b7da244699c382750ac (diff)
parent80398b3ccb0c4a6ff3ac20b3565619fe5cecc2f9 (diff)
merge
Diffstat (limited to 'indra/newview/app_settings/shaders/class3')
-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
9 files changed, 46 insertions, 40 deletions
diff --git a/indra/newview/app_settings/shaders/class3/avatar/avatarV.glsl b/indra/newview/app_settings/shaders/class3/avatar/avatarV.glsl
index 151602dbc0..f1d06b4fec 100644
--- a/indra/newview/app_settings/shaders/class3/avatar/avatarV.glsl
+++ b/indra/newview/app_settings/shaders/class3/avatar/avatarV.glsl
@@ -23,38 +23,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]
@@ -101,7 +102,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
@@ -119,7 +120,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 6231ee68b7..870d4c36bc 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/giDownsampleV.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/giDownsampleV.glsl
@@ -23,7 +23,7 @@
* $/LicenseInfo$
*/
-
+attribute vec3 position;
varying vec2 vary_fragcoord;
uniform vec2 screen_res;
@@ -31,7 +31,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 a6a206502c..76206f88d9 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/giFinalV.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/giFinalV.glsl
@@ -23,6 +23,7 @@
* $/LicenseInfo$
*/
+attribute vec3 position;
varying vec2 vary_fragcoord;
@@ -31,7 +32,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 190e32b6a3..1a23be349e 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/giV.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/giV.glsl
@@ -23,6 +23,9 @@
* $/LicenseInfo$
*/
+attribute vec3 position;
+attribute vec4 diffuse_color;
+attribute vec2 texcoord0;
varying vec2 vary_fragcoord;
@@ -32,11 +35,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 2d99ef5481..a2606f2fb2 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/luminanceV.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/luminanceV.glsl
@@ -23,18 +23,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 cb83dda795..2d0b60d513 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/postDeferredV.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/postDeferredV.glsl
@@ -23,7 +23,7 @@
* $/LicenseInfo$
*/
-
+attribute vec3 position;
varying vec2 vary_fragcoord;
uniform vec2 screen_res;
@@ -31,7 +31,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 6231ee68b7..25bdfdce45 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/postgiV.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/postgiV.glsl
@@ -23,7 +23,7 @@
* $/LicenseInfo$
*/
-
+attribute vec3 position;
varying vec2 vary_fragcoord;
uniform vec2 screen_res;
@@ -31,7 +31,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 fed238510a..9e07a4d219 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/softenLightV.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/softenLightV.glsl
@@ -24,6 +24,8 @@
*/
+attribute vec3 position;
+attribute vec2 texcoord0;
uniform vec2 screen_res;
@@ -32,13 +34,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 dcdc72ac02..c31afb6268 100644
--- a/indra/newview/app_settings/shaders/class3/lighting/sumLightsV.glsl
+++ b/indra/newview/app_settings/shaders/class3/lighting/sumLightsV.glsl
@@ -24,7 +24,6 @@
*/
-
float calcDirectionalLight(vec3 n, vec3 l);
float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float is_pointlight);