From 3710c6110d65d3a604f7b419cd764cf5b9b98600 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Fri, 10 Feb 2012 20:04:19 -0600 Subject: SH-2908 Rework indexed texture rendering to use a uvec4 instead of a float for texture indices in the data stream. Also rework gl_FragColor overrides to not collide with some odd driver implementations. --- indra/newview/app_settings/shaders/class1/environment/terrainF.glsl | 6 ++++-- .../app_settings/shaders/class1/environment/terrainWaterF.glsl | 6 ++++-- .../app_settings/shaders/class1/environment/underWaterF.glsl | 6 ++++-- indra/newview/app_settings/shaders/class1/environment/waterF.glsl | 6 ++++-- 4 files changed, 16 insertions(+), 8 deletions(-) (limited to 'indra/newview/app_settings/shaders/class1/environment') diff --git a/indra/newview/app_settings/shaders/class1/environment/terrainF.glsl b/indra/newview/app_settings/shaders/class1/environment/terrainF.glsl index 18f6d91804..51efdd4b39 100644 --- a/indra/newview/app_settings/shaders/class1/environment/terrainF.glsl +++ b/indra/newview/app_settings/shaders/class1/environment/terrainF.glsl @@ -24,7 +24,9 @@ */ #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif VARYING vec4 vertex_color; @@ -59,6 +61,6 @@ void main() /// Add WL Components outColor.rgb = atmosLighting(outColor.rgb * vertex_color.rgb); - gl_FragColor = vec4(scaleSoftClip(outColor.rgb), 1.0); + frag_color = vec4(scaleSoftClip(outColor.rgb), 1.0); } diff --git a/indra/newview/app_settings/shaders/class1/environment/terrainWaterF.glsl b/indra/newview/app_settings/shaders/class1/environment/terrainWaterF.glsl index e5c7ced52c..d9b5c5f7f5 100644 --- a/indra/newview/app_settings/shaders/class1/environment/terrainWaterF.glsl +++ b/indra/newview/app_settings/shaders/class1/environment/terrainWaterF.glsl @@ -24,7 +24,9 @@ */ #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif VARYING vec4 vertex_color; @@ -60,6 +62,6 @@ void main() outColor.rgb = atmosLighting(outColor.rgb * vertex_color.rgb); outColor = applyWaterFog(outColor); - gl_FragColor = outColor; + frag_color = outColor; } diff --git a/indra/newview/app_settings/shaders/class1/environment/underWaterF.glsl b/indra/newview/app_settings/shaders/class1/environment/underWaterF.glsl index 1fdb90f792..32459eff6a 100644 --- a/indra/newview/app_settings/shaders/class1/environment/underWaterF.glsl +++ b/indra/newview/app_settings/shaders/class1/environment/underWaterF.glsl @@ -24,7 +24,9 @@ */ #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif uniform sampler2D diffuseMap; @@ -106,5 +108,5 @@ void main() vec4 fb = texture2D(screenTex, distort); - gl_FragColor = applyWaterFog(fb,view.xyz); + frag_color = applyWaterFog(fb,view.xyz); } diff --git a/indra/newview/app_settings/shaders/class1/environment/waterF.glsl b/indra/newview/app_settings/shaders/class1/environment/waterF.glsl index 444c896d38..0cde7d0133 100644 --- a/indra/newview/app_settings/shaders/class1/environment/waterF.glsl +++ b/indra/newview/app_settings/shaders/class1/environment/waterF.glsl @@ -24,7 +24,9 @@ */ #ifdef DEFINE_GL_FRAGCOLOR -out vec4 gl_FragColor; +out vec4 frag_color; +#else +#define frag_color gl_FragColor; #endif vec3 scaleSoftClip(vec3 inColor); @@ -135,5 +137,5 @@ void main() color.rgb = scaleSoftClip(color.rgb); color.a = spec * sunAngle2; - gl_FragColor = color; + frag_color = color; } -- cgit v1.2.3