diff options
Diffstat (limited to 'indra/newview/app_settings/shaders/class2/windlight')
7 files changed, 49 insertions, 40 deletions
diff --git a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsV.glsl b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsV.glsl index be990c1757..6a83be1426 100644 --- a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsV.glsl +++ b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsV.glsl @@ -25,7 +25,7 @@ -// varying param funcs +// VARYING param funcs void setSunlitColor(vec3 v); void setAmblitColor(vec3 v); void setAdditiveColor(vec3 v); @@ -34,8 +34,8 @@ void setPositionEye(vec3 v); vec3 getAdditiveColor(); -//varying vec4 vary_CloudUVs; -//varying float vary_CloudDensity; +//VARYING vec4 vary_CloudUVs; +//VARYING float vary_CloudDensity; // Inputs uniform vec4 morphFactor; diff --git a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsF.glsl b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsF.glsl index a98c04b259..08814b49d8 100644 --- a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsF.glsl +++ b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsF.glsl @@ -25,12 +25,12 @@ -varying vec3 vary_PositionEye; +VARYING vec3 vary_PositionEye; -varying vec3 vary_SunlitColor; -varying vec3 vary_AmblitColor; -varying vec3 vary_AdditiveColor; -varying vec3 vary_AtmosAttenuation; +VARYING vec3 vary_SunlitColor; +VARYING vec3 vary_AmblitColor; +VARYING vec3 vary_AdditiveColor; +VARYING vec3 vary_AtmosAttenuation; vec3 getPositionEye() { diff --git a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsV.glsl b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsV.glsl index 7c3cb88b3c..514f009add 100644 --- a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsV.glsl +++ b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsV.glsl @@ -25,12 +25,12 @@ -varying vec3 vary_PositionEye; +VARYING vec3 vary_PositionEye; -varying vec3 vary_SunlitColor; -varying vec3 vary_AmblitColor; -varying vec3 vary_AdditiveColor; -varying vec3 vary_AtmosAttenuation; +VARYING vec3 vary_SunlitColor; +VARYING vec3 vary_AmblitColor; +VARYING vec3 vary_AdditiveColor; +VARYING vec3 vary_AtmosAttenuation; vec3 getPositionEye() { diff --git a/indra/newview/app_settings/shaders/class2/windlight/cloudsF.glsl b/indra/newview/app_settings/shaders/class2/windlight/cloudsF.glsl index b90cec119b..ea60d1df6c 100644 --- a/indra/newview/app_settings/shaders/class2/windlight/cloudsF.glsl +++ b/indra/newview/app_settings/shaders/class2/windlight/cloudsF.glsl @@ -29,9 +29,13 @@ // The fragment shader for the sky ///////////////////////////////////////////////////////////////////////// -varying vec4 vary_CloudColorSun; -varying vec4 vary_CloudColorAmbient; -varying float vary_CloudDensity; +VARYING vec4 vary_CloudColorSun; +VARYING vec4 vary_CloudColorAmbient; +VARYING float vary_CloudDensity; +VARYING vec2 vary_texcoord0; +VARYING vec2 vary_texcoord1; +VARYING vec2 vary_texcoord2; +VARYING vec2 vary_texcoord3; uniform sampler2D cloud_noise_texture; uniform vec4 cloud_pos_density1; @@ -50,14 +54,14 @@ vec3 scaleSoftClip(vec3 light) { void main() { // Set variables - vec2 uv1 = gl_TexCoord[0].xy; - vec2 uv2 = gl_TexCoord[1].xy; + vec2 uv1 = vary_texcoord0.xy; + vec2 uv2 = vary_texcoord1.xy; vec4 cloudColorSun = vary_CloudColorSun; vec4 cloudColorAmbient = vary_CloudColorAmbient; float cloudDensity = vary_CloudDensity; - vec2 uv3 = gl_TexCoord[2].xy; - vec2 uv4 = gl_TexCoord[3].xy; + vec2 uv3 = vary_texcoord2.xy; + vec2 uv4 = vary_texcoord3.xy; // Offset texture coords uv1 += cloud_pos_density1.xy; //large texture, visible density diff --git a/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl b/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl index 67b5e7fb83..c5bb52169c 100644 --- a/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl +++ b/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl @@ -25,17 +25,21 @@ uniform mat4 modelview_projection_matrix; -attribute vec3 position; -attribute vec2 texcoord0; +ATTRIBUTE vec3 position; +ATTRIBUTE vec2 texcoord0; ////////////////////////////////////////////////////////////////////////// // The vertex shader for creating the atmospheric sky /////////////////////////////////////////////////////////////////////////////// // Output parameters -varying vec4 vary_CloudColorSun; -varying vec4 vary_CloudColorAmbient; -varying float vary_CloudDensity; +VARYING vec4 vary_CloudColorSun; +VARYING vec4 vary_CloudColorAmbient; +VARYING float vary_CloudDensity; +VARYING vec2 vary_texcoord0; +VARYING vec2 vary_texcoord1; +VARYING vec2 vary_texcoord2; +VARYING vec2 vary_texcoord3; // Inputs uniform vec3 camPosLocal; @@ -64,7 +68,7 @@ void main() // World / view / projection gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); - gl_TexCoord[0] = vec4(texcoord0,0,1); + vary_texcoord0 = texcoord0; // Get relative position vec3 P = position.xyz - camPosLocal.xyz + vec3(0,50,0); @@ -163,17 +167,17 @@ void main() // Texture coords - 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; + vary_texcoord0 = texcoord0; + vary_texcoord0.xy -= 0.5; + vary_texcoord0.xy /= cloud_scale.x; + vary_texcoord0.xy += 0.5; - gl_TexCoord[1] = gl_TexCoord[0]; - gl_TexCoord[1].x += lightnorm.x * 0.0125; - gl_TexCoord[1].y += lightnorm.z * 0.0125; + vary_texcoord1 = vary_texcoord0; + vary_texcoord1.x += lightnorm.x * 0.0125; + vary_texcoord1.y += lightnorm.z * 0.0125; - gl_TexCoord[2] = gl_TexCoord[0] * 16.; - gl_TexCoord[3] = gl_TexCoord[1] * 16.; + vary_texcoord2 = vary_texcoord0 * 16.; + vary_texcoord3 = vary_texcoord1 * 16.; // Combine these to minimize register use vary_CloudColorAmbient += oHazeColorBelowCloud; diff --git a/indra/newview/app_settings/shaders/class2/windlight/skyF.glsl b/indra/newview/app_settings/shaders/class2/windlight/skyF.glsl index ac569e8257..5c9ee5fd63 100644 --- a/indra/newview/app_settings/shaders/class2/windlight/skyF.glsl +++ b/indra/newview/app_settings/shaders/class2/windlight/skyF.glsl @@ -29,7 +29,7 @@ // The fragment shader for the sky ///////////////////////////////////////////////////////////////////////// -varying vec4 vary_HazeColor; +VARYING vec4 vary_HazeColor; uniform sampler2D cloud_noise_texture; uniform vec4 gamma; diff --git a/indra/newview/app_settings/shaders/class2/windlight/skyV.glsl b/indra/newview/app_settings/shaders/class2/windlight/skyV.glsl index 50fdba64c2..b768cc9cf3 100644 --- a/indra/newview/app_settings/shaders/class2/windlight/skyV.glsl +++ b/indra/newview/app_settings/shaders/class2/windlight/skyV.glsl @@ -25,15 +25,16 @@ uniform mat4 modelview_projection_matrix; -attribute vec3 position; -attribute vec2 texcoord0; +ATTRIBUTE vec3 position; +ATTRIBUTE vec2 texcoord0; // SKY //////////////////////////////////////////////////////////////////////// // The vertex shader for creating the atmospheric sky /////////////////////////////////////////////////////////////////////////////// // Output parameters -varying vec4 vary_HazeColor; +VARYING vec4 vary_HazeColor; +VARYING vec2 vary_texcoord0; // Inputs uniform vec3 camPosLocal; @@ -61,7 +62,7 @@ void main() // World / view / projection gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); - gl_TexCoord[0] = vec4(texcoord0,0,1); + vary_texcoord0 = texcoord0; // Get relative position vec3 P = position.xyz - camPosLocal.xyz + vec3(0,50,0); |