How to change lightmap intensity at the material level & not texture level

I have a texture atlas that stores lightmaps for several materials. I’d like to change the intensity of light from the lightmap texture with a slider for a single material. I can think of one way of doing it. By changing the material.lightmapTexture.level.

However, this changes the intensity level for all materials using that atlas. Any way to go around this?

This is not supported at the moment. we would need a lightmap intensity parameter added within the material.

Would you want to create a PR for it ? Otherwise, you may be able to customize your materials with NME.

1 Like

@sebavan I’m reasoning about the pros and cons of using the NME in this case. Especially from a performance perspective. Is the following statement correct?

“Every material generated from NME is a custom shader and all such custom shaders have to go through the shader compilation step which may significantly delay first paint of the scene?”

Don’t know if it’s any good for you but I’m using a very simple work-around for this by cloning my texture (lightmap or env) a number of times and having a different level set for each (I went up to 8 without experiencing a negativ impact on performance). Then, I simply assign one of the clones to my materials. The good thing here is that if I change the level for one type of materials using this, I can easily keep with ‘consistency’ since all my materials of the same type will get the change. In other words, how to turn a downside into a potential advantage :grinning:

Edit: I’m also using the names or id to add identifiers forming group of meshes or materials and batch assign the wanted texture (and level) to them. Honestly, might not be very sexy :grinning: and requires a bit of a setting-up but then works nicely (at least, for me.)