Răsfoiți Sursa

when in PHYSICAL_LIGHTS mode disable multiplying hemispheric and ambient color*intensity products by PI.

Ben Houston 9 ani în urmă
părinte
comite
25f4e61a3e

+ 8 - 0
src/renderers/shaders/ShaderChunk/ambient_pars.glsl

@@ -2,6 +2,14 @@ uniform vec3 ambientLightColor;
 
 vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {
 
+#if defined ( PHYSICAL_LIGHTS )
+
+	return ambientLightColor;
+
+#else
+
 	return PI * ambientLightColor;
 
+#endif
+
 }

+ 8 - 0
src/renderers/shaders/ShaderChunk/lights_pars.glsl

@@ -140,8 +140,16 @@
 		float dotNL = dot( geometry.normal, hemiLight.direction );
 		float hemiDiffuseWeight = 0.5 * dotNL + 0.5;
 
+	#if defined( PHYSICAL_LIGHTS )
+
+		return mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );
+
+	#else
+
 		return PI * mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );
 
+	#endif
+
 	}
 
 #endif