1. simon_linden
  2. viewer-rabbit

Commits

Geenz  committed 36862a6

Encode viewspace Z normal to preserve negative Z (fixes all light shifting errors, and shiny environment map errors due to lack of negative Z)

  • Participants
  • Parent commits 3142ebd
  • Branches default

Comments (0)

Files changed (8)

File indra/newview/app_settings/shaders/class1/deferred/avatarF.glsl

View file
 	gl_FragData[0] = vec4(diff.rgb, 0.0);
 	gl_FragData[1] = vec4(0,0,0,0);
 	vec3 nvn = normalize(vary_normal);
-	gl_FragData[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0);
+	gl_FragData[2] = vec4(nvn.xyz * 0.5 + 0.5, 0.0);
 }
 

File indra/newview/app_settings/shaders/class1/deferred/bumpF.glsl

View file
 	gl_FragData[1] = vertex_color.aaaa; // spec
 	//gl_FragData[1] = vec4(vec3(vertex_color.a), vertex_color.a+(1.0-vertex_color.a)*vertex_color.a); // spec - from former class3 - maybe better, but not so well tested
 	vec3 nvn = normalize(tnorm);
-	gl_FragData[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0);
+	gl_FragData[2] = vec4(nvn.xyz * 0.5 + 0.5, 0.0);
 }

File indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskF.glsl

View file
 	gl_FragData[0] = vec4(col.rgb, 0.0);
 	gl_FragData[1] = vec4(0,0,0,0); // spec
 	vec3 nvn = normalize(vary_normal);
-	gl_FragData[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0);
+	gl_FragData[2] = vec4(nvn.xyz * 0.5 + 0.5, 0.0);
 }
 

File indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskIndexedF.glsl

View file
 	gl_FragData[0] = vec4(col.rgb, 0.0);
 	gl_FragData[1] = vec4(0,0,0,0);
 	vec3 nvn = normalize(vary_normal);
-	gl_FragData[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0);
+	gl_FragData[2] = vec4(nvn.xyz * 0.5 + 0.5, 0.0);
 }

File indra/newview/app_settings/shaders/class1/deferred/diffuseAlphaMaskNoColorF.glsl

View file
 	gl_FragData[0] = vec4(col.rgb, 0.0);
 	gl_FragData[1] = vec4(0,0,0,0); // spec
 	vec3 nvn = normalize(vary_normal);
-	gl_FragData[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0);
+	gl_FragData[2] = vec4(nvn.xyz * 0.5 + 0.5, 0.0);
 }
 

File indra/newview/app_settings/shaders/class1/deferred/diffuseF.glsl

View file
 	gl_FragData[1] = vertex_color.aaaa; // spec
 	//gl_FragData[1] = vec4(vec3(vertex_color.a), vertex_color.a+(1.0-vertex_color.a)*vertex_color.a); // spec - from former class3 - maybe better, but not so well tested
 	vec3 nvn = normalize(vary_normal);
-	gl_FragData[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0);
+	gl_FragData[2] = vec4(nvn.xyz * 0.5 + 0.5, 0.0);
 }
 

File indra/newview/app_settings/shaders/class1/deferred/diffuseIndexedF.glsl

View file
 	gl_FragData[1] = vertex_color.aaaa; // spec
 	//gl_FragData[1] = vec4(vec3(vertex_color.a), vertex_color.a+(1.0-vertex_color.a)*vertex_color.a); // spec - from former class3 - maybe better, but not so well tested
 	vec3 nvn = normalize(vary_normal);
-	gl_FragData[2] = vec4(nvn.xy * 0.5 + 0.5, nvn.z, 0.0);
+	gl_FragData[2] = vec4(nvn.xyz * 0.5 + 0.5, 0.0);
 }

File indra/newview/app_settings/shaders/class1/deferred/waterF.glsl

View file
 	
 	gl_FragData[0] = vec4(color.rgb, 0.5); // diffuse
 	gl_FragData[1] = vec4(0.5,0.5,0.5, 0.95); // speccolor*spec, spec
-	gl_FragData[2] = vec4(screenspacewavef.xy*0.5+0.5, screenspacewavef.z, screenspacewavef.z*0.5); // normalxyz, displace
+	gl_FragData[2] = vec4(screenspacewavef.xyz*0.5+0.5, screenspacewavef.z*0.5); // normalxyz, displace
 }