Baking strange issue on Babylon toolkit

Hey there @MackeyK24,
i have a weird issue on exported objects, hope you can figure it out. So i bake an object for our project and i notice than there are “white” zones under things, only on exported ones (unity keep them dark after baking, that make sense because something hidden under something need to be full dark). It is a problem because i see “leaks” of this white color.

Here is the screen from unity and exported one (i’ve moved one object on both to see the current issue). I’m on A48.9X9 btw and parameters are about the same as i always use.

Is it a bug or did i miss something ?
Thanks a lot.

i guess Unity creates shadows or sets black as a default albedo color - i think the meshes either have no material or the material has automatically a color set to rgb 1,1,1

Hi, material is the same as black part surrounding (it’s the same mesh in fact).

Are you exporting it as a .babylon or as a .glb/.gltf? Could we have a playground with the model so we can understand it better?

I’ve made some test and i found out that problem occurs only when objects are very close to each others. On these screens, i move the same part slightly away from the main structure :

Is there a parameter to fix this (maybe a detail level) ? Or this is only something to fix on exporter code side ?

check out the camera minZ value. set it to 0.01 for example

Thanks for your insight but it’s a lightmap export problem, not about camera. Here is two screens, i only remove the two front objects on the second one. We can cleary see that the slightly moved one (upper) have a correct lightmap zone under and the “too close to main structure” one has a wrong white lightmap zone.

Hi @jmax just checking in if you still have this problem.

Hey,
I managed to solve this problem by converting the lightmaps to .jpeg. The light areas become “dark” again as they should, with a big impact on the weight as well (without visual loss).

2 Likes