Im new to Unity and im trying to wrap my head around dynamic vs baked lighting. What i understand so far is that with dynamic lighting everything is lit in realtime and looks better but performance can take a bit of a hit. Baked lighting turns your lighting into textures thus not delivering realtime shadows. Im i correct so far?
My question is…is it possible to do an entire game with just the dynamic lighting? If so then why used Baked lighting? Can they both be used together? If so then what would be the benefit of that?
Yes, it is possible to do dynamic lighting, put performance will go down the drain VERY fast if you use all pixel lights.
Baked lighting can be used with dynamic- better perfomance for static objects, and dynamic ones get lit in realtime (generally by faster vertex lights)
Baked lighting has shadows in Unity Free, but doesn’t pick up normal maps; can’t comment on Pro as I don’t have it (yet) :).
It’s not that dynamic necessarily ‘looks’ better, it’s that it’s… well… dynamic. Lights can move and change. Objects can move and change and have their lighting update. As we’re in the business of making games rather than static art demos, dynamism is pretty important.
Baked lighting actually has the potential to look better, as the baking process can simulate the behaviour of light in a way that’s too expensive for realtime/dynamic methods (e.g. simulating the way light bounces off surfaces).
(Oh and that’s using Directional Lightmaps / RNMs of course).
Dynamic lighting recalculates the lights quite often, so it needs to cut corners to look nice.
Baked lighting has all the time in the world, so it can make much more complex lighting.
It depends on the game, but I think you can just use both without major issue.
Well I think dynamic lighting actually looks better unless you are running on mobile or have an artist to tweak it and constantly rebake the scenes to get it to look good.
Ok. sorry if im asking the same question again, got it. Now what about the controlled character? How would i light the player? And could you give me a good example of when to definitely use dynamic lighting?
oh…so even if i bake, the baked lighting will still affect objects moving in the scene? Shadows etc?
and my third question was basically asking if i should use baked or dynamic for something like candles and torches and things that will be interacted with
Rule of thumb: if your lighting has to change (day/nighttime or shooting out individual lights - things like that) you need dynamic lighting. If your lighting situation does not change or you want more performance for a pretty realistic lighting situation with Ambient Occlusion, Light Textures and indirect lighting/bounces then you should rather go for baked lighting. You can mix the two together but only in Unity Pro does it make sense, really because then you can blend between indirect lighting in the lightmaps and shadows from the realtime lights in the near clip range of the camera while the far clip range shows static baked shadows.
The documentation explains this very understandable and in detail. Just play around with the settings and modes a little and you’ll see how things work. Also do not forget to check ‘create lightmapping UVs’ for your imported assets.
I have just made some tests in WebGL.
I have just a simple walkthrough template, which is meant as a starting scene with a number of scenenes loaded from assetbundles.
I am usually using baked lighting for these scenes, but this time I tried to make a precomputed realtime and baked lighting versions of one of the scenes in order to compare them.
The template outputs a screnhot gallery and webgl player.
As one could expect, the quality of baked lighting version is much better than realtime. On my PC I am getting around 50 fps for lighting version and only 3 fps for realtime.
On the other side the realtime assetbundle size equals to a third of the baked bundle size and is a bit above 2 megs.
I think baked lighting option is the best choice for static walkthrough scenes like that.
Most of Unity tech demos use prebaked realtime, but I guess that is because they are dynamic.