Browse Source

[INDIRECT LIGHTING] Not rendering env if power is 0.

clandrin 3 years ago
parent
commit
255fcee542
1 changed files with 3 additions and 4 deletions
  1. 3 4
      h3d/scene/pbr/Renderer.hx

+ 3 - 4
h3d/scene/pbr/Renderer.hx

@@ -236,8 +236,8 @@ class Renderer extends h3d.scene.Renderer {
 		pbrProps.isScreen = false;
 		draw(pbrLightPass.name);
 
-		if( !renderLightProbes() && env != null ) {
-			mark("Indirect Lighting");
+		mark("Indirect Lighting");
+		if( !renderLightProbes() && env != null && env.power > 0.0 ) {
 			pbrProps.isScreen = true;
 			pbrIndirect.drawIndirectDiffuse = true;
 			pbrIndirect.drawIndirectSpecular = true;
@@ -262,8 +262,7 @@ class Renderer extends h3d.scene.Renderer {
 		clear(0);
 
 		// Default Env & SkyBox
-		if( env != null ) {
-			mark("Indirect Lighting");
+		if( env != null && env.power > 0.0  ) {
 			pbrProps.isScreen = true;
 			pbrIndirect.drawIndirectDiffuse = true;
 			pbrIndirect.drawIndirectSpecular = true;