lights_fragment_maps.glsl.js 950 B

1234567891011121314151617181920212223242526272829303132333435
  1. export default /* glsl */`
  2. #if defined( RE_IndirectDiffuse )
  3. #ifdef USE_LIGHTMAP
  4. vec3 lightMapIrradiance = texture2D( lightMap, vUv2 ).xyz * lightMapIntensity;
  5. #ifndef PHYSICALLY_CORRECT_LIGHTS
  6. lightMapIrradiance *= PI; // factor of PI should not be present; included here to prevent breakage
  7. #endif
  8. irradiance += lightMapIrradiance;
  9. #endif
  10. #if defined( USE_ENVMAP ) && defined( PHYSICAL ) && defined( ENVMAP_TYPE_CUBE_UV )
  11. irradiance += getLightProbeIndirectIrradiance( /*lightProbe,*/ geometry, maxMipLevel );
  12. #endif
  13. #endif
  14. #if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )
  15. radiance += getLightProbeIndirectRadiance( /*specularLightProbe,*/ geometry, Material_BlinnShininessExponent( material ), maxMipLevel );
  16. #ifndef STANDARD
  17. clearCoatRadiance += getLightProbeIndirectRadiance( /*specularLightProbe,*/ geometry, Material_ClearCoat_BlinnShininessExponent( material ), maxMipLevel );
  18. #endif
  19. #endif
  20. `;