فهرست منبع

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

Ben Houston 9 سال پیش
والد
کامیت
25f4e61a3e
2فایلهای تغییر یافته به همراه16 افزوده شده و 0 حذف شده
  1. 8 0
      src/renderers/shaders/ShaderChunk/ambient_pars.glsl
  2. 8 0
      src/renderers/shaders/ShaderChunk/lights_pars.glsl

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

@@ -2,6 +2,14 @@ uniform vec3 ambientLightColor;
 
 
 vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {
 vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {
 
 
+#if defined ( PHYSICAL_LIGHTS )
+
+	return ambientLightColor;
+
+#else
+
 	return PI * ambientLightColor;
 	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 dotNL = dot( geometry.normal, hemiLight.direction );
 		float hemiDiffuseWeight = 0.5 * dotNL + 0.5;
 		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 );
 		return PI * mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );
 
 
+	#endif
+
 	}
 	}
 
 
 #endif
 #endif