Object turns white when runtime lightmapper is enabled

Hi i’m not sure why my models turn white when i turn on runtime lightmap on objects in the scene with a generated UV1 in the editor. Some materials can display texture+lightmap while others just display white (lightmap only, no diffuse color).

editor scene link: PlayCanvas | HTML5 Game Engine

Please help. Thanks.

Hi @yapdakilla,

Not sure if that is the issue, but I can see that models are loading async in the background while the camera is orbiting the scene (preload set to false). Which makes sense to provide fast loading times. Though that means also that the models aren’t in place to be rendered when the light mapper runs.

Could you try setting them just for a test to have preloading enabled?

If that is the issue, I’d imagine a solution is to run the lightmapper at a later point when all models have loaded and are in place. There is a number of posts on how to do that on the forum.

EDIT: I missed that you said your issue is in the editor and not on runtime, I will let you know if I find something on that.

1 Like

Thanks @Leonidas, I’m wondering if there’s a limit to number of materials per object that can use runtime lightmaps as some materials can display the runtime lightmap + diffuse. Or maybe it’s a bug?

Otherwise realtime lighting is going to 2x my draw calls. :frowning:

1 Like

By the way where should I report this bug? Thanks.

You should submit an issue to the engine repo, this seems most likely an issue with the lightmapper class included in the engine.

Regarding your question I haven’t tried complex models with lightmapping yet, but taking a look in the shader chunks used to add the lightmap factor I don’t see any limit on how many materials you can have per object or anything. Lightmaps are applied per material using the UV1 coords provided by the mesh.

Here are some good practices on how to properly unwrap models for lightmapping, if you are doing them in your modelling app. Though I imagine you are already aware of them, pasting them for reference:


Has there been any developments with this bug? The same thing is happening to me.

Did an issue ever get logged on the engine repo?