Hi everyone. For my new job I have to do something I never did before: I have to export my models (interiors, mainly) to a viewer for real time navigation thru the scene. I cannot have interactive lights because they are too heavy.
My idea was to have normal PBR materials - so I still have bump, metalness and glossiness for example - and then bake the diffuse pass with shadows, direct and indirect light and use it in the emission node (the viewer I must use has only one light, a sun, which creates shadows I want to avoid them on my model)
I have then some questions:
is this the usual way it is done in applications like games? If not, can you suggest me a better way (or link me a video where they do it the right way)?
somewhere I saw that lightmaps are actually used for this type of applications, instead of baking the lights and shadows with the diffuse color, but I couldn’t find a way, inside blender, to replicate the results of the combined pass. Just multiply/add the light map to the diffuse channel doesn’t give me che same result. Is there a way to do that?
the viewer I use is based mainly on glb. How can I setup the lightmap in blender to be properly exported and displayed in the viewer?
when I export the combined texture, the highlights are dull or clipped. Is it because I’m not saving as 32bit image?
Thank you very much for your help
Yes, this is quite standard. Game engines are even usually equipped to do it because it’s so common.
If they don’t have lightmap abilities, they usually have some other form of baking, like irradiance volumes. But you will have to see what your viewer can do. If it doesn’t have any way to do global illumination, textures will be the only way.
If the viewer supports only one light, there isn’t really a better way. If the viewer did support multiple lights, you could have lightmapped only the indirect light and let the viewer handle the direct lighting. This produces better results, because it allows dynamic shadows, reflections and bump from the light sources. If you have to bake everything though, you lose those effects in the bake.
Bake the diffuse lighting without the diffuse color. Then, put the result of that in the emissive channel, not the diffuse. You will have the remove the original light source, or you will get double lighting. The lights you bake will be limited: they won’t cast direct speculars and won’t have bump beyond what your texture resolution allows.
Edit: you would need to multiply the color texture with the baked lighting. This will allow you to keep the original color texture intact while having a lower res light bake.
If the viewer doesn’t support complex materials, only then would you include the diffuse color as part of the bake, but it’s better not to if you want your textures intact.
When exporting between software, there isn’t a perfect way to transfer materials, because each renderer has its own unique material system. The best you can do is plan your materials so they are easy to re-create (everything baked to the most straightforward set of PBR maps).
Exactly. Lighting is brighter than what an 8-bit texture can capture. Though you might not need the full 32-bit, 16 might be enough.
Thank you etn249, this helps a lot. In the meantime the viewer i’m using has been terminated so i’m searching for a better solution that hopefully will allow more flexibility. Thanks again