|
@@ -1,8 +1,16 @@
|
|
|
export default /* glsl */`
|
|
|
#ifdef USE_LIGHTMAP
|
|
|
|
|
|
- vec4 lightMapTexel= texture2D( lightMap, vUv2 );
|
|
|
- reflectedLight.indirectDiffuse += PI * lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity; // factor of PI should not be present; included here to prevent breakage
|
|
|
+ vec4 lightMapTexel = texture2D( lightMap, vUv2 );
|
|
|
+ vec3 lightMapIrradiance = lightMapTexelToLinear( lightMapTexel ).rgb * lightMapIntensity;
|
|
|
+
|
|
|
+ #ifndef PHYSICALLY_CORRECT_LIGHTS
|
|
|
+
|
|
|
+ lightMapIrradiance *= PI;
|
|
|
+
|
|
|
+ #endif
|
|
|
+
|
|
|
+ reflectedLight.indirectDiffuse += lightMapIrradiance;
|
|
|
|
|
|
#endif
|
|
|
`;
|