Dynamic Lighting Vs Baked: Which one is better?

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?

What say you guys?

What say you guys… ?

Just read the reference manual first :slight_smile:

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) :).

Thanks for the response. Ive been researching it but just wanted to hear from people who are using it. Thanks

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).

Not just the potential, IMO it is very difficult to make it look as bad as real time.

Well if you set bounces to 0, use low-resolution maps, and only use them in Single mode, then it’ll look worse.

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.

what if im building something like an outdoor ruin and all i need it sunlight? Would dynamic work better than baked?

Again, it depends how you set it up. For static lighting, there’s not reason really not to bake lighting.

Probably not. No ambient occlusion, worse performance on the shadows, no light bounces, etc. Generally, you want to use baked whenever possible.

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?

  1. Bake the light.
  2. Leave the light’s realtime functionality on.
  3. ???

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

Read this:
http://docs.unity3d.com/Documentation/Manual/LightmappingInDepth.html

Thanks. You guys are all a big help. Thanks for the responses

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. :wink:

1 Like

thanks for the feedback. I believe i have a much clearer understanding of Unity’s lighting system

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.

This is the baked lighting output:
http://virtualplayground.d2.pl/WebGL/st15/galleries/gallery_D36_nk/

This is the precomputed realtime lighting output:
http://virtualplayground.d2.pl/WebGL/st15/galleries/gallery_D36_nkRealtime/

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.