Inspector lightmap switching after changing UV sets


I am currently playing around with lightmaps to try and understand how to implement them and came across a small issue with the inspector which caused me to scratch my head a bit. It’s not really a bug, just a small nuisance which might cause a little confusion.

I created a lightmap PNG texture in Blender and assigned it to a second UV set for a simple cube mesh and exported the scene to a glb. Loaded it in the sandbox for inspection. Once I had added this lighmap texture I noticed that the sandbox had used the first set of UVs instead of the second set. I looked through the tabs and noticed the option to switch UV sets in the texture properties. I switched the UV set using the slider over to UV set 1 instead of UV set 0. Nothing changed in the render, it was still using the UV set 0 so the lightmap was displaying incorrectly. I assumed something may be wrong with the UVs I exported or something. Tried a few things, but always the same issue. I then tried to switch the lightmap channel off and then on again and that fixed it.

Could you add some sort of trigger on the UV set slider to refresh the lightmap texture channel somehow?

Also should the default behaviour not be to use UV set 1 instead of UV set 0 for lightmap textures?

If these things can’t be changed, perhaps there should be some documentation about these on the lightmapping page of the docs.

On a side note: in general I am finding lightmapping quite confusing! Wish there was some sort of tool within Bablyon to help with the process of Baking lightmaps or some more tutorials on the different ways to go about it. There is not much documentation. If I knew enough I would offer to help write a tutorial, but I know less than nothing :grin:

p.s. I just noticed that the scene is updated if you click on another tab in the inspector. Maybe this is no big deal then…Not worth spending time on…

1 Like

Well I understand the ask but this is not what we want for Babylon.js. Taking CPU and rendering time to do work that can be done offline is a bad idea. You do not want your users to pay the price of baking the lights on every use right?

1 Like

Thanks for this reply. I have some more thought about this, but will start a new topic about lightmaps once I have done some more research in this area.

1 Like