How to set up coordinatesIndex of LightmapTexture in code?

One lightmaptexture was loaded to pbrmaterial in my code, when i tried to change the corrdinatesIndex, it didn’t work, nothing happend to texture UVs. How to activate this property?

We will need more details about your scene to help you, but in the meantime you can check how I did in this scene: https://playground.babylonjs.com/#ADPQFC#9

Please check my scene: https://playground.babylonjs.com/#ADPQFC#116

Hmm I don’t understand where the issue is :astonished:
Here I tried to access coordinatesIndex through materials, and also just switching from 0 to 1 ('cause meshes in this playground only have 2 UV chans) but it doesn’t fix the thing:
https://playground.babylonjs.com/#ADPQFC#117

The coordinate index is currently not smthg dynamic: https://playground.babylonjs.com/#ADPQFC#118

let me take a look if it is easy to address but as it changes pretty much never in code I all go for perf first

3 Likes

OK, I was just succeeded by… cloning the texture, but not sure if it’s good for VRAM :sweat_smile: https://playground.babylonjs.com/#ADPQFC#119

[edit] fixed using sebavan dirty trick :slight_smile: https://playground.babylonjs.com/#ADPQFC#120

Thanks sebavan!

that’s a good way, just need to dipose the last texture

nw it will be fixed in the next nightly in about 1 hour

2 Likes