MeshBasicNodeMaterial: Add lightMap support.#28821
Conversation
📦 Bundle sizeFull ESM build, minified and gzipped.
🌳 Bundle size after tree-shakingMinimal build including a renderer, camera, empty scene, and dependencies.
|
|
|
||
| if ( builder.material.lightMap ) { | ||
|
|
||
| node = new IrradianceNode( materialLightMap ); |
There was a problem hiding this comment.
Maybe we sould move this to StandardMeshNodeMaterial like setupEnvironment()?
There was a problem hiding this comment.
I've asked this myself this as well but then I've realized when I do this setupLightMap() in NodeMaterial will be empty. The basic and standard materials share no common code in context of light maps like the setup of the environment map node in NodeMaterial.setupEnvironment(). Besides, we would have to implement setupLightMap() in phong, lambert and toon not just in MeshStandardNodeMaterial.
The light map handling in MeshBasicNodeMaterial is quite an exception and I thought it's more clear to completely overwrite the standard implementation from NodeMaterial .
That said, I'm not feeling strong about this issue. If you think it's more consistent to follow the approach of env maps, I'll create a setupLightMap() method for each material that supports light maps.
Related issue: #28785
Description
This PR implements
lightMapsupport toMeshBasicNodeMaterial.MeshBasicNodeMaterialshould not react on other source of irradiance likeAmbientLightso it was necessary to addBasicLightMapNodeto handle this exception.