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 --- .../app_settings/shaders/class2/deferred/alphaF.glsl | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl') 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); -- 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 --- indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl') 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); - } -- 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 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl') 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 -- cgit v1.2.3