diff options
Diffstat (limited to 'indra/newview/app_settings')
| -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);  } | 
