diff options
Diffstat (limited to 'indra/newview/app_settings/shaders/class2')
70 files changed, 457 insertions, 373 deletions
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); |