
Overall, it's doable, but with a lot of coding and it is not the best solution to the problem.

Runtime baking would also require a modern Nvidia GPU from your players and it would be up to you to ensure that builds don't go out of memory. You would also have to manage scene exporting, atlas packing and texture importing manually. Technically baking can be invoked at runtime, but there is no finished/documented API for that. baking logic only works on editor side, and builds can only display baked lightmaps, not generate new ones. There is a Make Exportable script to do that if you want.Ĭurrent Unity edition of Bakery is for editor use only, i.e. To properly export the scene, you'll need to generate new unique meshes with scale/offset baked into their UV buffers. The purpose of this is to save memory: multiple instances of the same mesh can have the same UV buffer, but apply this scale/offset in the shader instead. Simply using a common FBX exporter won't work, because Unity also has a per-renderer UV scale/offset for lightmaps which is not exported. If you can't pre-unwrap the whole scene, then you'll need to export the updated geometry with new UVs. This way the resulting lightmaps will have 100% original UV match. Put Lightmap Groups with Original UV mode to these parent objects. Group objects sharing each atlas under a common parent object. Fully unwrap your scene in your modeling package before baking (not individual objects, but the whole scene, in one or multiple atlases). Bakery is based on OptiX, so same rules apply:Īdditionally, if you are baking in RTX mode, all GPUs should be RTX to work together.Ĭan I export lightmaps from Bakery to another program?

Is it progressive? Does it show lightmap updates in real time?Ĭan Bakery take advantage of multiple GPUs?
Bakery unity forum windows#
But for using Bakery you will need a 64-bit Windows (7+) machine with a Nvidia (6xx or newer) card. You can ship games with Bakery lightmaps on any platform. Yes! Bakery supports combining real-time direct lighting with baked indirect, as well as subtractive and shadowmask modes. 9 What should I change in Unity Lighting window when working with Bakery?.7 Can I export lightmaps from Bakery to another program?.6 Can Bakery take advantage of multiple GPUs?.5 Is it progressive? Does it show lightmap updates in real time?.

This is how mixed lighting works in Unity - having Bakery components only equals to using built-in lightmapping with all lights set to "baked" mode.īTW take a look at the example_shadowmask scene that comes with Bakery. When it's on, shadowmasked lights will work as dynamic close to camera but fall back to previous mode when your scene's shadow range ends. When it's off, dynamic objects will cast shadows that mix properly with baked lighting, but won't receive baked shadows. You can also try with "distance shadowmask" checkbox on and off. On top of that you get normal mapping and specular from Unity lights without paying for real-time shadows from static geometry (they are still baked). You should get the same baked lighting, but dynamic objects will also properly cast shadows. In main Bakery window, set render mode to "Shadowmask".

Enable the "Bake to indirect" checkbox on lights you want completely static (not affecting dynamics). Enable the "Shadowmask" checkbox on Bakery components on lights you want to interact with dynamic objects. Press "Match real-time to lightmapped" on Bakery components to copy the values into Unity lights. Add Unity lights to Bakery directionals and points (the ones you want to be semi-dynamic). You can use mixed lighting to integrate them into the baked scene: Click to expand.Dynamic objects are only affected by probes and Unity lights, yes.
