vircadia-web icon indicating copy to clipboard operation
vircadia-web copied to clipboard

Lightmaps Fail when more than one glb in the scene has them.

Open Aitolda opened this issue 11 months ago • 3 comments

If you have two glb files loaded and both contain lightmaps, one of them will fail. I strongly suspect this is because of having more than none vircadia_lightmapData object in the scene.

Aitolda avatar Mar 03 '24 21:03 Aitolda

It appears that whatever lightmap loads first tends to work, and the second will not scale properly, but still be applied to the object. I'm assuming at the moment that the smaller sized glb will typically finish first, and therefore be the one that loads correctly, but this is speculation.

Aitolda avatar Mar 15 '24 15:03 Aitolda

On closer inspection, the issue appears to be related to matching lightmap names/materials between multiple glb files. One solution is to have the name randomized, either directly in vircadia web or within the blender plugin.

Aitolda avatar Mar 16 '24 17:03 Aitolda

I've created a workaround in the unity-to-vircadia plugin that simply assigns lightmaps random 16 digit strings as lightmap names for the time being, however I think I'll leave this issue open as it's possible it can be adjusted so this is no longer necessary at some point.

Aitolda avatar Mar 21 '24 14:03 Aitolda