Browse Source

Fix sky color if MRT_low is set.

clementlandrin 1 year ago
parent
commit
51d3da3883
1 changed files with 4 additions and 0 deletions
  1. 4 0
      h3d/shader/pbr/Lighting.hx

+ 4 - 0
h3d/shader/pbr/Lighting.hx

@@ -45,7 +45,11 @@ class Indirect extends PropsDefinition {
 		}
 
 		function fragment() {
+			#if !MRT_low
 			var isSky = normal.dot(normal) <= 0;
+			#else
+			var isSky = normal.dot(normal) > 1.1; // due to normal packing, sky normal is likely sqrt(3) > 1.7
+			#end
 			if( isSky ) {
 				if( showSky ) {
 					var color : Vec3;