From 14f6bbadef2c39e58a3b54c0c6212949acf50e45 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Mon, 8 Aug 2011 15:29:23 -0500 Subject: SH-2242 Work in progress migrating to glVertexAttrib everywhere --- .../shaders/class2/avatar/eyeballV.glsl | 16 ++++++----- .../shaders/class2/deferred/alphaSkinnedV.glsl | 27 ++++++++++--------- .../shaders/class2/deferred/alphaV.glsl | 31 ++++++++++++---------- .../shaders/class2/deferred/avatarAlphaV.glsl | 31 +++++++++++++--------- .../shaders/class2/deferred/edgeV.glsl | 5 ++-- .../shaders/class2/deferred/softenLightV.glsl | 12 ++++----- .../shaders/class2/deferred/sunLightV.glsl | 15 +++++++---- .../app_settings/shaders/class2/effects/blurV.glsl | 6 +++-- .../shaders/class2/effects/drawQuadV.glsl | 10 ++++--- .../shaders/class2/environment/terrainV.glsl | 22 +++++++++------ .../shaders/class2/lighting/sumLightsV.glsl | 2 -- .../shaders/class2/objects/fullbrightShinyV.glsl | 19 ++++++++----- .../shaders/class2/objects/fullbrightV.glsl | 18 ++++++++----- .../shaders/class2/objects/shinyV.glsl | 18 ++++++++----- .../shaders/class2/objects/simpleV.glsl | 20 +++++++++----- .../shaders/class2/windlight/cloudsV.glsl | 11 ++++---- .../shaders/class2/windlight/skyV.glsl | 10 ++++--- 17 files changed, 163 insertions(+), 110 deletions(-) (limited to 'indra/newview/app_settings/shaders/class2') 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.) -- cgit v1.2.3 From 2ee815478043c4d5845f094f744a055707dba0e0 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Wed, 10 Aug 2011 13:01:14 -0500 Subject: SH-2238, SH-2223, SH-SH-2242 glVertexAttrib throughout main render pipeline complete, preview renders and debug displays still pending. Also fixed a render glitch and a crash (JIRAs listed). --- .../class2/deferred/alphaNonIndexedNoColorF.glsl | 121 +++++++++++++++++++++ .../shaders/class2/deferred/alphaSkinnedV.glsl | 4 +- .../shaders/class2/deferred/avatarAlphaV.glsl | 13 +-- .../shaders/class2/deferred/multiSpotLightF.glsl | 17 +-- .../shaders/class2/deferred/softenLightF.glsl | 7 +- .../shaders/class2/deferred/softenLightV.glsl | 5 +- .../shaders/class2/deferred/sunLightSSAOF.glsl | 6 +- .../shaders/class2/deferred/sunLightV.glsl | 9 -- .../shaders/class2/objects/simpleNonIndexedV.glsl | 36 ++++++ 9 files changed, 182 insertions(+), 36 deletions(-) create mode 100644 indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedNoColorF.glsl create mode 100644 indra/newview/app_settings/shaders/class2/objects/simpleNonIndexedV.glsl (limited to 'indra/newview/app_settings/shaders/class2') diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedNoColorF.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedNoColorF.glsl new file mode 100644 index 0000000000..294a000ab5 --- /dev/null +++ b/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedNoColorF.glsl @@ -0,0 +1,121 @@ +/** + * @file alphaNonIndexedNoColorF.glsl + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * $/LicenseInfo$ + */ + + + +#extension GL_ARB_texture_rectangle : enable + +uniform sampler2DRectShadow shadowMap0; +uniform sampler2DRectShadow shadowMap1; +uniform sampler2DRectShadow shadowMap2; +uniform sampler2DRectShadow shadowMap3; +uniform sampler2DRect depthMap; +uniform sampler2D diffuseMap; + +uniform mat4 shadow_matrix[6]; +uniform vec4 shadow_clip; +uniform vec2 screen_res; +uniform vec2 shadow_res; + +vec3 atmosLighting(vec3 light); +vec3 scaleSoftClip(vec3 light); + +varying vec3 vary_ambient; +varying vec3 vary_directional; +varying vec3 vary_fragcoord; +varying vec3 vary_position; +varying vec3 vary_pointlight_col; + +uniform float shadow_bias; + +uniform mat4 inv_proj; + +vec4 getPosition(vec2 pos_screen) +{ + float depth = texture2DRect(depthMap, pos_screen.xy).a; + vec2 sc = pos_screen.xy*2.0; + sc /= screen_res; + sc -= vec2(1.0,1.0); + vec4 ndc = vec4(sc.x, sc.y, 2.0*depth-1.0, 1.0); + vec4 pos = inv_proj * ndc; + pos.xyz /= pos.w; + pos.w = 1.0; + return pos; +} + +float pcfShadow(sampler2DRectShadow shadowMap, vec4 stc, float scl) +{ + stc.xyz /= stc.w; + stc.z += shadow_bias; + + float cs = shadow2DRect(shadowMap, stc.xyz).x; + float shadow = cs; + + shadow += max(shadow2DRect(shadowMap, stc.xyz+vec3(scl, scl, 0.0)).x, cs); + shadow += max(shadow2DRect(shadowMap, stc.xyz+vec3(scl, -scl, 0.0)).x, cs); + shadow += max(shadow2DRect(shadowMap, stc.xyz+vec3(-scl, scl, 0.0)).x, cs); + shadow += max(shadow2DRect(shadowMap, stc.xyz+vec3(-scl, -scl, 0.0)).x, cs); + + return shadow/5.0; +} + + +void main() +{ + vec2 frag = vary_fragcoord.xy/vary_fragcoord.z*0.5+0.5; + frag *= screen_res; + + float shadow = 1.0; + vec4 pos = vec4(vary_position, 1.0); + + vec4 spos = pos; + + if (spos.z > -shadow_clip.w) + { + vec4 lpos; + + if (spos.z < -shadow_clip.z) + { + lpos = shadow_matrix[3]*spos; + lpos.xy *= shadow_res; + shadow = pcfShadow(shadowMap3, lpos, 1.5); + shadow += max((pos.z+shadow_clip.z)/(shadow_clip.z-shadow_clip.w)*2.0-1.0, 0.0); + } + else if (spos.z < -shadow_clip.y) + { + lpos = shadow_matrix[2]*spos; + lpos.xy *= shadow_res; + shadow = pcfShadow(shadowMap2, lpos, 1.5); + } + else if (spos.z < -shadow_clip.x) + { + lpos = shadow_matrix[1]*spos; + lpos.xy *= shadow_res; + shadow = pcfShadow(shadowMap1, lpos, 1.5); + } + else + { + lpos = shadow_matrix[0]*spos; + lpos.xy *= shadow_res; + shadow = pcfShadow(shadowMap0, lpos, 1.5); + } + } + + vec4 diff = texture2D(diffuseMap,gl_TexCoord[0].xy); + + vec4 col = vec4(vary_ambient + vary_directional.rgb*shadow, 1.0); + vec4 color = diff * col; + + color.rgb = atmosLighting(color.rgb); + + color.rgb = scaleSoftClip(color.rgb); + + color.rgb += diff.rgb * vary_pointlight_col.rgb; + + gl_FragColor = color; +} + diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaSkinnedV.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaSkinnedV.glsl index 97fe7029e1..a446239a22 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/alphaSkinnedV.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/alphaSkinnedV.glsl @@ -68,11 +68,11 @@ void main() mat = gl_ModelViewMatrix * mat; - vec3 pos = (mat*position).xyz; + vec3 pos = (mat*vec4(position, 1.0)).xyz; gl_Position = gl_ProjectionMatrix * vec4(pos, 1.0); - vec4 n = position; + vec4 n = vec4(position, 1.0); n.xyz += normal.xyz; n.xyz = (mat*n).xyz; n.xyz = normalize(n.xyz-pos.xyz); diff --git a/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl b/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl index 65c3e5da10..8102578bb2 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl @@ -8,7 +8,6 @@ attribute vec3 position; attribute vec3 normal; -attribute vec4 diffuse_color; attribute vec2 texcoord0; vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol); @@ -89,9 +88,7 @@ void main() calcAtmospherics(pos.xyz); - //vec4 color = calcLighting(pos.xyz, norm, diffuse_color, vec4(0.)); - - vec4 col = vec4(0.0, 0.0, 0.0, diffuse_color.a); + vec4 col = vec4(0.0, 0.0, 0.0, 1.0); // 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); @@ -101,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*diffuse_color.rgb; + vary_pointlight_col = col.rgb; col.rgb = vec3(0,0,0); // Add windlight lights col.rgb = atmosAmbient(vec3(0.)); - 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))); + vary_ambient = col.rgb; + vary_directional = atmosAffectDirectionalLight(max(calcDirectionalLight(norm, gl_LightSource[0].position.xyz), 0.0)); - col.rgb = min(col.rgb*diffuse_color.rgb, 1.0); + col.rgb = min(col.rgb, 1.0); gl_FrontColor = col; diff --git a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl index f54186ffca..a16be0c8b4 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl @@ -36,7 +36,10 @@ uniform float sun_wash; uniform int proj_shadow_idx; uniform float shadow_fade; -varying vec4 vary_light; +uniform vec3 center; +uniform float size; +uniform vec3 color; +uniform float falloff; varying vec4 vary_fragcoord; uniform vec2 screen_res; @@ -110,9 +113,9 @@ void main() frag.xy *= screen_res; vec3 pos = getPosition(frag.xy).xyz; - vec3 lv = vary_light.xyz-pos.xyz; + vec3 lv = center.xyz-pos.xyz; float dist2 = dot(lv,lv); - dist2 /= vary_light.w; + dist2 /= size; if (dist2 > 1.0) { discard; @@ -143,7 +146,7 @@ void main() proj_tc.xyz /= proj_tc.w; - float fa = gl_Color.a+1.0; + float fa = falloff+1.0; float dist_atten = min(1.0-(dist2-1.0*(1.0-fa))/fa, 1.0); if (dist_atten <= 0.0) { @@ -175,7 +178,7 @@ void main() vec4 plcol = texture2DLodDiffuse(projectionMap, proj_tc.xy, lod); - vec3 lcol = gl_Color.rgb * plcol.rgb * plcol.a; + vec3 lcol = color.rgb * plcol.rgb * plcol.a; lit = da * dist_atten * noise; @@ -192,7 +195,7 @@ void main() amb_da = min(amb_da, 1.0-lit); - col += amb_da*gl_Color.rgb*diff_tex.rgb*amb_plcol.rgb*amb_plcol.a; + col += amb_da*color.rgb*diff_tex.rgb*amb_plcol.rgb*amb_plcol.a; } @@ -225,7 +228,7 @@ void main() stc.y > 0.0) { vec4 scol = texture2DLodSpecular(projectionMap, stc.xy, proj_lod-spec.a*proj_lod); - col += dist_atten*scol.rgb*gl_Color.rgb*scol.a*spec.rgb*shadow; + col += dist_atten*scol.rgb*color.rgb*scol.a*spec.rgb*shadow; } } } diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl index f0c9b01671..cbac299e44 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl @@ -47,7 +47,8 @@ uniform mat3 ssao_effect_mat; uniform mat4 inv_proj; uniform vec2 screen_res; -varying vec4 vary_light; +uniform vec3 sun_dir; + varying vec2 vary_fragcoord; vec3 vary_PositionEye; @@ -264,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); @@ -291,7 +292,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*scol_ambocc.r*texture2D(lightFunc, vec2(sa, spec.a)).a; // add the two types of shiny together diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightV.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightV.glsl index d2e3415d91..9534f1d79c 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/softenLightV.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightV.glsl @@ -7,12 +7,11 @@ attribute vec3 position; -attribute vec2 texcoord0; uniform vec2 screen_res; -varying vec4 vary_light; varying vec2 vary_fragcoord; + void main() { //transform vertex @@ -21,6 +20,4 @@ void main() vary_fragcoord = (pos.xy*0.5+0.5)*screen_res; - - vary_light = vec4(texcoord0,0,1); } diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl index d53850b489..699fcdb0f3 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl @@ -30,7 +30,7 @@ uniform float ssao_factor; uniform float ssao_factor_inv; varying vec2 vary_fragcoord; -varying vec4 vary_light; +uniform vec3 sun_dir; uniform mat4 inv_proj; uniform vec2 screen_res; @@ -167,10 +167,10 @@ void main() }*/ float shadow = 1.0; - float dp_directional_light = max(0.0, dot(norm, vary_light.xyz)); + float dp_directional_light = max(0.0, dot(norm, sun_dir.xyz)); vec3 shadow_pos = pos.xyz + displace*norm; - vec3 offset = vary_light.xyz * (1.0-dp_directional_light); + vec3 offset = sun_dir.xyz * (1.0-dp_directional_light); vec4 spos = vec4(shadow_pos+offset*shadow_offset, 1.0); diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightV.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightV.glsl index 6795b55dc6..39cca9589e 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/sunLightV.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightV.glsl @@ -6,9 +6,6 @@ */ attribute vec3 position; -attribute vec3 normal; -attribute vec4 diffuse_color; -attribute vec2 texcoord0; varying vec4 vary_light; @@ -23,10 +20,4 @@ void main() gl_Position = pos; vary_fragcoord = (pos.xy * 0.5 + 0.5)*screen_res; - vec4 tex = vec4(texcoord0,0,1); - tex.w = 1.0; - - vary_light = vec4(texcoord0,0,1); - - gl_FrontColor = diffuse_color; } diff --git a/indra/newview/app_settings/shaders/class2/objects/simpleNonIndexedV.glsl b/indra/newview/app_settings/shaders/class2/objects/simpleNonIndexedV.glsl new file mode 100644 index 0000000000..d2a83c9724 --- /dev/null +++ b/indra/newview/app_settings/shaders/class2/objects/simpleNonIndexedV.glsl @@ -0,0 +1,36 @@ +/** + * @file simpleNonIndexedV.glsl + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * $/LicenseInfo$ + */ + + + +attribute vec3 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); + +void main() +{ + //transform vertex + vec4 vert = vec4(position.xyz,1.0); + + gl_Position = gl_ModelViewProjectionMatrix*vert; + gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0, 0, 1); + + vec4 pos = (gl_ModelViewMatrix * vert); + + vec3 norm = normalize(gl_NormalMatrix * normal); + + calcAtmospherics(pos.xyz); + + vec4 color = calcLighting(pos.xyz, norm, diffuse_color, vec4(0.)); + gl_FrontColor = color; + + gl_FogFragCoord = pos.z; +} -- cgit v1.2.3 From bf0d36bf889bb913fbc2a53c5a1b9818acb11ee6 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Wed, 24 Aug 2011 15:41:00 -0700 Subject: Mac rendering now with 100% fewer crashes when enabling shadows. --- indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl | 6 +++--- indra/newview/app_settings/shaders/class2/deferred/sunLightV.glsl | 4 +--- 2 files changed, 4 insertions(+), 6 deletions(-) (limited to 'indra/newview/app_settings/shaders/class2') diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl index 1809cff1e5..146fac56e9 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl @@ -48,12 +48,12 @@ uniform float ssao_factor; uniform float ssao_factor_inv; varying vec2 vary_fragcoord; -varying vec4 vary_light; uniform mat4 inv_proj; uniform vec2 screen_res; uniform vec2 shadow_res; uniform vec2 proj_shadow_res; +uniform vec3 sun_dir; uniform float shadow_bias; uniform float shadow_offset; @@ -132,10 +132,10 @@ void main() }*/ float shadow = 1.0; - float dp_directional_light = max(0.0, dot(norm, vary_light.xyz)); + float dp_directional_light = max(0.0, dot(norm, sun_dir.xyz)); vec3 shadow_pos = pos.xyz + displace*norm; - vec3 offset = vary_light.xyz * (1.0-dp_directional_light); + vec3 offset = sun_dir.xyz * (1.0-dp_directional_light); vec4 spos = vec4(shadow_pos+offset*shadow_offset, 1.0); diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightV.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightV.glsl index 827ec15621..2cf7375d4d 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/sunLightV.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightV.glsl @@ -1,5 +1,5 @@ /** - * @file sunLightF.glsl + * @file sunLightV.glsl * * $LicenseInfo:firstyear=2007&license=viewerlgpl$ * Second Life Viewer Source Code @@ -25,8 +25,6 @@ attribute vec3 position; - -varying vec4 vary_light; varying vec2 vary_fragcoord; uniform vec2 screen_res; -- cgit v1.2.3 From 530981a2149a74e1dc003cea1bbc9dc392fcae60 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Thu, 15 Sep 2011 00:54:25 -0500 Subject: SH-2243 work in progress -- no more deprecated built-in matrix state when using shaders. --- .../shaders/class2/avatar/eyeballV.glsl | 14 ++++++---- .../shaders/class2/deferred/alphaSkinnedV.glsl | 13 ++++++--- .../shaders/class2/deferred/alphaV.glsl | 17 +++++++----- .../shaders/class2/deferred/avatarAlphaV.glsl | 3 ++- .../shaders/class2/deferred/edgeV.glsl | 3 ++- .../shaders/class2/deferred/softenLightV.glsl | 5 ++-- .../shaders/class2/deferred/sunLightV.glsl | 6 +++-- .../app_settings/shaders/class2/effects/blurV.glsl | 5 ++-- .../shaders/class2/effects/drawQuadV.glsl | 5 ++-- .../shaders/class2/environment/terrainV.glsl | 14 ++++++---- .../shaders/class2/objects/fullbrightShinyV.glsl | 17 +++++++----- .../shaders/class2/objects/fullbrightV.glsl | 11 +++++--- .../shaders/class2/objects/shinyV.glsl | 17 +++++++----- .../shaders/class2/objects/simpleNonIndexedV.glsl | 31 ++++++++++++++++++---- .../shaders/class2/objects/simpleV.glsl | 13 +++++---- .../shaders/class2/windlight/cloudsV.glsl | 6 +++-- .../shaders/class2/windlight/skyV.glsl | 3 ++- 17 files changed, 124 insertions(+), 59 deletions(-) (limited to 'indra/newview/app_settings/shaders/class2') diff --git a/indra/newview/app_settings/shaders/class2/avatar/eyeballV.glsl b/indra/newview/app_settings/shaders/class2/avatar/eyeballV.glsl index c0065f0bbe..43e19909d4 100644 --- a/indra/newview/app_settings/shaders/class2/avatar/eyeballV.glsl +++ b/indra/newview/app_settings/shaders/class2/avatar/eyeballV.glsl @@ -22,7 +22,11 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - + +uniform mat3 normal_matrix; +uniform mat4 texture_matrix0; +uniform mat4 modelview_matrix; +uniform mat4 modelview_projection_matrix; attribute vec3 position; attribute vec4 diffuse_color; @@ -35,11 +39,11 @@ void calcAtmospherics(vec3 inPositionEye); void main() { //transform vertex - 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 = (modelview_matrix * vec4(position.xyz, 1.0)).xyz; + gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); + gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1); - vec3 norm = normalize(gl_NormalMatrix * normal); + vec3 norm = normalize(normal_matrix * normal); calcAtmospherics(pos.xyz); diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaSkinnedV.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaSkinnedV.glsl index 501fcb004b..df4d26997a 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/alphaSkinnedV.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/alphaSkinnedV.glsl @@ -21,6 +21,11 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ + +uniform mat4 projection_matrix; +uniform mat4 texture_matrix0; +uniform mat4 modelview_matrix; +uniform mat4 modelview_projection_matrix; attribute vec3 position; attribute vec3 normal; @@ -79,15 +84,15 @@ float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, floa void main() { - gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1); + gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1); mat4 mat = getObjectSkinnedTransform(); - mat = gl_ModelViewMatrix * mat; + mat = modelview_matrix * mat; vec3 pos = (mat*vec4(position, 1.0)).xyz; - gl_Position = gl_ProjectionMatrix * vec4(pos, 1.0); + gl_Position = projection_matrix * vec4(pos, 1.0); vec4 n = vec4(position, 1.0); n.xyz += normal.xyz; @@ -128,7 +133,7 @@ void main() gl_FogFragCoord = pos.z; - pos.xyz = (gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0)).xyz; + pos.xyz = (modelview_projection_matrix * 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 b0ae0107fb..996203ffd6 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl @@ -22,7 +22,12 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - + +uniform mat3 normal_matrix; +uniform mat4 texture_matrix0; +uniform mat4 modelview_matrix; +uniform mat4 modelview_projection_matrix; + attribute vec4 position; attribute vec3 normal; attribute vec4 diffuse_color; @@ -84,12 +89,12 @@ void main() //transform vertex vec4 vert = vec4(position.xyz, 1.0); vary_texture_index = position.w; - vec4 pos = (gl_ModelViewMatrix * vert); - gl_Position = gl_ModelViewProjectionMatrix*vec4(position.xyz, 1.0); + vec4 pos = (modelview_matrix * vert); + gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0); - gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1); + gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1); - vec3 norm = normalize(gl_NormalMatrix * normal); + vec3 norm = normalize(normal_matrix * normal); float dp_directional_light = max(0.0, dot(norm, gl_LightSource[0].position.xyz)); vary_position = pos.xyz + gl_LightSource[0].position.xyz * (1.0-dp_directional_light)*shadow_offset; @@ -123,7 +128,7 @@ void main() gl_FogFragCoord = pos.z; - pos = gl_ModelViewProjectionMatrix * vert; + pos = modelview_projection_matrix * vert; vary_fragcoord.xyz = pos.xyz + vec3(0,0,near_clip); } diff --git a/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl b/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl index f35af53f95..3e35675784 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl @@ -23,6 +23,7 @@ * $/LicenseInfo$ */ +uniform mat4 projection_matrix; attribute vec3 position; attribute vec3 normal; @@ -99,7 +100,7 @@ void main() norm.z = dot(trans[2].xyz, normal); norm = normalize(norm); - gl_Position = gl_ProjectionMatrix * pos; + gl_Position = projection_matrix * pos; 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; diff --git a/indra/newview/app_settings/shaders/class2/deferred/edgeV.glsl b/indra/newview/app_settings/shaders/class2/deferred/edgeV.glsl index 964f12afcf..1f5470db3c 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/edgeV.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/edgeV.glsl @@ -23,6 +23,7 @@ * $/LicenseInfo$ */ +uniform mat4 modelview_projection_matrix; attribute vec3 position; @@ -32,7 +33,7 @@ uniform vec2 screen_res; void main() { //transform vertex - vec4 pos = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0); + vec4 pos = modelview_projection_matrix * vec4(position.xyz, 1.0); gl_Position = pos; vary_fragcoord = (pos.xy*0.5+0.5)*screen_res; } diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightV.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightV.glsl index e52edcba41..424299269f 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/softenLightV.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightV.glsl @@ -22,7 +22,8 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - + +uniform mat4 modelview_projection_matrix; attribute vec3 position; @@ -33,7 +34,7 @@ varying vec2 vary_fragcoord; void main() { //transform vertex - vec4 pos = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0); + vec4 pos = modelview_projection_matrix * vec4(position.xyz, 1.0); gl_Position = pos; diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightV.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightV.glsl index 2cf7375d4d..60ba2d7ad4 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/sunLightV.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightV.glsl @@ -22,7 +22,9 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - + +uniform mat4 modelview_projection_matrix; + attribute vec3 position; varying vec2 vary_fragcoord; @@ -32,7 +34,7 @@ uniform vec2 screen_res; void main() { //transform vertex - vec4 pos = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0); + vec4 pos = modelview_projection_matrix * vec4(position.xyz, 1.0); gl_Position = pos; vary_fragcoord = (pos.xy * 0.5 + 0.5)*screen_res; diff --git a/indra/newview/app_settings/shaders/class2/effects/blurV.glsl b/indra/newview/app_settings/shaders/class2/effects/blurV.glsl index 556e131d34..4fd4b101ff 100644 --- a/indra/newview/app_settings/shaders/class2/effects/blurV.glsl +++ b/indra/newview/app_settings/shaders/class2/effects/blurV.glsl @@ -22,7 +22,8 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - + +uniform mat4 modelview_projection_matrix; attribute vec3 position; attribute vec2 texcoord0; @@ -34,7 +35,7 @@ uniform float blurWidth; void main(void) { // Transform vertex - gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0); + gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); vec2 blurDelta = texelSize * blurDirection * vec2(blurWidth, blurWidth); vec2 s = vec4(texcoord0,0,1).st - (blurDelta * 3.0); diff --git a/indra/newview/app_settings/shaders/class2/effects/drawQuadV.glsl b/indra/newview/app_settings/shaders/class2/effects/drawQuadV.glsl index fbb87b6578..d3c93ab05f 100644 --- a/indra/newview/app_settings/shaders/class2/effects/drawQuadV.glsl +++ b/indra/newview/app_settings/shaders/class2/effects/drawQuadV.glsl @@ -22,7 +22,8 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - + +uniform mat4 modelview_projection_matrix; attribute vec3 position; attribute vec2 texcoord0; @@ -32,7 +33,7 @@ attribute vec2 texcoord1; void main(void) { //transform vertex - gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0); + gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); gl_TexCoord[0] = vec4(texcoord0,0,1); 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 1a7edbd61b..69f4d4ae45 100644 --- a/indra/newview/app_settings/shaders/class2/environment/terrainV.glsl +++ b/indra/newview/app_settings/shaders/class2/environment/terrainV.glsl @@ -22,7 +22,11 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - + +uniform mat3 normal_matrix; +uniform mat4 texture_matrix0; +uniform mat4 modelview_matrix; +uniform mat4 modelview_projection_matrix; attribute vec3 position; attribute vec3 normal; @@ -52,10 +56,10 @@ vec4 texgen_object(vec4 vpos, vec4 tc, mat4 mat, vec4 tp0, vec4 tp1) void main() { //transform vertex - gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0); + gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); - vec4 pos = gl_ModelViewMatrix * vec4(position.xyz, 1.0); - vec3 norm = normalize(gl_NormalMatrix * normal); + vec4 pos = modelview_matrix * vec4(position.xyz, 1.0); + vec3 norm = normalize(normal_matrix * normal); calcAtmospherics(pos.xyz); @@ -67,7 +71,7 @@ void main() gl_FrontColor = color; // Transform and pass tex coords - 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; + gl_TexCoord[0].xy = texgen_object(vec4(position.xyz, 1.0), vec4(texcoord0,0,1), texture_matrix0, gl_ObjectPlaneS[0], gl_ObjectPlaneT[0]).xy; vec4 t = vec4(texcoord1,0,1); diff --git a/indra/newview/app_settings/shaders/class2/objects/fullbrightShinyV.glsl b/indra/newview/app_settings/shaders/class2/objects/fullbrightShinyV.glsl index 8a88957659..b9eff87a13 100644 --- a/indra/newview/app_settings/shaders/class2/objects/fullbrightShinyV.glsl +++ b/indra/newview/app_settings/shaders/class2/objects/fullbrightShinyV.glsl @@ -22,7 +22,12 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - + +uniform mat3 normal_matrix; +uniform mat4 texture_matrix0; +uniform mat4 texture_matrix1; +uniform mat4 modelview_matrix; +uniform mat4 modelview_projection_matrix; void calcAtmospherics(vec3 inPositionEye); @@ -41,14 +46,14 @@ void main() //transform vertex vec4 vert = vec4(position.xyz,1.0); vary_texture_index = position.w; - vec4 pos = (gl_ModelViewMatrix * vert); - gl_Position = gl_ModelViewProjectionMatrix*vec4(position.xyz, 1.0); + vec4 pos = (modelview_matrix * vert); + gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0); - vec3 norm = normalize(gl_NormalMatrix * normal); + vec3 norm = normalize(normal_matrix * normal); vec3 ref = reflect(pos.xyz, -norm); - gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1); - gl_TexCoord[1] = gl_TextureMatrix[1]*vec4(ref,1.0); + gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1); + gl_TexCoord[1] = texture_matrix1*vec4(ref,1.0); calcAtmospherics(pos.xyz); diff --git a/indra/newview/app_settings/shaders/class2/objects/fullbrightV.glsl b/indra/newview/app_settings/shaders/class2/objects/fullbrightV.glsl index f5ff1d1d00..b7f7af7885 100644 --- a/indra/newview/app_settings/shaders/class2/objects/fullbrightV.glsl +++ b/indra/newview/app_settings/shaders/class2/objects/fullbrightV.glsl @@ -22,7 +22,10 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - + +uniform mat4 texture_matrix0; +uniform mat4 modelview_matrix; +uniform mat4 modelview_projection_matrix; attribute vec4 position; attribute vec2 texcoord0; @@ -39,9 +42,9 @@ void main() //transform vertex vec4 vert = vec4(position.xyz,1.0); vary_texture_index = position.w; - vec4 pos = (gl_ModelViewMatrix * vert); - gl_Position = gl_ModelViewProjectionMatrix*vec4(position.xyz, 1.0); - gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1); + vec4 pos = (modelview_matrix * vert); + gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0); + gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1); calcAtmospherics(pos.xyz); diff --git a/indra/newview/app_settings/shaders/class2/objects/shinyV.glsl b/indra/newview/app_settings/shaders/class2/objects/shinyV.glsl index d6fca4cda7..4511c4bc91 100644 --- a/indra/newview/app_settings/shaders/class2/objects/shinyV.glsl +++ b/indra/newview/app_settings/shaders/class2/objects/shinyV.glsl @@ -22,7 +22,12 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - + +uniform mat3 normal_matrix; +uniform mat4 texture_matrix0; +uniform mat4 texture_matrix1; +uniform mat4 modelview_matrix; +uniform mat4 modelview_projection_matrix; attribute vec4 position; attribute vec2 texcoord0; @@ -42,14 +47,14 @@ void main() //transform vertex vec4 vert = vec4(position.xyz,1.0); vary_texture_index = position.w; - vec4 pos = (gl_ModelViewMatrix * vert); - gl_Position = gl_ModelViewProjectionMatrix*vec4(position.xyz, 1.0); + vec4 pos = (modelview_matrix * vert); + gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0); - vec3 norm = normalize(gl_NormalMatrix * normal); + vec3 norm = normalize(normal_matrix * normal); vec3 ref = reflect(pos.xyz, -norm); - gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0,0,1); - gl_TexCoord[1] = gl_TextureMatrix[1]*vec4(ref,1.0); + gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1); + gl_TexCoord[1] = texture_matrix1*vec4(ref,1.0); calcAtmospherics(pos.xyz); diff --git a/indra/newview/app_settings/shaders/class2/objects/simpleNonIndexedV.glsl b/indra/newview/app_settings/shaders/class2/objects/simpleNonIndexedV.glsl index d2a83c9724..5f78495ae3 100644 --- a/indra/newview/app_settings/shaders/class2/objects/simpleNonIndexedV.glsl +++ b/indra/newview/app_settings/shaders/class2/objects/simpleNonIndexedV.glsl @@ -2,10 +2,31 @@ * @file simpleNonIndexedV.glsl * * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2007, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - +uniform mat3 normal_matrix; +uniform mat4 texture_matrix0; +uniform mat4 modelview_matrix; +uniform mat4 modelview_projection_matrix; attribute vec3 position; attribute vec2 texcoord0; @@ -20,12 +41,12 @@ void main() //transform vertex vec4 vert = vec4(position.xyz,1.0); - gl_Position = gl_ModelViewProjectionMatrix*vert; - gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0, 0, 1); + gl_Position = modelview_projection_matrix*vert; + gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0, 0, 1); - vec4 pos = (gl_ModelViewMatrix * vert); + vec4 pos = (modelview_matrix * vert); - vec3 norm = normalize(gl_NormalMatrix * normal); + vec3 norm = normalize(normal_matrix * normal); calcAtmospherics(pos.xyz); diff --git a/indra/newview/app_settings/shaders/class2/objects/simpleV.glsl b/indra/newview/app_settings/shaders/class2/objects/simpleV.glsl index c2db1e1949..91ee5e016e 100644 --- a/indra/newview/app_settings/shaders/class2/objects/simpleV.glsl +++ b/indra/newview/app_settings/shaders/class2/objects/simpleV.glsl @@ -22,8 +22,11 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - +uniform mat3 normal_matrix; +uniform mat4 texture_matrix0; +uniform mat4 modelview_matrix; +uniform mat4 modelview_projection_matrix; attribute vec4 position; attribute vec2 texcoord0; @@ -40,13 +43,13 @@ void main() //transform vertex vec4 vert = vec4(position.xyz,1.0); vary_texture_index = position.w; - vec4 pos = (gl_ModelViewMatrix * vert); - gl_Position = gl_ModelViewProjectionMatrix*vec4(position.xyz, 1.0); - gl_TexCoord[0] = gl_TextureMatrix[0] * vec4(texcoord0, 0, 1); + vec4 pos = (modelview_matrix * vert); + gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0); + gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0, 0, 1); - vec3 norm = normalize(gl_NormalMatrix * normal); + vec3 norm = normalize(normal_matrix * normal); calcAtmospherics(pos.xyz); diff --git a/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl b/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl index 297b3904a6..67b5e7fb83 100644 --- a/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl +++ b/indra/newview/app_settings/shaders/class2/windlight/cloudsV.glsl @@ -22,7 +22,9 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - + +uniform mat4 modelview_projection_matrix; + attribute vec3 position; attribute vec2 texcoord0; @@ -60,7 +62,7 @@ void main() { // World / view / projection - gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0); + gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); gl_TexCoord[0] = vec4(texcoord0,0,1); diff --git a/indra/newview/app_settings/shaders/class2/windlight/skyV.glsl b/indra/newview/app_settings/shaders/class2/windlight/skyV.glsl index 84e1f827d6..50fdba64c2 100644 --- a/indra/newview/app_settings/shaders/class2/windlight/skyV.glsl +++ b/indra/newview/app_settings/shaders/class2/windlight/skyV.glsl @@ -23,6 +23,7 @@ * $/LicenseInfo$ */ +uniform mat4 modelview_projection_matrix; attribute vec3 position; attribute vec2 texcoord0; @@ -59,7 +60,7 @@ void main() { // World / view / projection - gl_Position = gl_ModelViewProjectionMatrix * vec4(position.xyz, 1.0); + gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); gl_TexCoord[0] = vec4(texcoord0,0,1); // Get relative position -- cgit v1.2.3 From 24ae2fb5af52d7128e79a0f63afce9a8db1123eb Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Thu, 15 Sep 2011 16:38:31 -0500 Subject: SH-2243 work in progress -- don't use built-in GL light state when shaders are available. --- .../shaders/class2/deferred/alphaSkinnedV.glsl | 23 +++++++++++-------- .../shaders/class2/deferred/alphaV.glsl | 26 +++++++++++++--------- .../shaders/class2/deferred/avatarAlphaV.glsl | 23 +++++++++++-------- .../class2/lighting/sumLightsSpecularV.glsl | 13 ++++++----- .../shaders/class2/lighting/sumLightsV.glsl | 15 ++++++++----- 5 files changed, 62 insertions(+), 38 deletions(-) (limited to 'indra/newview/app_settings/shaders/class2') diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaSkinnedV.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaSkinnedV.glsl index df4d26997a..c3148d5fdf 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/alphaSkinnedV.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/alphaSkinnedV.glsl @@ -52,6 +52,11 @@ uniform float near_clip; uniform float shadow_offset; uniform float shadow_bias; +uniform vec4 light_position[8]; +uniform vec3 light_direction[8]; +uniform vec3 light_attenuation[8]; +uniform vec3 light_diffuse[8]; + float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight) { //get light vector @@ -101,8 +106,8 @@ void main() vec3 norm = n.xyz; - 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; + float dp_directional_light = max(0.0, dot(norm, light_position[0].xyz)); + vary_position = pos.xyz + light_position[0].xyz * (1.0-dp_directional_light)*shadow_offset; calcAtmospherics(pos.xyz); @@ -110,12 +115,12 @@ void main() 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); - col.rgb += gl_LightSource[3].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[3].position, gl_LightSource[3].spotDirection.xyz, gl_LightSource[3].linearAttenuation, gl_LightSource[3].quadraticAttenuation ,gl_LightSource[3].specular.a); - col.rgb += gl_LightSource[4].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[4].position, gl_LightSource[4].spotDirection.xyz, gl_LightSource[4].linearAttenuation, gl_LightSource[4].quadraticAttenuation, gl_LightSource[4].specular.a); - col.rgb += gl_LightSource[5].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[5].position, gl_LightSource[5].spotDirection.xyz, gl_LightSource[5].linearAttenuation, gl_LightSource[5].quadraticAttenuation, gl_LightSource[5].specular.a); - 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); + col.rgb += light_diffuse[2].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[2], light_direction[2], light_attenuation[2].x, light_attenuation[2].y, light_attenuation[2].z); + col.rgb += light_diffuse[3].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[3], light_direction[3], light_attenuation[3].x, light_attenuation[3].y, light_attenuation[3].z); + col.rgb += light_diffuse[4].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[4], light_direction[4], light_attenuation[4].x, light_attenuation[4].y, light_attenuation[4].z); + col.rgb += light_diffuse[5].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[5], light_direction[5], light_attenuation[5].x, light_attenuation[5].y, light_attenuation[5].z); + col.rgb += light_diffuse[6].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[6], light_direction[6], light_attenuation[6].x, light_attenuation[6].y, light_attenuation[6].z); + col.rgb += light_diffuse[7].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[7], light_direction[7], light_attenuation[7].x, light_attenuation[7].y, light_attenuation[7].z); vary_pointlight_col = col.rgb*diffuse_color.rgb; @@ -125,7 +130,7 @@ void main() col.rgb = atmosAmbient(vec3(0.)); 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))); + vary_directional.rgb = diffuse_color.rgb*atmosAffectDirectionalLight(max(calcDirectionalLight(norm, light_position[0].xyz), (1.0-diffuse_color.a)*(1.0-diffuse_color.a))); col.rgb = min(col.rgb*diffuse_color.rgb, 1.0); diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl index 996203ffd6..8d55616e67 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl @@ -54,6 +54,11 @@ uniform float near_clip; uniform float shadow_offset; uniform float shadow_bias; +uniform vec4 light_position[8]; +uniform vec3 light_direction[8]; +uniform vec3 light_attenuation[8]; +uniform vec3 light_diffuse[8]; + float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight) { //get light vector @@ -96,22 +101,23 @@ void main() vec3 norm = normalize(normal_matrix * normal); - float dp_directional_light = max(0.0, dot(norm, gl_LightSource[0].position.xyz)); - vary_position = pos.xyz + gl_LightSource[0].position.xyz * (1.0-dp_directional_light)*shadow_offset; + float dp_directional_light = max(0.0, dot(norm, light_position[0].xyz)); + vary_position = pos.xyz + light_position[0].xyz * (1.0-dp_directional_light)*shadow_offset; calcAtmospherics(pos.xyz); //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); - col.rgb += gl_LightSource[3].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[3].position, gl_LightSource[3].spotDirection.xyz, gl_LightSource[3].linearAttenuation, gl_LightSource[3].quadraticAttenuation ,gl_LightSource[3].specular.a); - col.rgb += gl_LightSource[4].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[4].position, gl_LightSource[4].spotDirection.xyz, gl_LightSource[4].linearAttenuation, gl_LightSource[4].quadraticAttenuation, gl_LightSource[4].specular.a); - col.rgb += gl_LightSource[5].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[5].position, gl_LightSource[5].spotDirection.xyz, gl_LightSource[5].linearAttenuation, gl_LightSource[5].quadraticAttenuation, gl_LightSource[5].specular.a); - 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); + // Collect normal lights + col.rgb += light_diffuse[2].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[2], light_direction[2], light_attenuation[2].x, light_attenuation[2].y, light_attenuation[2].z); + col.rgb += light_diffuse[3].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[3], light_direction[3], light_attenuation[3].x, light_attenuation[3].y, light_attenuation[3].z); + col.rgb += light_diffuse[4].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[4], light_direction[4], light_attenuation[4].x, light_attenuation[4].y, light_attenuation[4].z); + col.rgb += light_diffuse[5].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[5], light_direction[5], light_attenuation[5].x, light_attenuation[5].y, light_attenuation[5].z); + col.rgb += light_diffuse[6].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[6], light_direction[6], light_attenuation[6].x, light_attenuation[6].y, light_attenuation[6].z); + col.rgb += light_diffuse[7].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[7], light_direction[7], light_attenuation[7].x, light_attenuation[7].y, light_attenuation[7].z); + vary_pointlight_col = col.rgb*diffuse_color.rgb; col.rgb = vec3(0,0,0); @@ -120,7 +126,7 @@ void main() col.rgb = atmosAmbient(vec3(0.)); 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))); + vary_directional.rgb = diffuse_color.rgb*atmosAffectDirectionalLight(max(calcDirectionalLight(norm, light_position[0].xyz), (1.0-diffuse_color.a)*(1.0-diffuse_color.a))); col.rgb = col.rgb*diffuse_color.rgb; diff --git a/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl b/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl index 3e35675784..0273f3c121 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl @@ -51,6 +51,11 @@ uniform float near_clip; uniform float shadow_offset; uniform float shadow_bias; +uniform vec4 light_position[8]; +uniform vec3 light_direction[8]; +uniform vec3 light_attenuation[8]; +uniform vec3 light_diffuse[8]; + float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight) { //get light vector @@ -102,20 +107,20 @@ void main() gl_Position = projection_matrix * pos; - 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; + float dp_directional_light = max(0.0, dot(norm, light_position[0].xyz)); + vary_position = pos.xyz + light_position[0].xyz * (1.0-dp_directional_light)*shadow_offset; calcAtmospherics(pos.xyz); vec4 col = vec4(0.0, 0.0, 0.0, 1.0); // 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); - col.rgb += gl_LightSource[3].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[3].position, gl_LightSource[3].spotDirection.xyz, gl_LightSource[3].linearAttenuation, gl_LightSource[3].quadraticAttenuation ,gl_LightSource[3].specular.a); - col.rgb += gl_LightSource[4].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[4].position, gl_LightSource[4].spotDirection.xyz, gl_LightSource[4].linearAttenuation, gl_LightSource[4].quadraticAttenuation, gl_LightSource[4].specular.a); - col.rgb += gl_LightSource[5].diffuse.rgb*calcPointLightOrSpotLight(pos.xyz, norm, gl_LightSource[5].position, gl_LightSource[5].spotDirection.xyz, gl_LightSource[5].linearAttenuation, gl_LightSource[5].quadraticAttenuation, gl_LightSource[5].specular.a); - 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); + col.rgb += light_diffuse[2].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[2], light_direction[2], light_attenuation[2].x, light_attenuation[2].y, light_attenuation[2].z); + col.rgb += light_diffuse[3].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[3], light_direction[3], light_attenuation[3].x, light_attenuation[3].y, light_attenuation[3].z); + col.rgb += light_diffuse[4].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[4], light_direction[4], light_attenuation[4].x, light_attenuation[4].y, light_attenuation[4].z); + col.rgb += light_diffuse[5].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[5], light_direction[5], light_attenuation[5].x, light_attenuation[5].y, light_attenuation[5].z); + col.rgb += light_diffuse[6].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[6], light_direction[6], light_attenuation[6].x, light_attenuation[6].y, light_attenuation[6].z); + col.rgb += light_diffuse[7].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[7], light_direction[7], light_attenuation[7].x, light_attenuation[7].y, light_attenuation[7].z); vary_pointlight_col = col.rgb; @@ -125,7 +130,7 @@ void main() col.rgb = atmosAmbient(vec3(0.)); vary_ambient = col.rgb; - vary_directional = atmosAffectDirectionalLight(max(calcDirectionalLight(norm, gl_LightSource[0].position.xyz), 0.0)); + vary_directional = atmosAffectDirectionalLight(max(calcDirectionalLight(norm, light_position[0].xyz), 0.0)); col.rgb = min(col.rgb, 1.0); diff --git a/indra/newview/app_settings/shaders/class2/lighting/sumLightsSpecularV.glsl b/indra/newview/app_settings/shaders/class2/lighting/sumLightsSpecularV.glsl index d0a12479db..3acf9fe883 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/sumLightsSpecularV.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/sumLightsSpecularV.glsl @@ -33,6 +33,10 @@ vec3 atmosAffectDirectionalLight(float lightIntensity); vec3 atmosGetDiffuseSunlightColor(); vec3 scaleDownLight(vec3 light); +uniform vec4 light_position[8]; +uniform vec3 light_attenuation[8]; +uniform vec3 light_diffuse[8]; + vec4 sumLightsSpecular(vec3 pos, vec3 norm, vec4 color, inout vec4 specularColor, vec4 baseCol) { vec4 col = vec4(0.0, 0.0, 0.0, color.a); @@ -43,15 +47,14 @@ vec4 sumLightsSpecular(vec3 pos, vec3 norm, vec4 color, inout vec4 specularColor vec4 specularSum = vec4(0.0); // Collect normal lights (need to be divided by two, as we later multiply by 2) - col.rgb += gl_LightSource[1].diffuse.rgb * calcDirectionalLightSpecular(specularColor, view, norm, gl_LightSource[1].position.xyz, gl_LightSource[1].diffuse.rgb, 1.0); - col.rgb += calcPointLightSpecular(specularSum, view, pos, norm, gl_LightSource[2].position.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].quadraticAttenuation, gl_LightSource[2].diffuse.rgb); - col.rgb += calcPointLightSpecular(specularSum, view, pos, norm, gl_LightSource[3].position.xyz, gl_LightSource[3].linearAttenuation, gl_LightSource[3].quadraticAttenuation, gl_LightSource[3].diffuse.rgb); - //col.rgb += calcPointLightSpecular(specularSum, view, pos, norm, gl_LightSource[4].position.xyz, gl_LightSource[4].linearAttenuation, gl_LightSource[4].quadraticAttenuation, gl_LightSource[4].diffuse.rgb); + col.rgb += light_diffuse[1].rgb * calcDirectionalLightSpecular(specularColor, view, norm, light_position[1].xyz,light_diffuse[1].rgb, 1.0); + col.rgb += calcPointLightSpecular(specularSum, view, pos, norm, light_position[2].xyz, light_attenuation[2].x, light_attenuation[2].y, light_diffuse[2].rgb); + col.rgb += calcPointLightSpecular(specularSum, view, pos, norm, light_position[3].xyz, light_attenuation[3].x, light_attenuation[3].y, light_diffuse[3].rgb); col.rgb = scaleDownLight(col.rgb); // Add windlight lights col.rgb += atmosAmbient(baseCol.rgb); - col.rgb += atmosAffectDirectionalLight(calcDirectionalLightSpecular(specularSum, view, norm, gl_LightSource[0].position.xyz, atmosGetDiffuseSunlightColor()*baseCol.a, 1.0)); + col.rgb += atmosAffectDirectionalLight(calcDirectionalLightSpecular(specularSum, view, norm, light_position[0].xyz,atmosGetDiffuseSunlightColor()*baseCol.a, 1.0)); col.rgb = min(col.rgb*color.rgb, 1.0); specularColor.rgb = min(specularColor.rgb*specularSum.rgb, 1.0); diff --git a/indra/newview/app_settings/shaders/class2/lighting/sumLightsV.glsl b/indra/newview/app_settings/shaders/class2/lighting/sumLightsV.glsl index 55dfab2aa1..c9987ef3b9 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/sumLightsV.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/sumLightsV.glsl @@ -30,21 +30,26 @@ vec3 atmosAmbient(vec3 light); vec3 atmosAffectDirectionalLight(float lightIntensity); vec3 scaleDownLight(vec3 light); +uniform vec4 light_position[8]; +uniform vec3 light_direction[8]; +uniform vec3 light_attenuation[8]; +uniform vec3 light_diffuse[8]; + vec4 sumLights(vec3 pos, vec3 norm, vec4 color, vec4 baseLight) { vec4 col = vec4(0.0, 0.0, 0.0, color.a); // Collect normal lights (need to be divided by two, as we later multiply by 2) - col.rgb += gl_LightSource[1].diffuse.rgb * calcDirectionalLight(norm, gl_LightSource[1].position.xyz); + col.rgb += light_diffuse[1].rgb * calcDirectionalLight(norm, light_position[1].xyz); + + col.rgb += light_diffuse[2].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[2], light_direction[2], light_attenuation[2].x, light_attenuation[2].z); + col.rgb += light_diffuse[3].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[3], light_direction[3], light_attenuation[3].x, light_attenuation[3].z); - col.rgb += gl_LightSource[2].diffuse.rgb * calcPointLightOrSpotLight(pos, norm, gl_LightSource[2].position, gl_LightSource[2].spotDirection.xyz, gl_LightSource[2].linearAttenuation, gl_LightSource[2].specular.a); - col.rgb += gl_LightSource[3].diffuse.rgb * calcPointLightOrSpotLight(pos, norm, gl_LightSource[3].position, gl_LightSource[3].spotDirection.xyz, gl_LightSource[3].linearAttenuation, gl_LightSource[3].specular.a); - //col.rgb += gl_LightSource[4].diffuse.rgb * calcPointLightOrSpotLight(pos, norm, gl_LightSource[4].position, gl_LightSource[4].spotDirection.xyz, gl_LightSource[4].linearAttenuation, gl_LightSource[4].specular.a); col.rgb = scaleDownLight(col.rgb); // Add windlight lights col.rgb += atmosAmbient(baseLight.rgb); - col.rgb += atmosAffectDirectionalLight(calcDirectionalLight(norm, gl_LightSource[0].position.xyz)); + col.rgb += atmosAffectDirectionalLight(calcDirectionalLight(norm, light_position[0].xyz)); col.rgb = min(col.rgb*color.rgb, 1.0); -- cgit v1.2.3 From da84f5552731e1ece3a463c4c385bb327f1048a1 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Fri, 16 Sep 2011 12:40:53 -0500 Subject: SH-2243 work in progress -- don't use deprecated shader state --- .../shaders/class2/avatar/eyeballV.glsl | 18 +++++++----- .../shaders/class2/deferred/alphaF.glsl | 19 +++++++----- .../shaders/class2/deferred/alphaNonIndexedF.glsl | 18 +++++++----- .../class2/deferred/alphaNonIndexedNoColorF.glsl | 33 ++++++++++++++++----- .../shaders/class2/deferred/alphaSkinnedV.glsl | 28 ++++++++++-------- .../shaders/class2/deferred/alphaV.glsl | 29 +++++++++--------- .../shaders/class2/deferred/avatarAlphaV.glsl | 25 +++++++++------- .../shaders/class2/deferred/edgeF.glsl | 2 +- .../shaders/class2/deferred/edgeMSF.glsl | 2 +- .../shaders/class2/deferred/edgeV.glsl | 4 +-- .../shaders/class2/deferred/multiSpotLightF.glsl | 2 +- .../shaders/class2/deferred/multiSpotLightMSF.glsl | 14 +++++---- .../shaders/class2/deferred/softenLightF.glsl | 2 +- .../shaders/class2/deferred/softenLightMSF.glsl | 4 +-- .../shaders/class2/deferred/softenLightV.glsl | 4 +-- .../shaders/class2/deferred/spotLightF.glsl | 14 +++++---- .../shaders/class2/deferred/spotLightMSF.glsl | 14 +++++---- .../shaders/class2/deferred/sunLightF.glsl | 12 ++++---- .../shaders/class2/deferred/sunLightMSF.glsl | 14 ++++----- .../shaders/class2/deferred/sunLightSSAOF.glsl | 12 ++++---- .../shaders/class2/deferred/sunLightSSAOMSF.glsl | 14 ++++----- .../shaders/class2/deferred/sunLightV.glsl | 4 +-- .../app_settings/shaders/class2/effects/blurF.glsl | 26 +---------------- .../app_settings/shaders/class2/effects/blurV.glsl | 33 +-------------------- .../shaders/class2/effects/colorFilterF.glsl | 2 +- .../shaders/class2/effects/drawQuadV.glsl | 10 +++---- .../shaders/class2/effects/extractF.glsl | 2 +- .../shaders/class2/effects/nightVisionF.glsl | 7 +++-- .../shaders/class2/effects/simpleF.glsl | 4 ++- .../shaders/class2/environment/terrainF.glsl | 19 +++++++----- .../shaders/class2/environment/terrainV.glsl | 26 ++++++++++------- .../shaders/class2/environment/terrainWaterF.glsl | 20 +++++++------ .../shaders/class2/environment/underWaterF.glsl | 6 ++-- .../shaders/class2/environment/waterF.glsl | 6 ++-- .../shaders/class2/lighting/lightAlphaMaskF.glsl | 5 +++- .../class2/lighting/lightAlphaMaskNonIndexedF.glsl | 5 +++- .../shaders/class2/lighting/lightF.glsl | 5 ++-- .../class2/lighting/lightFullbrightAlphaMaskF.glsl | 5 +++- .../shaders/class2/lighting/lightFullbrightF.glsl | 5 ++-- .../lightFullbrightNonIndexedAlphaMaskF.glsl | 5 +++- .../lighting/lightFullbrightNonIndexedF.glsl | 5 ++-- .../class2/lighting/lightFullbrightShinyF.glsl | 14 +++++---- .../lighting/lightFullbrightShinyNonIndexedF.glsl | 14 +++++---- .../lighting/lightFullbrightShinyWaterF.glsl | 14 +++++---- .../lightFullbrightShinyWaterNonIndexedF.glsl | 14 +++++---- .../lighting/lightFullbrightWaterAlphaMaskF.glsl | 5 +++- .../class2/lighting/lightFullbrightWaterF.glsl | 5 ++-- .../lightFullbrightWaterNonIndexedAlphaMaskF.glsl | 5 +++- .../lighting/lightFullbrightWaterNonIndexedF.glsl | 4 ++- .../shaders/class2/lighting/lightNonIndexedF.glsl | 5 ++-- .../shaders/class2/lighting/lightShinyF.glsl | 14 +++++---- .../class2/lighting/lightShinyNonIndexedF.glsl | 15 +++++----- .../shaders/class2/lighting/lightShinyWaterF.glsl | 14 +++++---- .../lighting/lightShinyWaterNonIndexedF.glsl | 14 +++++---- .../class2/lighting/lightWaterAlphaMaskF.glsl | 5 +++- .../lighting/lightWaterAlphaMaskNonIndexedF.glsl | 5 +++- .../shaders/class2/lighting/lightWaterF.glsl | 4 ++- .../class2/lighting/lightWaterNonIndexedF.glsl | 4 ++- .../shaders/class2/objects/fullbrightShinyV.glsl | 23 +++++++++------ .../shaders/class2/objects/fullbrightV.glsl | 19 +++++++----- .../shaders/class2/objects/shinyV.glsl | 23 +++++++++------ .../shaders/class2/objects/simpleNonIndexedV.glsl | 18 +++++++----- .../shaders/class2/objects/simpleV.glsl | 19 +++++++----- .../shaders/class2/windlight/atmosphericsV.glsl | 6 ++-- .../class2/windlight/atmosphericsVarsF.glsl | 10 +++---- .../class2/windlight/atmosphericsVarsV.glsl | 10 +++---- .../shaders/class2/windlight/cloudsF.glsl | 18 +++++++----- .../shaders/class2/windlight/cloudsV.glsl | 34 ++++++++++++---------- .../shaders/class2/windlight/skyF.glsl | 2 +- .../shaders/class2/windlight/skyV.glsl | 9 +++--- 70 files changed, 457 insertions(+), 373 deletions(-) (limited to 'indra/newview/app_settings/shaders/class2') diff --git a/indra/newview/app_settings/shaders/class2/avatar/eyeballV.glsl b/indra/newview/app_settings/shaders/class2/avatar/eyeballV.glsl index 43e19909d4..04d3e2aa1f 100644 --- a/indra/newview/app_settings/shaders/class2/avatar/eyeballV.glsl +++ b/indra/newview/app_settings/shaders/class2/avatar/eyeballV.glsl @@ -28,10 +28,14 @@ uniform mat4 texture_matrix0; uniform mat4 modelview_matrix; uniform mat4 modelview_projection_matrix; -attribute vec3 position; -attribute vec4 diffuse_color; -attribute vec3 normal; -attribute vec2 texcoord0; +ATTRIBUTE vec3 position; +ATTRIBUTE vec4 diffuse_color; +ATTRIBUTE vec3 normal; +ATTRIBUTE vec2 texcoord0; + +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; +VARYING float fog_depth; vec4 calcLightingSpecular(vec3 pos, vec3 norm, vec4 color, inout vec4 specularColor, vec4 baseCol); void calcAtmospherics(vec3 inPositionEye); @@ -41,7 +45,7 @@ void main() //transform vertex vec3 pos = (modelview_matrix * vec4(position.xyz, 1.0)).xyz; gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); - gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1); + vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy; vec3 norm = normalize(normal_matrix * normal); @@ -51,8 +55,8 @@ void main() vec4 specular = vec4(1.0); vec4 color = calcLightingSpecular(pos, norm, diffuse_color, specular, vec4(0.0)); - gl_FrontColor = color; - gl_FogFragCoord = pos.z; + vertex_color = color; + fog_depth = pos.z; } diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl index 839606cdcb..4fffb9e97f 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl @@ -27,6 +27,9 @@ #extension GL_ARB_texture_rectangle : enable +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; + uniform sampler2DRectShadow shadowMap0; uniform sampler2DRectShadow shadowMap1; uniform sampler2DRectShadow shadowMap2; @@ -41,11 +44,11 @@ uniform vec2 shadow_res; vec3 atmosLighting(vec3 light); vec3 scaleSoftClip(vec3 light); -varying vec3 vary_ambient; -varying vec3 vary_directional; -varying vec3 vary_fragcoord; -varying vec3 vary_position; -varying vec3 vary_pointlight_col; +VARYING vec3 vary_ambient; +VARYING vec3 vary_directional; +VARYING vec3 vary_fragcoord; +VARYING vec3 vary_position; +VARYING vec3 vary_pointlight_col; uniform float shadow_bias; @@ -122,9 +125,9 @@ void main() } } - vec4 diff = diffuseLookup(gl_TexCoord[0].xy); + vec4 diff = diffuseLookup(vary_texcoord0.xy); - vec4 col = vec4(vary_ambient + vary_directional.rgb*shadow, gl_Color.a); + vec4 col = vec4(vary_ambient + vary_directional.rgb*shadow, vertex_color.a); vec4 color = diff * col; color.rgb = atmosLighting(color.rgb); @@ -133,7 +136,7 @@ void main() color.rgb += diff.rgb * vary_pointlight_col.rgb; - //gl_FragColor = gl_Color; + //gl_FragColor = vertex_color; gl_FragColor = color; //gl_FragColor.r = 0.0; //gl_FragColor = vec4(1,shadow,1,1); diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedF.glsl index 84e49a5f8f..30aa82473a 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedF.glsl @@ -42,11 +42,13 @@ uniform vec2 shadow_res; vec3 atmosLighting(vec3 light); vec3 scaleSoftClip(vec3 light); -varying vec3 vary_ambient; -varying vec3 vary_directional; -varying vec3 vary_fragcoord; -varying vec3 vary_position; -varying vec3 vary_pointlight_col; +VARYING vec3 vary_ambient; +VARYING vec3 vary_directional; +VARYING vec3 vary_fragcoord; +VARYING vec3 vary_position; +VARYING vec3 vary_pointlight_col; +VARYING vec2 vary_texcoord0; +VARYING vec4 vertex_color; uniform float shadow_bias; @@ -123,9 +125,9 @@ void main() } } - vec4 diff = texture2D(diffuseMap,gl_TexCoord[0].xy); + vec4 diff = texture2D(diffuseMap,vary_texcoord0.xy); - vec4 col = vec4(vary_ambient + vary_directional.rgb*shadow, gl_Color.a); + vec4 col = vec4(vary_ambient + vary_directional.rgb*shadow, vertex_color.a); vec4 color = diff * col; color.rgb = atmosLighting(color.rgb); @@ -134,7 +136,7 @@ void main() color.rgb += diff.rgb * vary_pointlight_col.rgb; - //gl_FragColor = gl_Color; + //gl_FragColor = vertex_color; gl_FragColor = color; //gl_FragColor.r = 0.0; //gl_FragColor = vec4(1,shadow,1,1); diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedNoColorF.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedNoColorF.glsl index 294a000ab5..9370b484b8 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedNoColorF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedNoColorF.glsl @@ -1,7 +1,25 @@ /** * @file alphaNonIndexedNoColorF.glsl * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * $LicenseInfo:firstyear=2005&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2005, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ @@ -24,11 +42,12 @@ uniform vec2 shadow_res; vec3 atmosLighting(vec3 light); vec3 scaleSoftClip(vec3 light); -varying vec3 vary_ambient; -varying vec3 vary_directional; -varying vec3 vary_fragcoord; -varying vec3 vary_position; -varying vec3 vary_pointlight_col; +VARYING vec3 vary_ambient; +VARYING vec3 vary_directional; +VARYING vec3 vary_fragcoord; +VARYING vec3 vary_position; +VARYING vec3 vary_pointlight_col; +VARYING vec2 vary_texcoord0; uniform float shadow_bias; @@ -105,7 +124,7 @@ void main() } } - vec4 diff = texture2D(diffuseMap,gl_TexCoord[0].xy); + vec4 diff = texture2D(diffuseMap,vary_texcoord0.xy); vec4 col = vec4(vary_ambient + vary_directional.rgb*shadow, 1.0); vec4 color = diff * col; diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaSkinnedV.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaSkinnedV.glsl index c3148d5fdf..ad353eb624 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/alphaSkinnedV.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/alphaSkinnedV.glsl @@ -27,10 +27,10 @@ uniform mat4 texture_matrix0; uniform mat4 modelview_matrix; uniform mat4 modelview_projection_matrix; -attribute vec3 position; -attribute vec3 normal; -attribute vec4 diffuse_color; -attribute vec2 texcoord0; +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); @@ -42,11 +42,15 @@ vec3 atmosAffectDirectionalLight(float lightIntensity); vec3 scaleDownLight(vec3 light); vec3 scaleUpLight(vec3 light); -varying vec3 vary_ambient; -varying vec3 vary_directional; -varying vec3 vary_fragcoord; -varying vec3 vary_position; -varying vec3 vary_pointlight_col; +VARYING vec3 vary_ambient; +VARYING vec3 vary_directional; +VARYING vec3 vary_fragcoord; +VARYING vec3 vary_position; +VARYING vec3 vary_pointlight_col; + +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; +VARYING float fog_depth; uniform float near_clip; uniform float shadow_offset; @@ -89,7 +93,7 @@ float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, floa void main() { - gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1); + vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy; mat4 mat = getObjectSkinnedTransform(); @@ -134,9 +138,9 @@ void main() col.rgb = min(col.rgb*diffuse_color.rgb, 1.0); - gl_FrontColor = col; + vertex_color = col; - gl_FogFragCoord = pos.z; + fog_depth = pos.z; pos.xyz = (modelview_projection_matrix * 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 8d55616e67..268e4127a2 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl @@ -28,10 +28,10 @@ uniform mat4 texture_matrix0; uniform mat4 modelview_matrix; uniform mat4 modelview_projection_matrix; -attribute vec4 position; -attribute vec3 normal; -attribute vec4 diffuse_color; -attribute vec2 texcoord0; +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); @@ -43,12 +43,15 @@ vec3 atmosAffectDirectionalLight(float lightIntensity); vec3 scaleDownLight(vec3 light); vec3 scaleUpLight(vec3 light); -varying vec3 vary_ambient; -varying vec3 vary_directional; -varying vec3 vary_fragcoord; -varying vec3 vary_position; -varying vec3 vary_pointlight_col; -varying float vary_texture_index; +VARYING vec3 vary_ambient; +VARYING vec3 vary_directional; +VARYING vec3 vary_fragcoord; +VARYING vec3 vary_position; +VARYING vec3 vary_pointlight_col; +VARYING float vary_texture_index; +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; +VARYING float fog_depth; uniform float near_clip; uniform float shadow_offset; @@ -97,7 +100,7 @@ void main() vec4 pos = (modelview_matrix * vert); gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0); - gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1); + vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy; vec3 norm = normalize(normal_matrix * normal); @@ -130,9 +133,9 @@ void main() col.rgb = col.rgb*diffuse_color.rgb; - gl_FrontColor = col; + vertex_color = col; - gl_FogFragCoord = pos.z; + fog_depth = pos.z; pos = modelview_projection_matrix * vert; vary_fragcoord.xyz = pos.xyz + vec3(0,0,near_clip); diff --git a/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl b/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl index 0273f3c121..091a865160 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl @@ -25,9 +25,9 @@ uniform mat4 projection_matrix; -attribute vec3 position; -attribute vec3 normal; -attribute vec2 texcoord0; +ATTRIBUTE vec3 position; +ATTRIBUTE vec3 normal; +ATTRIBUTE vec2 texcoord0; vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol); mat4 getSkinnedTransform(); @@ -41,11 +41,14 @@ vec3 atmosAffectDirectionalLight(float lightIntensity); vec3 scaleDownLight(vec3 light); vec3 scaleUpLight(vec3 light); -varying vec3 vary_position; -varying vec3 vary_ambient; -varying vec3 vary_directional; -varying vec3 vary_fragcoord; -varying vec3 vary_pointlight_col; +VARYING vec3 vary_position; +VARYING vec3 vary_ambient; +VARYING vec3 vary_directional; +VARYING vec3 vary_fragcoord; +VARYING vec3 vary_pointlight_col; +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; +VARYING float fog_depth; uniform float near_clip; uniform float shadow_offset; @@ -88,7 +91,7 @@ float calcPointLightOrSpotLight(vec3 v, vec3 n, vec4 lp, vec3 ln, float la, floa void main() { - gl_TexCoord[0] = vec4(texcoord0,0,1); + vary_texcoord0 = texcoord0; vec4 pos; vec3 norm; @@ -134,9 +137,9 @@ void main() col.rgb = min(col.rgb, 1.0); - gl_FrontColor = col; + vertex_color = col; - gl_FogFragCoord = pos.z; + fog_depth = pos.z; vary_fragcoord.xyz = pos.xyz + vec3(0,0,near_clip); } diff --git a/indra/newview/app_settings/shaders/class2/deferred/edgeF.glsl b/indra/newview/app_settings/shaders/class2/deferred/edgeF.glsl index d9eafb6eba..4fc6c00caf 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/edgeF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/edgeF.glsl @@ -30,7 +30,7 @@ uniform sampler2DRect depthMap; uniform sampler2DRect normalMap; -varying vec2 vary_fragcoord; +VARYING vec2 vary_fragcoord; uniform float depth_cutoff; uniform float norm_cutoff; diff --git a/indra/newview/app_settings/shaders/class2/deferred/edgeMSF.glsl b/indra/newview/app_settings/shaders/class2/deferred/edgeMSF.glsl index a84fdd5dc1..11a7cf846d 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/edgeMSF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/edgeMSF.glsl @@ -31,7 +31,7 @@ uniform sampler2DMS depthMap; uniform sampler2DMS normalMap; -varying vec2 vary_fragcoord; +VARYING vec2 vary_fragcoord; uniform float depth_cutoff; uniform float norm_cutoff; diff --git a/indra/newview/app_settings/shaders/class2/deferred/edgeV.glsl b/indra/newview/app_settings/shaders/class2/deferred/edgeV.glsl index 1f5470db3c..69c6acc07a 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/edgeV.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/edgeV.glsl @@ -25,9 +25,9 @@ uniform mat4 modelview_projection_matrix; -attribute vec3 position; +ATTRIBUTE vec3 position; -varying vec2 vary_fragcoord; +VARYING vec2 vary_fragcoord; uniform vec2 screen_res; void main() diff --git a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl index 4c92d72f44..d1f2db6188 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl @@ -59,7 +59,7 @@ uniform float size; uniform vec3 color; uniform float falloff; -varying vec4 vary_fragcoord; +VARYING vec4 vary_fragcoord; uniform vec2 screen_res; uniform mat4 inv_proj; diff --git a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightMSF.glsl b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightMSF.glsl index 1afa9a9fb4..74f78cfc06 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightMSF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightMSF.glsl @@ -28,6 +28,8 @@ #extension GL_ARB_texture_rectangle : enable #extension GL_ARB_texture_multisample : enable +VARYING vec4 vertex_color; + uniform sampler2DMS diffuseRect; uniform sampler2DMS specularRect; uniform sampler2DMS depthMap; @@ -54,9 +56,9 @@ uniform float sun_wash; uniform int proj_shadow_idx; uniform float shadow_fade; -varying vec4 vary_light; +VARYING vec4 vary_light; -varying vec4 vary_fragcoord; +VARYING vec4 vary_fragcoord; uniform vec2 screen_res; uniform mat4 inv_proj; @@ -160,7 +162,7 @@ void main() { proj_tc.xyz /= proj_tc.w; - float fa = gl_Color.a+1.0; + float fa = vertex_color.a+1.0; float dist_atten = min(1.0-(dist2-1.0*(1.0-fa))/fa, 1.0); if (dist_atten > 0.0) { @@ -189,7 +191,7 @@ void main() vec4 plcol = texture2DLodDiffuse(projectionMap, proj_tc.xy, lod); - vec3 lcol = gl_Color.rgb * plcol.rgb * plcol.a; + vec3 lcol = vertex_color.rgb * plcol.rgb * plcol.a; lit = da * dist_atten * noise; @@ -206,7 +208,7 @@ void main() amb_da = min(amb_da, 1.0-lit); - col += amb_da*gl_Color.rgb*diff_tex.rgb*amb_plcol.rgb*amb_plcol.a; + col += amb_da*vertex_color.rgb*diff_tex.rgb*amb_plcol.rgb*amb_plcol.a; } @@ -239,7 +241,7 @@ void main() stc.y > 0.0) { vec4 scol = texture2DLodSpecular(projectionMap, stc.xy, proj_lod-spec.a*proj_lod); - col += dist_atten*scol.rgb*gl_Color.rgb*scol.a*spec.rgb*shadow; + col += dist_atten*scol.rgb*vertex_color.rgb*scol.a*spec.rgb*shadow; } } } diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl index 22f52032a5..e9f1a3d3a5 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl @@ -67,7 +67,7 @@ uniform vec2 screen_res; uniform vec3 sun_dir; -varying vec2 vary_fragcoord; +VARYING vec2 vary_fragcoord; vec3 vary_PositionEye; diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightMSF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightMSF.glsl index 1244294451..6b979b13ed 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/softenLightMSF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightMSF.glsl @@ -66,8 +66,8 @@ uniform mat3 ssao_effect_mat; uniform mat4 inv_proj; uniform vec2 screen_res; -varying vec4 vary_light; -varying vec2 vary_fragcoord; +VARYING vec4 vary_light; +VARYING vec2 vary_fragcoord; vec3 vary_PositionEye; diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightV.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightV.glsl index 424299269f..c840d72784 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/softenLightV.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightV.glsl @@ -25,11 +25,11 @@ uniform mat4 modelview_projection_matrix; -attribute vec3 position; +ATTRIBUTE vec3 position; uniform vec2 screen_res; -varying vec2 vary_fragcoord; +VARYING vec2 vary_fragcoord; void main() { diff --git a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl index 25270f4939..19a1d1f165 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl @@ -27,6 +27,8 @@ #extension GL_ARB_texture_rectangle : enable +VARYING vec4 vertex_color; + uniform sampler2DRect diffuseRect; uniform sampler2DRect specularRect; uniform sampler2DRect depthMap; @@ -53,9 +55,9 @@ uniform float sun_wash; uniform int proj_shadow_idx; uniform float shadow_fade; -varying vec4 vary_light; +VARYING vec4 vary_light; -varying vec4 vary_fragcoord; +VARYING vec4 vary_fragcoord; uniform vec2 screen_res; uniform mat4 inv_proj; @@ -114,7 +116,7 @@ void main() proj_tc.xyz /= proj_tc.w; - float fa = gl_Color.a+1.0; + float fa = vertex_color.a+1.0; float dist_atten = clamp(1.0-(dist2-1.0*(1.0-fa))/fa, 0.0, 1.0); lv = proj_origin-pos.xyz; @@ -140,7 +142,7 @@ void main() vec4 plcol = texture2DLod(projectionMap, proj_tc.xy, lod); - vec3 lcol = gl_Color.rgb * plcol.rgb * plcol.a; + vec3 lcol = vertex_color.rgb * plcol.rgb * plcol.a; lit = da * dist_atten * noise; @@ -163,7 +165,7 @@ void main() amb_da = min(amb_da, 1.0-lit); - col += amb_da*gl_Color.rgb*diff_tex.rgb*amb_plcol.rgb*amb_plcol.a; + col += amb_da*vertex_color.rgb*diff_tex.rgb*amb_plcol.rgb*amb_plcol.a; } @@ -192,7 +194,7 @@ void main() stc.y > 0.0) { vec4 scol = texture2DLod(projectionMap, stc.xy, proj_lod-spec.a*proj_lod); - col += dist_atten*scol.rgb*gl_Color.rgb*scol.a*spec.rgb*shadow; + col += dist_atten*scol.rgb*vertex_color.rgb*scol.a*spec.rgb*shadow; } } } diff --git a/indra/newview/app_settings/shaders/class2/deferred/spotLightMSF.glsl b/indra/newview/app_settings/shaders/class2/deferred/spotLightMSF.glsl index 4962e73e39..85fea56411 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/spotLightMSF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/spotLightMSF.glsl @@ -28,6 +28,8 @@ #extension GL_ARB_texture_rectangle : enable #extension GL_ARB_texture_multisample : enable +VARYING vec4 vertex_color; + uniform sampler2DMS diffuseRect; uniform sampler2DMS specularRect; uniform sampler2DMS depthMap; @@ -54,9 +56,9 @@ uniform float sun_wash; uniform int proj_shadow_idx; uniform float shadow_fade; -varying vec4 vary_light; +VARYING vec4 vary_light; -varying vec4 vary_fragcoord; +VARYING vec4 vary_fragcoord; uniform vec2 screen_res; uniform mat4 inv_proj; @@ -161,7 +163,7 @@ void main() { proj_tc.xyz /= proj_tc.w; - float fa = gl_Color.a+1.0; + float fa = vertex_color.a+1.0; float dist_atten = min(1.0-(dist2-1.0*(1.0-fa))/fa, 1.0); if (dist_atten > 0.0) { @@ -190,7 +192,7 @@ void main() vec4 plcol = texture2DLodDiffuse(projectionMap, proj_tc.xy, lod); - vec3 lcol = gl_Color.rgb * plcol.rgb * plcol.a; + vec3 lcol = vertex_color.rgb * plcol.rgb * plcol.a; lit = da * dist_atten * noise; @@ -207,7 +209,7 @@ void main() amb_da = min(amb_da, 1.0-lit); - col += amb_da*gl_Color.rgb*diff_tex.rgb*amb_plcol.rgb*amb_plcol.a; + col += amb_da*vertex_color.rgb*diff_tex.rgb*amb_plcol.rgb*amb_plcol.a; } @@ -240,7 +242,7 @@ void main() stc.y > 0.0) { vec4 scol = texture2DLodSpecular(projectionMap, stc.xy, proj_lod-spec.a*proj_lod); - col += dist_atten*scol.rgb*gl_Color.rgb*scol.a*spec.rgb*shadow; + col += dist_atten*scol.rgb*vertex_color.rgb*scol.a*spec.rgb*shadow; } } } diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl index 146fac56e9..bb742adb62 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl @@ -47,7 +47,7 @@ uniform float ssao_max_radius; uniform float ssao_factor; uniform float ssao_factor_inv; -varying vec2 vary_fragcoord; +VARYING vec2 vary_fragcoord; uniform mat4 inv_proj; uniform vec2 screen_res; @@ -97,15 +97,15 @@ float pcfShadow(sampler2DShadow shadowMap, vec4 stc, float scl) stc.xyz /= stc.w; stc.z += spot_shadow_bias*scl; - float cs = shadow2D(shadowMap, stc.xyz).x; + float cs = shadow2D(shadowMap, stc.xyz); float shadow = cs; vec2 off = 1.5/proj_shadow_res; - shadow += max(shadow2D(shadowMap, stc.xyz+vec3(off.x, off.y, 0.0)).x, cs); - shadow += max(shadow2D(shadowMap, stc.xyz+vec3(off.x, -off.y, 0.0)).x, cs); - shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, off.y, 0.0)).x, cs); - shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, -off.y, 0.0)).x, cs); + shadow += max(shadow2D(shadowMap, stc.xyz+vec3(off.x, off.y, 0.0)), cs); + shadow += max(shadow2D(shadowMap, stc.xyz+vec3(off.x, -off.y, 0.0)), cs); + shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, off.y, 0.0)), cs); + shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, -off.y, 0.0)), cs); return shadow/5.0; diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightMSF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightMSF.glsl index ac4fe52655..4933eb00b7 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/sunLightMSF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightMSF.glsl @@ -48,8 +48,8 @@ uniform float ssao_max_radius; uniform float ssao_factor; uniform float ssao_factor_inv; -varying vec2 vary_fragcoord; -varying vec4 vary_light; +VARYING vec2 vary_fragcoord; +VARYING vec4 vary_light; uniform mat4 inv_proj; uniform vec2 screen_res; @@ -98,15 +98,15 @@ float pcfShadow(sampler2DShadow shadowMap, vec4 stc, float scl) stc.xyz /= stc.w; stc.z += spot_shadow_bias*scl; - float cs = shadow2D(shadowMap, stc.xyz).x; + float cs = shadow2D(shadowMap, stc.xyz); float shadow = cs; vec2 off = 1.5/proj_shadow_res; - shadow += max(shadow2D(shadowMap, stc.xyz+vec3(off.x, off.y, 0.0)).x, cs); - shadow += max(shadow2D(shadowMap, stc.xyz+vec3(off.x, -off.y, 0.0)).x, cs); - shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, off.y, 0.0)).x, cs); - shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, -off.y, 0.0)).x, cs); + shadow += max(shadow2D(shadowMap, stc.xyz+vec3(off.x, off.y, 0.0)), cs); + shadow += max(shadow2D(shadowMap, stc.xyz+vec3(off.x, -off.y, 0.0)), cs); + shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, off.y, 0.0)), cs); + shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, -off.y, 0.0)), cs); return shadow/5.0; diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl index 60741771d6..042bb5f96c 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl @@ -46,7 +46,7 @@ uniform float ssao_max_radius; uniform float ssao_factor; uniform float ssao_factor_inv; -varying vec2 vary_fragcoord; +VARYING vec2 vary_fragcoord; uniform vec3 sun_dir; uniform mat4 inv_proj; @@ -148,15 +148,15 @@ float pcfShadow(sampler2DShadow shadowMap, vec4 stc, float scl) stc.xyz /= stc.w; stc.z += spot_shadow_bias*scl; - float cs = shadow2D(shadowMap, stc.xyz).x; + float cs = shadow2D(shadowMap, stc.xyz); float shadow = cs; vec2 off = 1.5/proj_shadow_res; - shadow += max(shadow2D(shadowMap, stc.xyz+vec3(off.x, off.y, 0.0)).x, cs); - shadow += max(shadow2D(shadowMap, stc.xyz+vec3(off.x, -off.y, 0.0)).x, cs); - shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, off.y, 0.0)).x, cs); - shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, -off.y, 0.0)).x, cs); + shadow += max(shadow2D(shadowMap, stc.xyz+vec3(off.x, off.y, 0.0)), cs); + shadow += max(shadow2D(shadowMap, stc.xyz+vec3(off.x, -off.y, 0.0)), cs); + shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, off.y, 0.0)), cs); + shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, -off.y, 0.0)), cs); return shadow/5.0; diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOMSF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOMSF.glsl index 0fd7b7525d..e138ae5841 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOMSF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOMSF.glsl @@ -47,8 +47,8 @@ uniform float ssao_max_radius; uniform float ssao_factor; uniform float ssao_factor_inv; -varying vec2 vary_fragcoord; -varying vec4 vary_light; +VARYING vec2 vary_fragcoord; +VARYING vec4 vary_light; uniform mat4 inv_proj; uniform vec2 screen_res; @@ -149,15 +149,15 @@ float pcfShadow(sampler2DShadow shadowMap, vec4 stc, float scl) stc.xyz /= stc.w; stc.z += spot_shadow_bias*scl; - float cs = shadow2D(shadowMap, stc.xyz).x; + float cs = shadow2D(shadowMap, stc.xyz); float shadow = cs; vec2 off = 1.5/proj_shadow_res; - shadow += max(shadow2D(shadowMap, stc.xyz+vec3(off.x, off.y, 0.0)).x, cs); - shadow += max(shadow2D(shadowMap, stc.xyz+vec3(off.x, -off.y, 0.0)).x, cs); - shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, off.y, 0.0)).x, cs); - shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, -off.y, 0.0)).x, cs); + shadow += max(shadow2D(shadowMap, stc.xyz+vec3(off.x, off.y, 0.0)), cs); + shadow += max(shadow2D(shadowMap, stc.xyz+vec3(off.x, -off.y, 0.0)), cs); + shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, off.y, 0.0)), cs); + shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, -off.y, 0.0)), cs); return shadow/5.0; diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightV.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightV.glsl index 60ba2d7ad4..bc5eb5181d 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/sunLightV.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightV.glsl @@ -25,9 +25,9 @@ uniform mat4 modelview_projection_matrix; -attribute vec3 position; +ATTRIBUTE vec3 position; -varying vec2 vary_fragcoord; +VARYING vec2 vary_fragcoord; uniform vec2 screen_res; diff --git a/indra/newview/app_settings/shaders/class2/effects/blurF.glsl b/indra/newview/app_settings/shaders/class2/effects/blurF.glsl index 35411db04b..01fe4a4e14 100644 --- a/indra/newview/app_settings/shaders/class2/effects/blurF.glsl +++ b/indra/newview/app_settings/shaders/class2/effects/blurF.glsl @@ -23,29 +23,5 @@ * $/LicenseInfo$ */ +//NOT USED!!! - -uniform sampler2DRect RenderTexture; -uniform float bloomStrength; - -varying vec4 gl_TexCoord[gl_MaxTextureCoords]; -void main(void) -{ - float blurWeights[7]; - blurWeights[0] = 0.05; - blurWeights[1] = 0.1; - blurWeights[2] = 0.2; - blurWeights[3] = 0.3; - blurWeights[4] = 0.2; - blurWeights[5] = 0.1; - blurWeights[6] = 0.05; - - vec3 color = vec3(0,0,0); - for (int i = 0; i < 7; i++){ - color += vec3(texture2DRect(RenderTexture, gl_TexCoord[i].st)) * blurWeights[i]; - } - - color *= bloomStrength; - - gl_FragColor = vec4(color, 1.0); -} diff --git a/indra/newview/app_settings/shaders/class2/effects/blurV.glsl b/indra/newview/app_settings/shaders/class2/effects/blurV.glsl index 4fd4b101ff..b92e9b3f03 100644 --- a/indra/newview/app_settings/shaders/class2/effects/blurV.glsl +++ b/indra/newview/app_settings/shaders/class2/effects/blurV.glsl @@ -23,36 +23,5 @@ * $/LicenseInfo$ */ -uniform mat4 modelview_projection_matrix; + // NOT USED!! -attribute vec3 position; -attribute vec2 texcoord0; - -uniform vec2 texelSize; -uniform vec2 blurDirection; -uniform float blurWidth; - -void main(void) -{ - // Transform vertex - gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); - - vec2 blurDelta = texelSize * blurDirection * vec2(blurWidth, blurWidth); - vec2 s = vec4(texcoord0,0,1).st - (blurDelta * 3.0); - - // for (int i = 0; i < 7; i++) { - // gl_TexCoord[i].st = s + (i * blurDelta); - // } - - // MANUALLY UNROLL - gl_TexCoord[0].st = s; - gl_TexCoord[1].st = s + blurDelta; - gl_TexCoord[2].st = s + (2. * blurDelta); - gl_TexCoord[3].st = s + (3. * blurDelta); - gl_TexCoord[4].st = s + (4. * blurDelta); - gl_TexCoord[5].st = s + (5. * blurDelta); - gl_TexCoord[6].st = s + (6. * blurDelta); - - // gl_TexCoord[0].st = s; - // gl_TexCoord[1].st = blurDelta; -} diff --git a/indra/newview/app_settings/shaders/class2/effects/colorFilterF.glsl b/indra/newview/app_settings/shaders/class2/effects/colorFilterF.glsl index 42ab8d40e8..8d673237b8 100644 --- a/indra/newview/app_settings/shaders/class2/effects/colorFilterF.glsl +++ b/indra/newview/app_settings/shaders/class2/effects/colorFilterF.glsl @@ -36,7 +36,7 @@ const float gamma = 2.0; void main(void) { - vec3 color = vec3(texture2DRect(RenderTexture, gl_TexCoord[0].st)); + vec3 color = vec3(texture2DRect(RenderTexture, vary_texcoord0.st)); /// Modulate brightness color *= brightness; diff --git a/indra/newview/app_settings/shaders/class2/effects/drawQuadV.glsl b/indra/newview/app_settings/shaders/class2/effects/drawQuadV.glsl index d3c93ab05f..f03a6076c0 100644 --- a/indra/newview/app_settings/shaders/class2/effects/drawQuadV.glsl +++ b/indra/newview/app_settings/shaders/class2/effects/drawQuadV.glsl @@ -25,15 +25,15 @@ uniform mat4 modelview_projection_matrix; -attribute vec3 position; -attribute vec2 texcoord0; -attribute vec2 texcoord1; +ATTRIBUTE vec3 position; +ATTRIBUTE vec2 texcoord0; +ATTRIBUTE vec2 texcoord1; void main(void) { //transform vertex gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); - gl_TexCoord[0] = vec4(texcoord0,0,1); - gl_TexCoord[1] = vec4(texcoord1,0,1); + vary_texcoord0 = texcoord0; + vary_texcoord1 = texcoord1; } diff --git a/indra/newview/app_settings/shaders/class2/effects/extractF.glsl b/indra/newview/app_settings/shaders/class2/effects/extractF.glsl index 9187c8ec31..06b83e3f5f 100644 --- a/indra/newview/app_settings/shaders/class2/effects/extractF.glsl +++ b/indra/newview/app_settings/shaders/class2/effects/extractF.glsl @@ -33,7 +33,7 @@ uniform vec3 lumWeights; void main(void) { /// Get scene color - vec3 color = vec3(texture2DRect(RenderTexture, gl_TexCoord[0].st)); + vec3 color = vec3(texture2DRect(RenderTexture, vary_texcoord0.st)); /// Extract luminance and scale up by night vision brightness float lum = smoothstep(extractLow, extractHigh, dot(color, lumWeights)); diff --git a/indra/newview/app_settings/shaders/class2/effects/nightVisionF.glsl b/indra/newview/app_settings/shaders/class2/effects/nightVisionF.glsl index 76b675a9bd..3050fa63cc 100644 --- a/indra/newview/app_settings/shaders/class2/effects/nightVisionF.glsl +++ b/indra/newview/app_settings/shaders/class2/effects/nightVisionF.glsl @@ -30,6 +30,9 @@ uniform sampler2D NoiseTexture; uniform float brightMult; uniform float noiseStrength; +VARYING vec2 vary_texcoord0; +VARYING vec2 vary_texcoord1; + float luminance(vec3 color) { /// CALCULATING LUMINANCE (Using NTSC lum weights) @@ -40,7 +43,7 @@ float luminance(vec3 color) void main(void) { /// Get scene color - vec3 color = vec3(texture2DRect(RenderTexture, gl_TexCoord[0].st)); + vec3 color = vec3(texture2DRect(RenderTexture, vary_texcoord0.st)); /// Extract luminance and scale up by night vision brightness float lum = luminance(color) * brightMult; @@ -50,7 +53,7 @@ void main(void) vec3 outColor = (lum * vec3(0.91, 1.21, 0.9)) + vec3(-0.07, 0.1, -0.12); /// Add noise - float noiseValue = texture2D(NoiseTexture, gl_TexCoord[1].st).r; + float noiseValue = texture2D(NoiseTexture, vary_texcoord1.st).r; noiseValue = (noiseValue - 0.5) * noiseStrength; /// Older NVG colors (more muted) diff --git a/indra/newview/app_settings/shaders/class2/effects/simpleF.glsl b/indra/newview/app_settings/shaders/class2/effects/simpleF.glsl index abf1be6645..74e9559185 100644 --- a/indra/newview/app_settings/shaders/class2/effects/simpleF.glsl +++ b/indra/newview/app_settings/shaders/class2/effects/simpleF.glsl @@ -27,8 +27,10 @@ uniform sampler2DRect RenderTexture; +VARYING vec2 vary_texcoord0; + void main(void) { - vec3 color = vec3(texture2DRect(RenderTexture, gl_TexCoord[0].st)); + vec3 color = vec3(texture2DRect(RenderTexture, vary_texcoord0.st)); gl_FragColor = vec4(1.0 - color, 1.0); } diff --git a/indra/newview/app_settings/shaders/class2/environment/terrainF.glsl b/indra/newview/app_settings/shaders/class2/environment/terrainF.glsl index df08fce0da..6b9c629644 100644 --- a/indra/newview/app_settings/shaders/class2/environment/terrainF.glsl +++ b/indra/newview/app_settings/shaders/class2/environment/terrainF.glsl @@ -24,6 +24,9 @@ */ +VARYING vec4 vertex_color; +VARYING vec4 vary_texcoord0; +VARYING vec4 vary_texcoord1; uniform sampler2D detail_0; uniform sampler2D detail_1; @@ -40,18 +43,18 @@ void main() /// Note: This should duplicate the blending functionality currently used for the terrain rendering. /// TODO Confirm tex coords and bind them appropriately in vert shader. - vec4 color0 = texture2D(detail_0, gl_TexCoord[0].xy); - vec4 color1 = texture2D(detail_1, gl_TexCoord[0].xy); - vec4 color2 = texture2D(detail_2, gl_TexCoord[0].xy); - vec4 color3 = texture2D(detail_3, gl_TexCoord[0].xy); + vec4 color0 = texture2D(detail_0, vary_texcoord0.xy); + vec4 color1 = texture2D(detail_1, vary_texcoord0.xy); + vec4 color2 = texture2D(detail_2, vary_texcoord0.xy); + vec4 color3 = texture2D(detail_3, vary_texcoord0.xy); - float alpha1 = texture2D(alpha_ramp, gl_TexCoord[0].zw).a; - float alpha2 = texture2D(alpha_ramp,gl_TexCoord[1].xy).a; - float alphaFinal = texture2D(alpha_ramp, gl_TexCoord[1].zw).a; + float alpha1 = texture2D(alpha_ramp, vary_texcoord0.zw).a; + float alpha2 = texture2D(alpha_ramp,vary_texcoord1.xy).a; + float alphaFinal = texture2D(alpha_ramp, vary_texcoord1.zw).a; vec4 outColor = mix( mix(color3, color2, alpha2), mix(color1, color0, alpha1), alphaFinal ); /// Add WL Components - outColor.rgb = atmosLighting(outColor.rgb * gl_Color.rgb); + outColor.rgb = atmosLighting(outColor.rgb * vertex_color.rgb); gl_FragColor = vec4(scaleSoftClip(outColor.rgb), 1.0); } diff --git a/indra/newview/app_settings/shaders/class2/environment/terrainV.glsl b/indra/newview/app_settings/shaders/class2/environment/terrainV.glsl index 69f4d4ae45..f183b885d1 100644 --- a/indra/newview/app_settings/shaders/class2/environment/terrainV.glsl +++ b/indra/newview/app_settings/shaders/class2/environment/terrainV.glsl @@ -28,12 +28,18 @@ uniform mat4 texture_matrix0; uniform mat4 modelview_matrix; uniform mat4 modelview_projection_matrix; -attribute vec3 position; -attribute vec3 normal; -attribute vec4 diffuse_color; -attribute vec2 texcoord0; -attribute vec2 texcoord1; +uniform vec4 object_plane_t; +uniform vec4 object_plane_s; +ATTRIBUTE vec3 position; +ATTRIBUTE vec3 normal; +ATTRIBUTE vec4 diffuse_color; +ATTRIBUTE vec2 texcoord0; +ATTRIBUTE vec2 texcoord1; + +VARYING vec4 vertex_color; +VARYING vec4 vary_texcoord0; +VARYING vec4 vary_texcoord1; void calcAtmospherics(vec3 inPositionEye); @@ -68,15 +74,15 @@ void main() vec4 color = calcLighting(pos.xyz, norm, diffuse_color, vec4(0)); - gl_FrontColor = color; + vertex_color = color; // Transform and pass tex coords - gl_TexCoord[0].xy = texgen_object(vec4(position.xyz, 1.0), vec4(texcoord0,0,1), texture_matrix0, gl_ObjectPlaneS[0], gl_ObjectPlaneT[0]).xy; + vary_texcoord0.xy = texgen_object(vec4(position.xyz, 1.0), vec4(texcoord0,0,1), texture_matrix0, object_plane_s, object_plane_t).xy; vec4 t = vec4(texcoord1,0,1); - gl_TexCoord[0].zw = t.xy; - gl_TexCoord[1].xy = t.xy-vec2(2.0, 0.0); - gl_TexCoord[1].zw = t.xy-vec2(1.0, 0.0); + vary_texcoord0.zw = t.xy; + vary_texcoord1.xy = t.xy-vec2(2.0, 0.0); + vary_texcoord1.zw = t.xy-vec2(1.0, 0.0); } diff --git a/indra/newview/app_settings/shaders/class2/environment/terrainWaterF.glsl b/indra/newview/app_settings/shaders/class2/environment/terrainWaterF.glsl index 90468b45a2..9f1c4797c9 100644 --- a/indra/newview/app_settings/shaders/class2/environment/terrainWaterF.glsl +++ b/indra/newview/app_settings/shaders/class2/environment/terrainWaterF.glsl @@ -23,7 +23,9 @@ * $/LicenseInfo$ */ - +VARYING vec4 vertex_color; +VARYING vec4 vary_texcoord0; +VARYING vec4 vary_texcoord1; uniform sampler2D detail_0; uniform sampler2D detail_1; @@ -40,18 +42,18 @@ void main() /// Note: This should duplicate the blending functionality currently used for the terrain rendering. /// TODO Confirm tex coords and bind them appropriately in vert shader. - vec4 color0 = texture2D(detail_0, gl_TexCoord[0].xy); - vec4 color1 = texture2D(detail_1, gl_TexCoord[0].xy); - vec4 color2 = texture2D(detail_2, gl_TexCoord[0].xy); - vec4 color3 = texture2D(detail_3, gl_TexCoord[0].xy); + vec4 color0 = texture2D(detail_0, vary_texcoord0.xy); + vec4 color1 = texture2D(detail_1, vary_texcoord0.xy); + vec4 color2 = texture2D(detail_2, vary_texcoord0.xy); + vec4 color3 = texture2D(detail_3, vary_texcoord0.xy); - float alpha1 = texture2D(alpha_ramp, gl_TexCoord[0].zw).a; - float alpha2 = texture2D(alpha_ramp,gl_TexCoord[1].xy).a; - float alphaFinal = texture2D(alpha_ramp, gl_TexCoord[1].zw).a; + float alpha1 = texture2D(alpha_ramp, vary_texcoord0.zw).a; + float alpha2 = texture2D(alpha_ramp,vary_texcoord1.xy).a; + float alphaFinal = texture2D(alpha_ramp, vary_texcoord1.zw).a; vec4 outColor = mix( mix(color3, color2, alpha2), mix(color1, color0, alpha1), alphaFinal ); /// Add WL Components - outColor.rgb = atmosLighting(outColor.rgb * gl_Color.rgb); + outColor.rgb = atmosLighting(outColor.rgb * vertex_color.rgb); outColor = applyWaterFog(outColor); gl_FragColor = outColor; diff --git a/indra/newview/app_settings/shaders/class2/environment/underWaterF.glsl b/indra/newview/app_settings/shaders/class2/environment/underWaterF.glsl index f947aa4be1..e4b6402a8c 100644 --- a/indra/newview/app_settings/shaders/class2/environment/underWaterF.glsl +++ b/indra/newview/app_settings/shaders/class2/environment/underWaterF.glsl @@ -48,9 +48,9 @@ uniform float waterFogKS; uniform vec2 screenRes; //bigWave is (refCoord.w, view.w); -varying vec4 refCoord; -varying vec4 littleWave; -varying vec4 view; +VARYING vec4 refCoord; +VARYING vec4 littleWave; +VARYING vec4 view; vec4 applyWaterFog(vec4 color, vec3 viewVec) { diff --git a/indra/newview/app_settings/shaders/class2/environment/waterF.glsl b/indra/newview/app_settings/shaders/class2/environment/waterF.glsl index dc543b2231..0de77e6fe0 100644 --- a/indra/newview/app_settings/shaders/class2/environment/waterF.glsl +++ b/indra/newview/app_settings/shaders/class2/environment/waterF.glsl @@ -47,9 +47,9 @@ uniform float blurMultiplier; //bigWave is (refCoord.w, view.w); -varying vec4 refCoord; -varying vec4 littleWave; -varying vec4 view; +VARYING vec4 refCoord; +VARYING vec4 littleWave; +VARYING vec4 view; void main() { diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightAlphaMaskF.glsl index 4c05329065..ea17e42fab 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightAlphaMaskF.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/lightAlphaMaskF.glsl @@ -30,9 +30,12 @@ uniform float maximum_alpha; vec3 atmosLighting(vec3 light); vec3 scaleSoftClip(vec3 light); +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; + void default_lighting() { - vec4 color = diffuseLookup(gl_TexCoord[0].xy) * gl_Color; + vec4 color = diffuseLookup(vary_texcoord0.xy) * vertex_color; if (color.a < minimum_alpha || color.a > maximum_alpha) { diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightAlphaMaskNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightAlphaMaskNonIndexedF.glsl index 0de909353e..155d0756be 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightAlphaMaskNonIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/lightAlphaMaskNonIndexedF.glsl @@ -33,9 +33,12 @@ uniform sampler2D diffuseMap; vec3 atmosLighting(vec3 light); vec3 scaleSoftClip(vec3 light); +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; + void default_lighting() { - vec4 color = texture2D(diffuseMap,gl_TexCoord[0].xy) * gl_Color; + vec4 color = texture2D(diffuseMap,vary_texcoord0.xy) * vertex_color; if (color.a < minimum_alpha || color.a > maximum_alpha) { diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightF.glsl index d12d88f1c5..43970015c5 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightF.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/lightF.glsl @@ -23,14 +23,15 @@ * $/LicenseInfo$ */ - +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; vec3 atmosLighting(vec3 light); vec3 scaleSoftClip(vec3 light); void default_lighting() { - vec4 color = diffuseLookup(gl_TexCoord[0].xy) * gl_Color; + vec4 color = diffuseLookup(vary_texcoord0.xy) * vertex_color; color.rgb = atmosLighting(color.rgb); diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightAlphaMaskF.glsl index 8c7713c08d..c6583a54df 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightAlphaMaskF.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightAlphaMaskF.glsl @@ -29,9 +29,12 @@ uniform float maximum_alpha; vec3 fullbrightAtmosTransport(vec3 light); vec3 fullbrightScaleSoftClip(vec3 light); +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; + void fullbright_lighting() { - vec4 color = diffuseLookup(gl_TexCoord[0].xy) * gl_Color; + vec4 color = diffuseLookup(vary_texcoord0.xy) * vertex_color; if (color.a < minimum_alpha || color.a > maximum_alpha) { diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightF.glsl index f03b1fdc74..ba2e8608f1 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightF.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightF.glsl @@ -23,14 +23,15 @@ * $/LicenseInfo$ */ - +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; vec3 fullbrightAtmosTransport(vec3 light); vec3 fullbrightScaleSoftClip(vec3 light); void fullbright_lighting() { - vec4 color = diffuseLookup(gl_TexCoord[0].xy) * gl_Color; + vec4 color = diffuseLookup(vary_texcoord0.xy) * vertex_color; color.rgb = fullbrightAtmosTransport(color.rgb); diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightNonIndexedAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightNonIndexedAlphaMaskF.glsl index 89468b9665..76f468d914 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightNonIndexedAlphaMaskF.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightNonIndexedAlphaMaskF.glsl @@ -31,9 +31,12 @@ vec3 fullbrightScaleSoftClip(vec3 light); uniform sampler2D diffuseMap; +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; + void fullbright_lighting() { - vec4 color = texture2D(diffuseMap,gl_TexCoord[0].xy) * gl_Color; + vec4 color = texture2D(diffuseMap,vary_texcoord0.xy) * vertex_color; if (color.a < minimum_alpha || color.a > maximum_alpha) { diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightNonIndexedF.glsl index a909ff608a..e88bf7f0ab 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightNonIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightNonIndexedF.glsl @@ -23,7 +23,8 @@ * $/LicenseInfo$ */ - +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; vec3 fullbrightAtmosTransport(vec3 light); vec3 fullbrightScaleSoftClip(vec3 light); @@ -32,7 +33,7 @@ uniform sampler2D diffuseMap; void fullbright_lighting() { - vec4 color = texture2D(diffuseMap,gl_TexCoord[0].xy) * gl_Color; + vec4 color = texture2D(diffuseMap,vary_texcoord0.xy) * vertex_color; color.rgb = fullbrightAtmosTransport(color.rgb); diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyF.glsl index d2bc912edb..045fc5276d 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyF.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyF.glsl @@ -23,7 +23,9 @@ * $/LicenseInfo$ */ - +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; +VARYING vec3 vary_texcoord1; uniform samplerCube environmentMap; @@ -32,17 +34,17 @@ vec3 fullbrightScaleSoftClip(vec3 light); void fullbright_shiny_lighting() { - vec4 color = diffuseLookup(gl_TexCoord[0].xy); - color.rgb *= gl_Color.rgb; + vec4 color = diffuseLookup(vary_texcoord0.xy); + color.rgb *= vertex_color.rgb; - vec3 envColor = textureCube(environmentMap, gl_TexCoord[1].xyz).rgb; - color.rgb = mix(color.rgb, envColor.rgb, gl_Color.a); + vec3 envColor = textureCube(environmentMap, vary_texcoord1.xyz).rgb; + color.rgb = mix(color.rgb, envColor.rgb, vertex_color.a); color.rgb = fullbrightShinyAtmosTransport(color.rgb); color.rgb = fullbrightScaleSoftClip(color.rgb); - color.a = max(color.a, gl_Color.a); + color.a = max(color.a, vertex_color.a); gl_FragColor = color; } diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyNonIndexedF.glsl index af73168c13..93b14ad692 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyNonIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyNonIndexedF.glsl @@ -23,7 +23,9 @@ * $/LicenseInfo$ */ - +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; +VARYING vec3 vary_texcoord1; uniform samplerCube environmentMap; uniform sampler2D diffuseMap; @@ -33,17 +35,17 @@ vec3 fullbrightScaleSoftClip(vec3 light); void fullbright_shiny_lighting() { - vec4 color = texture2D(diffuseMap, gl_TexCoord[0].xy); - color.rgb *= gl_Color.rgb; + vec4 color = texture2D(diffuseMap, vary_texcoord0.xy); + color.rgb *= vertex_color.rgb; - vec3 envColor = textureCube(environmentMap, gl_TexCoord[1].xyz).rgb; - color.rgb = mix(color.rgb, envColor.rgb, gl_Color.a); + vec3 envColor = textureCube(environmentMap, vary_texcoord1.xyz).rgb; + color.rgb = mix(color.rgb, envColor.rgb, vertex_color.a); color.rgb = fullbrightShinyAtmosTransport(color.rgb); color.rgb = fullbrightScaleSoftClip(color.rgb); - color.a = max(color.a, gl_Color.a); + color.a = max(color.a, vertex_color.a); gl_FragColor = color; } diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyWaterF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyWaterF.glsl index e9dab85095..ffc91d9ee1 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyWaterF.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyWaterF.glsl @@ -23,7 +23,9 @@ */ - +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; +VARYING vec3 vary_texcoord1; uniform samplerCube environmentMap; @@ -33,15 +35,15 @@ vec4 applyWaterFog(vec4 color); void fullbright_shiny_lighting_water() { - vec4 color = diffuseLookup(gl_TexCoord[0].xy); - color.rgb *= gl_Color.rgb; + vec4 color = diffuseLookup(vary_texcoord0.xy); + color.rgb *= vertex_color.rgb; - vec3 envColor = textureCube(environmentMap, gl_TexCoord[1].xyz).rgb; - color.rgb = mix(color.rgb, envColor.rgb, gl_Color.a); + vec3 envColor = textureCube(environmentMap, vary_texcoord1.xyz).rgb; + color.rgb = mix(color.rgb, envColor.rgb, vertex_color.a); color.rgb = fullbrightShinyAtmosTransport(color.rgb); color.rgb = fullbrightScaleSoftClip(color.rgb); - color.a = max(color.a, gl_Color.a); + color.a = max(color.a, vertex_color.a); gl_FragColor = applyWaterFog(color); } diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyWaterNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyWaterNonIndexedF.glsl index e0a7986705..3f582d3228 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyWaterNonIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyWaterNonIndexedF.glsl @@ -23,7 +23,9 @@ */ - +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; +VARYING vec3 vary_texcoord1; uniform samplerCube environmentMap; uniform sampler2D diffuseMap; @@ -34,15 +36,15 @@ vec4 applyWaterFog(vec4 color); void fullbright_shiny_lighting_water() { - vec4 color = texture2D(diffuseMap,gl_TexCoord[0].xy); - color.rgb *= gl_Color.rgb; + vec4 color = texture2D(diffuseMap,vary_texcoord0.xy); + color.rgb *= vertex_color.rgb; - vec3 envColor = textureCube(environmentMap, gl_TexCoord[1].xyz).rgb; - color.rgb = mix(color.rgb, envColor.rgb, gl_Color.a); + vec3 envColor = textureCube(environmentMap, vary_texcoord1.xyz).rgb; + color.rgb = mix(color.rgb, envColor.rgb, vertex_color.a); color.rgb = fullbrightShinyAtmosTransport(color.rgb); color.rgb = fullbrightScaleSoftClip(color.rgb); - color.a = max(color.a, gl_Color.a); + color.a = max(color.a, vertex_color.a); gl_FragColor = applyWaterFog(color); } diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterAlphaMaskF.glsl index e5998b77a9..fb2b642022 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterAlphaMaskF.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterAlphaMaskF.glsl @@ -31,9 +31,12 @@ vec4 diffuseLookup(vec2 texcoord); vec3 fullbrightAtmosTransport(vec3 light); vec4 applyWaterFog(vec4 color); +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; + void fullbright_lighting_water() { - vec4 color = diffuseLookup(gl_TexCoord[0].xy) * gl_Color; + vec4 color = diffuseLookup(vary_texcoord0.xy) * vertex_color; if (color.a < minimum_alpha || color.a > maximum_alpha) { diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterF.glsl index 20ff3712af..258cad3cfe 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterF.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterF.glsl @@ -23,7 +23,8 @@ * $/LicenseInfo$ */ - +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; vec4 diffuseLookup(vec2 texcoord); @@ -32,7 +33,7 @@ vec4 applyWaterFog(vec4 color); void fullbright_lighting_water() { - vec4 color = diffuseLookup(gl_TexCoord[0].xy) * gl_Color; + vec4 color = diffuseLookup(vary_texcoord0.xy) * vertex_color; color.rgb = fullbrightAtmosTransport(color.rgb); diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterNonIndexedAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterNonIndexedAlphaMaskF.glsl index 3fdd110f7d..3f2802cbb8 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterNonIndexedAlphaMaskF.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterNonIndexedAlphaMaskF.glsl @@ -31,9 +31,12 @@ uniform sampler2D diffuseMap; vec3 fullbrightAtmosTransport(vec3 light); vec4 applyWaterFog(vec4 color); +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; + void fullbright_lighting_water() { - vec4 color = texture2D(diffuseMap, gl_TexCoord[0].xy) * gl_Color; + vec4 color = texture2D(diffuseMap, vary_texcoord0.xy) * vertex_color; if (color.a < minimum_alpha || color.a > maximum_alpha) { diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterNonIndexedF.glsl index 01b89019b1..23700fa1b0 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterNonIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterNonIndexedF.glsl @@ -24,6 +24,8 @@ */ +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; uniform sampler2D diffuseMap; @@ -32,7 +34,7 @@ vec4 applyWaterFog(vec4 color); void fullbright_lighting_water() { - vec4 color = texture2D(diffuseMap, gl_TexCoord[0].xy) * gl_Color; + vec4 color = texture2D(diffuseMap, vary_texcoord0.xy) * vertex_color; color.rgb = fullbrightAtmosTransport(color.rgb); diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightNonIndexedF.glsl index d419c2d116..09f02b9288 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightNonIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/lightNonIndexedF.glsl @@ -23,7 +23,8 @@ * $/LicenseInfo$ */ - +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; uniform sampler2D diffuseMap; @@ -32,7 +33,7 @@ vec3 scaleSoftClip(vec3 light); void default_lighting() { - vec4 color = texture2D(diffuseMap,gl_TexCoord[0].xy) * gl_Color; + vec4 color = texture2D(diffuseMap,vary_texcoord0.xy) * vertex_color; color.rgb = atmosLighting(color.rgb); diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightShinyF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightShinyF.glsl index ba4cd949d6..66a2462b88 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightShinyF.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/lightShinyF.glsl @@ -24,7 +24,9 @@ */ - +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; +VARYING vec3 vary_texcoord1; uniform samplerCube environmentMap; @@ -34,16 +36,16 @@ vec4 applyWaterFog(vec4 color); void shiny_lighting() { - vec4 color = diffuseLookup(gl_TexCoord[0].xy); - color.rgb *= gl_Color.rgb; + vec4 color = diffuseLookup(vary_texcoord0.xy); + color.rgb *= vertex_color.rgb; - vec3 envColor = textureCube(environmentMap, gl_TexCoord[1].xyz).rgb; - color.rgb = mix(color.rgb, envColor.rgb, gl_Color.a); + vec3 envColor = textureCube(environmentMap, vary_texcoord1.xyz).rgb; + color.rgb = mix(color.rgb, envColor.rgb, vertex_color.a); color.rgb = atmosLighting(color.rgb); color.rgb = scaleSoftClip(color.rgb); - color.a = max(color.a, gl_Color.a); + color.a = max(color.a, vertex_color.a); gl_FragColor = color; } diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightShinyNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightShinyNonIndexedF.glsl index 3b30ebf6f1..477408f5af 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightShinyNonIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/lightShinyNonIndexedF.glsl @@ -23,8 +23,9 @@ * $/LicenseInfo$ */ - - +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; +VARYING vec3 vary_texcoord1; uniform samplerCube environmentMap; uniform sampler2D diffuseMap; @@ -35,16 +36,16 @@ vec4 applyWaterFog(vec4 color); void shiny_lighting() { - vec4 color = texture2D(diffuseMap,gl_TexCoord[0].xy); - color.rgb *= gl_Color.rgb; + vec4 color = texture2D(diffuseMap,vary_texcoord0.xy); + color.rgb *= vertex_color.rgb; - vec3 envColor = textureCube(environmentMap, gl_TexCoord[1].xyz).rgb; - color.rgb = mix(color.rgb, envColor.rgb, gl_Color.a); + vec3 envColor = textureCube(environmentMap, vary_texcoord1.xyz).rgb; + color.rgb = mix(color.rgb, envColor.rgb, vertex_color.a); color.rgb = atmosLighting(color.rgb); color.rgb = scaleSoftClip(color.rgb); - color.a = max(color.a, gl_Color.a); + color.a = max(color.a, vertex_color.a); gl_FragColor = color; } diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightShinyWaterF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightShinyWaterF.glsl index c451e68763..6df8641b47 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightShinyWaterF.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/lightShinyWaterF.glsl @@ -24,7 +24,9 @@ */ - +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; +VARYING vec3 vary_texcoord1; uniform samplerCube environmentMap; @@ -33,14 +35,14 @@ vec4 applyWaterFog(vec4 color); void shiny_lighting_water() { - vec4 color = diffuseLookup(gl_TexCoord[0].xy); - color.rgb *= gl_Color.rgb; + vec4 color = diffuseLookup(vary_texcoord0.xy); + color.rgb *= vertex_color.rgb; - vec3 envColor = textureCube(environmentMap, gl_TexCoord[1].xyz).rgb; - color.rgb = mix(color.rgb, envColor.rgb, gl_Color.a); + vec3 envColor = textureCube(environmentMap, vary_texcoord1.xyz).rgb; + color.rgb = mix(color.rgb, envColor.rgb, vertex_color.a); color.rgb = atmosLighting(color.rgb); - color.a = max(color.a, gl_Color.a); + color.a = max(color.a, vertex_color.a); gl_FragColor = applyWaterFog(color); } diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightShinyWaterNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightShinyWaterNonIndexedF.glsl index eeb997fb5f..fce717d93a 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightShinyWaterNonIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/lightShinyWaterNonIndexedF.glsl @@ -24,7 +24,9 @@ */ - +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; +VARYING vec3 vary_texcoord1; uniform sampler2D diffuseMap; uniform samplerCube environmentMap; @@ -34,14 +36,14 @@ vec4 applyWaterFog(vec4 color); void shiny_lighting_water() { - vec4 color = texture2D(diffuseMap,gl_TexCoord[0].xy); - color.rgb *= gl_Color.rgb; + vec4 color = texture2D(diffuseMap,vary_texcoord0.xy); + color.rgb *= vertex_color.rgb; - vec3 envColor = textureCube(environmentMap, gl_TexCoord[1].xyz).rgb; - color.rgb = mix(color.rgb, envColor.rgb, gl_Color.a); + vec3 envColor = textureCube(environmentMap, vary_texcoord1.xyz).rgb; + color.rgb = mix(color.rgb, envColor.rgb, vertex_color.a); color.rgb = atmosLighting(color.rgb); - color.a = max(color.a, gl_Color.a); + color.a = max(color.a, vertex_color.a); gl_FragColor = applyWaterFog(color); } diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightWaterAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightWaterAlphaMaskF.glsl index 072dcaa6b6..4658b46a38 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightWaterAlphaMaskF.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/lightWaterAlphaMaskF.glsl @@ -29,9 +29,12 @@ uniform float maximum_alpha; vec3 atmosLighting(vec3 light); vec4 applyWaterFog(vec4 color); +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; + void default_lighting_water() { - vec4 color = diffuseLookup(gl_TexCoord[0].xy) * gl_Color; + vec4 color = diffuseLookup(vary_texcoord0.xy) * vertex_color; if (color.a < minimum_alpha || color.a > maximum_alpha) { diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightWaterAlphaMaskNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightWaterAlphaMaskNonIndexedF.glsl index 2df34da4b4..0db9253cd1 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightWaterAlphaMaskNonIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/lightWaterAlphaMaskNonIndexedF.glsl @@ -31,9 +31,12 @@ uniform sampler2D diffuseMap; vec3 atmosLighting(vec3 light); vec4 applyWaterFog(vec4 color); +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; + void default_lighting_water() { - vec4 color = texture2D(diffuseMap,gl_TexCoord[0].xy) * gl_Color; + vec4 color = texture2D(diffuseMap,vary_texcoord0.xy) * vertex_color; if (color.a < minimum_alpha || color.a > maximum_alpha) { diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightWaterF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightWaterF.glsl index ae7be4d231..a691d4f54a 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightWaterF.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/lightWaterF.glsl @@ -24,13 +24,15 @@ */ +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; vec3 atmosLighting(vec3 light); vec4 applyWaterFog(vec4 color); void default_lighting_water() { - vec4 color = diffuseLookup(gl_TexCoord[0].xy) * gl_Color; + vec4 color = diffuseLookup(vary_texcoord0.xy) * vertex_color; color.rgb = atmosLighting(color.rgb); diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightWaterNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightWaterNonIndexedF.glsl index 5a86dad827..6f5d6cd1c8 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightWaterNonIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/lightWaterNonIndexedF.glsl @@ -24,6 +24,8 @@ */ +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; uniform sampler2D diffuseMap; @@ -32,7 +34,7 @@ vec4 applyWaterFog(vec4 color); void default_lighting_water() { - vec4 color = texture2D(diffuseMap,gl_TexCoord[0].xy) * gl_Color; + vec4 color = texture2D(diffuseMap,vary_texcoord0.xy) * vertex_color; color.rgb = atmosLighting(color.rgb); diff --git a/indra/newview/app_settings/shaders/class2/objects/fullbrightShinyV.glsl b/indra/newview/app_settings/shaders/class2/objects/fullbrightShinyV.glsl index b9eff87a13..ef97e4f781 100644 --- a/indra/newview/app_settings/shaders/class2/objects/fullbrightShinyV.glsl +++ b/indra/newview/app_settings/shaders/class2/objects/fullbrightShinyV.glsl @@ -34,12 +34,17 @@ void calcAtmospherics(vec3 inPositionEye); uniform vec4 origin; -varying float vary_texture_index; +VARYING float vary_texture_index; -attribute vec4 position; -attribute vec3 normal; -attribute vec4 diffuse_color; -attribute vec2 texcoord0; +ATTRIBUTE vec4 position; +ATTRIBUTE vec3 normal; +ATTRIBUTE vec4 diffuse_color; +ATTRIBUTE vec2 texcoord0; + +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; +VARYING vec3 vary_texcoord1; +VARYING float fog_depth; void main() { @@ -52,12 +57,12 @@ void main() vec3 norm = normalize(normal_matrix * normal); vec3 ref = reflect(pos.xyz, -norm); - gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1); - gl_TexCoord[1] = texture_matrix1*vec4(ref,1.0); + vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy; + vary_texcoord1 = (texture_matrix1*vec4(ref,1.0)).xyz; calcAtmospherics(pos.xyz); - gl_FrontColor = diffuse_color; + vertex_color = diffuse_color; - gl_FogFragCoord = pos.z; + fog_depth = 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 b7f7af7885..2fd22cee9d 100644 --- a/indra/newview/app_settings/shaders/class2/objects/fullbrightV.glsl +++ b/indra/newview/app_settings/shaders/class2/objects/fullbrightV.glsl @@ -27,15 +27,18 @@ uniform mat4 texture_matrix0; uniform mat4 modelview_matrix; uniform mat4 modelview_projection_matrix; -attribute vec4 position; -attribute vec2 texcoord0; -attribute vec3 normal; -attribute vec4 diffuse_color; +ATTRIBUTE vec4 position; +ATTRIBUTE vec2 texcoord0; +ATTRIBUTE vec3 normal; +ATTRIBUTE vec4 diffuse_color; void calcAtmospherics(vec3 inPositionEye); -varying float vary_texture_index; +VARYING float vary_texture_index; +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; +VARYING float fog_depth; void main() { @@ -44,11 +47,11 @@ void main() vary_texture_index = position.w; vec4 pos = (modelview_matrix * vert); gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0); - gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1); + vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy; calcAtmospherics(pos.xyz); - gl_FrontColor = diffuse_color; + vertex_color = diffuse_color; - gl_FogFragCoord = pos.z; + fog_depth = 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 4511c4bc91..472ff219e5 100644 --- a/indra/newview/app_settings/shaders/class2/objects/shinyV.glsl +++ b/indra/newview/app_settings/shaders/class2/objects/shinyV.glsl @@ -29,16 +29,21 @@ uniform mat4 texture_matrix1; uniform mat4 modelview_matrix; uniform mat4 modelview_projection_matrix; -attribute vec4 position; -attribute vec2 texcoord0; -attribute vec3 normal; -attribute vec4 diffuse_color; +ATTRIBUTE vec4 position; +ATTRIBUTE vec2 texcoord0; +ATTRIBUTE vec3 normal; +ATTRIBUTE vec4 diffuse_color; + +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; +VARYING vec3 vary_texcoord1; vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol); void calcAtmospherics(vec3 inPositionEye); -varying float vary_texture_index; +VARYING float vary_texture_index; +VARYING float fog_depth; uniform vec4 origin; @@ -53,12 +58,12 @@ void main() vec3 norm = normalize(normal_matrix * normal); vec3 ref = reflect(pos.xyz, -norm); - gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0,0,1); - gl_TexCoord[1] = texture_matrix1*vec4(ref,1.0); + vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy; + vary_texcoord1 = (texture_matrix1*vec4(ref,1.0)).xyz; calcAtmospherics(pos.xyz); - gl_FrontColor = calcLighting(pos.xyz, norm, diffuse_color, vec4(0.0)); + vertex_color = calcLighting(pos.xyz, norm, diffuse_color, vec4(0.0)); - gl_FogFragCoord = pos.z; + fog_depth = pos.z; } diff --git a/indra/newview/app_settings/shaders/class2/objects/simpleNonIndexedV.glsl b/indra/newview/app_settings/shaders/class2/objects/simpleNonIndexedV.glsl index 5f78495ae3..6799e43b9a 100644 --- a/indra/newview/app_settings/shaders/class2/objects/simpleNonIndexedV.glsl +++ b/indra/newview/app_settings/shaders/class2/objects/simpleNonIndexedV.glsl @@ -28,10 +28,14 @@ uniform mat4 texture_matrix0; uniform mat4 modelview_matrix; uniform mat4 modelview_projection_matrix; -attribute vec3 position; -attribute vec2 texcoord0; -attribute vec3 normal; -attribute vec4 diffuse_color; +ATTRIBUTE vec3 position; +ATTRIBUTE vec2 texcoord0; +ATTRIBUTE vec3 normal; +ATTRIBUTE vec4 diffuse_color; + +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; +VARYING float fog_depth; vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol); void calcAtmospherics(vec3 inPositionEye); @@ -42,7 +46,7 @@ void main() vec4 vert = vec4(position.xyz,1.0); gl_Position = modelview_projection_matrix*vert; - gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0, 0, 1); + vary_texcoord0 = (texture_matrix0 * vec4(texcoord0, 0, 1)).xy; vec4 pos = (modelview_matrix * vert); @@ -51,7 +55,7 @@ void main() calcAtmospherics(pos.xyz); vec4 color = calcLighting(pos.xyz, norm, diffuse_color, vec4(0.)); - gl_FrontColor = color; + vertex_color = color; - gl_FogFragCoord = pos.z; + fog_depth = 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 91ee5e016e..144336417e 100644 --- a/indra/newview/app_settings/shaders/class2/objects/simpleV.glsl +++ b/indra/newview/app_settings/shaders/class2/objects/simpleV.glsl @@ -28,15 +28,18 @@ uniform mat4 texture_matrix0; uniform mat4 modelview_matrix; uniform mat4 modelview_projection_matrix; -attribute vec4 position; -attribute vec2 texcoord0; -attribute vec3 normal; -attribute vec4 diffuse_color; +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); -varying float vary_texture_index; +VARYING float vary_texture_index; +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; +VARYING float fog_depth; void main() { @@ -45,7 +48,7 @@ void main() vary_texture_index = position.w; vec4 pos = (modelview_matrix * vert); gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0); - gl_TexCoord[0] = texture_matrix0 * vec4(texcoord0, 0, 1); + vary_texcoord0 = (texture_matrix0 * vec4(texcoord0, 0, 1)).xy; @@ -54,7 +57,7 @@ void main() calcAtmospherics(pos.xyz); vec4 color = calcLighting(pos.xyz, norm, diffuse_color, vec4(0.)); - gl_FrontColor = color; + vertex_color = color; - gl_FogFragCoord = pos.z; + fog_depth = pos.z; } 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); -- cgit v1.2.3 From 8a1baaea6c0462b645499e8e7b88345e46b92621 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Fri, 16 Sep 2011 17:08:39 -0500 Subject: SH-2243 work in progress -- don't use gl_FragColor or gl_FragData for outputs -- no more deprecation warnings on nvidia --- .../newview/app_settings/shaders/class2/deferred/alphaF.glsl | 10 ++++------ .../shaders/class2/deferred/alphaNonIndexedF.glsl | 12 +++++------- .../shaders/class2/deferred/alphaNonIndexedNoColorF.glsl | 6 ++++-- .../newview/app_settings/shaders/class2/deferred/edgeF.glsl | 7 ++++--- .../app_settings/shaders/class2/deferred/edgeMSF.glsl | 6 ++++-- .../shaders/class2/deferred/multiSpotLightF.glsl | 8 +++++--- .../shaders/class2/deferred/multiSpotLightMSF.glsl | 6 ++++-- .../app_settings/shaders/class2/deferred/softenLightF.glsl | 6 ++++-- .../app_settings/shaders/class2/deferred/softenLightMSF.glsl | 6 ++++-- .../app_settings/shaders/class2/deferred/spotLightF.glsl | 6 ++++-- .../app_settings/shaders/class2/deferred/spotLightMSF.glsl | 6 ++++-- .../app_settings/shaders/class2/deferred/sunLightF.glsl | 6 ++++-- .../app_settings/shaders/class2/deferred/sunLightMSF.glsl | 6 ++++-- .../app_settings/shaders/class2/deferred/sunLightSSAOF.glsl | 6 ++++-- .../shaders/class2/deferred/sunLightSSAOMSF.glsl | 6 ++++-- .../app_settings/shaders/class2/effects/colorFilterF.glsl | 4 +++- .../app_settings/shaders/class2/effects/extractF.glsl | 4 +++- .../app_settings/shaders/class2/effects/nightVisionF.glsl | 4 +++- .../newview/app_settings/shaders/class2/effects/simpleF.glsl | 4 +++- .../app_settings/shaders/class2/environment/terrainF.glsl | 3 +++ .../shaders/class2/environment/terrainWaterF.glsl | 6 +++++- .../app_settings/shaders/class2/environment/underWaterF.glsl | 4 +++- .../app_settings/shaders/class2/environment/waterF.glsl | 4 +++- .../shaders/class2/lighting/lightAlphaMaskF.glsl | 3 +++ .../shaders/class2/lighting/lightAlphaMaskNonIndexedF.glsl | 5 ++++- .../newview/app_settings/shaders/class2/lighting/lightF.glsl | 6 +++++- .../shaders/class2/lighting/lightFullbrightAlphaMaskF.glsl | 6 +++++- .../shaders/class2/lighting/lightFullbrightF.glsl | 6 +++++- .../class2/lighting/lightFullbrightNonIndexedAlphaMaskF.glsl | 6 +++++- .../shaders/class2/lighting/lightFullbrightNonIndexedF.glsl | 6 +++++- .../shaders/class2/lighting/lightFullbrightShinyF.glsl | 6 +++++- .../class2/lighting/lightFullbrightShinyNonIndexedF.glsl | 6 +++++- .../shaders/class2/lighting/lightFullbrightShinyWaterF.glsl | 3 +++ .../lighting/lightFullbrightShinyWaterNonIndexedF.glsl | 3 +++ .../class2/lighting/lightFullbrightWaterAlphaMaskF.glsl | 4 ++++ .../shaders/class2/lighting/lightFullbrightWaterF.glsl | 6 +++++- .../lighting/lightFullbrightWaterNonIndexedAlphaMaskF.glsl | 6 +++++- .../class2/lighting/lightFullbrightWaterNonIndexedF.glsl | 5 ++++- .../shaders/class2/lighting/lightNonIndexedF.glsl | 4 ++++ .../app_settings/shaders/class2/lighting/lightShinyF.glsl | 5 ++++- .../shaders/class2/lighting/lightShinyNonIndexedF.glsl | 4 ++++ .../shaders/class2/lighting/lightShinyWaterF.glsl | 5 ++++- .../shaders/class2/lighting/lightShinyWaterNonIndexedF.glsl | 5 ++++- .../shaders/class2/lighting/lightWaterAlphaMaskF.glsl | 6 +++++- .../class2/lighting/lightWaterAlphaMaskNonIndexedF.glsl | 6 +++++- .../app_settings/shaders/class2/lighting/lightWaterF.glsl | 5 ++++- .../shaders/class2/lighting/lightWaterNonIndexedF.glsl | 5 ++++- .../app_settings/shaders/class2/windlight/cloudsF.glsl | 4 +++- .../newview/app_settings/shaders/class2/windlight/skyF.glsl | 4 +++- 49 files changed, 198 insertions(+), 68 deletions(-) (limited to 'indra/newview/app_settings/shaders/class2') diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl index 4fffb9e97f..ab4ed093c8 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl @@ -22,11 +22,13 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - - #extension GL_ARB_texture_rectangle : enable +#ifndef gl_FragColor +out vec4 gl_FragColor; +#endif + VARYING vec4 vertex_color; VARYING vec2 vary_texcoord0; @@ -136,10 +138,6 @@ void main() color.rgb += diff.rgb * vary_pointlight_col.rgb; - //gl_FragColor = vertex_color; gl_FragColor = color; - //gl_FragColor.r = 0.0; - //gl_FragColor = vec4(1,shadow,1,1); - } diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedF.glsl index 30aa82473a..a9ee534bdf 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedF.glsl @@ -23,10 +23,12 @@ * $/LicenseInfo$ */ - - #extension GL_ARB_texture_rectangle : enable +#ifndef gl_FragColor +out vec4 gl_FragColor; +#endif + uniform sampler2DRectShadow shadowMap0; uniform sampler2DRectShadow shadowMap1; uniform sampler2DRectShadow shadowMap2; @@ -136,10 +138,6 @@ void main() color.rgb += diff.rgb * vary_pointlight_col.rgb; - //gl_FragColor = vertex_color; - gl_FragColor = color; - //gl_FragColor.r = 0.0; - //gl_FragColor = vec4(1,shadow,1,1); - + gl_FragColor = color; } diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedNoColorF.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedNoColorF.glsl index 9370b484b8..98dd9d4a1e 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedNoColorF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedNoColorF.glsl @@ -23,10 +23,12 @@ * $/LicenseInfo$ */ - - #extension GL_ARB_texture_rectangle : enable +#ifndef gl_FragColor +out vec4 gl_FragColor; +#endif + uniform sampler2DRectShadow shadowMap0; uniform sampler2DRectShadow shadowMap1; uniform sampler2DRectShadow shadowMap2; diff --git a/indra/newview/app_settings/shaders/class2/deferred/edgeF.glsl b/indra/newview/app_settings/shaders/class2/deferred/edgeF.glsl index 4fc6c00caf..96e71b46d7 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/edgeF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/edgeF.glsl @@ -23,10 +23,12 @@ * $/LicenseInfo$ */ - - #extension GL_ARB_texture_rectangle : enable +#ifndef gl_FragColor +out vec4 gl_FragColor; +#endif + uniform sampler2DRect depthMap; uniform sampler2DRect normalMap; @@ -77,5 +79,4 @@ void main() ne = step(norm_cutoff, ne); gl_FragColor.a = dot(de,de)+dot(ne,ne); - //gl_FragColor.a = dot(de,de); } diff --git a/indra/newview/app_settings/shaders/class2/deferred/edgeMSF.glsl b/indra/newview/app_settings/shaders/class2/deferred/edgeMSF.glsl index 11a7cf846d..540c71c5e3 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/edgeMSF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/edgeMSF.glsl @@ -23,11 +23,13 @@ * $/LicenseInfo$ */ - - #extension GL_ARB_texture_rectangle : enable #extension GL_ARB_texture_multisample : enable +#ifndef gl_FragColor +out vec4 gl_FragColor; +#endif + uniform sampler2DMS depthMap; uniform sampler2DMS normalMap; diff --git a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl index d1f2db6188..409db862e6 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl @@ -22,11 +22,13 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - - - + #extension GL_ARB_texture_rectangle : enable +#ifndef gl_FragColor +out vec4 gl_FragColor; +#endif + uniform sampler2DRect diffuseRect; uniform sampler2DRect specularRect; uniform sampler2DRect depthMap; diff --git a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightMSF.glsl b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightMSF.glsl index 74f78cfc06..9e7542c01c 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightMSF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightMSF.glsl @@ -23,11 +23,13 @@ * $/LicenseInfo$ */ - - #extension GL_ARB_texture_rectangle : enable #extension GL_ARB_texture_multisample : enable +#ifndef gl_FragColor +out vec4 gl_FragColor; +#endif + VARYING vec4 vertex_color; uniform sampler2DMS diffuseRect; diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl index e9f1a3d3a5..642145a856 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl @@ -23,10 +23,12 @@ * $/LicenseInfo$ */ - - #extension GL_ARB_texture_rectangle : enable +#ifndef gl_FragColor +out vec4 gl_FragColor; +#endif + uniform sampler2DRect diffuseRect; uniform sampler2DRect specularRect; uniform sampler2DRect normalMap; diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightMSF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightMSF.glsl index 6b979b13ed..ab187ccfa5 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/softenLightMSF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightMSF.glsl @@ -23,11 +23,13 @@ * $/LicenseInfo$ */ - - #extension GL_ARB_texture_rectangle : enable #extension GL_ARB_texture_multisample : enable +#ifndef gl_FragColor +out vec4 gl_FragColor; +#endif + uniform sampler2DMS diffuseRect; uniform sampler2DMS specularRect; uniform sampler2DMS normalMap; diff --git a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl index 19a1d1f165..c2e36abbd6 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl @@ -23,10 +23,12 @@ * $/LicenseInfo$ */ - - #extension GL_ARB_texture_rectangle : enable +#ifndef gl_FragColor +out vec4 gl_FragColor; +#endif + VARYING vec4 vertex_color; uniform sampler2DRect diffuseRect; diff --git a/indra/newview/app_settings/shaders/class2/deferred/spotLightMSF.glsl b/indra/newview/app_settings/shaders/class2/deferred/spotLightMSF.glsl index 85fea56411..50369cb205 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/spotLightMSF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/spotLightMSF.glsl @@ -23,11 +23,13 @@ * $/LicenseInfo$ */ - - #extension GL_ARB_texture_rectangle : enable #extension GL_ARB_texture_multisample : enable +#ifndef gl_FragColor +out vec4 gl_FragColor; +#endif + VARYING vec4 vertex_color; uniform sampler2DMS diffuseRect; diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl index bb742adb62..efb1984874 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl @@ -22,11 +22,13 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - - #extension GL_ARB_texture_rectangle : enable +#ifndef gl_FragColor +out vec4 gl_FragColor; +#endif + //class 2, shadows, no SSAO uniform sampler2DRect depthMap; diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightMSF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightMSF.glsl index 4933eb00b7..96b6140c0a 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/sunLightMSF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightMSF.glsl @@ -23,11 +23,13 @@ * $/LicenseInfo$ */ - - #extension GL_ARB_texture_rectangle : enable #extension GL_ARB_texture_multisample : enable +#ifndef gl_FragColor +out vec4 gl_FragColor; +#endif + //class 2, shadows, no SSAO uniform sampler2DMS depthMap; diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl index 042bb5f96c..1886178731 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl @@ -22,10 +22,12 @@ * $/LicenseInfo$ */ - - #extension GL_ARB_texture_rectangle : enable +#ifndef gl_FragColor +out vec4 gl_FragColor; +#endif + //class 2 -- shadows and SSAO uniform sampler2DRect depthMap; diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOMSF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOMSF.glsl index e138ae5841..4a2ba0afc5 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOMSF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOMSF.glsl @@ -22,11 +22,13 @@ * $/LicenseInfo$ */ - - #extension GL_ARB_texture_rectangle : enable #extension GL_ARB_texture_multisample : enable +#ifndef gl_FragColor +out vec4 gl_FragColor; +#endif + //class 2 -- shadows and SSAO uniform sampler2DMS depthMap; diff --git a/indra/newview/app_settings/shaders/class2/effects/colorFilterF.glsl b/indra/newview/app_settings/shaders/class2/effects/colorFilterF.glsl index 8d673237b8..439855910e 100644 --- a/indra/newview/app_settings/shaders/class2/effects/colorFilterF.glsl +++ b/indra/newview/app_settings/shaders/class2/effects/colorFilterF.glsl @@ -22,8 +22,10 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - +#ifndef gl_FragColor +out vec4 gl_FragColor; +#endif uniform sampler2DRect RenderTexture; uniform float brightness; diff --git a/indra/newview/app_settings/shaders/class2/effects/extractF.glsl b/indra/newview/app_settings/shaders/class2/effects/extractF.glsl index 06b83e3f5f..786c00f946 100644 --- a/indra/newview/app_settings/shaders/class2/effects/extractF.glsl +++ b/indra/newview/app_settings/shaders/class2/effects/extractF.glsl @@ -23,7 +23,9 @@ * $/LicenseInfo$ */ - +#ifndef gl_FragColor +out vec4 gl_FragColor; +#endif uniform sampler2DRect RenderTexture; uniform float extractLow; diff --git a/indra/newview/app_settings/shaders/class2/effects/nightVisionF.glsl b/indra/newview/app_settings/shaders/class2/effects/nightVisionF.glsl index 3050fa63cc..4074540591 100644 --- a/indra/newview/app_settings/shaders/class2/effects/nightVisionF.glsl +++ b/indra/newview/app_settings/shaders/class2/effects/nightVisionF.glsl @@ -23,7 +23,9 @@ * $/LicenseInfo$ */ - +#ifndef gl_FragColor +out vec4 gl_FragColor; +#endif uniform sampler2DRect RenderTexture; uniform sampler2D NoiseTexture; diff --git a/indra/newview/app_settings/shaders/class2/effects/simpleF.glsl b/indra/newview/app_settings/shaders/class2/effects/simpleF.glsl index 74e9559185..7e8be3c19c 100644 --- a/indra/newview/app_settings/shaders/class2/effects/simpleF.glsl +++ b/indra/newview/app_settings/shaders/class2/effects/simpleF.glsl @@ -23,7 +23,9 @@ * $/LicenseInfo$ */ - +#ifndef gl_FragColor +out vec4 gl_FragColor; +#endif uniform sampler2DRect RenderTexture; diff --git a/indra/newview/app_settings/shaders/class2/environment/terrainF.glsl b/indra/newview/app_settings/shaders/class2/environment/terrainF.glsl index 6b9c629644..eed8b3cc01 100644 --- a/indra/newview/app_settings/shaders/class2/environment/terrainF.glsl +++ b/indra/newview/app_settings/shaders/class2/environment/terrainF.glsl @@ -23,6 +23,9 @@ * $/LicenseInfo$ */ +#ifndef gl_FragColor +out vec4 gl_FragColor; +#endif VARYING vec4 vertex_color; VARYING vec4 vary_texcoord0; diff --git a/indra/newview/app_settings/shaders/class2/environment/terrainWaterF.glsl b/indra/newview/app_settings/shaders/class2/environment/terrainWaterF.glsl index 9f1c4797c9..c48333aa87 100644 --- a/indra/newview/app_settings/shaders/class2/environment/terrainWaterF.glsl +++ b/indra/newview/app_settings/shaders/class2/environment/terrainWaterF.glsl @@ -22,7 +22,11 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - + +#ifndef gl_FragColor +out vec4 gl_FragColor; +#endif + VARYING vec4 vertex_color; VARYING vec4 vary_texcoord0; VARYING vec4 vary_texcoord1; diff --git a/indra/newview/app_settings/shaders/class2/environment/underWaterF.glsl b/indra/newview/app_settings/shaders/class2/environment/underWaterF.glsl index e4b6402a8c..90a7aab62e 100644 --- a/indra/newview/app_settings/shaders/class2/environment/underWaterF.glsl +++ b/indra/newview/app_settings/shaders/class2/environment/underWaterF.glsl @@ -23,7 +23,9 @@ * $/LicenseInfo$ */ - +#ifndef gl_FragColor +out vec4 gl_FragColor; +#endif uniform sampler2D diffuseMap; uniform sampler2D bumpMap; diff --git a/indra/newview/app_settings/shaders/class2/environment/waterF.glsl b/indra/newview/app_settings/shaders/class2/environment/waterF.glsl index 0de77e6fe0..33ffeaefb0 100644 --- a/indra/newview/app_settings/shaders/class2/environment/waterF.glsl +++ b/indra/newview/app_settings/shaders/class2/environment/waterF.glsl @@ -23,7 +23,9 @@ * $/LicenseInfo$ */ - +#ifndef gl_FragColor +out vec4 gl_FragColor; +#endif vec3 scaleSoftClip(vec3 inColor); vec3 atmosTransport(vec3 inColor); diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightAlphaMaskF.glsl index ea17e42fab..7325e0fe4e 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightAlphaMaskF.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/lightAlphaMaskF.glsl @@ -23,6 +23,9 @@ * $/LicenseInfo$ */ +#ifndef gl_FragColor +out vec4 gl_FragColor; +#endif uniform float minimum_alpha; uniform float maximum_alpha; diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightAlphaMaskNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightAlphaMaskNonIndexedF.glsl index 155d0756be..9a9f8fbf75 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightAlphaMaskNonIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/lightAlphaMaskNonIndexedF.glsl @@ -22,7 +22,10 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - + +#ifndef gl_FragColor +out vec4 gl_FragColor; +#endif uniform float minimum_alpha; uniform float maximum_alpha; diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightF.glsl index 43970015c5..c2847bbce8 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightF.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/lightF.glsl @@ -22,7 +22,11 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - + +#ifndef gl_FragColor +out vec4 gl_FragColor; +#endif + VARYING vec4 vertex_color; VARYING vec2 vary_texcoord0; diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightAlphaMaskF.glsl index c6583a54df..29dbcb2d8c 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightAlphaMaskF.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightAlphaMaskF.glsl @@ -22,7 +22,11 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - + +#ifndef gl_FragColor +out vec4 gl_FragColor; +#endif + uniform float minimum_alpha; uniform float maximum_alpha; diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightF.glsl index ba2e8608f1..5dd8822a68 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightF.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightF.glsl @@ -22,7 +22,11 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - + +#ifndef gl_FragColor +out vec4 gl_FragColor; +#endif + VARYING vec4 vertex_color; VARYING vec2 vary_texcoord0; diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightNonIndexedAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightNonIndexedAlphaMaskF.glsl index 76f468d914..ccd8fddb99 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightNonIndexedAlphaMaskF.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightNonIndexedAlphaMaskF.glsl @@ -22,7 +22,11 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - + +#ifndef gl_FragColor +out vec4 gl_FragColor; +#endif + uniform float minimum_alpha; uniform float maximum_alpha; diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightNonIndexedF.glsl index e88bf7f0ab..14d44de3d5 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightNonIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightNonIndexedF.glsl @@ -22,7 +22,11 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - + +#ifndef gl_FragColor +out vec4 gl_FragColor; +#endif + VARYING vec4 vertex_color; VARYING vec2 vary_texcoord0; diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyF.glsl index 045fc5276d..6cb6453f58 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyF.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyF.glsl @@ -22,7 +22,11 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - + +#ifndef gl_FragColor +out vec4 gl_FragColor; +#endif + VARYING vec4 vertex_color; VARYING vec2 vary_texcoord0; VARYING vec3 vary_texcoord1; diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyNonIndexedF.glsl index 93b14ad692..8940e1683b 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyNonIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyNonIndexedF.glsl @@ -22,7 +22,11 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - + +#ifndef gl_FragColor +out vec4 gl_FragColor; +#endif + VARYING vec4 vertex_color; VARYING vec2 vary_texcoord0; VARYING vec3 vary_texcoord1; diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyWaterF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyWaterF.glsl index ffc91d9ee1..560702c8ce 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyWaterF.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyWaterF.glsl @@ -22,6 +22,9 @@ * $/LicenseInfo$ */ +#ifndef gl_FragColor +out vec4 gl_FragColor; +#endif VARYING vec4 vertex_color; VARYING vec2 vary_texcoord0; diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyWaterNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyWaterNonIndexedF.glsl index 3f582d3228..b8b6a22a43 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyWaterNonIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyWaterNonIndexedF.glsl @@ -22,6 +22,9 @@ * $/LicenseInfo$ */ +#ifndef gl_FragColor +out vec4 gl_FragColor; +#endif VARYING vec4 vertex_color; VARYING vec2 vary_texcoord0; diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterAlphaMaskF.glsl index fb2b642022..748e30b8fb 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterAlphaMaskF.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterAlphaMaskF.glsl @@ -23,6 +23,10 @@ * $/LicenseInfo$ */ +#ifndef gl_FragColor +out vec4 gl_FragColor; +#endif + uniform float minimum_alpha; uniform float maximum_alpha; diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterF.glsl index 258cad3cfe..5a47f85833 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterF.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterF.glsl @@ -22,7 +22,11 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - + +#ifndef gl_FragColor +out vec4 gl_FragColor; +#endif + VARYING vec4 vertex_color; VARYING vec2 vary_texcoord0; diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterNonIndexedAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterNonIndexedAlphaMaskF.glsl index 3f2802cbb8..8430091bf5 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterNonIndexedAlphaMaskF.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterNonIndexedAlphaMaskF.glsl @@ -22,7 +22,11 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - + +#ifndef gl_FragColor +out vec4 gl_FragColor; +#endif + uniform float minimum_alpha; uniform float maximum_alpha; diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterNonIndexedF.glsl index 23700fa1b0..fe9f330215 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterNonIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterNonIndexedF.glsl @@ -22,7 +22,10 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - + +#ifndef gl_FragColor +out vec4 gl_FragColor; +#endif VARYING vec4 vertex_color; VARYING vec2 vary_texcoord0; diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightNonIndexedF.glsl index 09f02b9288..fc88010978 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightNonIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/lightNonIndexedF.glsl @@ -22,6 +22,10 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ + +#ifndef gl_FragColor +out vec4 gl_FragColor; +#endif VARYING vec4 vertex_color; VARYING vec2 vary_texcoord0; diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightShinyF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightShinyF.glsl index 66a2462b88..9f416090aa 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightShinyF.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/lightShinyF.glsl @@ -22,7 +22,10 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - + +#ifndef gl_FragColor +out vec4 gl_FragColor; +#endif VARYING vec4 vertex_color; VARYING vec2 vary_texcoord0; diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightShinyNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightShinyNonIndexedF.glsl index 477408f5af..abc41fc09a 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightShinyNonIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/lightShinyNonIndexedF.glsl @@ -22,6 +22,10 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ + +#ifndef gl_FragColor +out vec4 gl_FragColor; +#endif VARYING vec4 vertex_color; VARYING vec2 vary_texcoord0; diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightShinyWaterF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightShinyWaterF.glsl index 6df8641b47..99df846e68 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightShinyWaterF.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/lightShinyWaterF.glsl @@ -22,7 +22,10 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - + +#ifndef gl_FragColor +out vec4 gl_FragColor; +#endif VARYING vec4 vertex_color; VARYING vec2 vary_texcoord0; diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightShinyWaterNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightShinyWaterNonIndexedF.glsl index fce717d93a..d67aeb6655 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightShinyWaterNonIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/lightShinyWaterNonIndexedF.glsl @@ -22,7 +22,10 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - + +#ifndef gl_FragColor +out vec4 gl_FragColor; +#endif VARYING vec4 vertex_color; VARYING vec2 vary_texcoord0; diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightWaterAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightWaterAlphaMaskF.glsl index 4658b46a38..ad219d0d2a 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightWaterAlphaMaskF.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/lightWaterAlphaMaskF.glsl @@ -22,7 +22,11 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - + +#ifndef gl_FragColor +out vec4 gl_FragColor; +#endif + uniform float minimum_alpha; uniform float maximum_alpha; diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightWaterAlphaMaskNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightWaterAlphaMaskNonIndexedF.glsl index 0db9253cd1..3ec16b1681 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightWaterAlphaMaskNonIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/lightWaterAlphaMaskNonIndexedF.glsl @@ -22,7 +22,11 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - + +#ifndef gl_FragColor +out vec4 gl_FragColor; +#endif + uniform float minimum_alpha; uniform float maximum_alpha; diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightWaterF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightWaterF.glsl index a691d4f54a..4dddc95afd 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightWaterF.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/lightWaterF.glsl @@ -22,7 +22,10 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - + +#ifndef gl_FragColor +out vec4 gl_FragColor; +#endif VARYING vec4 vertex_color; VARYING vec2 vary_texcoord0; diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightWaterNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightWaterNonIndexedF.glsl index 6f5d6cd1c8..f89b2dcea2 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightWaterNonIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/lightWaterNonIndexedF.glsl @@ -22,7 +22,10 @@ * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ - + +#ifndef gl_FragColor +out vec4 gl_FragColor; +#endif VARYING vec4 vertex_color; VARYING vec2 vary_texcoord0; diff --git a/indra/newview/app_settings/shaders/class2/windlight/cloudsF.glsl b/indra/newview/app_settings/shaders/class2/windlight/cloudsF.glsl index ea60d1df6c..d06e80ec35 100644 --- a/indra/newview/app_settings/shaders/class2/windlight/cloudsF.glsl +++ b/indra/newview/app_settings/shaders/class2/windlight/cloudsF.glsl @@ -23,7 +23,9 @@ * $/LicenseInfo$ */ - +#ifndef gl_FragColor +out vec4 gl_FragColor; +#endif ///////////////////////////////////////////////////////////////////////// // The fragment shader for the sky diff --git a/indra/newview/app_settings/shaders/class2/windlight/skyF.glsl b/indra/newview/app_settings/shaders/class2/windlight/skyF.glsl index 5c9ee5fd63..be9fefcb33 100644 --- a/indra/newview/app_settings/shaders/class2/windlight/skyF.glsl +++ b/indra/newview/app_settings/shaders/class2/windlight/skyF.glsl @@ -23,7 +23,9 @@ * $/LicenseInfo$ */ - +#ifndef gl_FragColor +out vec4 gl_FragColor; +#endif ///////////////////////////////////////////////////////////////////////// // The fragment shader for the sky -- cgit v1.2.3 From e7b743d80bb6e7bde9c90eb0a7f0e0244bb41f8d Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Thu, 22 Sep 2011 00:33:27 -0500 Subject: SH-2244 Fix for artifacts with L&S enabled when using core profile. --- indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl | 1 - .../newview/app_settings/shaders/class2/deferred/multiSpotLightMSF.glsl | 1 - indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl | 2 +- indra/newview/app_settings/shaders/class2/deferred/softenLightMSF.glsl | 2 +- indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl | 1 - indra/newview/app_settings/shaders/class2/deferred/spotLightMSF.glsl | 1 - 6 files changed, 2 insertions(+), 6 deletions(-) (limited to 'indra/newview/app_settings/shaders/class2') diff --git a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl index 409db862e6..7ef2608841 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl @@ -36,7 +36,6 @@ uniform sampler2DRect normalMap; uniform samplerCube environmentMap; uniform sampler2DRect lightMap; uniform sampler2D noiseMap; -uniform sampler2D lightFunc; uniform sampler2D projectionMap; uniform mat4 proj_mat; //screen space to light space diff --git a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightMSF.glsl b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightMSF.glsl index 9e7542c01c..c2d374d22c 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightMSF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightMSF.glsl @@ -38,7 +38,6 @@ uniform sampler2DMS depthMap; uniform sampler2DMS normalMap; uniform sampler2DRect lightMap; uniform sampler2D noiseMap; -uniform sampler2D lightFunc; uniform sampler2D projectionMap; uniform mat4 proj_mat; //screen space to light space diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl index 642145a856..c09e3bb6e6 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl @@ -313,7 +313,7 @@ void main() // vec3 refnormpersp = normalize(reflect(pos.xyz, norm.xyz)); float sa = dot(refnormpersp, sun_dir.xyz); - vec3 dumbshiny = vary_SunlitColor*scol_ambocc.r*texture2D(lightFunc, vec2(sa, spec.a)).a; + vec3 dumbshiny = vary_SunlitColor*scol_ambocc.r*texture2D(lightFunc, vec2(sa, spec.a)).r; // add the two types of shiny together vec3 spec_contrib = dumbshiny * spec.rgb; diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightMSF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightMSF.glsl index ab187ccfa5..6d746ebbba 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/softenLightMSF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightMSF.glsl @@ -314,7 +314,7 @@ void main() // vec3 refnormpersp = normalize(reflect(pos.xyz, norm.xyz)); float sa = dot(refnormpersp, vary_light.xyz); - vec3 dumbshiny = vary_SunlitColor*scol_ambocc.r*texture2D(lightFunc, vec2(sa, spec.a)).a; + vec3 dumbshiny = vary_SunlitColor*scol_ambocc.r*texture2D(lightFunc, vec2(sa, spec.a)).r; // add the two types of shiny together vec3 spec_contrib = dumbshiny * spec.rgb; diff --git a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl index c2e36abbd6..93b385cbf5 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl @@ -38,7 +38,6 @@ uniform sampler2DRect normalMap; uniform samplerCube environmentMap; uniform sampler2DRect lightMap; uniform sampler2D noiseMap; -uniform sampler2D lightFunc; uniform sampler2D projectionMap; uniform mat4 proj_mat; //screen space to light space diff --git a/indra/newview/app_settings/shaders/class2/deferred/spotLightMSF.glsl b/indra/newview/app_settings/shaders/class2/deferred/spotLightMSF.glsl index 50369cb205..1e3257d4a2 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/spotLightMSF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/spotLightMSF.glsl @@ -38,7 +38,6 @@ uniform sampler2DMS depthMap; uniform sampler2DMS normalMap; uniform sampler2DRect lightMap; uniform sampler2D noiseMap; -uniform sampler2D lightFunc; uniform sampler2D projectionMap; uniform mat4 proj_mat; //screen space to light space -- cgit v1.2.3 From b9926e8f57787eb146b06260cc3d0260e34330ce Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Fri, 23 Sep 2011 02:29:53 -0500 Subject: SH-2244 Better VAO support -- still slower than non-VAO implementation for some reason --- indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl | 5 +++-- .../app_settings/shaders/class2/objects/fullbrightShinyV.glsl | 5 +++-- indra/newview/app_settings/shaders/class2/objects/fullbrightV.glsl | 5 +++-- indra/newview/app_settings/shaders/class2/objects/shinyV.glsl | 5 +++-- indra/newview/app_settings/shaders/class2/objects/simpleV.glsl | 5 +++-- 5 files changed, 15 insertions(+), 10 deletions(-) (limited to 'indra/newview/app_settings/shaders/class2') diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl index 268e4127a2..6a3777c7c8 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl @@ -28,7 +28,8 @@ uniform mat4 texture_matrix0; uniform mat4 modelview_matrix; uniform mat4 modelview_projection_matrix; -ATTRIBUTE vec4 position; +ATTRIBUTE vec3 position; +ATTRIBUTE float texture_index; ATTRIBUTE vec3 normal; ATTRIBUTE vec4 diffuse_color; ATTRIBUTE vec2 texcoord0; @@ -96,7 +97,7 @@ void main() { //transform vertex vec4 vert = vec4(position.xyz, 1.0); - vary_texture_index = position.w; + vary_texture_index = texture_index; vec4 pos = (modelview_matrix * vert); gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0); diff --git a/indra/newview/app_settings/shaders/class2/objects/fullbrightShinyV.glsl b/indra/newview/app_settings/shaders/class2/objects/fullbrightShinyV.glsl index ef97e4f781..580ef2694f 100644 --- a/indra/newview/app_settings/shaders/class2/objects/fullbrightShinyV.glsl +++ b/indra/newview/app_settings/shaders/class2/objects/fullbrightShinyV.glsl @@ -36,7 +36,8 @@ uniform vec4 origin; VARYING float vary_texture_index; -ATTRIBUTE vec4 position; +ATTRIBUTE vec3 position; +ATTRIBUTE float texture_index; ATTRIBUTE vec3 normal; ATTRIBUTE vec4 diffuse_color; ATTRIBUTE vec2 texcoord0; @@ -50,7 +51,7 @@ void main() { //transform vertex vec4 vert = vec4(position.xyz,1.0); - vary_texture_index = position.w; + vary_texture_index = texture_index; vec4 pos = (modelview_matrix * vert); gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0); diff --git a/indra/newview/app_settings/shaders/class2/objects/fullbrightV.glsl b/indra/newview/app_settings/shaders/class2/objects/fullbrightV.glsl index 2fd22cee9d..09dbd0b6cd 100644 --- a/indra/newview/app_settings/shaders/class2/objects/fullbrightV.glsl +++ b/indra/newview/app_settings/shaders/class2/objects/fullbrightV.glsl @@ -27,7 +27,8 @@ uniform mat4 texture_matrix0; uniform mat4 modelview_matrix; uniform mat4 modelview_projection_matrix; -ATTRIBUTE vec4 position; +ATTRIBUTE vec3 position; +ATTRIBUTE float texture_index; ATTRIBUTE vec2 texcoord0; ATTRIBUTE vec3 normal; ATTRIBUTE vec4 diffuse_color; @@ -44,7 +45,7 @@ void main() { //transform vertex vec4 vert = vec4(position.xyz,1.0); - vary_texture_index = position.w; + vary_texture_index = texture_index; vec4 pos = (modelview_matrix * vert); gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0); vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy; diff --git a/indra/newview/app_settings/shaders/class2/objects/shinyV.glsl b/indra/newview/app_settings/shaders/class2/objects/shinyV.glsl index 472ff219e5..86c592ea57 100644 --- a/indra/newview/app_settings/shaders/class2/objects/shinyV.glsl +++ b/indra/newview/app_settings/shaders/class2/objects/shinyV.glsl @@ -29,7 +29,8 @@ uniform mat4 texture_matrix1; uniform mat4 modelview_matrix; uniform mat4 modelview_projection_matrix; -ATTRIBUTE vec4 position; +ATTRIBUTE vec3 position; +ATTRIBUTE float texture_index; ATTRIBUTE vec2 texcoord0; ATTRIBUTE vec3 normal; ATTRIBUTE vec4 diffuse_color; @@ -51,7 +52,7 @@ void main() { //transform vertex vec4 vert = vec4(position.xyz,1.0); - vary_texture_index = position.w; + vary_texture_index = texture_index; vec4 pos = (modelview_matrix * vert); gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0); diff --git a/indra/newview/app_settings/shaders/class2/objects/simpleV.glsl b/indra/newview/app_settings/shaders/class2/objects/simpleV.glsl index 144336417e..8e8f0664b0 100644 --- a/indra/newview/app_settings/shaders/class2/objects/simpleV.glsl +++ b/indra/newview/app_settings/shaders/class2/objects/simpleV.glsl @@ -28,7 +28,8 @@ uniform mat4 texture_matrix0; uniform mat4 modelview_matrix; uniform mat4 modelview_projection_matrix; -ATTRIBUTE vec4 position; +ATTRIBUTE vec3 position; +ATTRIBUTE float texture_index; ATTRIBUTE vec2 texcoord0; ATTRIBUTE vec3 normal; ATTRIBUTE vec4 diffuse_color; @@ -45,7 +46,7 @@ void main() { //transform vertex vec4 vert = vec4(position.xyz,1.0); - vary_texture_index = position.w; + vary_texture_index = texture_index; vec4 pos = (modelview_matrix * vert); gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0); vary_texcoord0 = (texture_matrix0 * vec4(texcoord0, 0, 1)).xy; -- cgit v1.2.3 From 183fe0d14c48ebeb174567304cea197e7ea443fa Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Sat, 24 Sep 2011 03:09:32 -0500 Subject: SH-2244 Fix for shaders not compiling on pre-GL-3.0 ATI drivers --- indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl | 2 +- .../newview/app_settings/shaders/class2/deferred/alphaNonIndexedF.glsl | 2 +- .../app_settings/shaders/class2/deferred/alphaNonIndexedNoColorF.glsl | 2 +- indra/newview/app_settings/shaders/class2/deferred/edgeF.glsl | 2 +- indra/newview/app_settings/shaders/class2/deferred/edgeMSF.glsl | 2 +- indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl | 2 +- .../newview/app_settings/shaders/class2/deferred/multiSpotLightMSF.glsl | 2 +- indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl | 2 +- indra/newview/app_settings/shaders/class2/deferred/softenLightMSF.glsl | 2 +- indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl | 2 +- indra/newview/app_settings/shaders/class2/deferred/spotLightMSF.glsl | 2 +- indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl | 2 +- indra/newview/app_settings/shaders/class2/deferred/sunLightMSF.glsl | 2 +- indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl | 2 +- indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOMSF.glsl | 2 +- indra/newview/app_settings/shaders/class2/effects/colorFilterF.glsl | 2 +- indra/newview/app_settings/shaders/class2/effects/extractF.glsl | 2 +- indra/newview/app_settings/shaders/class2/effects/nightVisionF.glsl | 2 +- indra/newview/app_settings/shaders/class2/effects/simpleF.glsl | 2 +- indra/newview/app_settings/shaders/class2/environment/terrainF.glsl | 2 +- .../newview/app_settings/shaders/class2/environment/terrainWaterF.glsl | 2 +- indra/newview/app_settings/shaders/class2/environment/underWaterF.glsl | 2 +- indra/newview/app_settings/shaders/class2/environment/waterF.glsl | 2 +- indra/newview/app_settings/shaders/class2/lighting/lightAlphaMaskF.glsl | 2 +- .../app_settings/shaders/class2/lighting/lightAlphaMaskNonIndexedF.glsl | 2 +- indra/newview/app_settings/shaders/class2/lighting/lightF.glsl | 2 +- .../app_settings/shaders/class2/lighting/lightFullbrightAlphaMaskF.glsl | 2 +- .../newview/app_settings/shaders/class2/lighting/lightFullbrightF.glsl | 2 +- .../shaders/class2/lighting/lightFullbrightNonIndexedAlphaMaskF.glsl | 2 +- .../shaders/class2/lighting/lightFullbrightNonIndexedF.glsl | 2 +- .../app_settings/shaders/class2/lighting/lightFullbrightShinyF.glsl | 2 +- .../shaders/class2/lighting/lightFullbrightShinyNonIndexedF.glsl | 2 +- .../shaders/class2/lighting/lightFullbrightShinyWaterF.glsl | 2 +- .../shaders/class2/lighting/lightFullbrightShinyWaterNonIndexedF.glsl | 2 +- .../shaders/class2/lighting/lightFullbrightWaterAlphaMaskF.glsl | 2 +- .../app_settings/shaders/class2/lighting/lightFullbrightWaterF.glsl | 2 +- .../class2/lighting/lightFullbrightWaterNonIndexedAlphaMaskF.glsl | 2 +- .../shaders/class2/lighting/lightFullbrightWaterNonIndexedF.glsl | 2 +- .../newview/app_settings/shaders/class2/lighting/lightNonIndexedF.glsl | 2 +- indra/newview/app_settings/shaders/class2/lighting/lightShinyF.glsl | 2 +- .../app_settings/shaders/class2/lighting/lightShinyNonIndexedF.glsl | 2 +- .../newview/app_settings/shaders/class2/lighting/lightShinyWaterF.glsl | 2 +- .../shaders/class2/lighting/lightShinyWaterNonIndexedF.glsl | 2 +- .../app_settings/shaders/class2/lighting/lightWaterAlphaMaskF.glsl | 2 +- .../shaders/class2/lighting/lightWaterAlphaMaskNonIndexedF.glsl | 2 +- indra/newview/app_settings/shaders/class2/lighting/lightWaterF.glsl | 2 +- .../app_settings/shaders/class2/lighting/lightWaterNonIndexedF.glsl | 2 +- indra/newview/app_settings/shaders/class2/windlight/cloudsF.glsl | 2 +- indra/newview/app_settings/shaders/class2/windlight/skyF.glsl | 2 +- 49 files changed, 49 insertions(+), 49 deletions(-) (limited to 'indra/newview/app_settings/shaders/class2') diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl index ab4ed093c8..8d88e93698 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl @@ -25,7 +25,7 @@ #extension GL_ARB_texture_rectangle : enable -#ifndef gl_FragColor +#ifdef DEFINE_GL_FRAGCOLOR out vec4 gl_FragColor; #endif diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedF.glsl index a9ee534bdf..0df557f2aa 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedF.glsl @@ -25,7 +25,7 @@ #extension GL_ARB_texture_rectangle : enable -#ifndef gl_FragColor +#ifdef DEFINE_GL_FRAGCOLOR out vec4 gl_FragColor; #endif diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedNoColorF.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedNoColorF.glsl index 98dd9d4a1e..331dbc7079 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedNoColorF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/alphaNonIndexedNoColorF.glsl @@ -25,7 +25,7 @@ #extension GL_ARB_texture_rectangle : enable -#ifndef gl_FragColor +#ifdef DEFINE_GL_FRAGCOLOR out vec4 gl_FragColor; #endif diff --git a/indra/newview/app_settings/shaders/class2/deferred/edgeF.glsl b/indra/newview/app_settings/shaders/class2/deferred/edgeF.glsl index 96e71b46d7..f75a08779c 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/edgeF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/edgeF.glsl @@ -25,7 +25,7 @@ #extension GL_ARB_texture_rectangle : enable -#ifndef gl_FragColor +#ifdef DEFINE_GL_FRAGCOLOR out vec4 gl_FragColor; #endif diff --git a/indra/newview/app_settings/shaders/class2/deferred/edgeMSF.glsl b/indra/newview/app_settings/shaders/class2/deferred/edgeMSF.glsl index 540c71c5e3..b9c65b168c 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/edgeMSF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/edgeMSF.glsl @@ -26,7 +26,7 @@ #extension GL_ARB_texture_rectangle : enable #extension GL_ARB_texture_multisample : enable -#ifndef gl_FragColor +#ifdef DEFINE_GL_FRAGCOLOR out vec4 gl_FragColor; #endif diff --git a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl index 7ef2608841..14a683971a 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl @@ -25,7 +25,7 @@ #extension GL_ARB_texture_rectangle : enable -#ifndef gl_FragColor +#ifdef DEFINE_GL_FRAGCOLOR out vec4 gl_FragColor; #endif diff --git a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightMSF.glsl b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightMSF.glsl index c2d374d22c..4037dca91a 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightMSF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightMSF.glsl @@ -26,7 +26,7 @@ #extension GL_ARB_texture_rectangle : enable #extension GL_ARB_texture_multisample : enable -#ifndef gl_FragColor +#ifdef DEFINE_GL_FRAGCOLOR out vec4 gl_FragColor; #endif diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl index c09e3bb6e6..4543e83d0a 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl @@ -25,7 +25,7 @@ #extension GL_ARB_texture_rectangle : enable -#ifndef gl_FragColor +#ifdef DEFINE_GL_FRAGCOLOR out vec4 gl_FragColor; #endif diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightMSF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightMSF.glsl index 6d746ebbba..62a86a3f09 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/softenLightMSF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightMSF.glsl @@ -26,7 +26,7 @@ #extension GL_ARB_texture_rectangle : enable #extension GL_ARB_texture_multisample : enable -#ifndef gl_FragColor +#ifdef DEFINE_GL_FRAGCOLOR out vec4 gl_FragColor; #endif diff --git a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl index 93b385cbf5..31bd0c79da 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl @@ -25,7 +25,7 @@ #extension GL_ARB_texture_rectangle : enable -#ifndef gl_FragColor +#ifdef DEFINE_GL_FRAGCOLOR out vec4 gl_FragColor; #endif diff --git a/indra/newview/app_settings/shaders/class2/deferred/spotLightMSF.glsl b/indra/newview/app_settings/shaders/class2/deferred/spotLightMSF.glsl index 1e3257d4a2..af3487fd91 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/spotLightMSF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/spotLightMSF.glsl @@ -26,7 +26,7 @@ #extension GL_ARB_texture_rectangle : enable #extension GL_ARB_texture_multisample : enable -#ifndef gl_FragColor +#ifdef DEFINE_GL_FRAGCOLOR out vec4 gl_FragColor; #endif diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl index efb1984874..7e62012b5d 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl @@ -25,7 +25,7 @@ #extension GL_ARB_texture_rectangle : enable -#ifndef gl_FragColor +#ifdef DEFINE_GL_FRAGCOLOR out vec4 gl_FragColor; #endif diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightMSF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightMSF.glsl index 96b6140c0a..11b3faa4c9 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/sunLightMSF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightMSF.glsl @@ -26,7 +26,7 @@ #extension GL_ARB_texture_rectangle : enable #extension GL_ARB_texture_multisample : enable -#ifndef gl_FragColor +#ifdef DEFINE_GL_FRAGCOLOR out vec4 gl_FragColor; #endif diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl index 1886178731..025ff48109 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl @@ -24,7 +24,7 @@ #extension GL_ARB_texture_rectangle : enable -#ifndef gl_FragColor +#ifdef DEFINE_GL_FRAGCOLOR out vec4 gl_FragColor; #endif diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOMSF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOMSF.glsl index 4a2ba0afc5..c571db9df2 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOMSF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOMSF.glsl @@ -25,7 +25,7 @@ #extension GL_ARB_texture_rectangle : enable #extension GL_ARB_texture_multisample : enable -#ifndef gl_FragColor +#ifdef DEFINE_GL_FRAGCOLOR out vec4 gl_FragColor; #endif diff --git a/indra/newview/app_settings/shaders/class2/effects/colorFilterF.glsl b/indra/newview/app_settings/shaders/class2/effects/colorFilterF.glsl index 439855910e..f42497d8be 100644 --- a/indra/newview/app_settings/shaders/class2/effects/colorFilterF.glsl +++ b/indra/newview/app_settings/shaders/class2/effects/colorFilterF.glsl @@ -23,7 +23,7 @@ * $/LicenseInfo$ */ -#ifndef gl_FragColor +#ifdef DEFINE_GL_FRAGCOLOR out vec4 gl_FragColor; #endif diff --git a/indra/newview/app_settings/shaders/class2/effects/extractF.glsl b/indra/newview/app_settings/shaders/class2/effects/extractF.glsl index 786c00f946..ebf4f28a74 100644 --- a/indra/newview/app_settings/shaders/class2/effects/extractF.glsl +++ b/indra/newview/app_settings/shaders/class2/effects/extractF.glsl @@ -23,7 +23,7 @@ * $/LicenseInfo$ */ -#ifndef gl_FragColor +#ifdef DEFINE_GL_FRAGCOLOR out vec4 gl_FragColor; #endif diff --git a/indra/newview/app_settings/shaders/class2/effects/nightVisionF.glsl b/indra/newview/app_settings/shaders/class2/effects/nightVisionF.glsl index 4074540591..2bfcfad081 100644 --- a/indra/newview/app_settings/shaders/class2/effects/nightVisionF.glsl +++ b/indra/newview/app_settings/shaders/class2/effects/nightVisionF.glsl @@ -23,7 +23,7 @@ * $/LicenseInfo$ */ -#ifndef gl_FragColor +#ifdef DEFINE_GL_FRAGCOLOR out vec4 gl_FragColor; #endif diff --git a/indra/newview/app_settings/shaders/class2/effects/simpleF.glsl b/indra/newview/app_settings/shaders/class2/effects/simpleF.glsl index 7e8be3c19c..932bd87152 100644 --- a/indra/newview/app_settings/shaders/class2/effects/simpleF.glsl +++ b/indra/newview/app_settings/shaders/class2/effects/simpleF.glsl @@ -23,7 +23,7 @@ * $/LicenseInfo$ */ -#ifndef gl_FragColor +#ifdef DEFINE_GL_FRAGCOLOR out vec4 gl_FragColor; #endif diff --git a/indra/newview/app_settings/shaders/class2/environment/terrainF.glsl b/indra/newview/app_settings/shaders/class2/environment/terrainF.glsl index eed8b3cc01..18f6d91804 100644 --- a/indra/newview/app_settings/shaders/class2/environment/terrainF.glsl +++ b/indra/newview/app_settings/shaders/class2/environment/terrainF.glsl @@ -23,7 +23,7 @@ * $/LicenseInfo$ */ -#ifndef gl_FragColor +#ifdef DEFINE_GL_FRAGCOLOR out vec4 gl_FragColor; #endif diff --git a/indra/newview/app_settings/shaders/class2/environment/terrainWaterF.glsl b/indra/newview/app_settings/shaders/class2/environment/terrainWaterF.glsl index c48333aa87..e5c7ced52c 100644 --- a/indra/newview/app_settings/shaders/class2/environment/terrainWaterF.glsl +++ b/indra/newview/app_settings/shaders/class2/environment/terrainWaterF.glsl @@ -23,7 +23,7 @@ * $/LicenseInfo$ */ -#ifndef gl_FragColor +#ifdef DEFINE_GL_FRAGCOLOR out vec4 gl_FragColor; #endif diff --git a/indra/newview/app_settings/shaders/class2/environment/underWaterF.glsl b/indra/newview/app_settings/shaders/class2/environment/underWaterF.glsl index 90a7aab62e..1fdb90f792 100644 --- a/indra/newview/app_settings/shaders/class2/environment/underWaterF.glsl +++ b/indra/newview/app_settings/shaders/class2/environment/underWaterF.glsl @@ -23,7 +23,7 @@ * $/LicenseInfo$ */ -#ifndef gl_FragColor +#ifdef DEFINE_GL_FRAGCOLOR out vec4 gl_FragColor; #endif diff --git a/indra/newview/app_settings/shaders/class2/environment/waterF.glsl b/indra/newview/app_settings/shaders/class2/environment/waterF.glsl index 33ffeaefb0..444c896d38 100644 --- a/indra/newview/app_settings/shaders/class2/environment/waterF.glsl +++ b/indra/newview/app_settings/shaders/class2/environment/waterF.glsl @@ -23,7 +23,7 @@ * $/LicenseInfo$ */ -#ifndef gl_FragColor +#ifdef DEFINE_GL_FRAGCOLOR out vec4 gl_FragColor; #endif diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightAlphaMaskF.glsl index 7325e0fe4e..6815f7aa85 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightAlphaMaskF.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/lightAlphaMaskF.glsl @@ -23,7 +23,7 @@ * $/LicenseInfo$ */ -#ifndef gl_FragColor +#ifdef DEFINE_GL_FRAGCOLOR out vec4 gl_FragColor; #endif diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightAlphaMaskNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightAlphaMaskNonIndexedF.glsl index 9a9f8fbf75..2640668d7d 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightAlphaMaskNonIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/lightAlphaMaskNonIndexedF.glsl @@ -23,7 +23,7 @@ * $/LicenseInfo$ */ -#ifndef gl_FragColor +#ifdef DEFINE_GL_FRAGCOLOR out vec4 gl_FragColor; #endif diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightF.glsl index c2847bbce8..735f5b3813 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightF.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/lightF.glsl @@ -23,7 +23,7 @@ * $/LicenseInfo$ */ -#ifndef gl_FragColor +#ifdef DEFINE_GL_FRAGCOLOR out vec4 gl_FragColor; #endif diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightAlphaMaskF.glsl index 29dbcb2d8c..92113d9afa 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightAlphaMaskF.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightAlphaMaskF.glsl @@ -23,7 +23,7 @@ * $/LicenseInfo$ */ -#ifndef gl_FragColor +#ifdef DEFINE_GL_FRAGCOLOR out vec4 gl_FragColor; #endif diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightF.glsl index 5dd8822a68..c3edc0bd70 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightF.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightF.glsl @@ -23,7 +23,7 @@ * $/LicenseInfo$ */ -#ifndef gl_FragColor +#ifdef DEFINE_GL_FRAGCOLOR out vec4 gl_FragColor; #endif diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightNonIndexedAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightNonIndexedAlphaMaskF.glsl index ccd8fddb99..d1ad3da009 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightNonIndexedAlphaMaskF.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightNonIndexedAlphaMaskF.glsl @@ -23,7 +23,7 @@ * $/LicenseInfo$ */ -#ifndef gl_FragColor +#ifdef DEFINE_GL_FRAGCOLOR out vec4 gl_FragColor; #endif diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightNonIndexedF.glsl index 14d44de3d5..4e1e664e6b 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightNonIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightNonIndexedF.glsl @@ -23,7 +23,7 @@ * $/LicenseInfo$ */ -#ifndef gl_FragColor +#ifdef DEFINE_GL_FRAGCOLOR out vec4 gl_FragColor; #endif diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyF.glsl index 6cb6453f58..c981e9eba2 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyF.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyF.glsl @@ -23,7 +23,7 @@ * $/LicenseInfo$ */ -#ifndef gl_FragColor +#ifdef DEFINE_GL_FRAGCOLOR out vec4 gl_FragColor; #endif diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyNonIndexedF.glsl index 8940e1683b..a4893f0359 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyNonIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyNonIndexedF.glsl @@ -23,7 +23,7 @@ * $/LicenseInfo$ */ -#ifndef gl_FragColor +#ifdef DEFINE_GL_FRAGCOLOR out vec4 gl_FragColor; #endif diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyWaterF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyWaterF.glsl index 560702c8ce..c10cde98e0 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyWaterF.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyWaterF.glsl @@ -22,7 +22,7 @@ * $/LicenseInfo$ */ -#ifndef gl_FragColor +#ifdef DEFINE_GL_FRAGCOLOR out vec4 gl_FragColor; #endif diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyWaterNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyWaterNonIndexedF.glsl index b8b6a22a43..e9b26087f4 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyWaterNonIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyWaterNonIndexedF.glsl @@ -22,7 +22,7 @@ * $/LicenseInfo$ */ -#ifndef gl_FragColor +#ifdef DEFINE_GL_FRAGCOLOR out vec4 gl_FragColor; #endif diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterAlphaMaskF.glsl index 748e30b8fb..32a1c71099 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterAlphaMaskF.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterAlphaMaskF.glsl @@ -23,7 +23,7 @@ * $/LicenseInfo$ */ -#ifndef gl_FragColor +#ifdef DEFINE_GL_FRAGCOLOR out vec4 gl_FragColor; #endif diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterF.glsl index 5a47f85833..2547f9e750 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterF.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterF.glsl @@ -23,7 +23,7 @@ * $/LicenseInfo$ */ -#ifndef gl_FragColor +#ifdef DEFINE_GL_FRAGCOLOR out vec4 gl_FragColor; #endif diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterNonIndexedAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterNonIndexedAlphaMaskF.glsl index 8430091bf5..1b5aa61441 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterNonIndexedAlphaMaskF.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterNonIndexedAlphaMaskF.glsl @@ -23,7 +23,7 @@ * $/LicenseInfo$ */ -#ifndef gl_FragColor +#ifdef DEFINE_GL_FRAGCOLOR out vec4 gl_FragColor; #endif diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterNonIndexedF.glsl index fe9f330215..aa3ef8cdd9 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterNonIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterNonIndexedF.glsl @@ -23,7 +23,7 @@ * $/LicenseInfo$ */ -#ifndef gl_FragColor +#ifdef DEFINE_GL_FRAGCOLOR out vec4 gl_FragColor; #endif diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightNonIndexedF.glsl index fc88010978..9f1a358b53 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightNonIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/lightNonIndexedF.glsl @@ -23,7 +23,7 @@ * $/LicenseInfo$ */ -#ifndef gl_FragColor +#ifdef DEFINE_GL_FRAGCOLOR out vec4 gl_FragColor; #endif diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightShinyF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightShinyF.glsl index 9f416090aa..e9c27dbefd 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightShinyF.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/lightShinyF.glsl @@ -23,7 +23,7 @@ * $/LicenseInfo$ */ -#ifndef gl_FragColor +#ifdef DEFINE_GL_FRAGCOLOR out vec4 gl_FragColor; #endif diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightShinyNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightShinyNonIndexedF.glsl index abc41fc09a..595ad74365 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightShinyNonIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/lightShinyNonIndexedF.glsl @@ -23,7 +23,7 @@ * $/LicenseInfo$ */ -#ifndef gl_FragColor +#ifdef DEFINE_GL_FRAGCOLOR out vec4 gl_FragColor; #endif diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightShinyWaterF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightShinyWaterF.glsl index 99df846e68..68c727d62c 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightShinyWaterF.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/lightShinyWaterF.glsl @@ -23,7 +23,7 @@ * $/LicenseInfo$ */ -#ifndef gl_FragColor +#ifdef DEFINE_GL_FRAGCOLOR out vec4 gl_FragColor; #endif diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightShinyWaterNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightShinyWaterNonIndexedF.glsl index d67aeb6655..f32b9e1958 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightShinyWaterNonIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/lightShinyWaterNonIndexedF.glsl @@ -23,7 +23,7 @@ * $/LicenseInfo$ */ -#ifndef gl_FragColor +#ifdef DEFINE_GL_FRAGCOLOR out vec4 gl_FragColor; #endif diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightWaterAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightWaterAlphaMaskF.glsl index ad219d0d2a..60289cf7f7 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightWaterAlphaMaskF.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/lightWaterAlphaMaskF.glsl @@ -23,7 +23,7 @@ * $/LicenseInfo$ */ -#ifndef gl_FragColor +#ifdef DEFINE_GL_FRAGCOLOR out vec4 gl_FragColor; #endif diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightWaterAlphaMaskNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightWaterAlphaMaskNonIndexedF.glsl index 3ec16b1681..d0038ae89b 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightWaterAlphaMaskNonIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/lightWaterAlphaMaskNonIndexedF.glsl @@ -23,7 +23,7 @@ * $/LicenseInfo$ */ -#ifndef gl_FragColor +#ifdef DEFINE_GL_FRAGCOLOR out vec4 gl_FragColor; #endif diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightWaterF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightWaterF.glsl index 4dddc95afd..e9537d1e9d 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightWaterF.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/lightWaterF.glsl @@ -23,7 +23,7 @@ * $/LicenseInfo$ */ -#ifndef gl_FragColor +#ifdef DEFINE_GL_FRAGCOLOR out vec4 gl_FragColor; #endif diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightWaterNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightWaterNonIndexedF.glsl index f89b2dcea2..8b0c25b705 100644 --- a/indra/newview/app_settings/shaders/class2/lighting/lightWaterNonIndexedF.glsl +++ b/indra/newview/app_settings/shaders/class2/lighting/lightWaterNonIndexedF.glsl @@ -23,7 +23,7 @@ * $/LicenseInfo$ */ -#ifndef gl_FragColor +#ifdef DEFINE_GL_FRAGCOLOR out vec4 gl_FragColor; #endif diff --git a/indra/newview/app_settings/shaders/class2/windlight/cloudsF.glsl b/indra/newview/app_settings/shaders/class2/windlight/cloudsF.glsl index d06e80ec35..4ab06c6e21 100644 --- a/indra/newview/app_settings/shaders/class2/windlight/cloudsF.glsl +++ b/indra/newview/app_settings/shaders/class2/windlight/cloudsF.glsl @@ -23,7 +23,7 @@ * $/LicenseInfo$ */ -#ifndef gl_FragColor +#ifdef DEFINE_GL_FRAGCOLOR out vec4 gl_FragColor; #endif diff --git a/indra/newview/app_settings/shaders/class2/windlight/skyF.glsl b/indra/newview/app_settings/shaders/class2/windlight/skyF.glsl index be9fefcb33..c9d96b2cf4 100644 --- a/indra/newview/app_settings/shaders/class2/windlight/skyF.glsl +++ b/indra/newview/app_settings/shaders/class2/windlight/skyF.glsl @@ -23,7 +23,7 @@ * $/LicenseInfo$ */ -#ifndef gl_FragColor +#ifdef DEFINE_GL_FRAGCOLOR out vec4 gl_FragColor; #endif -- cgit v1.2.3 From 554b14dedac5a51927bad57b475d8f5a571c1add Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Tue, 27 Sep 2011 15:56:15 -0500 Subject: Remove some unused shaders --- .../shaders/class2/deferred/edgeMSF.glsl | 94 ------ .../shaders/class2/deferred/multiSpotLightMSF.glsl | 265 ---------------- .../shaders/class2/deferred/softenLightMSF.glsl | 339 --------------------- .../shaders/class2/deferred/spotLightMSF.glsl | 266 ---------------- .../shaders/class2/deferred/sunLightMSF.glsl | 222 -------------- .../shaders/class2/deferred/sunLightSSAOMSF.glsl | 260 ---------------- 6 files changed, 1446 deletions(-) delete mode 100644 indra/newview/app_settings/shaders/class2/deferred/edgeMSF.glsl delete mode 100644 indra/newview/app_settings/shaders/class2/deferred/multiSpotLightMSF.glsl delete mode 100644 indra/newview/app_settings/shaders/class2/deferred/softenLightMSF.glsl delete mode 100644 indra/newview/app_settings/shaders/class2/deferred/spotLightMSF.glsl delete mode 100644 indra/newview/app_settings/shaders/class2/deferred/sunLightMSF.glsl delete mode 100644 indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOMSF.glsl (limited to 'indra/newview/app_settings/shaders/class2') diff --git a/indra/newview/app_settings/shaders/class2/deferred/edgeMSF.glsl b/indra/newview/app_settings/shaders/class2/deferred/edgeMSF.glsl deleted file mode 100644 index b9c65b168c..0000000000 --- a/indra/newview/app_settings/shaders/class2/deferred/edgeMSF.glsl +++ /dev/null @@ -1,94 +0,0 @@ -/** - * @file edgeF.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#extension GL_ARB_texture_rectangle : enable -#extension GL_ARB_texture_multisample : enable - -#ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; -#endif - -uniform sampler2DMS depthMap; -uniform sampler2DMS normalMap; - -VARYING vec2 vary_fragcoord; - -uniform float depth_cutoff; -uniform float norm_cutoff; - -uniform mat4 inv_proj; -uniform vec2 screen_res; - -float getDepth(ivec2 pos_screen, int sample) -{ - float z = texelFetch(depthMap, pos_screen, sample).r; - z = z*2.0-1.0; - vec4 ndc = vec4(0.0, 0.0, z, 1.0); - vec4 p = inv_proj*ndc; - return p.z/p.w; -} - -void main() -{ - float e = 0; - - ivec2 itc = ivec2(vary_fragcoord.xy); - - for (int i = 0; i < samples; i++) - { - vec3 norm = texelFetch(normalMap, itc, i).xyz; - norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm - float depth = getDepth(itc, i); - - vec2 tc = vary_fragcoord.xy; - - int sc = 1; - - vec2 de; - de.x = (depth-getDepth(itc+ivec2(sc, sc),i)) + (depth-getDepth(itc+ivec2(-sc, -sc), i)); - de.y = (depth-getDepth(itc+ivec2(-sc, sc),i)) + (depth-getDepth(itc+ivec2(sc, -sc), i)); - de /= depth; - de *= de; - de = step(depth_cutoff, de); - - vec2 ne; - vec3 nexnorm = texelFetch(normalMap, itc+ivec2(-sc,-sc), i).rgb; - nexnorm = vec3((nexnorm.xy-0.5)*2.0,nexnorm.z); // unpack norm - ne.x = dot(nexnorm, norm); - vec3 neynorm = texelFetch(normalMap, itc+ivec2(sc,sc), i).rgb; - neynorm = vec3((neynorm.xy-0.5)*2.0,neynorm.z); // unpack norm - ne.y = dot(neynorm, norm); - - ne = 1.0-ne; - - ne = step(norm_cutoff, ne); - - e += dot(de,de)+dot(ne,ne); - } - - e /= samples; - - gl_FragColor.a = e; -} diff --git a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightMSF.glsl b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightMSF.glsl deleted file mode 100644 index 4037dca91a..0000000000 --- a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightMSF.glsl +++ /dev/null @@ -1,265 +0,0 @@ -/** - * @file multiSpotLightF.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#extension GL_ARB_texture_rectangle : enable -#extension GL_ARB_texture_multisample : enable - -#ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; -#endif - -VARYING vec4 vertex_color; - -uniform sampler2DMS diffuseRect; -uniform sampler2DMS specularRect; -uniform sampler2DMS depthMap; -uniform sampler2DMS normalMap; -uniform sampler2DRect lightMap; -uniform sampler2D noiseMap; -uniform sampler2D projectionMap; - -uniform mat4 proj_mat; //screen space to light space -uniform float proj_near; //near clip for projection -uniform vec3 proj_p; //plane projection is emitting from (in screen space) -uniform vec3 proj_n; -uniform float proj_focus; //distance from plane to begin blurring -uniform float proj_lod; //(number of mips in proj map) -uniform float proj_range; //range between near clip and far clip plane of projection -uniform float proj_ambient_lod; -uniform float proj_ambiance; -uniform float near_clip; -uniform float far_clip; - -uniform vec3 proj_origin; //origin of projection to be used for angular attenuation -uniform float sun_wash; -uniform int proj_shadow_idx; -uniform float shadow_fade; - -VARYING vec4 vary_light; - -VARYING vec4 vary_fragcoord; -uniform vec2 screen_res; - -uniform mat4 inv_proj; - -vec4 texture2DLodSpecular(sampler2D projectionMap, vec2 tc, float lod) -{ - vec4 ret = texture2DLod(projectionMap, tc, lod); - - vec2 dist = tc-vec2(0.5); - - float det = max(1.0-lod/(proj_lod*0.5), 0.0); - - float d = dot(dist,dist); - - ret *= min(clamp((0.25-d)/0.25, 0.0, 1.0)+det, 1.0); - - return ret; -} - -vec4 texture2DLodDiffuse(sampler2D projectionMap, vec2 tc, float lod) -{ - vec4 ret = texture2DLod(projectionMap, tc, lod); - - vec2 dist = vec2(0.5) - abs(tc-vec2(0.5)); - - float det = min(lod/(proj_lod*0.5), 1.0); - - float d = min(dist.x, dist.y); - - float edge = 0.25*det; - - ret *= clamp(d/edge, 0.0, 1.0); - - return ret; -} - -vec4 texture2DLodAmbient(sampler2D projectionMap, vec2 tc, float lod) -{ - vec4 ret = texture2DLod(projectionMap, tc, lod); - - vec2 dist = tc-vec2(0.5); - - float d = dot(dist,dist); - - ret *= min(clamp((0.25-d)/0.25, 0.0, 1.0), 1.0); - - return ret; -} - - -vec4 getPosition(ivec2 pos_screen, int sample) -{ - float depth = texelFetch(depthMap, pos_screen, sample).r; - vec2 sc = vec2(pos_screen.xy)*2.0; - sc /= screen_res; - sc -= vec2(1.0,1.0); - vec4 ndc = vec4(sc.x, sc.y, 2.0*depth-1.0, 1.0); - vec4 pos = inv_proj * ndc; - pos /= pos.w; - pos.w = 1.0; - return pos; -} - -void main() -{ - int wght = 0; - - vec3 fcol = vec3(0,0,0); - - vec2 frag = (vary_fragcoord.xy*0.5+0.5)*screen_res; - - ivec2 itc = ivec2(frag.xy); - - float shadow = 1.0; - - if (proj_shadow_idx >= 0) - { - vec4 shd = texture2DRect(lightMap, frag); - float sh[2]; - sh[0] = shd.b; - sh[1] = shd.a; - shadow = min(sh[proj_shadow_idx]+shadow_fade, 1.0); - } - - for (int i = 0; i < samples; i++) - { - vec3 pos = getPosition(itc, i).xyz; - vec3 lv = vary_light.xyz-pos.xyz; - float dist2 = dot(lv,lv); - dist2 /= vary_light.w; - if (dist2 <= 1.0) - { - vec3 norm = texelFetch(normalMap, itc, i).xyz; - norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm - - norm = normalize(norm); - float l_dist = -dot(lv, proj_n); - - vec4 proj_tc = (proj_mat * vec4(pos.xyz, 1.0)); - if (proj_tc.z >= 0.0) - { - proj_tc.xyz /= proj_tc.w; - - float fa = vertex_color.a+1.0; - float dist_atten = min(1.0-(dist2-1.0*(1.0-fa))/fa, 1.0); - if (dist_atten > 0.0) - { - lv = proj_origin-pos.xyz; - lv = normalize(lv); - float da = dot(norm, lv); - - vec3 col = vec3(0,0,0); - - vec3 diff_tex = texelFetch(diffuseRect, itc, i).rgb; - - float noise = texture2D(noiseMap, frag.xy/128.0).b; - if (proj_tc.z > 0.0 && - proj_tc.x < 1.0 && - proj_tc.y < 1.0 && - proj_tc.x > 0.0 && - proj_tc.y > 0.0) - { - float lit = 0.0; - float amb_da = proj_ambiance; - - if (da > 0.0) - { - float diff = clamp((l_dist-proj_focus)/proj_range, 0.0, 1.0); - float lod = diff * proj_lod; - - vec4 plcol = texture2DLodDiffuse(projectionMap, proj_tc.xy, lod); - - vec3 lcol = vertex_color.rgb * plcol.rgb * plcol.a; - - lit = da * dist_atten * noise; - - col = lcol*lit*diff_tex*shadow; - amb_da += (da*0.5)*(1.0-shadow)*proj_ambiance; - } - - //float diff = clamp((proj_range-proj_focus)/proj_range, 0.0, 1.0); - vec4 amb_plcol = texture2DLodAmbient(projectionMap, proj_tc.xy, proj_lod); - - amb_da += (da*da*0.5+0.5)*proj_ambiance; - - amb_da *= dist_atten * noise; - - amb_da = min(amb_da, 1.0-lit); - - col += amb_da*vertex_color.rgb*diff_tex.rgb*amb_plcol.rgb*amb_plcol.a; - } - - - vec4 spec = texelFetch(specularRect, itc, i); - if (spec.a > 0.0) - { - vec3 ref = reflect(normalize(pos), norm); - - //project from point pos in direction ref to plane proj_p, proj_n - vec3 pdelta = proj_p-pos; - float ds = dot(ref, proj_n); - - if (ds < 0.0) - { - vec3 pfinal = pos + ref * dot(pdelta, proj_n)/ds; - - vec4 stc = (proj_mat * vec4(pfinal.xyz, 1.0)); - - if (stc.z > 0.0) - { - stc.xy /= stc.w; - - float fatten = clamp(spec.a*spec.a+spec.a*0.5, 0.25, 1.0); - - stc.xy = (stc.xy - vec2(0.5)) * fatten + vec2(0.5); - - if (stc.x < 1.0 && - stc.y < 1.0 && - stc.x > 0.0 && - stc.y > 0.0) - { - vec4 scol = texture2DLodSpecular(projectionMap, stc.xy, proj_lod-spec.a*proj_lod); - col += dist_atten*scol.rgb*vertex_color.rgb*scol.a*spec.rgb*shadow; - } - } - } - } - - fcol += col; - wght++; - } - } - } - } - - if (wght <= 0) - { - discard; - } - - gl_FragColor.rgb = fcol/samples; - gl_FragColor.a = 0.0; -} diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightMSF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightMSF.glsl deleted file mode 100644 index 62a86a3f09..0000000000 --- a/indra/newview/app_settings/shaders/class2/deferred/softenLightMSF.glsl +++ /dev/null @@ -1,339 +0,0 @@ -/** - * @file softenLightMSF.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#extension GL_ARB_texture_rectangle : enable -#extension GL_ARB_texture_multisample : enable - -#ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; -#endif - -uniform sampler2DMS diffuseRect; -uniform sampler2DMS specularRect; -uniform sampler2DMS normalMap; -uniform sampler2DRect lightMap; -uniform sampler2DMS depthMap; -uniform sampler2D noiseMap; -uniform samplerCube environmentMap; -uniform sampler2D lightFunc; -uniform vec3 gi_quad; - -uniform float blur_size; -uniform float blur_fidelity; - -// Inputs -uniform vec4 morphFactor; -uniform vec3 camPosLocal; -//uniform vec4 camPosWorld; -uniform vec4 gamma; -uniform vec4 lightnorm; -uniform vec4 sunlight_color; -uniform vec4 ambient; -uniform vec4 blue_horizon; -uniform vec4 blue_density; -uniform vec4 haze_horizon; -uniform vec4 haze_density; -uniform vec4 cloud_shadow; -uniform vec4 density_multiplier; -uniform vec4 distance_multiplier; -uniform vec4 max_y; -uniform vec4 glow; -uniform float scene_light_strength; -uniform vec3 env_mat[3]; -uniform vec4 shadow_clip; -uniform mat3 ssao_effect_mat; - -uniform mat4 inv_proj; -uniform vec2 screen_res; - -VARYING vec4 vary_light; -VARYING vec2 vary_fragcoord; - -vec3 vary_PositionEye; - -vec3 vary_SunlitColor; -vec3 vary_AmblitColor; -vec3 vary_AdditiveColor; -vec3 vary_AtmosAttenuation; - -vec4 getPosition_d(vec2 pos_screen, float depth) -{ - vec2 sc = pos_screen.xy*2.0; - sc /= screen_res; - sc -= vec2(1.0,1.0); - vec4 ndc = vec4(sc.x, sc.y, 2.0*depth-1.0, 1.0); - vec4 pos = inv_proj * ndc; - pos /= pos.w; - pos.w = 1.0; - return pos; -} - -vec3 getPositionEye() -{ - return vary_PositionEye; -} -vec3 getSunlitColor() -{ - return vary_SunlitColor; -} -vec3 getAmblitColor() -{ - return vary_AmblitColor; -} -vec3 getAdditiveColor() -{ - return vary_AdditiveColor; -} -vec3 getAtmosAttenuation() -{ - return vary_AtmosAttenuation; -} - - -void setPositionEye(vec3 v) -{ - vary_PositionEye = v; -} - -void setSunlitColor(vec3 v) -{ - vary_SunlitColor = v; -} - -void setAmblitColor(vec3 v) -{ - vary_AmblitColor = v; -} - -void setAdditiveColor(vec3 v) -{ - vary_AdditiveColor = v; -} - -void setAtmosAttenuation(vec3 v) -{ - vary_AtmosAttenuation = v; -} - -void calcAtmospherics(vec3 inPositionEye, float ambFactor) { - - vec3 P = inPositionEye; - setPositionEye(P); - - //(TERRAIN) limit altitude - if (P.y > max_y.x) P *= (max_y.x / P.y); - if (P.y < -max_y.x) P *= (-max_y.x / P.y); - - vec3 tmpLightnorm = lightnorm.xyz; - - vec3 Pn = normalize(P); - float Plen = length(P); - - vec4 temp1 = vec4(0); - vec3 temp2 = vec3(0); - vec4 blue_weight; - vec4 haze_weight; - vec4 sunlight = sunlight_color; - vec4 light_atten; - - //sunlight attenuation effect (hue and brightness) due to atmosphere - //this is used later for sunlight modulation at various altitudes - light_atten = (blue_density * 1.0 + vec4(haze_density.r) * 0.25) * (density_multiplier.x * max_y.x); - //I had thought blue_density and haze_density should have equal weighting, - //but attenuation due to haze_density tends to seem too strong - - temp1 = blue_density + vec4(haze_density.r); - blue_weight = blue_density / temp1; - haze_weight = vec4(haze_density.r) / temp1; - - //(TERRAIN) compute sunlight from lightnorm only (for short rays like terrain) - temp2.y = max(0.0, tmpLightnorm.y); - temp2.y = 1. / temp2.y; - sunlight *= exp( - light_atten * temp2.y); - - // main atmospheric scattering line integral - temp2.z = Plen * density_multiplier.x; - - // Transparency (-> temp1) - // ATI Bugfix -- can't store temp1*temp2.z*distance_multiplier.x in a variable because the ati - // compiler gets confused. - temp1 = exp(-temp1 * temp2.z * distance_multiplier.x); - - //final atmosphere attenuation factor - setAtmosAttenuation(temp1.rgb); - - //compute haze glow - //(can use temp2.x as temp because we haven't used it yet) - temp2.x = dot(Pn, tmpLightnorm.xyz); - temp2.x = 1. - temp2.x; - //temp2.x is 0 at the sun and increases away from sun - temp2.x = max(temp2.x, .03); //was glow.y - //set a minimum "angle" (smaller glow.y allows tighter, brighter hotspot) - temp2.x *= glow.x; - //higher glow.x gives dimmer glow (because next step is 1 / "angle") - temp2.x = pow(temp2.x, glow.z); - //glow.z should be negative, so we're doing a sort of (1 / "angle") function - - //add "minimum anti-solar illumination" - temp2.x += .25; - - //increase ambient when there are more clouds - vec4 tmpAmbient = ambient + (vec4(1.) - ambient) * cloud_shadow.x * 0.5; - - /* decrease value and saturation (that in HSV, not HSL) for occluded areas - * // for HSV color/geometry used here, see http://gimp-savvy.com/BOOK/index.html?node52.html - * // The following line of code performs the equivalent of: - * float ambAlpha = tmpAmbient.a; - * float ambValue = dot(vec3(tmpAmbient), vec3(0.577)); // projection onto <1/rt(3), 1/rt(3), 1/rt(3)>, the neutral white-black axis - * vec3 ambHueSat = vec3(tmpAmbient) - vec3(ambValue); - * tmpAmbient = vec4(RenderSSAOEffect.valueFactor * vec3(ambValue) + RenderSSAOEffect.saturationFactor *(1.0 - ambFactor) * ambHueSat, ambAlpha); - */ - tmpAmbient = vec4(mix(ssao_effect_mat * tmpAmbient.rgb, tmpAmbient.rgb, ambFactor), tmpAmbient.a); - - //haze color - setAdditiveColor( - vec3(blue_horizon * blue_weight * (sunlight*(1.-cloud_shadow.x) + tmpAmbient) - + (haze_horizon.r * haze_weight) * (sunlight*(1.-cloud_shadow.x) * temp2.x - + tmpAmbient))); - - //brightness of surface both sunlight and ambient - setSunlitColor(vec3(sunlight * .5)); - setAmblitColor(vec3(tmpAmbient * .25)); - setAdditiveColor(getAdditiveColor() * vec3(1.0 - temp1)); -} - -vec3 atmosLighting(vec3 light) -{ - light *= getAtmosAttenuation().r; - light += getAdditiveColor(); - return (2.0 * light); -} - -vec3 atmosTransport(vec3 light) { - light *= getAtmosAttenuation().r; - light += getAdditiveColor() * 2.0; - return light; -} -vec3 atmosGetDiffuseSunlightColor() -{ - return getSunlitColor(); -} - -vec3 scaleDownLight(vec3 light) -{ - return (light / scene_light_strength ); -} - -vec3 scaleUpLight(vec3 light) -{ - return (light * scene_light_strength); -} - -vec3 atmosAmbient(vec3 light) -{ - return getAmblitColor() + light / 2.0; -} - -vec3 atmosAffectDirectionalLight(float lightIntensity) -{ - return getSunlitColor() * lightIntensity; -} - -vec3 scaleSoftClip(vec3 light) -{ - //soft clip effect: - light = 1. - clamp(light, vec3(0.), vec3(1.)); - light = 1. - pow(light, gamma.xxx); - - return light; -} - -void main() -{ - vec2 tc = vary_fragcoord.xy; - ivec2 itc = ivec2(tc); - - vec4 fcol = vec4(0,0,0,0); - - vec2 scol_ambocc = texture2DRect(lightMap, tc).rg; - float ambocc = scol_ambocc.g; - - for (int i = 0; i < samples; ++i) - { - float depth = texelFetch(depthMap, itc.xy, i).r; - vec3 pos = getPosition_d(tc, depth).xyz; - vec3 norm = texelFetch(normalMap, itc, i).xyz; - norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm - - float da = max(dot(norm.xyz, vary_light.xyz), 0.0); - - vec4 diffuse = texelFetch(diffuseRect, itc, i); - vec3 col; - float bloom = 0.0; - if (diffuse.a < 0.9) - { - vec4 spec = texelFetch(specularRect, itc, i); - - float amb = 0; - - float scol = max(scol_ambocc.r, diffuse.a); - amb += ambocc; - - calcAtmospherics(pos.xyz, ambocc); - - col = atmosAmbient(vec3(0)); - col += atmosAffectDirectionalLight(max(min(da, scol), diffuse.a)); - - col *= diffuse.rgb; - - if (spec.a > 0.0) // specular reflection - { - // the old infinite-sky shiny reflection - // - vec3 refnormpersp = normalize(reflect(pos.xyz, norm.xyz)); - float sa = dot(refnormpersp, vary_light.xyz); - vec3 dumbshiny = vary_SunlitColor*scol_ambocc.r*texture2D(lightFunc, vec2(sa, spec.a)).r; - - // add the two types of shiny together - vec3 spec_contrib = dumbshiny * spec.rgb; - bloom = dot(spec_contrib, spec_contrib); - col += spec_contrib; - } - - col = atmosLighting(col); - col = scaleSoftClip(col); - - col = mix(col, diffuse.rgb, diffuse.a); - } - else - { - col = diffuse.rgb; - } - - fcol += vec4(col, bloom); - } - - gl_FragColor = fcol/samples; -} diff --git a/indra/newview/app_settings/shaders/class2/deferred/spotLightMSF.glsl b/indra/newview/app_settings/shaders/class2/deferred/spotLightMSF.glsl deleted file mode 100644 index af3487fd91..0000000000 --- a/indra/newview/app_settings/shaders/class2/deferred/spotLightMSF.glsl +++ /dev/null @@ -1,266 +0,0 @@ -/** - * @file multiSpotLightF.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#extension GL_ARB_texture_rectangle : enable -#extension GL_ARB_texture_multisample : enable - -#ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; -#endif - -VARYING vec4 vertex_color; - -uniform sampler2DMS diffuseRect; -uniform sampler2DMS specularRect; -uniform sampler2DMS depthMap; -uniform sampler2DMS normalMap; -uniform sampler2DRect lightMap; -uniform sampler2D noiseMap; -uniform sampler2D projectionMap; - -uniform mat4 proj_mat; //screen space to light space -uniform float proj_near; //near clip for projection -uniform vec3 proj_p; //plane projection is emitting from (in screen space) -uniform vec3 proj_n; -uniform float proj_focus; //distance from plane to begin blurring -uniform float proj_lod; //(number of mips in proj map) -uniform float proj_range; //range between near clip and far clip plane of projection -uniform float proj_ambient_lod; -uniform float proj_ambiance; -uniform float near_clip; -uniform float far_clip; - -uniform vec3 proj_origin; //origin of projection to be used for angular attenuation -uniform float sun_wash; -uniform int proj_shadow_idx; -uniform float shadow_fade; - -VARYING vec4 vary_light; - -VARYING vec4 vary_fragcoord; -uniform vec2 screen_res; - -uniform mat4 inv_proj; - -vec4 texture2DLodSpecular(sampler2D projectionMap, vec2 tc, float lod) -{ - vec4 ret = texture2DLod(projectionMap, tc, lod); - - vec2 dist = tc-vec2(0.5); - - float det = max(1.0-lod/(proj_lod*0.5), 0.0); - - float d = dot(dist,dist); - - ret *= min(clamp((0.25-d)/0.25, 0.0, 1.0)+det, 1.0); - - return ret; -} - -vec4 texture2DLodDiffuse(sampler2D projectionMap, vec2 tc, float lod) -{ - vec4 ret = texture2DLod(projectionMap, tc, lod); - - vec2 dist = vec2(0.5) - abs(tc-vec2(0.5)); - - float det = min(lod/(proj_lod*0.5), 1.0); - - float d = min(dist.x, dist.y); - - float edge = 0.25*det; - - ret *= clamp(d/edge, 0.0, 1.0); - - return ret; -} - -vec4 texture2DLodAmbient(sampler2D projectionMap, vec2 tc, float lod) -{ - vec4 ret = texture2DLod(projectionMap, tc, lod); - - vec2 dist = tc-vec2(0.5); - - float d = dot(dist,dist); - - ret *= min(clamp((0.25-d)/0.25, 0.0, 1.0), 1.0); - - return ret; -} - - -vec4 getPosition(ivec2 pos_screen, int sample) -{ - float depth = texelFetch(depthMap, pos_screen, sample).r; - vec2 sc = vec2(pos_screen.xy)*2.0; - sc /= screen_res; - sc -= vec2(1.0,1.0); - vec4 ndc = vec4(sc.x, sc.y, 2.0*depth-1.0, 1.0); - vec4 pos = inv_proj * ndc; - pos /= pos.w; - pos.w = 1.0; - return pos; -} - -void main() -{ - vec4 frag = vary_fragcoord; - frag.xyz /= frag.w; - frag.xyz = frag.xyz*0.5+0.5; - frag.xy *= screen_res; - ivec2 itc = ivec2(frag.xy); - - vec3 fcol = vec3(0,0,0); - int wght = 0; - - float shadow = 1.0; - - if (proj_shadow_idx >= 0) - { - vec4 shd = texture2DRect(lightMap, frag.xy); - float sh[2]; - sh[0] = shd.b; - sh[1] = shd.a; - shadow = min(sh[proj_shadow_idx]+shadow_fade, 1.0); - } - - for (int i = 0; i < samples; i++) - { - vec3 pos = getPosition(itc, i).xyz; - vec3 lv = vary_light.xyz-pos.xyz; - float dist2 = dot(lv,lv); - dist2 /= vary_light.w; - if (dist2 <= 1.0) - { - vec3 norm = texelFetch(normalMap, itc, i).xyz; - norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm - - norm = normalize(norm); - float l_dist = -dot(lv, proj_n); - - vec4 proj_tc = (proj_mat * vec4(pos.xyz, 1.0)); - if (proj_tc.z >= 0.0) - { - proj_tc.xyz /= proj_tc.w; - - float fa = vertex_color.a+1.0; - float dist_atten = min(1.0-(dist2-1.0*(1.0-fa))/fa, 1.0); - if (dist_atten > 0.0) - { - lv = proj_origin-pos.xyz; - lv = normalize(lv); - float da = dot(norm, lv); - - vec3 col = vec3(0,0,0); - - vec3 diff_tex = texelFetch(diffuseRect, itc, i).rgb; - - float noise = texture2D(noiseMap, frag.xy/128.0).b; - if (proj_tc.z > 0.0 && - proj_tc.x < 1.0 && - proj_tc.y < 1.0 && - proj_tc.x > 0.0 && - proj_tc.y > 0.0) - { - float lit = 0.0; - float amb_da = proj_ambiance; - - if (da > 0.0) - { - float diff = clamp((l_dist-proj_focus)/proj_range, 0.0, 1.0); - float lod = diff * proj_lod; - - vec4 plcol = texture2DLodDiffuse(projectionMap, proj_tc.xy, lod); - - vec3 lcol = vertex_color.rgb * plcol.rgb * plcol.a; - - lit = da * dist_atten * noise; - - col = lcol*lit*diff_tex*shadow; - amb_da += (da*0.5)*(1.0-shadow)*proj_ambiance; - } - - //float diff = clamp((proj_range-proj_focus)/proj_range, 0.0, 1.0); - vec4 amb_plcol = texture2DLodAmbient(projectionMap, proj_tc.xy, proj_lod); - - amb_da += (da*da*0.5+0.5)*proj_ambiance; - - amb_da *= dist_atten * noise; - - amb_da = min(amb_da, 1.0-lit); - - col += amb_da*vertex_color.rgb*diff_tex.rgb*amb_plcol.rgb*amb_plcol.a; - } - - - vec4 spec = texelFetch(specularRect, itc, i); - if (spec.a > 0.0) - { - vec3 ref = reflect(normalize(pos), norm); - - //project from point pos in direction ref to plane proj_p, proj_n - vec3 pdelta = proj_p-pos; - float ds = dot(ref, proj_n); - - if (ds < 0.0) - { - vec3 pfinal = pos + ref * dot(pdelta, proj_n)/ds; - - vec4 stc = (proj_mat * vec4(pfinal.xyz, 1.0)); - - if (stc.z > 0.0) - { - stc.xy /= stc.w; - - float fatten = clamp(spec.a*spec.a+spec.a*0.5, 0.25, 1.0); - - stc.xy = (stc.xy - vec2(0.5)) * fatten + vec2(0.5); - - if (stc.x < 1.0 && - stc.y < 1.0 && - stc.x > 0.0 && - stc.y > 0.0) - { - vec4 scol = texture2DLodSpecular(projectionMap, stc.xy, proj_lod-spec.a*proj_lod); - col += dist_atten*scol.rgb*vertex_color.rgb*scol.a*spec.rgb*shadow; - } - } - } - } - - fcol += col; - wght++; - } - } - } - } - - if (wght <= 0) - { - discard; - } - - gl_FragColor.rgb = fcol/wght; - gl_FragColor.a = 0.0; -} diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightMSF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightMSF.glsl deleted file mode 100644 index 11b3faa4c9..0000000000 --- a/indra/newview/app_settings/shaders/class2/deferred/sunLightMSF.glsl +++ /dev/null @@ -1,222 +0,0 @@ -/** - * @file sunLightMSF.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#extension GL_ARB_texture_rectangle : enable -#extension GL_ARB_texture_multisample : enable - -#ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; -#endif - -//class 2, shadows, no SSAO - -uniform sampler2DMS depthMap; -uniform sampler2DMS normalMap; -uniform sampler2DRectShadow shadowMap0; -uniform sampler2DRectShadow shadowMap1; -uniform sampler2DRectShadow shadowMap2; -uniform sampler2DRectShadow shadowMap3; -uniform sampler2DShadow shadowMap4; -uniform sampler2DShadow shadowMap5; - - -// Inputs -uniform mat4 shadow_matrix[6]; -uniform vec4 shadow_clip; -uniform float ssao_radius; -uniform float ssao_max_radius; -uniform float ssao_factor; -uniform float ssao_factor_inv; - -VARYING vec2 vary_fragcoord; -VARYING vec4 vary_light; - -uniform mat4 inv_proj; -uniform vec2 screen_res; -uniform vec2 shadow_res; -uniform vec2 proj_shadow_res; - -uniform float shadow_bias; -uniform float shadow_offset; - -uniform float spot_shadow_bias; -uniform float spot_shadow_offset; - -vec4 getPosition(ivec2 pos_screen, int sample) -{ - float depth = texelFetch(depthMap, pos_screen.xy, sample).r; - vec2 sc = vec2(pos_screen.xy)*2.0; - sc /= screen_res; - sc -= vec2(1.0,1.0); - vec4 ndc = vec4(sc.x, sc.y, 2.0*depth-1.0, 1.0); - vec4 pos = inv_proj * ndc; - pos /= pos.w; - pos.w = 1.0; - return pos; -} - -float pcfShadow(sampler2DRectShadow shadowMap, vec4 stc, float scl) -{ - stc.xyz /= stc.w; - stc.z += shadow_bias*scl; - - float cs = shadow2DRect(shadowMap, stc.xyz).x; - float shadow = cs; - - shadow += max(shadow2DRect(shadowMap, stc.xyz+vec3(1.5, 1.5, 0.0)).x, cs); - shadow += max(shadow2DRect(shadowMap, stc.xyz+vec3(1.5, -1.5, 0.0)).x, cs); - shadow += max(shadow2DRect(shadowMap, stc.xyz+vec3(-1.5, 1.5, 0.0)).x, cs); - shadow += max(shadow2DRect(shadowMap, stc.xyz+vec3(-1.5, -1.5, 0.0)).x, cs); - - return shadow/5.0; - - //return shadow; -} - -float pcfShadow(sampler2DShadow shadowMap, vec4 stc, float scl) -{ - stc.xyz /= stc.w; - stc.z += spot_shadow_bias*scl; - - float cs = shadow2D(shadowMap, stc.xyz); - float shadow = cs; - - vec2 off = 1.5/proj_shadow_res; - - shadow += max(shadow2D(shadowMap, stc.xyz+vec3(off.x, off.y, 0.0)), cs); - shadow += max(shadow2D(shadowMap, stc.xyz+vec3(off.x, -off.y, 0.0)), cs); - shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, off.y, 0.0)), cs); - shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, -off.y, 0.0)), cs); - - return shadow/5.0; - - //return shadow; -} - -void main() -{ - vec2 pos_screen = vary_fragcoord.xy; - ivec2 itc = ivec2(pos_screen); - - //try doing an unproject here - - vec4 fcol = vec4(0,0,0,0); - - for (int i = 0; i < samples; i++) - { - vec4 pos = getPosition(itc, i); - - vec4 nmap4 = texelFetch(normalMap, itc, i); - nmap4 = vec4((nmap4.xy-0.5)*2.0,nmap4.z,nmap4.w); // unpack norm - float displace = nmap4.w; - vec3 norm = nmap4.xyz; - - /*if (pos.z == 0.0) // do nothing for sky *FIX: REMOVE THIS IF/WHEN THE POSITION MAP IS BEING USED AS A STENCIL - { - gl_FragColor = vec4(0.0); // doesn't matter - return; - }*/ - - float shadow = 1.0; - float dp_directional_light = max(0.0, dot(norm, vary_light.xyz)); - - vec3 shadow_pos = pos.xyz + displace*norm; - vec3 offset = vary_light.xyz * (1.0-dp_directional_light); - - vec4 spos = vec4(shadow_pos+offset*shadow_offset, 1.0); - - if (spos.z > -shadow_clip.w) - { - if (dp_directional_light == 0.0) - { - // if we know this point is facing away from the sun then we know it's in shadow without having to do a squirrelly shadow-map lookup - shadow = 0.0; - } - else - { - vec4 lpos; - - if (spos.z < -shadow_clip.z) - { - lpos = shadow_matrix[3]*spos; - lpos.xy *= shadow_res; - shadow = pcfShadow(shadowMap3, lpos, 0.25); - shadow += max((pos.z+shadow_clip.z)/(shadow_clip.z-shadow_clip.w)*2.0-1.0, 0.0); - } - else if (spos.z < -shadow_clip.y) - { - lpos = shadow_matrix[2]*spos; - lpos.xy *= shadow_res; - shadow = pcfShadow(shadowMap2, lpos, 0.5); - } - else if (spos.z < -shadow_clip.x) - { - lpos = shadow_matrix[1]*spos; - lpos.xy *= shadow_res; - shadow = pcfShadow(shadowMap1, lpos, 0.75); - } - else - { - lpos = shadow_matrix[0]*spos; - lpos.xy *= shadow_res; - shadow = pcfShadow(shadowMap0, lpos, 1.0); - } - - // take the most-shadowed value out of these two: - // * the blurred sun shadow in the light (shadow) map - // * an unblurred dot product between the sun and this norm - // the goal is to err on the side of most-shadow to fill-in shadow holes and reduce artifacting - shadow = min(shadow, dp_directional_light); - - //lpos.xy /= lpos.w*32.0; - //if (fract(lpos.x) < 0.1 || fract(lpos.y) < 0.1) - //{ - // shadow = 0.0; - //} - - } - } - else - { - // more distant than the shadow map covers - shadow = 1.0; - } - - fcol[0] += shadow; - fcol[1] += 1.0; - - spos = vec4(shadow_pos+norm*spot_shadow_offset, 1.0); - - //spotlight shadow 1 - vec4 lpos = shadow_matrix[4]*spos; - fcol[2] += pcfShadow(shadowMap4, lpos, 0.8); - - //spotlight shadow 2 - lpos = shadow_matrix[5]*spos; - fcol[3] += pcfShadow(shadowMap5, lpos, 0.8); - } - - gl_FragColor = fcol/samples; -} diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOMSF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOMSF.glsl deleted file mode 100644 index c571db9df2..0000000000 --- a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOMSF.glsl +++ /dev/null @@ -1,260 +0,0 @@ -/** - * @file sunLightSSAOF.glsl - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#extension GL_ARB_texture_rectangle : enable -#extension GL_ARB_texture_multisample : enable - -#ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; -#endif - -//class 2 -- shadows and SSAO - -uniform sampler2DMS depthMap; -uniform sampler2DMS normalMap; -uniform sampler2DRectShadow shadowMap0; -uniform sampler2DRectShadow shadowMap1; -uniform sampler2DRectShadow shadowMap2; -uniform sampler2DRectShadow shadowMap3; -uniform sampler2DShadow shadowMap4; -uniform sampler2DShadow shadowMap5; -uniform sampler2D noiseMap; - -// Inputs -uniform mat4 shadow_matrix[6]; -uniform vec4 shadow_clip; -uniform float ssao_radius; -uniform float ssao_max_radius; -uniform float ssao_factor; -uniform float ssao_factor_inv; - -VARYING vec2 vary_fragcoord; -VARYING vec4 vary_light; - -uniform mat4 inv_proj; -uniform vec2 screen_res; -uniform vec2 shadow_res; -uniform vec2 proj_shadow_res; - -uniform float shadow_bias; -uniform float shadow_offset; - -uniform float spot_shadow_bias; -uniform float spot_shadow_offset; - -vec4 getPosition(ivec2 pos_screen, int sample) -{ - float depth = texelFetch(depthMap, pos_screen, sample).r; - vec2 sc = vec2(pos_screen.xy)*2.0; - sc /= screen_res; - sc -= vec2(1.0,1.0); - vec4 ndc = vec4(sc.x, sc.y, 2.0*depth-1.0, 1.0); - vec4 pos = inv_proj * ndc; - pos /= pos.w; - pos.w = 1.0; - return pos; -} - -//calculate decreases in ambient lighting when crowded out (SSAO) -float calcAmbientOcclusion(vec4 pos, vec3 norm, int sample) -{ - float ret = 1.0; - - vec2 kern[8]; - // exponentially (^2) distant occlusion samples spread around origin - kern[0] = vec2(-1.0, 0.0) * 0.125*0.125; - kern[1] = vec2(1.0, 0.0) * 0.250*0.250; - kern[2] = vec2(0.0, 1.0) * 0.375*0.375; - kern[3] = vec2(0.0, -1.0) * 0.500*0.500; - kern[4] = vec2(0.7071, 0.7071) * 0.625*0.625; - kern[5] = vec2(-0.7071, -0.7071) * 0.750*0.750; - kern[6] = vec2(-0.7071, 0.7071) * 0.875*0.875; - kern[7] = vec2(0.7071, -0.7071) * 1.000*1.000; - - vec2 pos_screen = vary_fragcoord.xy; - vec3 pos_world = pos.xyz; - vec2 noise_reflect = texture2D(noiseMap, vary_fragcoord.xy/128.0).xy; - - float angle_hidden = 0.0; - int points = 0; - - float scale = min(ssao_radius / -pos_world.z, ssao_max_radius); - - // it was found that keeping # of samples a constant was the fastest, probably due to compiler optimizations (unrolling?) - for (int i = 0; i < 8; i++) - { - ivec2 samppos_screen = ivec2(pos_screen + scale * reflect(kern[i], noise_reflect)); - vec3 samppos_world = getPosition(samppos_screen, sample).xyz; - - vec3 diff = pos_world - samppos_world; - float dist2 = dot(diff, diff); - - // assume each sample corresponds to an occluding sphere with constant radius, constant x-sectional area - // --> solid angle shrinking by the square of distance - //radius is somewhat arbitrary, can approx with just some constant k * 1 / dist^2 - //(k should vary inversely with # of samples, but this is taken care of later) - - angle_hidden = angle_hidden + float(dot((samppos_world - 0.05*norm - pos_world), norm) > 0.0) * min(1.0/dist2, ssao_factor_inv); - - // 'blocked' samples (significantly closer to camera relative to pos_world) are "no data", not "no occlusion" - points = points + int(diff.z > -1.0); - } - - angle_hidden = min(ssao_factor*angle_hidden/float(points), 1.0); - - ret = (1.0 - (float(points != 0) * angle_hidden)); - - return min(ret, 1.0); -} - -float pcfShadow(sampler2DRectShadow shadowMap, vec4 stc, float scl) -{ - stc.xyz /= stc.w; - stc.z += shadow_bias*scl; - - float cs = shadow2DRect(shadowMap, stc.xyz).x; - float shadow = cs; - - shadow += max(shadow2DRect(shadowMap, stc.xyz+vec3(1.5, 1.5, 0.0)).x, cs); - shadow += max(shadow2DRect(shadowMap, stc.xyz+vec3(1.5, -1.5, 0.0)).x, cs); - shadow += max(shadow2DRect(shadowMap, stc.xyz+vec3(-1.5, 1.5, 0.0)).x, cs); - shadow += max(shadow2DRect(shadowMap, stc.xyz+vec3(-1.5, -1.5, 0.0)).x, cs); - - return shadow/5.0; - - //return shadow; -} - -float pcfShadow(sampler2DShadow shadowMap, vec4 stc, float scl) -{ - stc.xyz /= stc.w; - stc.z += spot_shadow_bias*scl; - - float cs = shadow2D(shadowMap, stc.xyz); - float shadow = cs; - - vec2 off = 1.5/proj_shadow_res; - - shadow += max(shadow2D(shadowMap, stc.xyz+vec3(off.x, off.y, 0.0)), cs); - shadow += max(shadow2D(shadowMap, stc.xyz+vec3(off.x, -off.y, 0.0)), cs); - shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, off.y, 0.0)), cs); - shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, -off.y, 0.0)), cs); - - - return shadow/5.0; - - //return shadow; -} - -void main() -{ - vec2 pos_screen = vary_fragcoord.xy; - ivec2 itc = ivec2(pos_screen); - vec4 fcol = vec4(0,0,0,0); - - for (int i = 0; i < samples; i++) - { - vec4 pos = getPosition(itc, i); - - vec4 nmap4 = texelFetch(normalMap, itc, i); - nmap4 = vec4((nmap4.xy-0.5)*2.0,nmap4.z,nmap4.w); // unpack norm - float displace = nmap4.w; - vec3 norm = nmap4.xyz; - - float shadow = 1.0; - float dp_directional_light = max(0.0, dot(norm, vary_light.xyz)); - - vec3 shadow_pos = pos.xyz + displace*norm; - vec3 offset = vary_light.xyz * (1.0-dp_directional_light); - - vec4 spos = vec4(shadow_pos+offset*shadow_offset, 1.0); - - if (spos.z > -shadow_clip.w) - { - if (dp_directional_light == 0.0) - { - // if we know this point is facing away from the sun then we know it's in shadow without having to do a squirrelly shadow-map lookup - shadow = 0.0; - } - else - { - vec4 lpos; - - if (spos.z < -shadow_clip.z) - { - lpos = shadow_matrix[3]*spos; - lpos.xy *= shadow_res; - shadow = pcfShadow(shadowMap3, lpos, 0.25); - shadow += max((pos.z+shadow_clip.z)/(shadow_clip.z-shadow_clip.w)*2.0-1.0, 0.0); - } - else if (spos.z < -shadow_clip.y) - { - lpos = shadow_matrix[2]*spos; - lpos.xy *= shadow_res; - shadow = pcfShadow(shadowMap2, lpos, 0.5); - } - else if (spos.z < -shadow_clip.x) - { - lpos = shadow_matrix[1]*spos; - lpos.xy *= shadow_res; - shadow = pcfShadow(shadowMap1, lpos, 0.75); - } - else - { - lpos = shadow_matrix[0]*spos; - lpos.xy *= shadow_res; - shadow = pcfShadow(shadowMap0, lpos, 1.0); - } - - // take the most-shadowed value out of these two: - // * the blurred sun shadow in the light (shadow) map - // * an unblurred dot product between the sun and this norm - // the goal is to err on the side of most-shadow to fill-in shadow holes and reduce artifacting - shadow = min(shadow, dp_directional_light); - - } - } - else - { - // more distant than the shadow map covers - shadow = 1.0; - } - - - fcol[0] += shadow; - fcol[1] += calcAmbientOcclusion(pos, norm, i); - - spos.xyz = shadow_pos+offset*spot_shadow_offset; - - //spotlight shadow 1 - vec4 lpos = shadow_matrix[4]*spos; - fcol[2] += pcfShadow(shadowMap4, lpos, 0.8); - - //spotlight shadow 2 - lpos = shadow_matrix[5]*spos; - fcol[3] += pcfShadow(shadowMap5, lpos, 0.8); - } - - gl_FragColor = fcol / samples; -} -- cgit v1.2.3 From 348a70181211b8fe37c569f8b3fb8324cc8c59ea Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Wed, 28 Sep 2011 00:41:10 -0500 Subject: SH-2507 Shave some unused/redundant varying state and make the max texture index debug setting rebuild shaders to use no flow control when set to 1 or lower --- .../shaders/class2/avatar/eyeballV.glsl | 4 +- .../shaders/class2/deferred/alphaSkinnedV.glsl | 4 +- .../shaders/class2/deferred/alphaV.glsl | 10 +-- .../shaders/class2/deferred/avatarAlphaV.glsl | 4 +- .../shaders/class2/objects/fullbrightShinyV.glsl | 10 ++- .../shaders/class2/objects/fullbrightV.glsl | 10 +-- .../shaders/class2/objects/shinyV.glsl | 11 +-- .../shaders/class2/objects/simpleNonIndexedV.glsl | 4 +- .../shaders/class2/objects/simpleV.glsl | 10 +-- .../class2/windlight/atmosphericsVarsF.glsl | 16 ++--- .../class2/windlight/atmosphericsVarsV.glsl | 36 +++++----- .../class2/windlight/atmosphericsVarsWaterF.glsl | 51 ++++++++++++++ .../class2/windlight/atmosphericsVarsWaterV.glsl | 81 ++++++++++++++++++++++ 13 files changed, 185 insertions(+), 66 deletions(-) create mode 100644 indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsWaterF.glsl create mode 100644 indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsWaterV.glsl (limited to 'indra/newview/app_settings/shaders/class2') diff --git a/indra/newview/app_settings/shaders/class2/avatar/eyeballV.glsl b/indra/newview/app_settings/shaders/class2/avatar/eyeballV.glsl index 04d3e2aa1f..5af9f5c902 100644 --- a/indra/newview/app_settings/shaders/class2/avatar/eyeballV.glsl +++ b/indra/newview/app_settings/shaders/class2/avatar/eyeballV.glsl @@ -35,7 +35,7 @@ ATTRIBUTE vec2 texcoord0; VARYING vec4 vertex_color; VARYING vec2 vary_texcoord0; -VARYING float fog_depth; + vec4 calcLightingSpecular(vec3 pos, vec3 norm, vec4 color, inout vec4 specularColor, vec4 baseCol); void calcAtmospherics(vec3 inPositionEye); @@ -56,7 +56,7 @@ void main() vec4 color = calcLightingSpecular(pos, norm, diffuse_color, specular, vec4(0.0)); vertex_color = color; - fog_depth = 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 ad353eb624..5a3955ef00 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/alphaSkinnedV.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/alphaSkinnedV.glsl @@ -50,7 +50,7 @@ VARYING vec3 vary_pointlight_col; VARYING vec4 vertex_color; VARYING vec2 vary_texcoord0; -VARYING float fog_depth; + uniform float near_clip; uniform float shadow_offset; @@ -140,7 +140,7 @@ void main() vertex_color = col; - fog_depth = pos.z; + pos.xyz = (modelview_projection_matrix * 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 6a3777c7c8..9540ddd2e8 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/alphaV.glsl @@ -29,7 +29,7 @@ uniform mat4 modelview_matrix; uniform mat4 modelview_projection_matrix; ATTRIBUTE vec3 position; -ATTRIBUTE float texture_index; +void passTextureIndex(); ATTRIBUTE vec3 normal; ATTRIBUTE vec4 diffuse_color; ATTRIBUTE vec2 texcoord0; @@ -49,10 +49,10 @@ VARYING vec3 vary_directional; VARYING vec3 vary_fragcoord; VARYING vec3 vary_position; VARYING vec3 vary_pointlight_col; -VARYING float vary_texture_index; + VARYING vec4 vertex_color; VARYING vec2 vary_texcoord0; -VARYING float fog_depth; + uniform float near_clip; uniform float shadow_offset; @@ -97,7 +97,7 @@ void main() { //transform vertex vec4 vert = vec4(position.xyz, 1.0); - vary_texture_index = texture_index; + passTextureIndex(); vec4 pos = (modelview_matrix * vert); gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0); @@ -136,7 +136,7 @@ void main() vertex_color = col; - fog_depth = pos.z; + pos = modelview_projection_matrix * vert; vary_fragcoord.xyz = pos.xyz + vec3(0,0,near_clip); diff --git a/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl b/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl index 091a865160..63c7a6b13d 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl @@ -48,7 +48,7 @@ VARYING vec3 vary_fragcoord; VARYING vec3 vary_pointlight_col; VARYING vec4 vertex_color; VARYING vec2 vary_texcoord0; -VARYING float fog_depth; + uniform float near_clip; uniform float shadow_offset; @@ -139,7 +139,7 @@ void main() vertex_color = col; - fog_depth = pos.z; + vary_fragcoord.xyz = pos.xyz + vec3(0,0,near_clip); } diff --git a/indra/newview/app_settings/shaders/class2/objects/fullbrightShinyV.glsl b/indra/newview/app_settings/shaders/class2/objects/fullbrightShinyV.glsl index 580ef2694f..34bd8d445a 100644 --- a/indra/newview/app_settings/shaders/class2/objects/fullbrightShinyV.glsl +++ b/indra/newview/app_settings/shaders/class2/objects/fullbrightShinyV.glsl @@ -34,10 +34,10 @@ void calcAtmospherics(vec3 inPositionEye); uniform vec4 origin; -VARYING float vary_texture_index; + ATTRIBUTE vec3 position; -ATTRIBUTE float texture_index; +void passTextureIndex(); ATTRIBUTE vec3 normal; ATTRIBUTE vec4 diffuse_color; ATTRIBUTE vec2 texcoord0; @@ -45,13 +45,13 @@ ATTRIBUTE vec2 texcoord0; VARYING vec4 vertex_color; VARYING vec2 vary_texcoord0; VARYING vec3 vary_texcoord1; -VARYING float fog_depth; + void main() { //transform vertex vec4 vert = vec4(position.xyz,1.0); - vary_texture_index = texture_index; + passTextureIndex(); vec4 pos = (modelview_matrix * vert); gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0); @@ -64,6 +64,4 @@ void main() calcAtmospherics(pos.xyz); vertex_color = diffuse_color; - - fog_depth = 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 09dbd0b6cd..fc20d3270e 100644 --- a/indra/newview/app_settings/shaders/class2/objects/fullbrightV.glsl +++ b/indra/newview/app_settings/shaders/class2/objects/fullbrightV.glsl @@ -28,7 +28,7 @@ uniform mat4 modelview_matrix; uniform mat4 modelview_projection_matrix; ATTRIBUTE vec3 position; -ATTRIBUTE float texture_index; +void passTextureIndex(); ATTRIBUTE vec2 texcoord0; ATTRIBUTE vec3 normal; ATTRIBUTE vec4 diffuse_color; @@ -36,16 +36,16 @@ ATTRIBUTE vec4 diffuse_color; void calcAtmospherics(vec3 inPositionEye); -VARYING float vary_texture_index; + VARYING vec4 vertex_color; VARYING vec2 vary_texcoord0; -VARYING float fog_depth; + void main() { //transform vertex vec4 vert = vec4(position.xyz,1.0); - vary_texture_index = texture_index; + passTextureIndex(); vec4 pos = (modelview_matrix * vert); gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0); vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy; @@ -54,5 +54,5 @@ void main() vertex_color = diffuse_color; - fog_depth = 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 86c592ea57..fdb3453cc5 100644 --- a/indra/newview/app_settings/shaders/class2/objects/shinyV.glsl +++ b/indra/newview/app_settings/shaders/class2/objects/shinyV.glsl @@ -30,7 +30,7 @@ uniform mat4 modelview_matrix; uniform mat4 modelview_projection_matrix; ATTRIBUTE vec3 position; -ATTRIBUTE float texture_index; +void passTextureIndex(); ATTRIBUTE vec2 texcoord0; ATTRIBUTE vec3 normal; ATTRIBUTE vec4 diffuse_color; @@ -43,16 +43,13 @@ vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol); void calcAtmospherics(vec3 inPositionEye); -VARYING float vary_texture_index; -VARYING float fog_depth; - uniform vec4 origin; void main() { //transform vertex vec4 vert = vec4(position.xyz,1.0); - vary_texture_index = texture_index; + passTextureIndex(); vec4 pos = (modelview_matrix * vert); gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0); @@ -64,7 +61,5 @@ void main() calcAtmospherics(pos.xyz); - vertex_color = calcLighting(pos.xyz, norm, diffuse_color, vec4(0.0)); - - fog_depth = pos.z; + vertex_color = calcLighting(pos.xyz, norm, diffuse_color, vec4(0.0)); } diff --git a/indra/newview/app_settings/shaders/class2/objects/simpleNonIndexedV.glsl b/indra/newview/app_settings/shaders/class2/objects/simpleNonIndexedV.glsl index 6799e43b9a..cb80697d15 100644 --- a/indra/newview/app_settings/shaders/class2/objects/simpleNonIndexedV.glsl +++ b/indra/newview/app_settings/shaders/class2/objects/simpleNonIndexedV.glsl @@ -35,7 +35,7 @@ ATTRIBUTE vec4 diffuse_color; VARYING vec4 vertex_color; VARYING vec2 vary_texcoord0; -VARYING float fog_depth; + vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol); void calcAtmospherics(vec3 inPositionEye); @@ -57,5 +57,5 @@ void main() vec4 color = calcLighting(pos.xyz, norm, diffuse_color, vec4(0.)); vertex_color = color; - fog_depth = 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 8e8f0664b0..37a20383e2 100644 --- a/indra/newview/app_settings/shaders/class2/objects/simpleV.glsl +++ b/indra/newview/app_settings/shaders/class2/objects/simpleV.glsl @@ -29,7 +29,7 @@ uniform mat4 modelview_matrix; uniform mat4 modelview_projection_matrix; ATTRIBUTE vec3 position; -ATTRIBUTE float texture_index; +void passTextureIndex(); ATTRIBUTE vec2 texcoord0; ATTRIBUTE vec3 normal; ATTRIBUTE vec4 diffuse_color; @@ -37,16 +37,16 @@ ATTRIBUTE vec4 diffuse_color; vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol); void calcAtmospherics(vec3 inPositionEye); -VARYING float vary_texture_index; + VARYING vec4 vertex_color; VARYING vec2 vary_texcoord0; -VARYING float fog_depth; + void main() { //transform vertex vec4 vert = vec4(position.xyz,1.0); - vary_texture_index = texture_index; + passTextureIndex(); vec4 pos = (modelview_matrix * vert); gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0); vary_texcoord0 = (texture_matrix0 * vec4(texcoord0, 0, 1)).xy; @@ -60,5 +60,5 @@ void main() vec4 color = calcLighting(pos.xyz, norm, diffuse_color, vec4(0.)); vertex_color = color; - fog_depth = pos.z; + } diff --git a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsF.glsl b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsF.glsl index 08814b49d8..e8e56e12c1 100644 --- a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsF.glsl +++ b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsF.glsl @@ -24,25 +24,17 @@ */ - -VARYING vec3 vary_PositionEye; - VARYING vec3 vary_SunlitColor; -VARYING vec3 vary_AmblitColor; VARYING vec3 vary_AdditiveColor; -VARYING vec3 vary_AtmosAttenuation; +VARYING float vary_AtmosAttenuation; -vec3 getPositionEye() -{ - return vary_PositionEye; -} vec3 getSunlitColor() { - return vary_SunlitColor; + return vec3(0,0,0); } vec3 getAmblitColor() { - return vary_AmblitColor; + return vec3(0,0,0); } vec3 getAdditiveColor() { @@ -50,5 +42,5 @@ vec3 getAdditiveColor() } vec3 getAtmosAttenuation() { - return vary_AtmosAttenuation; + return vec3(vary_AtmosAttenuation); } diff --git a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsV.glsl b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsV.glsl index 514f009add..01605e5b25 100644 --- a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsV.glsl +++ b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsV.glsl @@ -24,49 +24,50 @@ */ - -VARYING vec3 vary_PositionEye; - -VARYING vec3 vary_SunlitColor; -VARYING vec3 vary_AmblitColor; VARYING vec3 vary_AdditiveColor; -VARYING vec3 vary_AtmosAttenuation; +VARYING float vary_AtmosAttenuation; + +vec3 atmos_attenuation; +vec3 sunlit_color; +vec3 amblit_color; +vec3 position_eye; -vec3 getPositionEye() -{ - return vary_PositionEye; -} vec3 getSunlitColor() { - return vary_SunlitColor; + return sunlit_color; } vec3 getAmblitColor() { - return vary_AmblitColor; + return amblit_color; } + vec3 getAdditiveColor() { return vary_AdditiveColor; } vec3 getAtmosAttenuation() { - return vary_AtmosAttenuation; + return atmos_attenuation; } +vec3 getPositionEye() +{ + return position_eye; +} void setPositionEye(vec3 v) { - vary_PositionEye = v; + position_eye = v; } void setSunlitColor(vec3 v) { - vary_SunlitColor = v; + sunlit_color = v; } void setAmblitColor(vec3 v) { - vary_AmblitColor = v; + amblit_color = v; } void setAdditiveColor(vec3 v) @@ -76,5 +77,6 @@ void setAdditiveColor(vec3 v) void setAtmosAttenuation(vec3 v) { - vary_AtmosAttenuation = v; + atmos_attenuation = v; + vary_AtmosAttenuation = v.r; } diff --git a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsWaterF.glsl b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsWaterF.glsl new file mode 100644 index 0000000000..23046f990d --- /dev/null +++ b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsWaterF.glsl @@ -0,0 +1,51 @@ +/** + * @file atmosphericVarsWaterF.glsl + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2007, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +VARYING vec3 vary_PositionEye; +VARYING vec3 vary_SunlitColor; +VARYING vec3 vary_AdditiveColor; +VARYING float vary_AtmosAttenuation; + +vec3 getSunlitColor() +{ + return vec3(0,0,0); +} +vec3 getAmblitColor() +{ + return vec3(0,0,0); +} +vec3 getAdditiveColor() +{ + return vary_AdditiveColor; +} +vec3 getAtmosAttenuation() +{ + return vec3(vary_AtmosAttenuation); +} +vec3 getPositionEye() +{ + return vary_PositionEye; +} + diff --git a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsWaterV.glsl b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsWaterV.glsl new file mode 100644 index 0000000000..279c4dd981 --- /dev/null +++ b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsWaterV.glsl @@ -0,0 +1,81 @@ +/** + * @file atmosphericVarsWaterV.glsl + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2007, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +VARYING vec3 vary_PositionEye; +VARYING vec3 vary_AdditiveColor; +VARYING float vary_AtmosAttenuation; + +vec3 atmos_attenuation; +vec3 sunlit_color; +vec3 amblit_color; + +vec3 getSunlitColor() +{ + return sunlit_color; +} +vec3 getAmblitColor() +{ + return amblit_color; +} + +vec3 getAdditiveColor() +{ + return vary_AdditiveColor; +} +vec3 getAtmosAttenuation() +{ + return atmos_attenuation; +} + +vec3 getPositionEye() +{ + return vary_PositionEye; +} + +void setPositionEye(vec3 v) +{ + vary_PositionEye = v; +} + +void setSunlitColor(vec3 v) +{ + sunlit_color = v; +} + +void setAmblitColor(vec3 v) +{ + amblit_color = v; +} + +void setAdditiveColor(vec3 v) +{ + vary_AdditiveColor = v; +} + +void setAtmosAttenuation(vec3 v) +{ + atmos_attenuation = v; + vary_AtmosAttenuation = v.r; +} -- cgit v1.2.3 From 6dfcb11000f349e24dbd1a9b78efa2ca4f799379 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Wed, 28 Sep 2011 01:37:54 -0500 Subject: SH-2453 Fix for horizontal line when max altitude set to 0 --- indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl | 4 ---- 1 file changed, 4 deletions(-) (limited to 'indra/newview/app_settings/shaders/class2') diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl index 4543e83d0a..eb367d4ad6 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl @@ -148,10 +148,6 @@ void calcAtmospherics(vec3 inPositionEye, float ambFactor) { vec3 P = inPositionEye; setPositionEye(P); - //(TERRAIN) limit altitude - if (P.y > max_y.x) P *= (max_y.x / P.y); - if (P.y < -max_y.x) P *= (-max_y.x / P.y); - vec3 tmpLightnorm = lightnorm.xyz; vec3 Pn = normalize(P); -- cgit v1.2.3 From 7238714634e72dacc4b09c1c4ee98b16fb0c91fe Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Thu, 29 Sep 2011 19:32:56 -0500 Subject: SH-2507 Potential fix for basic shaders causing objects to disappear with some drivers (prune shader tree of unused shaders while we're at it) --- .../app_settings/shaders/class2/effects/blurF.glsl | 27 ---- .../app_settings/shaders/class2/effects/blurV.glsl | 27 ---- .../shaders/class2/effects/colorFilterF.glsl | 53 -------- .../shaders/class2/effects/drawQuadV.glsl | 39 ------ .../shaders/class2/effects/extractF.glsl | 44 ------- .../shaders/class2/effects/nightVisionF.glsl | 67 ---------- .../shaders/class2/effects/simpleF.glsl | 38 ------ .../shaders/class2/environment/terrainF.glsl | 64 ---------- .../shaders/class2/environment/terrainV.glsl | 88 ------------- .../shaders/class2/environment/terrainWaterF.glsl | 65 ---------- .../shaders/class2/environment/underWaterF.glsl | 110 ---------------- .../shaders/class2/environment/waterF.glsl | 139 --------------------- .../shaders/class2/environment/waterFogF.glsl | 74 ----------- .../shaders/class2/lighting/lightAlphaMaskF.glsl | 54 -------- .../class2/lighting/lightAlphaMaskNonIndexedF.glsl | 57 --------- .../shaders/class2/lighting/lightF.glsl | 46 ------- .../class2/lighting/lightFullbrightAlphaMaskF.glsl | 54 -------- .../shaders/class2/lighting/lightFullbrightF.glsl | 46 ------- .../lightFullbrightNonIndexedAlphaMaskF.glsl | 56 --------- .../lighting/lightFullbrightNonIndexedF.glsl | 48 ------- .../class2/lighting/lightFullbrightShinyF.glsl | 55 -------- .../lighting/lightFullbrightShinyNonIndexedF.glsl | 56 --------- .../lighting/lightFullbrightShinyWaterF.glsl | 53 -------- .../lightFullbrightShinyWaterNonIndexedF.glsl | 54 -------- .../lighting/lightFullbrightWaterAlphaMaskF.glsl | 54 -------- .../class2/lighting/lightFullbrightWaterF.glsl | 46 ------- .../lightFullbrightWaterNonIndexedAlphaMaskF.glsl | 54 -------- .../lighting/lightFullbrightWaterNonIndexedF.glsl | 46 ------- .../shaders/class2/lighting/lightNonIndexedF.glsl | 48 ------- .../shaders/class2/lighting/lightShinyF.glsl | 54 -------- .../class2/lighting/lightShinyNonIndexedF.glsl | 55 -------- .../shaders/class2/lighting/lightShinyWaterF.glsl | 51 -------- .../lighting/lightShinyWaterNonIndexedF.glsl | 52 -------- .../shaders/class2/lighting/lightSpecularV.glsl | 36 ------ .../shaders/class2/lighting/lightV.glsl | 36 ------ .../class2/lighting/lightWaterAlphaMaskF.glsl | 52 -------- .../lighting/lightWaterAlphaMaskNonIndexedF.glsl | 56 --------- .../shaders/class2/lighting/lightWaterF.glsl | 44 ------- .../class2/lighting/lightWaterNonIndexedF.glsl | 46 ------- .../shaders/class2/objects/fullbrightShinyV.glsl | 67 ---------- .../shaders/class2/objects/fullbrightV.glsl | 58 --------- .../shaders/class2/objects/shinyV.glsl | 65 ---------- .../shaders/class2/objects/simpleNonIndexedV.glsl | 61 --------- .../shaders/class2/objects/simpleV.glsl | 64 ---------- 44 files changed, 2459 deletions(-) delete mode 100644 indra/newview/app_settings/shaders/class2/effects/blurF.glsl delete mode 100644 indra/newview/app_settings/shaders/class2/effects/blurV.glsl delete mode 100644 indra/newview/app_settings/shaders/class2/effects/colorFilterF.glsl delete mode 100644 indra/newview/app_settings/shaders/class2/effects/drawQuadV.glsl delete mode 100644 indra/newview/app_settings/shaders/class2/effects/extractF.glsl delete mode 100644 indra/newview/app_settings/shaders/class2/effects/nightVisionF.glsl delete mode 100644 indra/newview/app_settings/shaders/class2/effects/simpleF.glsl delete mode 100644 indra/newview/app_settings/shaders/class2/environment/terrainF.glsl delete mode 100644 indra/newview/app_settings/shaders/class2/environment/terrainV.glsl delete mode 100644 indra/newview/app_settings/shaders/class2/environment/terrainWaterF.glsl delete mode 100644 indra/newview/app_settings/shaders/class2/environment/underWaterF.glsl delete mode 100644 indra/newview/app_settings/shaders/class2/environment/waterF.glsl delete mode 100644 indra/newview/app_settings/shaders/class2/environment/waterFogF.glsl delete mode 100644 indra/newview/app_settings/shaders/class2/lighting/lightAlphaMaskF.glsl delete mode 100644 indra/newview/app_settings/shaders/class2/lighting/lightAlphaMaskNonIndexedF.glsl delete mode 100644 indra/newview/app_settings/shaders/class2/lighting/lightF.glsl delete mode 100644 indra/newview/app_settings/shaders/class2/lighting/lightFullbrightAlphaMaskF.glsl delete mode 100644 indra/newview/app_settings/shaders/class2/lighting/lightFullbrightF.glsl delete mode 100644 indra/newview/app_settings/shaders/class2/lighting/lightFullbrightNonIndexedAlphaMaskF.glsl delete mode 100644 indra/newview/app_settings/shaders/class2/lighting/lightFullbrightNonIndexedF.glsl delete mode 100644 indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyF.glsl delete mode 100644 indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyNonIndexedF.glsl delete mode 100644 indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyWaterF.glsl delete mode 100644 indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyWaterNonIndexedF.glsl delete mode 100644 indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterAlphaMaskF.glsl delete mode 100644 indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterF.glsl delete mode 100644 indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterNonIndexedAlphaMaskF.glsl delete mode 100644 indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterNonIndexedF.glsl delete mode 100644 indra/newview/app_settings/shaders/class2/lighting/lightNonIndexedF.glsl delete mode 100644 indra/newview/app_settings/shaders/class2/lighting/lightShinyF.glsl delete mode 100644 indra/newview/app_settings/shaders/class2/lighting/lightShinyNonIndexedF.glsl delete mode 100644 indra/newview/app_settings/shaders/class2/lighting/lightShinyWaterF.glsl delete mode 100644 indra/newview/app_settings/shaders/class2/lighting/lightShinyWaterNonIndexedF.glsl delete mode 100644 indra/newview/app_settings/shaders/class2/lighting/lightSpecularV.glsl delete mode 100644 indra/newview/app_settings/shaders/class2/lighting/lightV.glsl delete mode 100644 indra/newview/app_settings/shaders/class2/lighting/lightWaterAlphaMaskF.glsl delete mode 100644 indra/newview/app_settings/shaders/class2/lighting/lightWaterAlphaMaskNonIndexedF.glsl delete mode 100644 indra/newview/app_settings/shaders/class2/lighting/lightWaterF.glsl delete mode 100644 indra/newview/app_settings/shaders/class2/lighting/lightWaterNonIndexedF.glsl delete mode 100644 indra/newview/app_settings/shaders/class2/objects/fullbrightShinyV.glsl delete mode 100644 indra/newview/app_settings/shaders/class2/objects/fullbrightV.glsl delete mode 100644 indra/newview/app_settings/shaders/class2/objects/shinyV.glsl delete mode 100644 indra/newview/app_settings/shaders/class2/objects/simpleNonIndexedV.glsl delete mode 100644 indra/newview/app_settings/shaders/class2/objects/simpleV.glsl (limited to 'indra/newview/app_settings/shaders/class2') diff --git a/indra/newview/app_settings/shaders/class2/effects/blurF.glsl b/indra/newview/app_settings/shaders/class2/effects/blurF.glsl deleted file mode 100644 index 01fe4a4e14..0000000000 --- a/indra/newview/app_settings/shaders/class2/effects/blurF.glsl +++ /dev/null @@ -1,27 +0,0 @@ -/** - * @file blurf.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -//NOT USED!!! - diff --git a/indra/newview/app_settings/shaders/class2/effects/blurV.glsl b/indra/newview/app_settings/shaders/class2/effects/blurV.glsl deleted file mode 100644 index b92e9b3f03..0000000000 --- a/indra/newview/app_settings/shaders/class2/effects/blurV.glsl +++ /dev/null @@ -1,27 +0,0 @@ -/** - * @file blurV.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - - // NOT USED!! - diff --git a/indra/newview/app_settings/shaders/class2/effects/colorFilterF.glsl b/indra/newview/app_settings/shaders/class2/effects/colorFilterF.glsl deleted file mode 100644 index f42497d8be..0000000000 --- a/indra/newview/app_settings/shaders/class2/effects/colorFilterF.glsl +++ /dev/null @@ -1,53 +0,0 @@ -/** - * @file colorFilterF.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; -#endif - -uniform sampler2DRect RenderTexture; -uniform float brightness; -uniform float contrast; -uniform vec3 contrastBase; -uniform float saturation; -uniform vec3 lumWeights; - -const float gamma = 2.0; - -void main(void) -{ - vec3 color = vec3(texture2DRect(RenderTexture, vary_texcoord0.st)); - - /// Modulate brightness - color *= brightness; - - /// Modulate contrast - color = mix(contrastBase, color, contrast); - - /// Modulate saturation - color = mix(vec3(dot(color, lumWeights)), color, saturation); - - gl_FragColor = vec4(color, 1.0); -} diff --git a/indra/newview/app_settings/shaders/class2/effects/drawQuadV.glsl b/indra/newview/app_settings/shaders/class2/effects/drawQuadV.glsl deleted file mode 100644 index f03a6076c0..0000000000 --- a/indra/newview/app_settings/shaders/class2/effects/drawQuadV.glsl +++ /dev/null @@ -1,39 +0,0 @@ -/** - * @file drawQuadV.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -uniform mat4 modelview_projection_matrix; - -ATTRIBUTE vec3 position; -ATTRIBUTE vec2 texcoord0; -ATTRIBUTE vec2 texcoord1; - - -void main(void) -{ - //transform vertex - gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); - vary_texcoord0 = texcoord0; - vary_texcoord1 = texcoord1; -} diff --git a/indra/newview/app_settings/shaders/class2/effects/extractF.glsl b/indra/newview/app_settings/shaders/class2/effects/extractF.glsl deleted file mode 100644 index ebf4f28a74..0000000000 --- a/indra/newview/app_settings/shaders/class2/effects/extractF.glsl +++ /dev/null @@ -1,44 +0,0 @@ -/** - * @file extractF.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; -#endif - -uniform sampler2DRect RenderTexture; -uniform float extractLow; -uniform float extractHigh; -uniform vec3 lumWeights; - -void main(void) -{ - /// Get scene color - vec3 color = vec3(texture2DRect(RenderTexture, vary_texcoord0.st)); - - /// Extract luminance and scale up by night vision brightness - float lum = smoothstep(extractLow, extractHigh, dot(color, lumWeights)); - - gl_FragColor = vec4(vec3(lum), 1.0); -} diff --git a/indra/newview/app_settings/shaders/class2/effects/nightVisionF.glsl b/indra/newview/app_settings/shaders/class2/effects/nightVisionF.glsl deleted file mode 100644 index 2bfcfad081..0000000000 --- a/indra/newview/app_settings/shaders/class2/effects/nightVisionF.glsl +++ /dev/null @@ -1,67 +0,0 @@ -/** - * @file nightVisionF.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; -#endif - -uniform sampler2DRect RenderTexture; -uniform sampler2D NoiseTexture; -uniform float brightMult; -uniform float noiseStrength; - -VARYING vec2 vary_texcoord0; -VARYING vec2 vary_texcoord1; - -float luminance(vec3 color) -{ - /// CALCULATING LUMINANCE (Using NTSC lum weights) - /// http://en.wikipedia.org/wiki/Luma_%28video%29 - return dot(color, vec3(0.299, 0.587, 0.114)); -} - -void main(void) -{ - /// Get scene color - vec3 color = vec3(texture2DRect(RenderTexture, vary_texcoord0.st)); - - /// Extract luminance and scale up by night vision brightness - float lum = luminance(color) * brightMult; - - /// Convert into night vision color space - /// Newer NVG colors (crisper and more saturated) - vec3 outColor = (lum * vec3(0.91, 1.21, 0.9)) + vec3(-0.07, 0.1, -0.12); - - /// Add noise - float noiseValue = texture2D(NoiseTexture, vary_texcoord1.st).r; - noiseValue = (noiseValue - 0.5) * noiseStrength; - - /// Older NVG colors (more muted) - // vec3 outColor = (lum * vec3(0.82, 0.75, 0.83)) + vec3(0.05, 0.32, -0.11); - - outColor += noiseValue; - - gl_FragColor = vec4(outColor, 1.0); -} diff --git a/indra/newview/app_settings/shaders/class2/effects/simpleF.glsl b/indra/newview/app_settings/shaders/class2/effects/simpleF.glsl deleted file mode 100644 index 932bd87152..0000000000 --- a/indra/newview/app_settings/shaders/class2/effects/simpleF.glsl +++ /dev/null @@ -1,38 +0,0 @@ -/** - * @file simpleF.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; -#endif - -uniform sampler2DRect RenderTexture; - -VARYING vec2 vary_texcoord0; - -void main(void) -{ - vec3 color = vec3(texture2DRect(RenderTexture, vary_texcoord0.st)); - gl_FragColor = vec4(1.0 - color, 1.0); -} diff --git a/indra/newview/app_settings/shaders/class2/environment/terrainF.glsl b/indra/newview/app_settings/shaders/class2/environment/terrainF.glsl deleted file mode 100644 index 18f6d91804..0000000000 --- a/indra/newview/app_settings/shaders/class2/environment/terrainF.glsl +++ /dev/null @@ -1,64 +0,0 @@ -/** - * @file terrainF.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; -#endif - -VARYING vec4 vertex_color; -VARYING vec4 vary_texcoord0; -VARYING vec4 vary_texcoord1; - -uniform sampler2D detail_0; -uniform sampler2D detail_1; -uniform sampler2D detail_2; -uniform sampler2D detail_3; -uniform sampler2D alpha_ramp; - -vec3 atmosLighting(vec3 light); - -vec3 scaleSoftClip(vec3 color); - -void main() -{ - /// Note: This should duplicate the blending functionality currently used for the terrain rendering. - - /// TODO Confirm tex coords and bind them appropriately in vert shader. - vec4 color0 = texture2D(detail_0, vary_texcoord0.xy); - vec4 color1 = texture2D(detail_1, vary_texcoord0.xy); - vec4 color2 = texture2D(detail_2, vary_texcoord0.xy); - vec4 color3 = texture2D(detail_3, vary_texcoord0.xy); - - float alpha1 = texture2D(alpha_ramp, vary_texcoord0.zw).a; - float alpha2 = texture2D(alpha_ramp,vary_texcoord1.xy).a; - float alphaFinal = texture2D(alpha_ramp, vary_texcoord1.zw).a; - vec4 outColor = mix( mix(color3, color2, alpha2), mix(color1, color0, alpha1), alphaFinal ); - - /// Add WL Components - outColor.rgb = atmosLighting(outColor.rgb * vertex_color.rgb); - - gl_FragColor = vec4(scaleSoftClip(outColor.rgb), 1.0); -} - diff --git a/indra/newview/app_settings/shaders/class2/environment/terrainV.glsl b/indra/newview/app_settings/shaders/class2/environment/terrainV.glsl deleted file mode 100644 index f183b885d1..0000000000 --- a/indra/newview/app_settings/shaders/class2/environment/terrainV.glsl +++ /dev/null @@ -1,88 +0,0 @@ -/** - * @file terrainV.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -uniform mat3 normal_matrix; -uniform mat4 texture_matrix0; -uniform mat4 modelview_matrix; -uniform mat4 modelview_projection_matrix; - -uniform vec4 object_plane_t; -uniform vec4 object_plane_s; - -ATTRIBUTE vec3 position; -ATTRIBUTE vec3 normal; -ATTRIBUTE vec4 diffuse_color; -ATTRIBUTE vec2 texcoord0; -ATTRIBUTE vec2 texcoord1; - -VARYING vec4 vertex_color; -VARYING vec4 vary_texcoord0; -VARYING vec4 vary_texcoord1; - -void calcAtmospherics(vec3 inPositionEye); - -vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol); - -vec4 texgen_object(vec4 vpos, vec4 tc, mat4 mat, vec4 tp0, vec4 tp1) -{ - vec4 tcoord; - - tcoord.x = dot(vpos, tp0); - tcoord.y = dot(vpos, tp1); - tcoord.z = tc.z; - tcoord.w = tc.w; - - tcoord = mat * tcoord; - - return tcoord; -} - -void main() -{ - //transform vertex - gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); - - vec4 pos = modelview_matrix * vec4(position.xyz, 1.0); - vec3 norm = normalize(normal_matrix * normal); - - calcAtmospherics(pos.xyz); - - /// Potentially better without it for water. - pos /= pos.w; - - vec4 color = calcLighting(pos.xyz, norm, diffuse_color, vec4(0)); - - vertex_color = color; - - // Transform and pass tex coords - vary_texcoord0.xy = texgen_object(vec4(position.xyz, 1.0), vec4(texcoord0,0,1), texture_matrix0, object_plane_s, object_plane_t).xy; - - vec4 t = vec4(texcoord1,0,1); - - vary_texcoord0.zw = t.xy; - vary_texcoord1.xy = t.xy-vec2(2.0, 0.0); - vary_texcoord1.zw = t.xy-vec2(1.0, 0.0); -} - diff --git a/indra/newview/app_settings/shaders/class2/environment/terrainWaterF.glsl b/indra/newview/app_settings/shaders/class2/environment/terrainWaterF.glsl deleted file mode 100644 index e5c7ced52c..0000000000 --- a/indra/newview/app_settings/shaders/class2/environment/terrainWaterF.glsl +++ /dev/null @@ -1,65 +0,0 @@ -/** - * @file terrainWaterF.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; -#endif - -VARYING vec4 vertex_color; -VARYING vec4 vary_texcoord0; -VARYING vec4 vary_texcoord1; - -uniform sampler2D detail_0; -uniform sampler2D detail_1; -uniform sampler2D detail_2; -uniform sampler2D detail_3; -uniform sampler2D alpha_ramp; - -vec3 atmosLighting(vec3 light); - -vec4 applyWaterFog(vec4 color); - -void main() -{ - /// Note: This should duplicate the blending functionality currently used for the terrain rendering. - - /// TODO Confirm tex coords and bind them appropriately in vert shader. - vec4 color0 = texture2D(detail_0, vary_texcoord0.xy); - vec4 color1 = texture2D(detail_1, vary_texcoord0.xy); - vec4 color2 = texture2D(detail_2, vary_texcoord0.xy); - vec4 color3 = texture2D(detail_3, vary_texcoord0.xy); - - float alpha1 = texture2D(alpha_ramp, vary_texcoord0.zw).a; - float alpha2 = texture2D(alpha_ramp,vary_texcoord1.xy).a; - float alphaFinal = texture2D(alpha_ramp, vary_texcoord1.zw).a; - vec4 outColor = mix( mix(color3, color2, alpha2), mix(color1, color0, alpha1), alphaFinal ); - - /// Add WL Components - outColor.rgb = atmosLighting(outColor.rgb * vertex_color.rgb); - - outColor = applyWaterFog(outColor); - gl_FragColor = outColor; -} - diff --git a/indra/newview/app_settings/shaders/class2/environment/underWaterF.glsl b/indra/newview/app_settings/shaders/class2/environment/underWaterF.glsl deleted file mode 100644 index 1fdb90f792..0000000000 --- a/indra/newview/app_settings/shaders/class2/environment/underWaterF.glsl +++ /dev/null @@ -1,110 +0,0 @@ -/** - * @file underWaterF.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; -#endif - -uniform sampler2D diffuseMap; -uniform sampler2D bumpMap; -uniform sampler2D screenTex; -uniform sampler2D refTex; -uniform sampler2D screenDepth; - -uniform vec4 fogCol; -uniform vec3 lightDir; -uniform vec3 specular; -uniform float lightExp; -uniform vec2 fbScale; -uniform float refScale; -uniform float znear; -uniform float zfar; -uniform float kd; -uniform vec4 waterPlane; -uniform vec3 eyeVec; -uniform vec4 waterFogColor; -uniform float waterFogDensity; -uniform float waterFogKS; -uniform vec2 screenRes; - -//bigWave is (refCoord.w, view.w); -VARYING vec4 refCoord; -VARYING vec4 littleWave; -VARYING vec4 view; - -vec4 applyWaterFog(vec4 color, vec3 viewVec) -{ - //normalize view vector - vec3 view = normalize(viewVec); - float es = -view.z; - - //find intersection point with water plane and eye vector - - //get eye depth - float e0 = max(-waterPlane.w, 0.0); - - //get object depth - float depth = length(viewVec); - - //get "thickness" of water - float l = max(depth, 0.1); - - float kd = waterFogDensity; - float ks = waterFogKS; - vec4 kc = waterFogColor; - - float F = 0.98; - - float t1 = -kd * pow(F, ks * e0); - float t2 = kd + ks * es; - float t3 = pow(F, t2*l) - 1.0; - - float L = min(t1/t2*t3, 1.0); - - float D = pow(0.98, l*kd); - //return vec4(1.0, 0.0, 1.0, 1.0); - return color * D + kc * L; - //depth /= 10.0; - //return vec4(depth,depth,depth,0.0); -} - -void main() -{ - vec4 color; - - //get detail normals - vec3 wave1 = texture2D(bumpMap, vec2(refCoord.w, view.w)).xyz*2.0-1.0; - vec3 wave2 = texture2D(bumpMap, littleWave.xy).xyz*2.0-1.0; - vec3 wave3 = texture2D(bumpMap, littleWave.zw).xyz*2.0-1.0; - vec3 wavef = normalize(wave1+wave2+wave3); - - //figure out distortion vector (ripply) - vec2 distort = (refCoord.xy/refCoord.z) * 0.5 + 0.5; - distort = distort+wavef.xy*refScale; - - vec4 fb = texture2D(screenTex, distort); - - gl_FragColor = applyWaterFog(fb,view.xyz); -} diff --git a/indra/newview/app_settings/shaders/class2/environment/waterF.glsl b/indra/newview/app_settings/shaders/class2/environment/waterF.glsl deleted file mode 100644 index 444c896d38..0000000000 --- a/indra/newview/app_settings/shaders/class2/environment/waterF.glsl +++ /dev/null @@ -1,139 +0,0 @@ -/** - * @file waterF.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; -#endif - -vec3 scaleSoftClip(vec3 inColor); -vec3 atmosTransport(vec3 inColor); - -uniform sampler2D bumpMap; -uniform sampler2D screenTex; -uniform sampler2D refTex; - -uniform float sunAngle; -uniform float sunAngle2; -uniform vec3 lightDir; -uniform vec3 specular; -uniform float lightExp; -uniform float refScale; -uniform float kd; -uniform vec2 screenRes; -uniform vec3 normScale; -uniform float fresnelScale; -uniform float fresnelOffset; -uniform float blurMultiplier; - - -//bigWave is (refCoord.w, view.w); -VARYING vec4 refCoord; -VARYING vec4 littleWave; -VARYING vec4 view; - -void main() -{ - vec4 color; - - float dist = length(view.xy); - - //normalize view vector - vec3 viewVec = normalize(view.xyz); - - //get wave normals - vec3 wave1 = texture2D(bumpMap, vec2(refCoord.w, view.w)).xyz*2.0-1.0; - vec3 wave2 = texture2D(bumpMap, littleWave.xy).xyz*2.0-1.0; - vec3 wave3 = texture2D(bumpMap, littleWave.zw).xyz*2.0-1.0; - //get base fresnel components - - vec3 df = vec3( - dot(viewVec, wave1), - dot(viewVec, (wave2 + wave3) * 0.5), - dot(viewVec, wave3) - ) * fresnelScale + fresnelOffset; - df *= df; - - vec2 distort = (refCoord.xy/refCoord.z) * 0.5 + 0.5; - - float dist2 = dist; - dist = max(dist, 5.0); - - float dmod = sqrt(dist); - - vec2 dmod_scale = vec2(dmod*dmod, dmod); - - //get reflected color - vec2 refdistort1 = wave1.xy*normScale.x; - vec2 refvec1 = distort+refdistort1/dmod_scale; - vec4 refcol1 = texture2D(refTex, refvec1); - - vec2 refdistort2 = wave2.xy*normScale.y; - vec2 refvec2 = distort+refdistort2/dmod_scale; - vec4 refcol2 = texture2D(refTex, refvec2); - - vec2 refdistort3 = wave3.xy*normScale.z; - vec2 refvec3 = distort+refdistort3/dmod_scale; - vec4 refcol3 = texture2D(refTex, refvec3); - - vec4 refcol = refcol1 + refcol2 + refcol3; - float df1 = df.x + df.y + df.z; - refcol *= df1 * 0.333; - - vec3 wavef = (wave1 + wave2 * 0.4 + wave3 * 0.6) * 0.5; - - wavef.z *= max(-viewVec.z, 0.1); - wavef = normalize(wavef); - - float df2 = dot(viewVec, wavef) * fresnelScale+fresnelOffset; - - vec2 refdistort4 = wavef.xy*0.125; - refdistort4.y -= abs(refdistort4.y); - vec2 refvec4 = distort+refdistort4/dmod; - float dweight = min(dist2*blurMultiplier, 1.0); - vec4 baseCol = texture2D(refTex, refvec4); - refcol = mix(baseCol*df2, refcol, dweight); - - //get specular component - float spec = clamp(dot(lightDir, (reflect(viewVec,wavef))),0.0,1.0); - - //harden specular - spec = pow(spec, 128.0); - - //figure out distortion vector (ripply) - vec2 distort2 = distort+wavef.xy*refScale/max(dmod*df1, 1.0); - - vec4 fb = texture2D(screenTex, distort2); - - //mix with reflection - // Note we actually want to use just df1, but multiplying by 0.999999 gets around and nvidia compiler bug - color.rgb = mix(fb.rgb, refcol.rgb, df1 * 0.99999); - color.rgb += spec * specular; - - color.rgb = atmosTransport(color.rgb); - color.rgb = scaleSoftClip(color.rgb); - color.a = spec * sunAngle2; - - gl_FragColor = color; -} diff --git a/indra/newview/app_settings/shaders/class2/environment/waterFogF.glsl b/indra/newview/app_settings/shaders/class2/environment/waterFogF.glsl deleted file mode 100644 index 4bdfce9260..0000000000 --- a/indra/newview/app_settings/shaders/class2/environment/waterFogF.glsl +++ /dev/null @@ -1,74 +0,0 @@ -/** - * @file waterFogF.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - - - -uniform vec4 lightnorm; -uniform vec4 waterPlane; -uniform vec4 waterFogColor; -uniform float waterFogDensity; -uniform float waterFogKS; - -vec3 getPositionEye(); - -vec4 applyWaterFog(vec4 color) -{ - //normalize view vector - vec3 view = normalize(getPositionEye()); - float es = -(dot(view, waterPlane.xyz)); - - //find intersection point with water plane and eye vector - - //get eye depth - float e0 = max(-waterPlane.w, 0.0); - - vec3 int_v = waterPlane.w > 0.0 ? view * waterPlane.w/es : vec3(0.0, 0.0, 0.0); - - //get object depth - float depth = length(getPositionEye() - int_v); - - //get "thickness" of water - float l = max(depth, 0.1); - - float kd = waterFogDensity; - float ks = waterFogKS; - vec4 kc = waterFogColor; - - float F = 0.98; - - float t1 = -kd * pow(F, ks * e0); - float t2 = kd + ks * es; - float t3 = pow(F, t2*l) - 1.0; - - float L = min(t1/t2*t3, 1.0); - - float D = pow(0.98, l*kd); - - color.rgb = color.rgb * D + kc.rgb * L; - color.a = kc.a + color.a; - - return color; -} - diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightAlphaMaskF.glsl deleted file mode 100644 index 6815f7aa85..0000000000 --- a/indra/newview/app_settings/shaders/class2/lighting/lightAlphaMaskF.glsl +++ /dev/null @@ -1,54 +0,0 @@ -/** - * @file lightAlphaMaskF.glsl - * - * $LicenseInfo:firstyear=2011&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2011, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; -#endif - -uniform float minimum_alpha; -uniform float maximum_alpha; - -vec3 atmosLighting(vec3 light); -vec3 scaleSoftClip(vec3 light); - -VARYING vec4 vertex_color; -VARYING vec2 vary_texcoord0; - -void default_lighting() -{ - vec4 color = diffuseLookup(vary_texcoord0.xy) * vertex_color; - - if (color.a < minimum_alpha || color.a > maximum_alpha) - { - discard; - } - - color.rgb = atmosLighting(color.rgb); - - color.rgb = scaleSoftClip(color.rgb); - - gl_FragColor = color; -} - diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightAlphaMaskNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightAlphaMaskNonIndexedF.glsl deleted file mode 100644 index 2640668d7d..0000000000 --- a/indra/newview/app_settings/shaders/class2/lighting/lightAlphaMaskNonIndexedF.glsl +++ /dev/null @@ -1,57 +0,0 @@ -/** - * @file lightAlphaMaskNonIndexedF.glsl - * - * $LicenseInfo:firstyear=2011&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2011, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; -#endif - -uniform float minimum_alpha; -uniform float maximum_alpha; - - -uniform sampler2D diffuseMap; - -vec3 atmosLighting(vec3 light); -vec3 scaleSoftClip(vec3 light); - -VARYING vec4 vertex_color; -VARYING vec2 vary_texcoord0; - -void default_lighting() -{ - vec4 color = texture2D(diffuseMap,vary_texcoord0.xy) * vertex_color; - - if (color.a < minimum_alpha || color.a > maximum_alpha) - { - discard; - } - - color.rgb = atmosLighting(color.rgb); - - color.rgb = scaleSoftClip(color.rgb); - - gl_FragColor = color; -} - diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightF.glsl deleted file mode 100644 index 735f5b3813..0000000000 --- a/indra/newview/app_settings/shaders/class2/lighting/lightF.glsl +++ /dev/null @@ -1,46 +0,0 @@ -/** - * @file lightF.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; -#endif - -VARYING vec4 vertex_color; -VARYING vec2 vary_texcoord0; - -vec3 atmosLighting(vec3 light); -vec3 scaleSoftClip(vec3 light); - -void default_lighting() -{ - vec4 color = diffuseLookup(vary_texcoord0.xy) * vertex_color; - - color.rgb = atmosLighting(color.rgb); - - color.rgb = scaleSoftClip(color.rgb); - - gl_FragColor = color; -} - diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightAlphaMaskF.glsl deleted file mode 100644 index 92113d9afa..0000000000 --- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightAlphaMaskF.glsl +++ /dev/null @@ -1,54 +0,0 @@ -/** - * @file lightFullbrightAlphaMaskF.glsl - * - * $LicenseInfo:firstyear=2011&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2011, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; -#endif - -uniform float minimum_alpha; -uniform float maximum_alpha; - -vec3 fullbrightAtmosTransport(vec3 light); -vec3 fullbrightScaleSoftClip(vec3 light); - -VARYING vec4 vertex_color; -VARYING vec2 vary_texcoord0; - -void fullbright_lighting() -{ - vec4 color = diffuseLookup(vary_texcoord0.xy) * vertex_color; - - if (color.a < minimum_alpha || color.a > maximum_alpha) - { - discard; - } - - color.rgb = fullbrightAtmosTransport(color.rgb); - - color.rgb = fullbrightScaleSoftClip(color.rgb); - - gl_FragColor = color; -} - diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightF.glsl deleted file mode 100644 index c3edc0bd70..0000000000 --- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightF.glsl +++ /dev/null @@ -1,46 +0,0 @@ -/** - * @file lightFullbrightF.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; -#endif - -VARYING vec4 vertex_color; -VARYING vec2 vary_texcoord0; - -vec3 fullbrightAtmosTransport(vec3 light); -vec3 fullbrightScaleSoftClip(vec3 light); - -void fullbright_lighting() -{ - vec4 color = diffuseLookup(vary_texcoord0.xy) * vertex_color; - - color.rgb = fullbrightAtmosTransport(color.rgb); - - color.rgb = fullbrightScaleSoftClip(color.rgb); - - gl_FragColor = color; -} - diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightNonIndexedAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightNonIndexedAlphaMaskF.glsl deleted file mode 100644 index d1ad3da009..0000000000 --- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightNonIndexedAlphaMaskF.glsl +++ /dev/null @@ -1,56 +0,0 @@ -/** - * @file lightFullbrightNonIndexedAlphaMaskF.glsl - * - * $LicenseInfo:firstyear=2011&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2011, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; -#endif - -uniform float minimum_alpha; -uniform float maximum_alpha; - -vec3 fullbrightAtmosTransport(vec3 light); -vec3 fullbrightScaleSoftClip(vec3 light); - -uniform sampler2D diffuseMap; - -VARYING vec4 vertex_color; -VARYING vec2 vary_texcoord0; - -void fullbright_lighting() -{ - vec4 color = texture2D(diffuseMap,vary_texcoord0.xy) * vertex_color; - - if (color.a < minimum_alpha || color.a > maximum_alpha) - { - discard; - } - - color.rgb = fullbrightAtmosTransport(color.rgb); - - color.rgb = fullbrightScaleSoftClip(color.rgb); - - gl_FragColor = color; -} - diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightNonIndexedF.glsl deleted file mode 100644 index 4e1e664e6b..0000000000 --- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightNonIndexedF.glsl +++ /dev/null @@ -1,48 +0,0 @@ -/** - * @file lightFullbrightF.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; -#endif - -VARYING vec4 vertex_color; -VARYING vec2 vary_texcoord0; - -vec3 fullbrightAtmosTransport(vec3 light); -vec3 fullbrightScaleSoftClip(vec3 light); - -uniform sampler2D diffuseMap; - -void fullbright_lighting() -{ - vec4 color = texture2D(diffuseMap,vary_texcoord0.xy) * vertex_color; - - color.rgb = fullbrightAtmosTransport(color.rgb); - - color.rgb = fullbrightScaleSoftClip(color.rgb); - - gl_FragColor = color; -} - diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyF.glsl deleted file mode 100644 index c981e9eba2..0000000000 --- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyF.glsl +++ /dev/null @@ -1,55 +0,0 @@ -/** - * @file lightFullbrightShinyF.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; -#endif - -VARYING vec4 vertex_color; -VARYING vec2 vary_texcoord0; -VARYING vec3 vary_texcoord1; - -uniform samplerCube environmentMap; - -vec3 fullbrightShinyAtmosTransport(vec3 light); -vec3 fullbrightScaleSoftClip(vec3 light); - -void fullbright_shiny_lighting() -{ - vec4 color = diffuseLookup(vary_texcoord0.xy); - color.rgb *= vertex_color.rgb; - - vec3 envColor = textureCube(environmentMap, vary_texcoord1.xyz).rgb; - color.rgb = mix(color.rgb, envColor.rgb, vertex_color.a); - - color.rgb = fullbrightShinyAtmosTransport(color.rgb); - - color.rgb = fullbrightScaleSoftClip(color.rgb); - - color.a = max(color.a, vertex_color.a); - - gl_FragColor = color; -} - diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyNonIndexedF.glsl deleted file mode 100644 index a4893f0359..0000000000 --- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyNonIndexedF.glsl +++ /dev/null @@ -1,56 +0,0 @@ -/** - * @file lightFullbrightShinyF.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; -#endif - -VARYING vec4 vertex_color; -VARYING vec2 vary_texcoord0; -VARYING vec3 vary_texcoord1; - -uniform samplerCube environmentMap; -uniform sampler2D diffuseMap; - -vec3 fullbrightShinyAtmosTransport(vec3 light); -vec3 fullbrightScaleSoftClip(vec3 light); - -void fullbright_shiny_lighting() -{ - vec4 color = texture2D(diffuseMap, vary_texcoord0.xy); - color.rgb *= vertex_color.rgb; - - vec3 envColor = textureCube(environmentMap, vary_texcoord1.xyz).rgb; - color.rgb = mix(color.rgb, envColor.rgb, vertex_color.a); - - color.rgb = fullbrightShinyAtmosTransport(color.rgb); - - color.rgb = fullbrightScaleSoftClip(color.rgb); - - color.a = max(color.a, vertex_color.a); - - gl_FragColor = color; -} - diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyWaterF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyWaterF.glsl deleted file mode 100644 index c10cde98e0..0000000000 --- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyWaterF.glsl +++ /dev/null @@ -1,53 +0,0 @@ -/** - * @file lightFullbrightShinyWaterF.glsl - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; -#endif - -VARYING vec4 vertex_color; -VARYING vec2 vary_texcoord0; -VARYING vec3 vary_texcoord1; - -uniform samplerCube environmentMap; - -vec3 fullbrightShinyAtmosTransport(vec3 light); -vec3 fullbrightScaleSoftClip(vec3 light); -vec4 applyWaterFog(vec4 color); - -void fullbright_shiny_lighting_water() -{ - vec4 color = diffuseLookup(vary_texcoord0.xy); - color.rgb *= vertex_color.rgb; - - vec3 envColor = textureCube(environmentMap, vary_texcoord1.xyz).rgb; - color.rgb = mix(color.rgb, envColor.rgb, vertex_color.a); - - color.rgb = fullbrightShinyAtmosTransport(color.rgb); - color.rgb = fullbrightScaleSoftClip(color.rgb); - color.a = max(color.a, vertex_color.a); - - gl_FragColor = applyWaterFog(color); -} - diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyWaterNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyWaterNonIndexedF.glsl deleted file mode 100644 index e9b26087f4..0000000000 --- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightShinyWaterNonIndexedF.glsl +++ /dev/null @@ -1,54 +0,0 @@ -/** - * @file lightFullbrightShinyWaterF.glsl - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; -#endif - -VARYING vec4 vertex_color; -VARYING vec2 vary_texcoord0; -VARYING vec3 vary_texcoord1; - -uniform samplerCube environmentMap; -uniform sampler2D diffuseMap; - -vec3 fullbrightShinyAtmosTransport(vec3 light); -vec3 fullbrightScaleSoftClip(vec3 light); -vec4 applyWaterFog(vec4 color); - -void fullbright_shiny_lighting_water() -{ - vec4 color = texture2D(diffuseMap,vary_texcoord0.xy); - color.rgb *= vertex_color.rgb; - - vec3 envColor = textureCube(environmentMap, vary_texcoord1.xyz).rgb; - color.rgb = mix(color.rgb, envColor.rgb, vertex_color.a); - - color.rgb = fullbrightShinyAtmosTransport(color.rgb); - color.rgb = fullbrightScaleSoftClip(color.rgb); - color.a = max(color.a, vertex_color.a); - - gl_FragColor = applyWaterFog(color); -} - diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterAlphaMaskF.glsl deleted file mode 100644 index 32a1c71099..0000000000 --- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterAlphaMaskF.glsl +++ /dev/null @@ -1,54 +0,0 @@ -/** - * @file lightFullbrightWaterAlphaMaskF.glsl - * - * $LicenseInfo:firstyear=2011&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2011, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; -#endif - -uniform float minimum_alpha; -uniform float maximum_alpha; - -vec4 diffuseLookup(vec2 texcoord); - -vec3 fullbrightAtmosTransport(vec3 light); -vec4 applyWaterFog(vec4 color); - -VARYING vec4 vertex_color; -VARYING vec2 vary_texcoord0; - -void fullbright_lighting_water() -{ - vec4 color = diffuseLookup(vary_texcoord0.xy) * vertex_color; - - if (color.a < minimum_alpha || color.a > maximum_alpha) - { - discard; - } - - color.rgb = fullbrightAtmosTransport(color.rgb); - - gl_FragColor = applyWaterFog(color); -} - diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterF.glsl deleted file mode 100644 index 2547f9e750..0000000000 --- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterF.glsl +++ /dev/null @@ -1,46 +0,0 @@ -/** - * @file lightFullbrightWaterF.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; -#endif - -VARYING vec4 vertex_color; -VARYING vec2 vary_texcoord0; - -vec4 diffuseLookup(vec2 texcoord); - -vec3 fullbrightAtmosTransport(vec3 light); -vec4 applyWaterFog(vec4 color); - -void fullbright_lighting_water() -{ - vec4 color = diffuseLookup(vary_texcoord0.xy) * vertex_color; - - color.rgb = fullbrightAtmosTransport(color.rgb); - - gl_FragColor = applyWaterFog(color); -} - diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterNonIndexedAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterNonIndexedAlphaMaskF.glsl deleted file mode 100644 index 1b5aa61441..0000000000 --- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterNonIndexedAlphaMaskF.glsl +++ /dev/null @@ -1,54 +0,0 @@ -/** - * @file lightFullbrightWaterNonIndexedAlphaMaskF.glsl - * - * $LicenseInfo:firstyear=2011&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2011, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; -#endif - -uniform float minimum_alpha; -uniform float maximum_alpha; - -uniform sampler2D diffuseMap; - -vec3 fullbrightAtmosTransport(vec3 light); -vec4 applyWaterFog(vec4 color); - -VARYING vec4 vertex_color; -VARYING vec2 vary_texcoord0; - -void fullbright_lighting_water() -{ - vec4 color = texture2D(diffuseMap, vary_texcoord0.xy) * vertex_color; - - if (color.a < minimum_alpha || color.a > maximum_alpha) - { - discard; - } - - color.rgb = fullbrightAtmosTransport(color.rgb); - - gl_FragColor = applyWaterFog(color); -} - diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterNonIndexedF.glsl deleted file mode 100644 index aa3ef8cdd9..0000000000 --- a/indra/newview/app_settings/shaders/class2/lighting/lightFullbrightWaterNonIndexedF.glsl +++ /dev/null @@ -1,46 +0,0 @@ -/** - * @file lightFullbrightWaterF.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; -#endif - -VARYING vec4 vertex_color; -VARYING vec2 vary_texcoord0; - -uniform sampler2D diffuseMap; - -vec3 fullbrightAtmosTransport(vec3 light); -vec4 applyWaterFog(vec4 color); - -void fullbright_lighting_water() -{ - vec4 color = texture2D(diffuseMap, vary_texcoord0.xy) * vertex_color; - - color.rgb = fullbrightAtmosTransport(color.rgb); - - gl_FragColor = applyWaterFog(color); -} - diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightNonIndexedF.glsl deleted file mode 100644 index 9f1a358b53..0000000000 --- a/indra/newview/app_settings/shaders/class2/lighting/lightNonIndexedF.glsl +++ /dev/null @@ -1,48 +0,0 @@ -/** - * @file lightF.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; -#endif - -VARYING vec4 vertex_color; -VARYING vec2 vary_texcoord0; - -uniform sampler2D diffuseMap; - -vec3 atmosLighting(vec3 light); -vec3 scaleSoftClip(vec3 light); - -void default_lighting() -{ - vec4 color = texture2D(diffuseMap,vary_texcoord0.xy) * vertex_color; - - color.rgb = atmosLighting(color.rgb); - - color.rgb = scaleSoftClip(color.rgb); - - gl_FragColor = color; -} - diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightShinyF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightShinyF.glsl deleted file mode 100644 index e9c27dbefd..0000000000 --- a/indra/newview/app_settings/shaders/class2/lighting/lightShinyF.glsl +++ /dev/null @@ -1,54 +0,0 @@ -/** - * @file lightShinyF.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; -#endif - -VARYING vec4 vertex_color; -VARYING vec2 vary_texcoord0; -VARYING vec3 vary_texcoord1; - -uniform samplerCube environmentMap; - -vec3 scaleSoftClip(vec3 light); -vec3 atmosLighting(vec3 light); -vec4 applyWaterFog(vec4 color); - -void shiny_lighting() -{ - vec4 color = diffuseLookup(vary_texcoord0.xy); - color.rgb *= vertex_color.rgb; - - vec3 envColor = textureCube(environmentMap, vary_texcoord1.xyz).rgb; - color.rgb = mix(color.rgb, envColor.rgb, vertex_color.a); - - color.rgb = atmosLighting(color.rgb); - - color.rgb = scaleSoftClip(color.rgb); - color.a = max(color.a, vertex_color.a); - gl_FragColor = color; -} - diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightShinyNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightShinyNonIndexedF.glsl deleted file mode 100644 index 595ad74365..0000000000 --- a/indra/newview/app_settings/shaders/class2/lighting/lightShinyNonIndexedF.glsl +++ /dev/null @@ -1,55 +0,0 @@ -/** - * @file lightShinyF.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; -#endif - -VARYING vec4 vertex_color; -VARYING vec2 vary_texcoord0; -VARYING vec3 vary_texcoord1; - -uniform samplerCube environmentMap; -uniform sampler2D diffuseMap; - -vec3 scaleSoftClip(vec3 light); -vec3 atmosLighting(vec3 light); -vec4 applyWaterFog(vec4 color); - -void shiny_lighting() -{ - vec4 color = texture2D(diffuseMap,vary_texcoord0.xy); - color.rgb *= vertex_color.rgb; - - vec3 envColor = textureCube(environmentMap, vary_texcoord1.xyz).rgb; - color.rgb = mix(color.rgb, envColor.rgb, vertex_color.a); - - color.rgb = atmosLighting(color.rgb); - - color.rgb = scaleSoftClip(color.rgb); - color.a = max(color.a, vertex_color.a); - gl_FragColor = color; -} - diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightShinyWaterF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightShinyWaterF.glsl deleted file mode 100644 index 68c727d62c..0000000000 --- a/indra/newview/app_settings/shaders/class2/lighting/lightShinyWaterF.glsl +++ /dev/null @@ -1,51 +0,0 @@ -/** - * @file lightShinyWaterF.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; -#endif - -VARYING vec4 vertex_color; -VARYING vec2 vary_texcoord0; -VARYING vec3 vary_texcoord1; - -uniform samplerCube environmentMap; - -vec3 atmosLighting(vec3 light); -vec4 applyWaterFog(vec4 color); - -void shiny_lighting_water() -{ - vec4 color = diffuseLookup(vary_texcoord0.xy); - color.rgb *= vertex_color.rgb; - - vec3 envColor = textureCube(environmentMap, vary_texcoord1.xyz).rgb; - color.rgb = mix(color.rgb, envColor.rgb, vertex_color.a); - - color.rgb = atmosLighting(color.rgb); - color.a = max(color.a, vertex_color.a); - gl_FragColor = applyWaterFog(color); -} - diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightShinyWaterNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightShinyWaterNonIndexedF.glsl deleted file mode 100644 index f32b9e1958..0000000000 --- a/indra/newview/app_settings/shaders/class2/lighting/lightShinyWaterNonIndexedF.glsl +++ /dev/null @@ -1,52 +0,0 @@ -/** - * @file lightShinyWaterF.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; -#endif - -VARYING vec4 vertex_color; -VARYING vec2 vary_texcoord0; -VARYING vec3 vary_texcoord1; - -uniform sampler2D diffuseMap; -uniform samplerCube environmentMap; - -vec3 atmosLighting(vec3 light); -vec4 applyWaterFog(vec4 color); - -void shiny_lighting_water() -{ - vec4 color = texture2D(diffuseMap,vary_texcoord0.xy); - color.rgb *= vertex_color.rgb; - - vec3 envColor = textureCube(environmentMap, vary_texcoord1.xyz).rgb; - color.rgb = mix(color.rgb, envColor.rgb, vertex_color.a); - - color.rgb = atmosLighting(color.rgb); - color.a = max(color.a, vertex_color.a); - gl_FragColor = applyWaterFog(color); -} - diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightSpecularV.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightSpecularV.glsl deleted file mode 100644 index 24bf9b3cee..0000000000 --- a/indra/newview/app_settings/shaders/class2/lighting/lightSpecularV.glsl +++ /dev/null @@ -1,36 +0,0 @@ -/** - * @file lightSpecularV.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - - - -// All lights, no specular highlights - -vec4 sumLightsSpecular(vec3 pos, vec3 norm, vec4 color, inout vec4 specularColor, vec4 baseCol); - -vec4 calcLightingSpecular(vec3 pos, vec3 norm, vec4 color, inout vec4 specularColor, vec4 baseCol) -{ - return sumLightsSpecular(pos, norm, color, specularColor, baseCol); -} - diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightV.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightV.glsl deleted file mode 100644 index 8045809b82..0000000000 --- a/indra/newview/app_settings/shaders/class2/lighting/lightV.glsl +++ /dev/null @@ -1,36 +0,0 @@ -/** - * @file lightV.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - - - -// All lights, no specular highlights - -vec4 sumLights(vec3 pos, vec3 norm, vec4 color, vec4 baseLight); - -vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseLight) -{ - return sumLights(pos, norm, color, baseLight); -} - diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightWaterAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightWaterAlphaMaskF.glsl deleted file mode 100644 index 60289cf7f7..0000000000 --- a/indra/newview/app_settings/shaders/class2/lighting/lightWaterAlphaMaskF.glsl +++ /dev/null @@ -1,52 +0,0 @@ -/** - * @file lightWaterAlphaMaskF.glsl - * - * $LicenseInfo:firstyear=2011&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2011, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; -#endif - -uniform float minimum_alpha; -uniform float maximum_alpha; - -vec3 atmosLighting(vec3 light); -vec4 applyWaterFog(vec4 color); - -VARYING vec4 vertex_color; -VARYING vec2 vary_texcoord0; - -void default_lighting_water() -{ - vec4 color = diffuseLookup(vary_texcoord0.xy) * vertex_color; - - if (color.a < minimum_alpha || color.a > maximum_alpha) - { - discard; - } - - color.rgb = atmosLighting(color.rgb); - - gl_FragColor = applyWaterFog(color); -} - diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightWaterAlphaMaskNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightWaterAlphaMaskNonIndexedF.glsl deleted file mode 100644 index d0038ae89b..0000000000 --- a/indra/newview/app_settings/shaders/class2/lighting/lightWaterAlphaMaskNonIndexedF.glsl +++ /dev/null @@ -1,56 +0,0 @@ -/** - * @file lightWaterAlphaMaskNonIndexedF.glsl - * - * $LicenseInfo:firstyear=2011&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2011, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; -#endif - -uniform float minimum_alpha; -uniform float maximum_alpha; - -uniform sampler2D diffuseMap; - -vec3 atmosLighting(vec3 light); -vec4 applyWaterFog(vec4 color); - -VARYING vec4 vertex_color; -VARYING vec2 vary_texcoord0; - -void default_lighting_water() -{ - vec4 color = texture2D(diffuseMap,vary_texcoord0.xy) * vertex_color; - - if (color.a < minimum_alpha || color.a > maximum_alpha) - { - discard; - } - - color.rgb = atmosLighting(color.rgb); - - color = applyWaterFog(color); - - gl_FragColor = color; -} - diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightWaterF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightWaterF.glsl deleted file mode 100644 index e9537d1e9d..0000000000 --- a/indra/newview/app_settings/shaders/class2/lighting/lightWaterF.glsl +++ /dev/null @@ -1,44 +0,0 @@ -/** - * @file lightWaterF.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; -#endif - -VARYING vec4 vertex_color; -VARYING vec2 vary_texcoord0; - -vec3 atmosLighting(vec3 light); -vec4 applyWaterFog(vec4 color); - -void default_lighting_water() -{ - vec4 color = diffuseLookup(vary_texcoord0.xy) * vertex_color; - - color.rgb = atmosLighting(color.rgb); - - gl_FragColor = applyWaterFog(color); -} - diff --git a/indra/newview/app_settings/shaders/class2/lighting/lightWaterNonIndexedF.glsl b/indra/newview/app_settings/shaders/class2/lighting/lightWaterNonIndexedF.glsl deleted file mode 100644 index 8b0c25b705..0000000000 --- a/indra/newview/app_settings/shaders/class2/lighting/lightWaterNonIndexedF.glsl +++ /dev/null @@ -1,46 +0,0 @@ -/** - * @file lightWaterF.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; -#endif - -VARYING vec4 vertex_color; -VARYING vec2 vary_texcoord0; - -uniform sampler2D diffuseMap; - -vec3 atmosLighting(vec3 light); -vec4 applyWaterFog(vec4 color); - -void default_lighting_water() -{ - vec4 color = texture2D(diffuseMap,vary_texcoord0.xy) * vertex_color; - - color.rgb = atmosLighting(color.rgb); - - gl_FragColor = applyWaterFog(color); -} - diff --git a/indra/newview/app_settings/shaders/class2/objects/fullbrightShinyV.glsl b/indra/newview/app_settings/shaders/class2/objects/fullbrightShinyV.glsl deleted file mode 100644 index 34bd8d445a..0000000000 --- a/indra/newview/app_settings/shaders/class2/objects/fullbrightShinyV.glsl +++ /dev/null @@ -1,67 +0,0 @@ -/** - * @file fullbrightShinyV.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -uniform mat3 normal_matrix; -uniform mat4 texture_matrix0; -uniform mat4 texture_matrix1; -uniform mat4 modelview_matrix; -uniform mat4 modelview_projection_matrix; - - -void calcAtmospherics(vec3 inPositionEye); - -uniform vec4 origin; - - - -ATTRIBUTE vec3 position; -void passTextureIndex(); -ATTRIBUTE vec3 normal; -ATTRIBUTE vec4 diffuse_color; -ATTRIBUTE vec2 texcoord0; - -VARYING vec4 vertex_color; -VARYING vec2 vary_texcoord0; -VARYING vec3 vary_texcoord1; - - -void main() -{ - //transform vertex - vec4 vert = vec4(position.xyz,1.0); - passTextureIndex(); - vec4 pos = (modelview_matrix * vert); - gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0); - - vec3 norm = normalize(normal_matrix * normal); - vec3 ref = reflect(pos.xyz, -norm); - - vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy; - vary_texcoord1 = (texture_matrix1*vec4(ref,1.0)).xyz; - - calcAtmospherics(pos.xyz); - - vertex_color = diffuse_color; -} diff --git a/indra/newview/app_settings/shaders/class2/objects/fullbrightV.glsl b/indra/newview/app_settings/shaders/class2/objects/fullbrightV.glsl deleted file mode 100644 index fc20d3270e..0000000000 --- a/indra/newview/app_settings/shaders/class2/objects/fullbrightV.glsl +++ /dev/null @@ -1,58 +0,0 @@ -/** - * @file fullbrightV.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -uniform mat4 texture_matrix0; -uniform mat4 modelview_matrix; -uniform mat4 modelview_projection_matrix; - -ATTRIBUTE vec3 position; -void passTextureIndex(); -ATTRIBUTE vec2 texcoord0; -ATTRIBUTE vec3 normal; -ATTRIBUTE vec4 diffuse_color; - - -void calcAtmospherics(vec3 inPositionEye); - - -VARYING vec4 vertex_color; -VARYING vec2 vary_texcoord0; - - -void main() -{ - //transform vertex - vec4 vert = vec4(position.xyz,1.0); - passTextureIndex(); - vec4 pos = (modelview_matrix * vert); - gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0); - vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy; - - calcAtmospherics(pos.xyz); - - vertex_color = diffuse_color; - - -} diff --git a/indra/newview/app_settings/shaders/class2/objects/shinyV.glsl b/indra/newview/app_settings/shaders/class2/objects/shinyV.glsl deleted file mode 100644 index fdb3453cc5..0000000000 --- a/indra/newview/app_settings/shaders/class2/objects/shinyV.glsl +++ /dev/null @@ -1,65 +0,0 @@ -/** - * @file shinyV.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -uniform mat3 normal_matrix; -uniform mat4 texture_matrix0; -uniform mat4 texture_matrix1; -uniform mat4 modelview_matrix; -uniform mat4 modelview_projection_matrix; - -ATTRIBUTE vec3 position; -void passTextureIndex(); -ATTRIBUTE vec2 texcoord0; -ATTRIBUTE vec3 normal; -ATTRIBUTE vec4 diffuse_color; - -VARYING vec4 vertex_color; -VARYING vec2 vary_texcoord0; -VARYING vec3 vary_texcoord1; - -vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol); - -void calcAtmospherics(vec3 inPositionEye); - -uniform vec4 origin; - -void main() -{ - //transform vertex - vec4 vert = vec4(position.xyz,1.0); - passTextureIndex(); - vec4 pos = (modelview_matrix * vert); - gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0); - - vec3 norm = normalize(normal_matrix * normal); - vec3 ref = reflect(pos.xyz, -norm); - - vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy; - vary_texcoord1 = (texture_matrix1*vec4(ref,1.0)).xyz; - - calcAtmospherics(pos.xyz); - - vertex_color = calcLighting(pos.xyz, norm, diffuse_color, vec4(0.0)); -} diff --git a/indra/newview/app_settings/shaders/class2/objects/simpleNonIndexedV.glsl b/indra/newview/app_settings/shaders/class2/objects/simpleNonIndexedV.glsl deleted file mode 100644 index cb80697d15..0000000000 --- a/indra/newview/app_settings/shaders/class2/objects/simpleNonIndexedV.glsl +++ /dev/null @@ -1,61 +0,0 @@ -/** - * @file simpleNonIndexedV.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -uniform mat3 normal_matrix; -uniform mat4 texture_matrix0; -uniform mat4 modelview_matrix; -uniform mat4 modelview_projection_matrix; - -ATTRIBUTE vec3 position; -ATTRIBUTE vec2 texcoord0; -ATTRIBUTE vec3 normal; -ATTRIBUTE vec4 diffuse_color; - -VARYING vec4 vertex_color; -VARYING vec2 vary_texcoord0; - - -vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol); -void calcAtmospherics(vec3 inPositionEye); - -void main() -{ - //transform vertex - vec4 vert = vec4(position.xyz,1.0); - - gl_Position = modelview_projection_matrix*vert; - vary_texcoord0 = (texture_matrix0 * vec4(texcoord0, 0, 1)).xy; - - vec4 pos = (modelview_matrix * vert); - - vec3 norm = normalize(normal_matrix * normal); - - calcAtmospherics(pos.xyz); - - vec4 color = calcLighting(pos.xyz, norm, diffuse_color, vec4(0.)); - vertex_color = color; - - -} diff --git a/indra/newview/app_settings/shaders/class2/objects/simpleV.glsl b/indra/newview/app_settings/shaders/class2/objects/simpleV.glsl deleted file mode 100644 index 37a20383e2..0000000000 --- a/indra/newview/app_settings/shaders/class2/objects/simpleV.glsl +++ /dev/null @@ -1,64 +0,0 @@ -/** - * @file simpleV.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -uniform mat3 normal_matrix; -uniform mat4 texture_matrix0; -uniform mat4 modelview_matrix; -uniform mat4 modelview_projection_matrix; - -ATTRIBUTE vec3 position; -void passTextureIndex(); -ATTRIBUTE vec2 texcoord0; -ATTRIBUTE vec3 normal; -ATTRIBUTE vec4 diffuse_color; - -vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol); -void calcAtmospherics(vec3 inPositionEye); - - -VARYING vec4 vertex_color; -VARYING vec2 vary_texcoord0; - - -void main() -{ - //transform vertex - vec4 vert = vec4(position.xyz,1.0); - passTextureIndex(); - vec4 pos = (modelview_matrix * vert); - gl_Position = modelview_projection_matrix*vec4(position.xyz, 1.0); - vary_texcoord0 = (texture_matrix0 * vec4(texcoord0, 0, 1)).xy; - - - - vec3 norm = normalize(normal_matrix * normal); - - calcAtmospherics(pos.xyz); - - vec4 color = calcLighting(pos.xyz, norm, diffuse_color, vec4(0.)); - vertex_color = color; - - -} -- cgit v1.2.3 From c4aa8c50daf7c4eea3509057a7ca74b083682779 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Tue, 4 Oct 2011 02:31:54 -0500 Subject: SH-2447, SH-2525, SH-2276 Strip out defunct global illumination code, add accounting for how much memory is taken up by LLRenderTarget, fix crash on login in bindGLIndices (work around driver bug that doesn't respect VAO state WRT to index buffers), remove some unused render targets, remove some unused shaders, make it possible to run a fullscreen session --- .../shaders/class2/deferred/edgeF.glsl | 82 ---------------------- .../shaders/class2/deferred/edgeV.glsl | 39 ---------- 2 files changed, 121 deletions(-) delete mode 100644 indra/newview/app_settings/shaders/class2/deferred/edgeF.glsl delete mode 100644 indra/newview/app_settings/shaders/class2/deferred/edgeV.glsl (limited to 'indra/newview/app_settings/shaders/class2') diff --git a/indra/newview/app_settings/shaders/class2/deferred/edgeF.glsl b/indra/newview/app_settings/shaders/class2/deferred/edgeF.glsl deleted file mode 100644 index f75a08779c..0000000000 --- a/indra/newview/app_settings/shaders/class2/deferred/edgeF.glsl +++ /dev/null @@ -1,82 +0,0 @@ -/** - * @file edgeF.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#extension GL_ARB_texture_rectangle : enable - -#ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; -#endif - -uniform sampler2DRect depthMap; -uniform sampler2DRect normalMap; - -VARYING vec2 vary_fragcoord; - -uniform float depth_cutoff; -uniform float norm_cutoff; - -uniform mat4 inv_proj; -uniform vec2 screen_res; - -float getDepth(vec2 pos_screen) -{ - float z = texture2DRect(depthMap, pos_screen.xy).r; - z = z*2.0-1.0; - vec4 ndc = vec4(0.0, 0.0, z, 1.0); - vec4 p = inv_proj*ndc; - return p.z/p.w; -} - -void main() -{ - vec3 norm = texture2DRect(normalMap, vary_fragcoord.xy).xyz; - norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm - float depth = getDepth(vary_fragcoord.xy); - - vec2 tc = vary_fragcoord.xy; - - float sc = 0.75; - - vec2 de; - de.x = (depth-getDepth(tc+vec2(sc, sc))) + (depth-getDepth(tc+vec2(-sc, -sc))); - de.y = (depth-getDepth(tc+vec2(-sc, sc))) + (depth-getDepth(tc+vec2(sc, -sc))); - de /= depth; - de *= de; - de = step(depth_cutoff, de); - - vec2 ne; - vec3 nexnorm = texture2DRect(normalMap, tc+vec2(-sc,-sc)).rgb; - nexnorm = vec3((nexnorm.xy-0.5)*2.0,nexnorm.z); // unpack norm - ne.x = dot(nexnorm, norm); - vec3 neynorm = texture2DRect(normalMap, tc+vec2(sc,sc)).rgb; - neynorm = vec3((neynorm.xy-0.5)*2.0,neynorm.z); // unpack norm - ne.y = dot(neynorm, norm); - - ne = 1.0-ne; - - ne = step(norm_cutoff, ne); - - gl_FragColor.a = dot(de,de)+dot(ne,ne); -} diff --git a/indra/newview/app_settings/shaders/class2/deferred/edgeV.glsl b/indra/newview/app_settings/shaders/class2/deferred/edgeV.glsl deleted file mode 100644 index 69c6acc07a..0000000000 --- a/indra/newview/app_settings/shaders/class2/deferred/edgeV.glsl +++ /dev/null @@ -1,39 +0,0 @@ -/** - * @file edgeV.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2007, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -uniform mat4 modelview_projection_matrix; - -ATTRIBUTE vec3 position; - -VARYING vec2 vary_fragcoord; -uniform vec2 screen_res; - -void main() -{ - //transform vertex - vec4 pos = modelview_projection_matrix * vec4(position.xyz, 1.0); - gl_Position = pos; - vary_fragcoord = (pos.xy*0.5+0.5)*screen_res; -} -- cgit v1.2.3 From 969aa248a4c398dd0608a447f99cf74683d09f65 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Fri, 28 Oct 2011 16:26:20 -0500 Subject: SH-2633 Fix for avatar hair turning white when editing appearance --- .../newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl | 7 ++++--- .../app_settings/shaders/class2/windlight/atmosphericsVarsV.glsl | 4 +++- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'indra/newview/app_settings/shaders/class2') diff --git a/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl b/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl index 63c7a6b13d..9c7a332417 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/avatarAlphaV.glsl @@ -49,6 +49,7 @@ VARYING vec3 vary_pointlight_col; VARYING vec4 vertex_color; VARYING vec2 vary_texcoord0; +uniform vec4 color; uniform float near_clip; uniform float shadow_offset; @@ -125,17 +126,17 @@ void main() col.rgb += light_diffuse[6].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[6], light_direction[6], light_attenuation[6].x, light_attenuation[6].y, light_attenuation[6].z); col.rgb += light_diffuse[7].rgb*calcPointLightOrSpotLight(pos.xyz, norm, light_position[7], light_direction[7], light_attenuation[7].x, light_attenuation[7].y, light_attenuation[7].z); - vary_pointlight_col = col.rgb; + vary_pointlight_col = col.rgb*color.rgb; col.rgb = vec3(0,0,0); // Add windlight lights col.rgb = atmosAmbient(vec3(0.)); - vary_ambient = col.rgb; + vary_ambient = col.rgb*color.rgb; vary_directional = atmosAffectDirectionalLight(max(calcDirectionalLight(norm, light_position[0].xyz), 0.0)); - col.rgb = min(col.rgb, 1.0); + col.rgb = col.rgb*color.rgb; vertex_color = col; diff --git a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsV.glsl b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsV.glsl index 01605e5b25..ba2ed6b1ce 100644 --- a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsV.glsl +++ b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsV.glsl @@ -27,6 +27,7 @@ VARYING vec3 vary_AdditiveColor; VARYING float vary_AtmosAttenuation; +vec3 additive_color; vec3 atmos_attenuation; vec3 sunlit_color; vec3 amblit_color; @@ -43,7 +44,7 @@ vec3 getAmblitColor() vec3 getAdditiveColor() { - return vary_AdditiveColor; + return additive_color; } vec3 getAtmosAttenuation() { @@ -72,6 +73,7 @@ void setAmblitColor(vec3 v) void setAdditiveColor(vec3 v) { + additive_color = v; vary_AdditiveColor = v; } -- cgit v1.2.3 From 74fcb62b3dc0084c61cdf611b2b95ab3b03203bd Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Tue, 1 Nov 2011 12:33:59 -0500 Subject: SH-2546 Fix for black avatars and terrain on GF Go 7800 (use vec3 instead of float on varying parameters). --- .../app_settings/shaders/class2/windlight/atmosphericsVarsF.glsl | 2 +- .../app_settings/shaders/class2/windlight/atmosphericsVarsV.glsl | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/newview/app_settings/shaders/class2') diff --git a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsF.glsl b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsF.glsl index e8e56e12c1..765b0927c3 100644 --- a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsF.glsl +++ b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsF.glsl @@ -26,7 +26,7 @@ VARYING vec3 vary_SunlitColor; VARYING vec3 vary_AdditiveColor; -VARYING float vary_AtmosAttenuation; +VARYING vec3 vary_AtmosAttenuation; vec3 getSunlitColor() { diff --git a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsV.glsl b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsV.glsl index ba2ed6b1ce..99dbee15ee 100644 --- a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsV.glsl +++ b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsV.glsl @@ -25,7 +25,7 @@ VARYING vec3 vary_AdditiveColor; -VARYING float vary_AtmosAttenuation; +VARYING vec3 vary_AtmosAttenuation; vec3 additive_color; vec3 atmos_attenuation; @@ -80,5 +80,5 @@ void setAdditiveColor(vec3 v) void setAtmosAttenuation(vec3 v) { atmos_attenuation = v; - vary_AtmosAttenuation = v.r; + vary_AtmosAttenuation = v; } -- cgit v1.2.3 From 8c8edbbaeb68d82e1653e92dd7940ba0439777f2 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Mon, 7 Nov 2011 13:04:30 -0600 Subject: SH-2546 Fix for black water under terrain (use vec3 instead of float for vary_AtmosAttenuation --- .../shaders/class2/windlight/atmosphericsVarsWaterF.glsl | 5 ++--- .../shaders/class2/windlight/atmosphericsVarsWaterV.glsl | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) (limited to 'indra/newview/app_settings/shaders/class2') diff --git a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsWaterF.glsl b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsWaterF.glsl index 23046f990d..163ef26444 100644 --- a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsWaterF.glsl +++ b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsWaterF.glsl @@ -24,9 +24,8 @@ */ VARYING vec3 vary_PositionEye; -VARYING vec3 vary_SunlitColor; VARYING vec3 vary_AdditiveColor; -VARYING float vary_AtmosAttenuation; +VARYING vec3 vary_AtmosAttenuation; vec3 getSunlitColor() { @@ -42,7 +41,7 @@ vec3 getAdditiveColor() } vec3 getAtmosAttenuation() { - return vec3(vary_AtmosAttenuation); + return vary_AtmosAttenuation; } vec3 getPositionEye() { diff --git a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsWaterV.glsl b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsWaterV.glsl index 279c4dd981..553f6752e6 100644 --- a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsWaterV.glsl +++ b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsVarsWaterV.glsl @@ -25,7 +25,7 @@ VARYING vec3 vary_PositionEye; VARYING vec3 vary_AdditiveColor; -VARYING float vary_AtmosAttenuation; +VARYING vec3 vary_AtmosAttenuation; vec3 atmos_attenuation; vec3 sunlit_color; @@ -77,5 +77,5 @@ void setAdditiveColor(vec3 v) void setAtmosAttenuation(vec3 v) { atmos_attenuation = v; - vary_AtmosAttenuation = v.r; + vary_AtmosAttenuation = v; } -- cgit v1.2.3 From 84ab08d2a5ac59ea2681e3dea0e0bc48e3d99de5 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Fri, 11 Nov 2011 16:27:08 -0800 Subject: Assorted shader cleanup to remove a few warnings and errors for OS X. --- .../app_settings/shaders/class2/deferred/sunLightF.glsl | 10 +++++----- .../app_settings/shaders/class2/deferred/sunLightSSAOF.glsl | 8 ++++---- indra/newview/app_settings/shaders/class2/windlight/skyV.glsl | 3 --- 3 files changed, 9 insertions(+), 12 deletions(-) (limited to 'indra/newview/app_settings/shaders/class2') diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl index 7e62012b5d..229c2f4b67 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightF.glsl @@ -99,15 +99,15 @@ float pcfShadow(sampler2DShadow shadowMap, vec4 stc, float scl) stc.xyz /= stc.w; stc.z += spot_shadow_bias*scl; - float cs = shadow2D(shadowMap, stc.xyz); + float cs = shadow2D(shadowMap, stc.xyz).x; float shadow = cs; vec2 off = 1.5/proj_shadow_res; - shadow += max(shadow2D(shadowMap, stc.xyz+vec3(off.x, off.y, 0.0)), cs); - shadow += max(shadow2D(shadowMap, stc.xyz+vec3(off.x, -off.y, 0.0)), cs); - shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, off.y, 0.0)), cs); - shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, -off.y, 0.0)), cs); + shadow += max(shadow2D(shadowMap, stc.xyz+vec3(off.x, off.y, 0.0)).x, cs); + shadow += max(shadow2D(shadowMap, stc.xyz+vec3(off.x, -off.y, 0.0)).x, cs); + shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, off.y, 0.0)).x, cs); + shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, -off.y, 0.0)).x, cs); return shadow/5.0; diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl index 025ff48109..fc19f15e02 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl @@ -155,10 +155,10 @@ float pcfShadow(sampler2DShadow shadowMap, vec4 stc, float scl) vec2 off = 1.5/proj_shadow_res; - shadow += max(shadow2D(shadowMap, stc.xyz+vec3(off.x, off.y, 0.0)), cs); - shadow += max(shadow2D(shadowMap, stc.xyz+vec3(off.x, -off.y, 0.0)), cs); - shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, off.y, 0.0)), cs); - shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, -off.y, 0.0)), cs); + shadow += max(shadow2D(shadowMap, stc.xyz+vec3(off.x, off.y, 0.0)).x, cs); + shadow += max(shadow2D(shadowMap, stc.xyz+vec3(off.x, -off.y, 0.0)).x, cs); + shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, off.y, 0.0)).x, cs); + shadow += max(shadow2D(shadowMap, stc.xyz+vec3(-off.x, -off.y, 0.0)).x, cs); return shadow/5.0; diff --git a/indra/newview/app_settings/shaders/class2/windlight/skyV.glsl b/indra/newview/app_settings/shaders/class2/windlight/skyV.glsl index b768cc9cf3..46773cf89f 100644 --- a/indra/newview/app_settings/shaders/class2/windlight/skyV.glsl +++ b/indra/newview/app_settings/shaders/class2/windlight/skyV.glsl @@ -26,7 +26,6 @@ uniform mat4 modelview_projection_matrix; ATTRIBUTE vec3 position; -ATTRIBUTE vec2 texcoord0; // SKY //////////////////////////////////////////////////////////////////////// // The vertex shader for creating the atmospheric sky @@ -34,7 +33,6 @@ ATTRIBUTE vec2 texcoord0; // Output parameters VARYING vec4 vary_HazeColor; -VARYING vec2 vary_texcoord0; // Inputs uniform vec3 camPosLocal; @@ -62,7 +60,6 @@ void main() // World / view / projection gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); - vary_texcoord0 = texcoord0; // Get relative position vec3 P = position.xyz - camPosLocal.xyz + vec3(0,50,0); -- cgit v1.2.3 From bbac7e9aecf433c1a84515ede954650bd76befbf Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Tue, 15 Nov 2011 13:01:23 -0600 Subject: SH-2681 Fix for shader compiler error on GLSL 1.30 and later --- indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/app_settings/shaders/class2') diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl index fc19f15e02..5b207ab558 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl @@ -150,7 +150,7 @@ float pcfShadow(sampler2DShadow shadowMap, vec4 stc, float scl) stc.xyz /= stc.w; stc.z += spot_shadow_bias*scl; - float cs = shadow2D(shadowMap, stc.xyz); + float cs = shadow2D(shadowMap, stc.xyz).x; float shadow = cs; vec2 off = 1.5/proj_shadow_res; -- cgit v1.2.3