Lightmapper possible bug need help

Hi ,

I have two scenes.
1 - Entry scene
2- Game scene

Both two scenes baked with lightmapper.At start in entry scene , when i change to game scene , lightmapper works and all is fine in online editor.But when i downloaded my scene and and make self hosted , lightmapper doesnt work and some materials are all white some materials baked.

You can see in this image

i setTimeout the lightmapper for solution but nothing changed.This is a big project but i can reproduce the bug in new project.Do you know how can we fix it?Somehow lighmapper crashes with no errors…

EDIT : By the way here is published link on playcanvas and lightmapper not working on there.
https://playcanv.as/p/hdO5Havu/

Hi @esr_esr,

Not sure why this is happening. I’ve opened your iframe build and run the lightmapper manually which should produce lightmaps if all lights/models are properly set. But it didn’t work.

Are you able to share a sample project to take a look?

Hi leonidas ,
i reduce all assets and reproduce the sample project.Here is the link.

https://playcanvas.com/editor/project/701689

By the way , if you press the enter button , scene will change

Thank you

So I did the following steps:

  • Forked your project to be able to make changes
  • Open the hall1Scene
  • Launch from editor, lightmaps work
  • Push a new build, lightmaps work
  • Download a zip build and run from a local server, lightmaps work

Ok i did exactly what you did and in this case it works.But the main problem is , the main entry scene is entrence scene and initially app start with that scene.In entrenceScene , when you click “enter button” on tv like object , the scene changed to hall1Scene and lightmapper fails on there.I mean problem is changing scene with lightmapper setups…

I think the lightmapper runs automatically only when the Playcanvas app boots.

After that you need to run it in code, after the hierarchy has finished loading and is in place, using:

this.app.lightmapper.bake();

https://developer.playcanvas.com/en/api/pc.Lightmapper.html#bake

Yes , i agree with you and i reproduced that also.I mean , i load the hierarchy and after two seconds i

this.app.lightmapper.bake();

and the result is the same.It seems that some weird bug happens on lightmapper when changing scenes…

1 Like

Right, try posting an issue on the engine repo about it, in case it’s an engine bug:

By the way thank you Leonidas.I will post this issue.And possible solution is lightbaking in 3ds max and i will do it too.Thanks again

1 Like