diff options
| author | Dave Parks <davep@lindenlab.com> | 2011-09-29 19:32:56 -0500 | 
|---|---|---|
| committer | Dave Parks <davep@lindenlab.com> | 2011-09-29 19:32:56 -0500 | 
| commit | 7238714634e72dacc4b09c1c4ee98b16fb0c91fe (patch) | |
| tree | 89500aeb877bcf5b3d00f0c96ec0f0321834de1e | |
| parent | 973fefc8d9014f6389b4c3f9633ce398fdf5399e (diff) | |
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)
69 files changed, 424 insertions, 2737 deletions
| diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp index 8ba164fcc9..bbdd0a7a60 100644 --- a/indra/llrender/llrender.cpp +++ b/indra/llrender/llrender.cpp @@ -1,4 +1,4 @@ -/**  + /**    * @file llrender.cpp   * @brief LLRender implementation   * @@ -1132,6 +1132,8 @@ void LLRender::syncLightState()  		shader->uniform3fv("light_attenuation", 8, attenuation[0].mV);  		shader->uniform3fv("light_diffuse", 8, diffuse[0].mV);  		shader->uniform4fv("light_ambient", 1, mAmbientLightColor.mV); +		//HACK -- duplicate sunlight color for compatibility with drivers that can't deal with multiple shader objects referencing the same uniform +		shader->uniform4fv("sunlight_color", 1, diffuse[0].mV);  	}  } diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 11ac2b695e..cd5218c56d 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -3148,17 +3148,6 @@        <key>Value</key>        <integer>1</integer>      </map> -    <key>EnableRippleWater</key> -    <map> -      <key>Comment</key> -      <string>Whether to use ripple water shader or not</string> -      <key>Persist</key> -      <integer>1</integer> -      <key>Type</key> -      <string>Boolean</string> -      <key>Value</key> -      <integer>1</integer> -    </map>      <key>EnableTextureAtlas</key>      <map>        <key>Comment</key> @@ -9296,7 +9285,7 @@        <key>Type</key>        <string>Boolean</string>        <key>Value</key> -      <integer>0</integer> +      <integer>1</integer>      </map>      <key>RenderVBOMappingDisable</key>      <map> diff --git a/indra/newview/app_settings/shaders/class1/environment/terrainF.glsl b/indra/newview/app_settings/shaders/class1/environment/terrainF.glsl index f0837dd4ca..18f6d91804 100644 --- a/indra/newview/app_settings/shaders/class1/environment/terrainF.glsl +++ b/indra/newview/app_settings/shaders/class1/environment/terrainF.glsl @@ -1,4 +1,4 @@ -/**  +/**   * @file terrainF.glsl   *   * $LicenseInfo:firstyear=2007&license=viewerlgpl$ @@ -27,22 +27,38 @@  out vec4 gl_FragColor;  #endif -uniform sampler2D detail0; -uniform sampler2D detail1; -uniform sampler2D alphaRamp; +VARYING vec4 vertex_color; +VARYING vec4 vary_texcoord0; +VARYING vec4 vary_texcoord1; -VARYING vec2 vary_texcoord0; -VARYING vec2 vary_texcoord1; -VARYING vec2 vary_texcoord2; -VARYING vec2 vary_texcoord3; +uniform sampler2D detail_0; +uniform sampler2D detail_1; +uniform sampler2D detail_2; +uniform sampler2D detail_3; +uniform sampler2D alpha_ramp; -void main()  +vec3 atmosLighting(vec3 light); + +vec3 scaleSoftClip(vec3 color); + +void main()  { -	float a = texture2D(alphaRamp, vary_texcoord1.xy).a; -	vec3 color = mix(texture2D(detail1, vary_texcoord2.xy).rgb, -					 texture2D(detail0, vary_texcoord0.xy).rgb, -					 a); +	/// 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); -	gl_FragColor.rgb = color; -	gl_FragColor.a = texture2D(alphaRamp, vary_texcoord3.xy).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 * vertex_color.rgb); +	 +	gl_FragColor = vec4(scaleSoftClip(outColor.rgb), 1.0);  } + diff --git a/indra/newview/app_settings/shaders/class1/environment/terrainV.glsl b/indra/newview/app_settings/shaders/class1/environment/terrainV.glsl index d4a62db684..f183b885d1 100644 --- a/indra/newview/app_settings/shaders/class1/environment/terrainV.glsl +++ b/indra/newview/app_settings/shaders/class1/environment/terrainV.glsl @@ -1,4 +1,4 @@ -/**  +/**   * @file terrainV.glsl   *   * $LicenseInfo:firstyear=2007&license=viewerlgpl$ @@ -25,9 +25,6 @@  uniform mat3 normal_matrix;  uniform mat4 texture_matrix0; -uniform mat4 texture_matrix1; -uniform mat4 texture_matrix2; -uniform mat4 texture_matrix3;  uniform mat4 modelview_matrix;  uniform mat4 modelview_projection_matrix; @@ -39,14 +36,12 @@ ATTRIBUTE vec3 normal;  ATTRIBUTE vec4 diffuse_color;  ATTRIBUTE vec2 texcoord0;  ATTRIBUTE vec2 texcoord1; -ATTRIBUTE vec2 texcoord2; -ATTRIBUTE vec2 texcoord3;  VARYING vec4 vertex_color; -VARYING vec2 vary_texcoord0; -VARYING vec2 vary_texcoord1; -VARYING vec2 vary_texcoord2; -VARYING vec2 vary_texcoord3; +VARYING vec4 vary_texcoord0; +VARYING vec4 vary_texcoord1; + +void calcAtmospherics(vec3 inPositionEye);  vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol); @@ -68,16 +63,26 @@ void main()  {  	//transform vertex  	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); -			 -	vec4 pos = modelview_matrix * vec4(position, 1.0); + +	vec4 pos = modelview_matrix * vec4(position.xyz, 1.0);  	vec3 norm = normalize(normal_matrix * normal); -	 -	vec4 color = calcLighting(pos.xyz, norm, vec4(1,1,1,1), diffuse_color); + +	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; -	vary_texcoord0 = texgen_object(vec4(position.xyz, 1.0),vec4(texcoord0,0,1),texture_matrix0,object_plane_s,object_plane_t).xy; -	vary_texcoord1 = (texture_matrix1*vec4(texcoord1,0,1)).xy; -	vary_texcoord2 = texgen_object(vec4(position.xyz, 1.0),vec4(texcoord2,0,1),texture_matrix2,object_plane_s,object_plane_t).xy; -	vary_texcoord3 = (texture_matrix3*vec4(texcoord3,0,1)).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/class1/environment/terrainWaterF.glsl b/indra/newview/app_settings/shaders/class1/environment/terrainWaterF.glsl index b84f29423f..e5c7ced52c 100644 --- a/indra/newview/app_settings/shaders/class1/environment/terrainWaterF.glsl +++ b/indra/newview/app_settings/shaders/class1/environment/terrainWaterF.glsl @@ -1,4 +1,4 @@ -/**  +/**   * @file terrainWaterF.glsl   *   * $LicenseInfo:firstyear=2007&license=viewerlgpl$ @@ -27,24 +27,39 @@  out vec4 gl_FragColor;  #endif -// this class1 shader is just a copy of terrainF +VARYING vec4 vertex_color; +VARYING vec4 vary_texcoord0; +VARYING vec4 vary_texcoord1; -uniform sampler2D detail0; -uniform sampler2D detail1; -uniform sampler2D alphaRamp; +uniform sampler2D detail_0; +uniform sampler2D detail_1; +uniform sampler2D detail_2; +uniform sampler2D detail_3; +uniform sampler2D alpha_ramp; -VARYING vec2 vary_texcoord0; -VARYING vec2 vary_texcoord1; -VARYING vec2 vary_texcoord2; -VARYING vec2 vary_texcoord3; +vec3 atmosLighting(vec3 light); -void main()  +vec4 applyWaterFog(vec4 color); + +void main()  { -	float a = texture2D(alphaRamp, vary_texcoord1.xy).a; -	vec3 color = mix(texture2D(detail1, vary_texcoord2.xy).rgb, -					 texture2D(detail0, vary_texcoord0.xy).rgb, -					 a); +	/// 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); -	gl_FragColor.rgb = color; -	gl_FragColor.a = texture2D(alphaRamp, vary_texcoord3.xy).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 * vertex_color.rgb); +	 +	outColor = applyWaterFog(outColor); +	gl_FragColor = outColor;  } + diff --git a/indra/newview/app_settings/shaders/class1/environment/underWaterF.glsl b/indra/newview/app_settings/shaders/class1/environment/underWaterF.glsl index 2e138d35bf..1fdb90f792 100644 --- a/indra/newview/app_settings/shaders/class1/environment/underWaterF.glsl +++ b/indra/newview/app_settings/shaders/class1/environment/underWaterF.glsl @@ -30,31 +30,75 @@ out vec4 gl_FragColor;  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; -void main()  +vec4 applyWaterFog(vec4 color, vec3 viewVec)  { -	vec4 color;     +	//normalize view vector +	vec3 view = normalize(viewVec); +	float es = -view.z; + +	//find intersection point with water plane and eye vector -	//get bigwave normal -	vec3 wavef = texture2D(bumpMap, vec2(refCoord.w, view.w)).xyz*2.0; -     -	//get detail normals -	vec3 dcol = texture2D(bumpMap, littleWave.xy).rgb*0.75; -	dcol += texture2D(bumpMap, littleWave.zw).rgb*1.25; -	     -	//interpolate between big waves and little waves (big waves in deep water) -	wavef = (wavef+dcol)*0.5; +	//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); +} -	//crunch normal to range [-1,1] -	wavef -= vec3(1,1,1); +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; @@ -62,6 +106,5 @@ void main()  	vec4 fb = texture2D(screenTex, distort); -	gl_FragColor.rgb = mix(waterFogColor.rgb, fb.rgb, waterFogColor.a * 0.001 + 0.999); -	gl_FragColor.a = fb.a; +	gl_FragColor = 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 1512074dda..444c896d38 100644 --- a/indra/newview/app_settings/shaders/class1/environment/waterF.glsl +++ b/indra/newview/app_settings/shaders/class1/environment/waterF.glsl @@ -29,16 +29,13 @@ out vec4 gl_FragColor;  vec3 scaleSoftClip(vec3 inColor);  vec3 atmosTransport(vec3 inColor); -vec3 applyWaterFog(vec4 inColor); -uniform sampler2D diffuseMap;  uniform sampler2D bumpMap;     uniform sampler2D screenTex;  uniform sampler2D refTex;  uniform float sunAngle;  uniform float sunAngle2; -uniform float scaledAngle;  uniform vec3 lightDir;  uniform vec3 specular;  uniform float lightExp; @@ -49,7 +46,7 @@ uniform vec3 normScale;  uniform float fresnelScale;  uniform float fresnelOffset;  uniform float blurMultiplier; -uniform vec4 fogCol; +  //bigWave is (refCoord.w, view.w);  VARYING vec4 refCoord; @@ -58,58 +55,83 @@ VARYING vec4 view;  void main()   { -	vec3 viewVec = view.xyz;  	vec4 color; -	float dist = length(viewVec.xy); +	float dist = length(view.xy);  	//normalize view vector -	viewVec = normalize(viewVec); +	vec3 viewVec = normalize(view.xyz);  	//get wave normals -	vec3 wavef = texture2D(bumpMap, vec2(refCoord.w, view.w)).xyz*2.0; - -	//get detail normals -	vec3 dcol = texture2D(bumpMap, littleWave.xy).rgb*0.75; -	dcol += texture2D(bumpMap, littleWave.zw).rgb*1.25; - -	//interpolate between big waves and little waves (big waves in deep water) -	wavef = (wavef + dcol) * 0.5; -	 -	//crunch normal to range [-1,1] -	wavef -= vec3(1,1,1); -	wavef = normalize(wavef); -    +	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	 -	float df = dot(viewVec,wavef) * fresnelScale + fresnelOffset; +	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 refdistort = wavef.xy*dot(normScale, vec3(0.333)); -	vec2 refvec = distort+refdistort/dist; -	vec4 refcol = texture2D(refTex, refvec); +	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, lightExp); +	spec = pow(spec, 128.0);  	//figure out distortion vector (ripply)    -	vec2 distort2 = distort+wavef.xy*refScale/max(dist*df, 1.0); +	vec2 distort2 = distort+wavef.xy*refScale/max(dmod*df1, 1.0);  	vec4 fb = texture2D(screenTex, distort2);  	//mix with reflection -	color.rgb = mix(mix(fogCol.rgb, fb.rgb, fogCol.a), refcol.rgb, df); +	// 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 = applyWaterFog(color);//atmosTransport(color.rgb); +	color.rgb = atmosTransport(color.rgb);  	color.rgb = scaleSoftClip(color.rgb);  	color.a = spec * sunAngle2; diff --git a/indra/newview/app_settings/shaders/class1/environment/waterFogF.glsl b/indra/newview/app_settings/shaders/class1/environment/waterFogF.glsl index 45bd5c8b42..4bdfce9260 100644 --- a/indra/newview/app_settings/shaders/class1/environment/waterFogF.glsl +++ b/indra/newview/app_settings/shaders/class1/environment/waterFogF.glsl @@ -25,20 +25,50 @@ - +uniform vec4 lightnorm; +uniform vec4 waterPlane;  uniform vec4 waterFogColor; -uniform float waterFogEnd; +uniform float waterFogDensity; +uniform float waterFogKS; + +vec3 getPositionEye();  vec4 applyWaterFog(vec4 color)  { -	// GL_EXP2 Fog -	//float fog = exp(-gl_Fog.density * gl_Fog.density * fog_depth * fog_depth); -	// GL_EXP Fog -	// float fog = exp(-gl_Fog.density * fog_depth); -	// GL_LINEAR Fog -	float fog = (waterFogEnd - fog_depth) * gl_Fog.scale; -	fog = clamp(fog, 0.0, 1.0); -	color.rgb = mix(waterFogColor.rgb, color.rgb, fog); +	//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/class1/lighting/lightF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightF.glsl index 8274a655db..735f5b3813 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightF.glsl @@ -22,7 +22,7 @@   * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA   * $/LicenseInfo$   */ -  +  #ifdef DEFINE_GL_FRAGCOLOR  out vec4 gl_FragColor;  #endif @@ -30,11 +30,17 @@ out vec4 gl_FragColor;  VARYING vec4 vertex_color;  VARYING vec2 vary_texcoord0; -uniform sampler2D diffuseMap; +vec3 atmosLighting(vec3 light); +vec3 scaleSoftClip(vec3 light);  void default_lighting()   { -	vec4 color = vertex_color * texture2D(diffuseMap, vary_texcoord0.xy); +	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/class1/lighting/lightFullbrightF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightF.glsl index ec7ec9ae7d..c3edc0bd70 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightF.glsl @@ -22,18 +22,25 @@   * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA   * $/LicenseInfo$   */ -  +  #ifdef DEFINE_GL_FRAGCOLOR  out vec4 gl_FragColor;  #endif - -uniform sampler2D diffuseMap; - +VARYING vec4 vertex_color;  VARYING vec2 vary_texcoord0; +vec3 fullbrightAtmosTransport(vec3 light); +vec3 fullbrightScaleSoftClip(vec3 light); +  void fullbright_lighting()  { -	gl_FragColor = texture2D(diffuseMap, vary_texcoord0.xy); +	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/class1/lighting/lightFullbrightShinyF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyF.glsl index d47d1724a7..c981e9eba2 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyF.glsl @@ -22,18 +22,34 @@   * 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; -VARYING vec2 vary_texcoord0; +vec3 fullbrightShinyAtmosTransport(vec3 light); +vec3 fullbrightScaleSoftClip(vec3 light); -void fullbright_shiny_lighting()  +void fullbright_shiny_lighting()  { -	gl_FragColor = texture2D(diffuseMap, vary_texcoord0.xy); +	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/class1/lighting/lightFullbrightShinyWaterF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyWaterF.glsl index bd67e2659e..c10cde98e0 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyWaterF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightShinyWaterF.glsl @@ -21,18 +21,33 @@   * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA   * $/LicenseInfo$   */ - +   #ifdef DEFINE_GL_FRAGCOLOR  out vec4 gl_FragColor; -#endif  +#endif +VARYING vec4 vertex_color; +VARYING vec2 vary_texcoord0; +VARYING vec3 vary_texcoord1; -uniform sampler2D diffuseMap;  uniform samplerCube environmentMap; -VARYING vec2 vary_texcoord0; +vec3 fullbrightShinyAtmosTransport(vec3 light); +vec3 fullbrightScaleSoftClip(vec3 light); +vec4 applyWaterFog(vec4 color); -void fullbright_shiny_lighting_water()  +void fullbright_shiny_lighting_water()  { -	gl_FragColor = texture2D(diffuseMap, vary_texcoord0.xy); +	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/class1/lighting/lightFullbrightWaterF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterF.glsl index 0cf5152661..2547f9e750 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightFullbrightWaterF.glsl @@ -27,12 +27,20 @@  out vec4 gl_FragColor;  #endif -uniform sampler2D diffuseMap; - +VARYING vec4 vertex_color;  VARYING vec2 vary_texcoord0; +vec4 diffuseLookup(vec2 texcoord); + +vec3 fullbrightAtmosTransport(vec3 light); +vec4 applyWaterFog(vec4 color); +  void fullbright_lighting_water()  { -	gl_FragColor = texture2D(diffuseMap, vary_texcoord0.xy); +	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/class1/lighting/lightShinyF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightShinyF.glsl index 761bda487d..e9c27dbefd 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightShinyF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightShinyF.glsl @@ -29,13 +29,26 @@ out vec4 gl_FragColor;  VARYING vec4 vertex_color;  VARYING vec2 vary_texcoord0; +VARYING vec3 vary_texcoord1; -uniform sampler2D diffuseMap;  uniform samplerCube environmentMap; -void shiny_lighting()  +vec3 scaleSoftClip(vec3 light); +vec3 atmosLighting(vec3 light); +vec4 applyWaterFog(vec4 color); + +void shiny_lighting()  { -	vec4 color = vertex_color * texture2D(diffuseMap, vary_texcoord0.xy); +	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/class1/lighting/lightShinyWaterF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterF.glsl index 6761d35316..68c727d62c 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightShinyWaterF.glsl @@ -29,13 +29,23 @@ out vec4 gl_FragColor;  VARYING vec4 vertex_color;  VARYING vec2 vary_texcoord0; +VARYING vec3 vary_texcoord1; -uniform sampler2D diffuseMap;  uniform samplerCube environmentMap; -void shiny_lighting_water()  +vec3 atmosLighting(vec3 light); +vec4 applyWaterFog(vec4 color); + +void shiny_lighting_water()  { -	vec4 color = vertex_color * texture2D(diffuseMap, vary_texcoord0.xy); -	gl_FragColor = color; +	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/class1/lighting/lightSpecularV.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightSpecularV.glsl index 265d548ce9..24bf9b3cee 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightSpecularV.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightSpecularV.glsl @@ -1,5 +1,5 @@  /**  - * @file lightV.glsl + * @file lightSpecularV.glsl   *   * $LicenseInfo:firstyear=2007&license=viewerlgpl$   * Second Life Viewer Source Code @@ -24,26 +24,13 @@   */ -uniform vec4 light_position[8]; -uniform vec3 light_diffuse[8]; -uniform vec4 light_ambient; -float calcDirectionalLight(vec3 n, vec3 l); +// All lights, no specular highlights + +vec4 sumLightsSpecular(vec3 pos, vec3 norm, vec4 color, inout vec4 specularColor, vec4 baseCol); -// Same as non-specular lighting in lightV.glsl  vec4 calcLightingSpecular(vec3 pos, vec3 norm, vec4 color, inout vec4 specularColor, vec4 baseCol)  { -	specularColor.rgb = vec3(0.0, 0.0, 0.0); -	vec4 col; -	col.a = color.a; - -	col.rgb = baseCol.rgb + light_ambient.rgb; - -	col.rgb += light_diffuse[0].rgb*calcDirectionalLight(norm, light_position[0].xyz); -	col.rgb += light_diffuse[1].rgb*calcDirectionalLight(norm, light_position[1].xyz); - -	col.rgb = min(col.rgb*color.rgb, 1.0); - -	return col;	 +	return sumLightsSpecular(pos, norm, color, specularColor, baseCol);  } diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightV.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightV.glsl index b886f97743..8045809b82 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightV.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightV.glsl @@ -24,24 +24,13 @@   */ -uniform vec4 light_position[8]; -uniform vec3 light_diffuse[8]; -uniform vec4 light_ambient; -float calcDirectionalLight(vec3 n, vec3 l); +// 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)  { -	vec4 col; -	col.a = color.a; -	 -	col.rgb = baseLight.rgb+light_ambient.rgb;   -	 -	col.rgb += light_diffuse[0].rgb*calcDirectionalLight(norm, light_position[0].xyz); -	col.rgb += light_diffuse[1].rgb*calcDirectionalLight(norm, light_position[1].xyz); -						 -	col.rgb = min(col.rgb*color.rgb, 1.0); -	 -	return col;	 +	return sumLights(pos, norm, color, baseLight);  } diff --git a/indra/newview/app_settings/shaders/class1/lighting/lightWaterF.glsl b/indra/newview/app_settings/shaders/class1/lighting/lightWaterF.glsl index 2908d77443..e9537d1e9d 100644 --- a/indra/newview/app_settings/shaders/class1/lighting/lightWaterF.glsl +++ b/indra/newview/app_settings/shaders/class1/lighting/lightWaterF.glsl @@ -25,16 +25,20 @@  #ifdef DEFINE_GL_FRAGCOLOR  out vec4 gl_FragColor; -#endif -  +#endif  +  VARYING vec4 vertex_color;  VARYING vec2 vary_texcoord0; -uniform sampler2D diffuseMap; +vec3 atmosLighting(vec3 light); +vec4 applyWaterFog(vec4 color); -void default_lighting_water()  +void default_lighting_water()  { -	vec4 color = vertex_color * texture2D(diffuseMap, vary_texcoord0.xy); -	gl_FragColor = color; +	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/class1/objects/fullbrightShinyV.glsl b/indra/newview/app_settings/shaders/class1/objects/fullbrightShinyV.glsl index 8d1bbf350d..34bd8d445a 100644 --- a/indra/newview/app_settings/shaders/class1/objects/fullbrightShinyV.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/fullbrightShinyV.glsl @@ -29,9 +29,17 @@ uniform mat4 texture_matrix1;  uniform mat4 modelview_matrix;  uniform mat4 modelview_projection_matrix; + +void calcAtmospherics(vec3 inPositionEye); + +uniform vec4 origin; + + +  ATTRIBUTE vec3 position; -ATTRIBUTE vec4 diffuse_color; +void passTextureIndex();  ATTRIBUTE vec3 normal; +ATTRIBUTE vec4 diffuse_color;  ATTRIBUTE vec2 texcoord0;  VARYING vec4 vertex_color; @@ -39,14 +47,13 @@ VARYING vec2 vary_texcoord0;  VARYING vec3 vary_texcoord1; -void calcAtmospherics(vec3 inPositionEye); - -uniform vec4 origin; -  void main()  {  	//transform vertex -	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); +	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); @@ -54,10 +61,7 @@ void main()  	vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;  	vary_texcoord1 = (texture_matrix1*vec4(ref,1.0)).xyz; -	vec4 pos = (modelview_matrix * vec4(position.xyz, 1.0));  	calcAtmospherics(pos.xyz);  	vertex_color = diffuse_color; - -	  } diff --git a/indra/newview/app_settings/shaders/class1/objects/fullbrightV.glsl b/indra/newview/app_settings/shaders/class1/objects/fullbrightV.glsl index 8b20c2a860..fc20d3270e 100644 --- a/indra/newview/app_settings/shaders/class1/objects/fullbrightV.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/fullbrightV.glsl @@ -26,26 +26,30 @@  uniform mat4 texture_matrix0;  uniform mat4 modelview_matrix;  uniform mat4 modelview_projection_matrix; - +   ATTRIBUTE vec3 position; -ATTRIBUTE vec4 diffuse_color; +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 calcAtmospherics(vec3 inPositionEye); -  void main()  {  	//transform vertex -	vec4 pos = (modelview_matrix * vec4(position.xyz, 1.0)); -	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); +	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/class1/objects/shinyV.glsl b/indra/newview/app_settings/shaders/class1/objects/shinyV.glsl index 4ca53a8f30..fdb3453cc5 100644 --- a/indra/newview/app_settings/shaders/class1/objects/shinyV.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/shinyV.glsl @@ -1,4 +1,4 @@ -/**  +/**   * @file shinyV.glsl   *   * $LicenseInfo:firstyear=2007&license=viewerlgpl$ @@ -25,17 +25,21 @@  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; -ATTRIBUTE vec2 texcoord0;  VARYING vec4 vertex_color; -VARYING vec3 vary_texcoord0; +VARYING vec2 vary_texcoord0; +VARYING vec3 vary_texcoord1; +vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol);  void calcAtmospherics(vec3 inPositionEye); @@ -44,19 +48,18 @@ uniform vec4 origin;  void main()  {  	//transform vertex -	vec4 pos = (modelview_matrix * vec4(position.xyz, 1.0)); -	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); -	 +	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; -	 -	vec3 ref = reflect(pos.xyz, -norm); -	 -	vary_texcoord0 = (texture_matrix0*vec4(ref,1.0)).xyz; -	 -	 -} +	vertex_color = calcLighting(pos.xyz, norm, diffuse_color, vec4(0.0));	 +} diff --git a/indra/newview/app_settings/shaders/class1/objects/simpleV.glsl b/indra/newview/app_settings/shaders/class1/objects/simpleV.glsl index df9111f941..37a20383e2 100644 --- a/indra/newview/app_settings/shaders/class1/objects/simpleV.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/simpleV.glsl @@ -29,28 +29,36 @@ uniform mat4 modelview_matrix;  uniform mat4 modelview_projection_matrix;  ATTRIBUTE vec3 position; +void passTextureIndex(); +ATTRIBUTE vec2 texcoord0;  ATTRIBUTE vec3 normal;  ATTRIBUTE vec4 diffuse_color; -ATTRIBUTE vec2 texcoord0; + +vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol); +void calcAtmospherics(vec3 inPositionEye); +  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 pos = (modelview_matrix * vec4(position.xyz, 1.0)); -	gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); -	vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy; -		 +	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; + +	  } diff --git a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsHelpersV.glsl b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsHelpersV.glsl index ed0249330e..89b6a52909 100644 --- a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsHelpersV.glsl +++ b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsHelpersV.glsl @@ -23,7 +23,7 @@   * $/LicenseInfo$   */ -uniform vec3 light_diffuse[8]; +uniform vec4 sunlight_color;  uniform vec4 light_ambient;  vec3 atmosAmbient(vec3 light) @@ -33,12 +33,12 @@ vec3 atmosAmbient(vec3 light)  vec3 atmosAffectDirectionalLight(float lightIntensity)  { -	return light_diffuse[0].rgb * lightIntensity; +	return sunlight_color.rgb * lightIntensity;  }  vec3 atmosGetDiffuseSunlightColor()  { -	return light_diffuse[0].rgb; +	return sunlight_color.rgb;  }  vec3 scaleDownLight(vec3 light) 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; - -	 -} diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index 563a63287e..9fb804a74f 100644 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -608,7 +608,6 @@ void settings_setup_listeners()  	gSavedSettings.getControl("RenderShadowResolutionScale")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2));  	gSavedSettings.getControl("RenderGlow")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2));  	gSavedSettings.getControl("RenderGlow")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2)); -	gSavedSettings.getControl("EnableRippleWater")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2));  	gSavedSettings.getControl("RenderGlowResolutionPow")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2));  	gSavedSettings.getControl("RenderAvatarCloth")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2));  	gSavedSettings.getControl("WindLightUseAtmosShaders")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2)); diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index 6af9e464df..8e59a7c32d 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -561,11 +561,7 @@ void LLViewerShaderMgr::setShaders()  			wl_class = 1;  		} -		if(!gSavedSettings.getBOOL("EnableRippleWater")) -		{ -			water_class = 0; -		} - +		  		// Trigger a full rebuild of the fallback skybox / cubemap if we've toggled windlight shaders  		if (mVertexShaderLevel[SHADER_WINDLIGHT] != wl_class && gSky.mVOSkyp.notNull())  		{ @@ -1087,51 +1083,6 @@ BOOL LLViewerShaderMgr::loadShadersEffects()  		}  	} -#if 0 -	// disabling loading of postprocess shaders until we fix -	// ATI sampler2DRect compatibility. -	 -	//load Color Filter Shader -	if (success) -	{ -		vector<string> shaderUniforms; -		shaderUniforms.reserve(7); -		shaderUniforms.push_back("RenderTexture"); -		shaderUniforms.push_back("gamma"); -		shaderUniforms.push_back("brightness"); -		shaderUniforms.push_back("contrast"); -		shaderUniforms.push_back("contrastBase"); -		shaderUniforms.push_back("saturation"); -		shaderUniforms.push_back("lumWeights"); - -		gPostColorFilterProgram.mName = "Color Filter Shader (Post)"; -		gPostColorFilterProgram.mShaderFiles.clear(); -		gPostColorFilterProgram.mShaderFiles.push_back(make_pair("effects/colorFilterF.glsl", GL_FRAGMENT_SHADER_ARB)); -		gPostColorFilterProgram.mShaderFiles.push_back(make_pair("effects/drawQuadV.glsl", GL_VERTEX_SHADER_ARB)); -		gPostColorFilterProgram.mShaderLevel = mVertexShaderLevel[SHADER_EFFECT]; -		success = gPostColorFilterProgram.createShader(NULL, &shaderUniforms); -	} - -	//load Night Vision Shader -	if (success) -	{ -		vector<string> shaderUniforms; -		shaderUniforms.reserve(5); -		shaderUniforms.push_back("RenderTexture"); -		shaderUniforms.push_back("NoiseTexture"); -		shaderUniforms.push_back("brightMult"); -		shaderUniforms.push_back("noiseStrength"); -		shaderUniforms.push_back("lumWeights"); - -		gPostNightVisionProgram.mName = "Night Vision Shader (Post)"; -		gPostNightVisionProgram.mShaderFiles.clear(); -		gPostNightVisionProgram.mShaderFiles.push_back(make_pair("effects/nightVisionF.glsl", GL_FRAGMENT_SHADER_ARB)); -		gPostNightVisionProgram.mShaderFiles.push_back(make_pair("effects/drawQuadV.glsl", GL_VERTEX_SHADER_ARB)); -		gPostNightVisionProgram.mShaderLevel = mVertexShaderLevel[SHADER_EFFECT]; -		success = gPostNightVisionProgram.createShader(NULL, &shaderUniforms); -	} -	#endif -  	return success;  } | 
