Hi ! I am working on a game where players can create their own race tracks out fundamental elements like cubes, a bit like Minecraft does. However, the lighting looks crap, because it is not baked (I assume). I can’t perform baking from the editor since the content of the race track only exist at run-time. I can also not bake elements individually into their own scene as I saw in another suggestion, because the lighting depends on surrounding elements so it doesn’t really make sense.
So my question is : is there anything in the Unity API that allows performing baking at runtime ?
I am fully aware that baking can be a greedy process that can’t be done while playing without making the game run very slowly. But I could perform the baking when the user saves his race track or let the user decide when to do it. The baking info would then be stored into the same file that defines the content of the race track.
Thanks.
EDIT : I found : Lightmapping.Bake(); but this doesn’t seem to affect the graphics, for some reason. I’ve also set my blocks as “static”, but doesn’t help.
EDIT : I’m adding my lighting settings as attached file
That’s an editor only function. It either won’t do anything or will error if you try to call it at runtime.
If you want baked lighting you’d have to write it all yourself, or look for an asset on the store that can do runtime baking. I know there are a couple of light baking assets on the store to replace the built in one(s), and some may be capable of working at runtime.
Thanks for the help guys. I will look into this SEGI thing, cause my game really looks ugly right now.
EDIT : Tried SEGI and it looks nice. I struggled a moment to get it working in my existing project, but once it works it looks nice. It’s greedy in terms of performance though. I can gain 5 FPS by disabling the “Update GI” thing, which I assume updates GI in real time, which I don’t car about sicne my scene is mostly static, but still greedy.
I am also interested in this feature. I think it is very important for games where the user can create their own levels. With just 15 minutes the user could calculate a very nice global illumination (with a high-end pc). I am working on a level editor for interior design (Archviz) and I need to achieve the best visual quality.
I have read on another post about command line option to calculate the lighting, but I don’t understand if this is possible.
Do you know if Unity developers are interested in developing this feature in the future?
Unfortunately Unreal does not support runtime baking. Your best bet in Unity would be the aforementioned SEGI or maybe POLM at some time in the future when it bakes GI.