Browse Source

forward PBR crash fix

trethaller 4 years ago
parent
commit
c6aaa64e90
2 changed files with 2 additions and 2 deletions
  1. 1 1
      h3d/scene/pbr/LightBuffer.hx
  2. 1 1
      h3d/shader/pbr/DefaultForward.hx

+ 1 - 1
h3d/scene/pbr/LightBuffer.hx

@@ -168,8 +168,8 @@ class LightBuffer {
 
 
 		s.lightInfos.uploadVector(lightInfos, 0, s.lightInfos.vertices, 0);
 		s.lightInfos.uploadVector(lightInfos, 0, s.lightInfos.vertices, 0);
 
 
-		s.USE_INDIRECT = pbrRenderer.env != null;
 		var pbrIndirect = @:privateAccess pbrRenderer.pbrIndirect;
 		var pbrIndirect = @:privateAccess pbrRenderer.pbrIndirect;
+		s.USE_INDIRECT = pbrRenderer.env != null && pbrIndirect.irrLut != null;
 		if( s.USE_INDIRECT ) {
 		if( s.USE_INDIRECT ) {
 			s.irrRotation = pbrIndirect.irrRotation;
 			s.irrRotation = pbrIndirect.irrRotation;
 			s.irrPower = pbrIndirect.irrPower;
 			s.irrPower = pbrIndirect.irrPower;

+ 1 - 1
h3d/shader/pbr/DefaultForward.hx

@@ -41,7 +41,7 @@ class DefaultForward extends hxsl.Shader {
 		var F0 : Vec3;
 		var F0 : Vec3;
 
 
 		// Indirect Lighting
 		// Indirect Lighting
-		@const var USE_INDIRECT = true;
+		@const var USE_INDIRECT = false;
 		@param var irrLut : Sampler2D;
 		@param var irrLut : Sampler2D;
 		@param var irrDiffuse : SamplerCube;
 		@param var irrDiffuse : SamplerCube;
 		@param var irrSpecular : SamplerCube;
 		@param var irrSpecular : SamplerCube;