diff options
| author | Graham Linden <graham@lindenlab.com> | 2013-08-07 08:42:35 -0700 | 
|---|---|---|
| committer | Graham Linden <graham@lindenlab.com> | 2013-08-07 08:42:35 -0700 | 
| commit | bfe2377a9a3061094e3c1fa10bb0afed06cac709 (patch) | |
| tree | 7f90f7b15ee3314ec044c471b7333060f7e43b80 /indra/newview/app_settings/shaders | |
| parent | 83fa549b56826f55f0f30244dbceda77a8a5dbfe (diff) | |
NORSPEC-342 WIP fix issues with skimpy clothes getting too skimpy in impostors
Diffstat (limited to 'indra/newview/app_settings/shaders')
| -rwxr-xr-x | indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl | 20 | 
1 files changed, 17 insertions, 3 deletions
| diff --git a/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl b/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl index d52744103f..d1eaabf901 100755 --- a/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl @@ -38,6 +38,17 @@ uniform sampler2D specularMap;  VARYING vec2 vary_texcoord0; +vec3 decode_normal (vec2 enc) +{ +    vec2 fenc = enc*4-2; +    float f = dot(fenc,fenc); +    float g = sqrt(1-f/4); +    vec3 n; +    n.xy = fenc*g; +    n.z = 1-f/2; +    return n; +} +  vec2 encode_normal(vec3 n)  {  	float f = sqrt(8 * n.z + 8); @@ -72,7 +83,10 @@ void main()  		discard;  	} -	frag_data[0] = vec4(linear_to_srgb(col.rgb), col.a); -	frag_data[1] = vec4(texture2D(specularMap, vary_texcoord0.xy)); -	frag_data[2] = vec4(texture2D(normalMap, vary_texcoord0.xy).xy,0,0); +	vec4 norm = texture2D(normalMap,   vary_texcoord0.xy); +	vec4 spec = texture2D(specularMap, vary_texcoord0.xy); + +	frag_data[0] = vec4(col.rgb, col.a); +	frag_data[1] = spec; +	frag_data[2] = vec4(norm.xy,0,0);  } | 
