How to bake a 3D scene from three js

Hello guys,

I want to bake a complete 3D scene edited in three js. Once the user sets all the position / scale / rotation of a set of models, I want to bake the full scene in a server side (just an idea) and then, once the bake process it is done, load the lightmaps in three js.

I want to know If this process is viable, and which software should I use in that case. I know how to bake the scene in Blender, but this process is manual, and I want to do something similar in an automatic way.

I would like to know the kind of structure that I should continue with this project,

Thanks!

There is an example in the repository about progressive light maps. Maybe it’s a starting point for your use case: three.js webgl - progressive lightmap accumulation

You might consider using an intermediate (meta) language, as is done for Threeml.org. In each example page you can press F2, and download the threeml code that can reproduce the page as is, having the actual objects positions, rotations etc.
Internally the script recursively checks the scene and the objects within it.

Similarly you could create a json or xml from this, post this back to the server, and use this baked file there to regenerate the scene as edited by the user.

Thank you bot for your answers.

I didn’t clarify that there’s two parts here:

  • One where the scene it is been edited
  • One where everything is static and we can see everything with the lights baked.

My question was related to the second one. The idea is to export all the entire scene (let’s say in glb), use one software (?) to bake the scene and get the lightmapping and then, for the second part load that glb + lightmaps.

Something simiar as this example: Swivel

My question is basically which kind of software should I use to reproduce these lightmap textures in a server side. Do you have any suggestion?

Thanks!