diff options
Diffstat (limited to 'indra/newview')
11 files changed, 103 insertions, 224 deletions
| diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index d71b84739c..74181d9764 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -7240,7 +7240,7 @@      <string>Vector3</string>      <key>Value</key>      <array> -      <real>0.40</real> +      <real>0.70</real>        <real>1.00</real>        <real>0.00</real>      </array> @@ -7997,7 +7997,7 @@      <key>Type</key>      <string>F32</string>      <key>Value</key> -    <real>0.1</real> +    <real>0</real>    </map>    <key>RenderGIAmbiance</key> @@ -8217,9 +8217,9 @@        <string>Vector3</string>        <key>Value</key>        <array> -        <real>0.299</real> -        <real>0.587</real> -        <real>0.114</real> +        <real>1</real> +        <real>0</real> +        <real>0</real>        </array>      </map>      <key>RenderGlowMaxExtractAlpha</key> @@ -8231,7 +8231,7 @@        <key>Type</key>        <string>F32</string>        <key>Value</key> -      <real>0.065</real> +      <real>0.25</real>      </map>      <key>RenderGlowMinLuminance</key>      <map> @@ -8242,7 +8242,7 @@        <key>Type</key>        <string>F32</string>        <key>Value</key> -      <real>2.5</real> +      <real>0.81</real>      </map>      <key>RenderGlowResolutionPow</key>      <map> diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl index b08c5dd295..28a38d4390 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl @@ -10,7 +10,6 @@  #extension GL_ARB_texture_rectangle : enable  uniform sampler2D diffuseMap; -uniform sampler2D noiseMap;  uniform sampler2DRect depthMap;  uniform mat4 shadow_matrix[6]; @@ -45,8 +44,6 @@ void main()  	vec2 frag = vary_fragcoord.xy/vary_fragcoord.z*0.5+0.5;  	frag *= screen_res; -	vec3 samp_pos = getPosition(frag).xyz; -	  	vec4 pos = vec4(vary_position, 1.0);  	vec4 col = vec4(vary_ambient + vary_directional.rgb, gl_Color.a); diff --git a/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl index ea2df4b51a..d9f021b114 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl @@ -39,44 +39,49 @@ vec4 getPosition(vec2 pos_screen)  void main()   { -	vec3 norm = texture2DRect(normalMap, vary_fragcoord.xy).xyz; +        vec2 tc = vary_fragcoord.xy; +	vec3 norm = texture2DRect(normalMap, tc).xyz;  	norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm -	vec3 pos = getPosition(vary_fragcoord.xy).xyz; -	vec4 ccol = texture2DRect(lightMap, vary_fragcoord.xy).rgba; +	vec3 pos = getPosition(tc).xyz; +	vec4 ccol = texture2DRect(lightMap, tc).rgba;  	vec2 dlt = kern_scale * delta / (1.0+norm.xy*norm.xy); -	  	dlt /= max(-pos.z*dist_factor, 1.0);  	vec2 defined_weight = kern[0].xy; // special case the first (centre) sample's weight in the blur; we have to sample it anyway so we get it for 'free'  	vec4 col = defined_weight.xyxx * ccol; -	 + +	// relax tolerance according to distance to avoid speckling artifacts, as angles and distances are a lot more abrupt within a small screen area at larger distances +	float pointplanedist_tolerance_pow2 = pos.z*pos.z*0.00005; + +	// perturb sampling origin slightly in screen-space to hide edge-ghosting artifacts where smoothing radius is quite large +	tc += ( (mod(tc.x+tc.y,2) - 0.5) * kern[1].z * dlt * 0.5 ); +  	for (int i = 1; i < 4; i++)  	{ -		vec2 tc = vary_fragcoord.xy + kern[i].z*dlt; -	        vec3 samppos = getPosition(tc).xyz;  +		vec2 samptc = tc + kern[i].z*dlt; +	        vec3 samppos = getPosition(samptc).xyz;   		float d = dot(norm.xyz, samppos.xyz-pos.xyz);// dist from plane -		if (d*d <= 0.003) +		if (d*d <= pointplanedist_tolerance_pow2)  		{ -			col += texture2DRect(lightMap, tc)*kern[i].xyxx; +			col += texture2DRect(lightMap, samptc)*kern[i].xyxx;  			defined_weight += kern[i].xy;  		}  	}  	for (int i = 1; i < 4; i++)  	{ -		vec2 tc = vary_fragcoord.xy - kern[i].z*dlt; -	        vec3 samppos = getPosition(tc).xyz;  +		vec2 samptc = tc - kern[i].z*dlt; +	        vec3 samppos = getPosition(samptc).xyz;   		float d = dot(norm.xyz, samppos.xyz-pos.xyz);// dist from plane -		if (d*d <= 0.003) +		if (d*d <= pointplanedist_tolerance_pow2)  		{ -			col += texture2DRect(lightMap, tc)*kern[i].xyxx; +			col += texture2DRect(lightMap, samptc)*kern[i].xyxx;  			defined_weight += kern[i].xy;  		}  	} - -  	col /= defined_weight.xyxx; +	col.y *= col.y;  	gl_FragColor = col;  } diff --git a/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl b/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl index 7125d845d9..7829e9b72f 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl @@ -14,7 +14,7 @@ uniform sampler2D specularMap;  void main()   {  	vec4 col = texture2D(diffuseMap, gl_TexCoord[0].xy); -	gl_FragData[0] = vec4(col.rgb, col.a <= 0.5 ? 0.0 : 0.005); +	gl_FragData[0] = vec4(col.rgb, col != vec4(0,0,0,0));  	gl_FragData[1] = texture2D(specularMap, gl_TexCoord[0].xy); -	gl_FragData[2] = vec4(texture2D(normalMap, gl_TexCoord[0].xy).xyz, 0.0); +	gl_FragData[2] = texture2D(normalMap, gl_TexCoord[0].xy);  } diff --git a/indra/newview/app_settings/shaders/class1/deferred/sunLightSSAOF.glsl b/indra/newview/app_settings/shaders/class1/deferred/sunLightSSAOF.glsl index 1e0693d19f..25ff958107 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/sunLightSSAOF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/sunLightSSAOF.glsl @@ -53,57 +53,49 @@ float calcAmbientOcclusion(vec4 pos, vec3 norm)  {  	float ret = 1.0; -	float dist = dot(pos.xyz,pos.xyz); -	 -	if (dist < 64.0*64.0) -	{ -		vec2 kern[8]; -		// exponentially (^2) distant occlusion samples spread around origin -		kern[0] = vec2(-1.0, 0.0) * 0.125*0.125; -		kern[1] = vec2(1.0, 0.0) * 0.250*0.250; -		kern[2] = vec2(0.0, 1.0) * 0.375*0.375; -		kern[3] = vec2(0.0, -1.0) * 0.500*0.500; -		kern[4] = vec2(0.7071, 0.7071) * 0.625*0.625; -		kern[5] = vec2(-0.7071, -0.7071) * 0.750*0.750; -		kern[6] = vec2(-0.7071, 0.7071) * 0.875*0.875; -		kern[7] = vec2(0.7071, -0.7071) * 1.000*1.000; +	vec2 kern[8]; +	// exponentially (^2) distant occlusion samples spread around origin +	kern[0] = vec2(-1.0, 0.0) * 0.125*0.125; +	kern[1] = vec2(1.0, 0.0) * 0.250*0.250; +	kern[2] = vec2(0.0, 1.0) * 0.375*0.375; +	kern[3] = vec2(0.0, -1.0) * 0.500*0.500; +	kern[4] = vec2(0.7071, 0.7071) * 0.625*0.625; +	kern[5] = vec2(-0.7071, -0.7071) * 0.750*0.750; +	kern[6] = vec2(-0.7071, 0.7071) * 0.875*0.875; +	kern[7] = vec2(0.7071, -0.7071) * 1.000*1.000; -		vec2 pos_screen = vary_fragcoord.xy; -		vec3 pos_world = pos.xyz; -		vec2 noise_reflect = texture2D(noiseMap, vary_fragcoord.xy/128.0).xy; +	vec2 pos_screen = vary_fragcoord.xy; +	vec3 pos_world = pos.xyz; +	vec2 noise_reflect = texture2D(noiseMap, vary_fragcoord.xy/128.0).xy; -		float angle_hidden = 0.0; -		int points = 0; +	float angle_hidden = 0.0; +	int points = 0; -		float scale = min(ssao_radius / -pos_world.z, ssao_max_radius); +	float scale = min(ssao_radius / -pos_world.z, ssao_max_radius); -		// it was found that keeping # of samples a constant was the fastest, probably due to compiler optimizations (unrolling?) -		for (int i = 0; i < 8; i++) -		{ -			vec2 samppos_screen = pos_screen + scale * reflect(kern[i], noise_reflect); -			vec3 samppos_world = getPosition(samppos_screen).xyz;  +	// it was found that keeping # of samples a constant was the fastest, probably due to compiler optimizations unrolling?) +	for (int i = 0; i < 8; i++) +	{ +		vec2 samppos_screen = pos_screen + scale * reflect(kern[i], noise_reflect); +		vec3 samppos_world = getPosition(samppos_screen).xyz;  -			vec3 diff = pos_world - samppos_world; -			float dist2 = dot(diff, diff); +		vec3 diff = pos_world - samppos_world; +		float dist2 = dot(diff, diff); -			// assume each sample corresponds to an occluding sphere with constant radius, constant x-sectional area -			// --> solid angle shrinking by the square of distance -			//radius is somewhat arbitrary, can approx with just some constant k * 1 / dist^2 -			//(k should vary inversely with # of samples, but this is taken care of later) +		// assume each sample corresponds to an occluding sphere with constant radius, constant x-sectional area +		// --> solid angle shrinking by the square of distance +		//radius is somewhat arbitrary, can approx with just some constant k * 1 / dist^2 +		//(k should vary inversely with # of samples, but this is taken care of later) -			//if (dot((samppos_world - 0.05*norm - pos_world), norm) > 0.0)  // -0.05*norm to shift sample point back slightly for flat surfaces -			//	angle_hidden += min(1.0/dist2, ssao_factor_inv); // dist != 0 follows from conditional.  max of 1.0 (= ssao_factor_inv * ssao_factor) -			angle_hidden = angle_hidden + float(dot((samppos_world - 0.05*norm - pos_world), norm) > 0.0) * min(1.0/dist2, ssao_factor_inv); +		angle_hidden = angle_hidden + float(dot((samppos_world - 0.05*norm - pos_world), norm) > 0.0) * min(1.0/dist2, ssao_factor_inv); -			// 'blocked' samples (significantly closer to camera relative to pos_world) are "no data", not "no occlusion"  -			points = points + int(diff.z > -1.0); -		} +		// 'blocked' samples (significantly closer to camera relative to pos_world) are "no data", not "no occlusion"  +		points = points + int(diff.z > -1.0); +	} -		angle_hidden = min(ssao_factor*angle_hidden/float(points), 1.0); +	angle_hidden = min(ssao_factor*angle_hidden/float(points), 1.0); -		ret = (1.0 - (float(points != 0) * angle_hidden)); -		ret += max((dist-32.0*32.0)/(32.0*32.0), 0.0); -	} +	ret = (1.0 - (float(points != 0) * angle_hidden));  	return min(ret, 1.0);  } diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl index 32aab152a3..1dd29bfc70 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl @@ -14,7 +14,6 @@ uniform sampler2DRectShadow shadowMap0;  uniform sampler2DRectShadow shadowMap1;  uniform sampler2DRectShadow shadowMap2;  uniform sampler2DRectShadow shadowMap3; -uniform sampler2D noiseMap;  uniform sampler2DRect depthMap;  uniform mat4 shadow_matrix[6]; @@ -70,8 +69,6 @@ void main()  	vec2 frag = vary_fragcoord.xy/vary_fragcoord.z*0.5+0.5;  	frag *= screen_res; -	vec3 samp_pos = getPosition(frag).xyz; -	  	float shadow = 1.0;  	vec4 pos = vec4(vary_position, 1.0); diff --git a/indra/newview/app_settings/shaders/class2/deferred/blurLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/blurLightF.glsl deleted file mode 100644 index ea2df4b51a..0000000000 --- a/indra/newview/app_settings/shaders/class2/deferred/blurLightF.glsl +++ /dev/null @@ -1,83 +0,0 @@ -/**  - * @file blurLightF.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * $/LicenseInfo$ - */ -  -#version 120 - -#extension GL_ARB_texture_rectangle : enable - -uniform sampler2DRect depthMap; -uniform sampler2DRect normalMap; -uniform sampler2DRect lightMap; - -uniform float dist_factor; -uniform float blur_size; -uniform vec2 delta; -uniform vec3 kern[4]; -uniform float kern_scale; - -varying vec2 vary_fragcoord; - -uniform mat4 inv_proj; -uniform vec2 screen_res; - -vec4 getPosition(vec2 pos_screen) -{ -	float depth = texture2DRect(depthMap, pos_screen.xy).a; -	vec2 sc = pos_screen.xy*2.0; -	sc /= screen_res; -	sc -= vec2(1.0,1.0); -	vec4 ndc = vec4(sc.x, sc.y, 2.0*depth-1.0, 1.0); -	vec4 pos = inv_proj * ndc; -	pos /= pos.w; -	pos.w = 1.0; -	return pos; -} - -void main()  -{ -	vec3 norm = texture2DRect(normalMap, vary_fragcoord.xy).xyz; -	norm = vec3((norm.xy-0.5)*2.0,norm.z); // unpack norm -	vec3 pos = getPosition(vary_fragcoord.xy).xyz; -	vec4 ccol = texture2DRect(lightMap, vary_fragcoord.xy).rgba; -	 -	vec2 dlt = kern_scale * delta / (1.0+norm.xy*norm.xy); -	 -	dlt /= max(-pos.z*dist_factor, 1.0); -	 -	vec2 defined_weight = kern[0].xy; // special case the first (centre) sample's weight in the blur; we have to sample it anyway so we get it for 'free' -	vec4 col = defined_weight.xyxx * ccol; -	 -	for (int i = 1; i < 4; i++) -	{ -		vec2 tc = vary_fragcoord.xy + kern[i].z*dlt; -	        vec3 samppos = getPosition(tc).xyz;  -		float d = dot(norm.xyz, samppos.xyz-pos.xyz);// dist from plane -		if (d*d <= 0.003) -		{ -			col += texture2DRect(lightMap, tc)*kern[i].xyxx; -			defined_weight += kern[i].xy; -		} -	} -	for (int i = 1; i < 4; i++) -	{ -		vec2 tc = vary_fragcoord.xy - kern[i].z*dlt; -	        vec3 samppos = getPosition(tc).xyz;  -		float d = dot(norm.xyz, samppos.xyz-pos.xyz);// dist from plane -		if (d*d <= 0.003) -		{ -			col += texture2DRect(lightMap, tc)*kern[i].xyxx; -			defined_weight += kern[i].xy; -		} -	} - - - -	col /= defined_weight.xyxx; -	 -	gl_FragColor = col; -} - diff --git a/indra/newview/app_settings/shaders/class2/deferred/blurLightV.glsl b/indra/newview/app_settings/shaders/class2/deferred/blurLightV.glsl deleted file mode 100644 index c2d05c601a..0000000000 --- a/indra/newview/app_settings/shaders/class2/deferred/blurLightV.glsl +++ /dev/null @@ -1,19 +0,0 @@ -/**  - * @file blurLightF.glsl - * - * $LicenseInfo:firstyear=2007&license=viewerlgpl$ - * $/LicenseInfo$ - */ -  -#version 120 - -varying vec2 vary_fragcoord; -uniform vec2 screen_res; - -void main() -{ -	//transform vertex -	gl_Position = ftransform();  -	vec4 pos = gl_ModelViewProjectionMatrix * gl_Vertex; -	vary_fragcoord = (pos.xy*0.5+0.5)*screen_res; -} diff --git a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl b/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl index cc921f23d7..08b16d787f 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/sunLightSSAOF.glsl @@ -62,58 +62,50 @@ vec4 getPosition(vec2 pos_screen)  float calcAmbientOcclusion(vec4 pos, vec3 norm)  {  	float ret = 1.0; -	 -	float dist = dot(pos.xyz,pos.xyz); -	 -	if (dist < 64.0*64.0) -	{ -		vec2 kern[8]; -		// exponentially (^2) distant occlusion samples spread around origin -		kern[0] = vec2(-1.0, 0.0) * 0.125*0.125; -		kern[1] = vec2(1.0, 0.0) * 0.250*0.250; -		kern[2] = vec2(0.0, 1.0) * 0.375*0.375; -		kern[3] = vec2(0.0, -1.0) * 0.500*0.500; -		kern[4] = vec2(0.7071, 0.7071) * 0.625*0.625; -		kern[5] = vec2(-0.7071, -0.7071) * 0.750*0.750; -		kern[6] = vec2(-0.7071, 0.7071) * 0.875*0.875; -		kern[7] = vec2(0.7071, -0.7071) * 1.000*1.000; -		vec2 pos_screen = vary_fragcoord.xy; -		vec3 pos_world = pos.xyz; -		vec2 noise_reflect = texture2D(noiseMap, vary_fragcoord.xy/128.0).xy; +	vec2 kern[8]; +	// exponentially (^2) distant occlusion samples spread around origin +	kern[0] = vec2(-1.0, 0.0) * 0.125*0.125; +	kern[1] = vec2(1.0, 0.0) * 0.250*0.250; +	kern[2] = vec2(0.0, 1.0) * 0.375*0.375; +	kern[3] = vec2(0.0, -1.0) * 0.500*0.500; +	kern[4] = vec2(0.7071, 0.7071) * 0.625*0.625; +	kern[5] = vec2(-0.7071, -0.7071) * 0.750*0.750; +	kern[6] = vec2(-0.7071, 0.7071) * 0.875*0.875; +	kern[7] = vec2(0.7071, -0.7071) * 1.000*1.000; + +	vec2 pos_screen = vary_fragcoord.xy; +	vec3 pos_world = pos.xyz; +	vec2 noise_reflect = texture2D(noiseMap, vary_fragcoord.xy/128.0).xy; -		float angle_hidden = 0.0; -		int points = 0; +	float angle_hidden = 0.0; +	int points = 0; -		float scale = min(ssao_radius / -pos_world.z, ssao_max_radius); +	float scale = min(ssao_radius / -pos_world.z, ssao_max_radius); -		// it was found that keeping # of samples a constant was the fastest, probably due to compiler optimizations (unrolling?) -		for (int i = 0; i < 8; i++) -		{ -			vec2 samppos_screen = pos_screen + scale * reflect(kern[i], noise_reflect); -			vec3 samppos_world = getPosition(samppos_screen).xyz;  +	// it was found that keeping # of samples a constant was the fastest, probably due to compiler optimizations (unrolling?) +	for (int i = 0; i < 8; i++) +	{ +		vec2 samppos_screen = pos_screen + scale * reflect(kern[i], noise_reflect); +		vec3 samppos_world = getPosition(samppos_screen).xyz;  -			vec3 diff = pos_world - samppos_world; -			float dist2 = dot(diff, diff); +		vec3 diff = pos_world - samppos_world; +		float dist2 = dot(diff, diff); -			// assume each sample corresponds to an occluding sphere with constant radius, constant x-sectional area -			// --> solid angle shrinking by the square of distance -			//radius is somewhat arbitrary, can approx with just some constant k * 1 / dist^2 -			//(k should vary inversely with # of samples, but this is taken care of later) +		// assume each sample corresponds to an occluding sphere with constant radius, constant x-sectional area +		// --> solid angle shrinking by the square of distance +		//radius is somewhat arbitrary, can approx with just some constant k * 1 / dist^2 +		//(k should vary inversely with # of samples, but this is taken care of later) -			//if (dot((samppos_world - 0.05*norm - pos_world), norm) > 0.0)  // -0.05*norm to shift sample point back slightly for flat surfaces -			//	angle_hidden += min(1.0/dist2, ssao_factor_inv); // dist != 0 follows from conditional.  max of 1.0 (= ssao_factor_inv * ssao_factor) -			angle_hidden = angle_hidden + float(dot((samppos_world - 0.05*norm - pos_world), norm) > 0.0) * min(1.0/dist2, ssao_factor_inv); +		angle_hidden = angle_hidden + float(dot((samppos_world - 0.05*norm - pos_world), norm) > 0.0) * min(1.0/dist2, ssao_factor_inv); -			// 'blocked' samples (significantly closer to camera relative to pos_world) are "no data", not "no occlusion"  -			points = points + int(diff.z > -1.0); -		} +		// 'blocked' samples (significantly closer to camera relative to pos_world) are "no data", not "no occlusion"  +		points = points + int(diff.z > -1.0); +	} -		angle_hidden = min(ssao_factor*angle_hidden/float(points), 1.0); +	angle_hidden = min(ssao_factor*angle_hidden/float(points), 1.0); -		ret = (1.0 - (float(points != 0) * angle_hidden)); -		ret += max((dist-32.0*32.0)/(32.0*32.0), 0.0); -	} +	ret = (1.0 - (float(points != 0) * angle_hidden));  	return min(ret, 1.0);  } diff --git a/indra/newview/llfloatersearch.cpp b/indra/newview/llfloatersearch.cpp index 2041fac8d8..1e321674a7 100644 --- a/indra/newview/llfloatersearch.cpp +++ b/indra/newview/llfloatersearch.cpp @@ -103,14 +103,14 @@ BOOL LLFloaterSearch::postBuild()  void LLFloaterSearch::onOpen(const LLSD& key)  { -	search(key); -} +	if ( (key.has("category")) || ((mBrowser) && (mBrowser->getCurrentNavUrl().empty())) ) +	{ +		// new search triggered - blank the page while loading, instead of +		//  temporarily showing stale results +		mBrowser->navigateTo("about:blank"); -void LLFloaterSearch::onClose(bool app_quitting) -{ -	// tear down the web view so we don't show the previous search -	// result when the floater is opened next time -	destroy(); +		search(key); +	}  }  void LLFloaterSearch::handleMediaEvent(LLPluginClassMedia *self, EMediaEvent event) diff --git a/indra/newview/llfloatersearch.h b/indra/newview/llfloatersearch.h index ba4dc4c0fa..615c099d0d 100644 --- a/indra/newview/llfloatersearch.h +++ b/indra/newview/llfloatersearch.h @@ -53,8 +53,6 @@ public:  	/// see search() for details on the key parameter.  	/*virtual*/ void onOpen(const LLSD& key); -	/*virtual*/ void onClose(bool app_quitting); -  	/// perform a search with the specific search term.  	/// The key should be a map that can contain the following keys:  	///  - "id": specifies the text phrase to search for | 
