Lightmaps with dynamic lighting and trees

hi there,

I have a quick workflow question regarding foliage/trees and dynamic lights in your scene.

so far I’ve always baked all the lighting and that worked like a charm (as expected).
I just added some trees into my level and when I bake the lighting as ususal all I get is static tree shadows (of course), which looks kinda weird.
so instead I changed my main directional light to dynamic to get really nice moving shadows.
it looks great, but I dropped a new mesh into the scene yesterday and I didnt get prompted to rebuild the lighting as usual. that leads to the conclusion that now all the lighting in my scene is calculated on the fly.
is that a normal workflow for foliage? because to me it seems it must be super heavy on GPU/CPU to have the whole level calculated dynamically :open_mouth:

is it possible to bake only parts of the level and have only the areas affected by tree shadows calculate dynamically?

on that same note I wanted to quickly ask about moving lights in the scene.
If I had a room with a moving light, but all the other rooms had static lighting… is it possible to have only this one room calculated dynamically and bake down the rest of the lighting?

just asking, because I want to be as efficient as possible and not run into massive performance problems further down the line :slight_smile:

thanks a lot!
chris

If your light is set to dynamic (movable) it means it will be calculate in real time only, lightmaps won’t be affected by that light. As a result, adding new objects in the scene won’t require lightmaps being baked unless those objects are affected by other lights that are not movable.

You can set the threes meshes to be ‘movable’ if you don’t want them to have lightmaps on them.

Regarding mixing movable and non movable lights question, yes you can do that, that’s how most game do, you don’t want all lights dynamic but you may want to have some of them dynamic.

hi bigzer!

thanks for the swift response :slight_smile:

If your light is set to dynamic (movable) it means it will be calculate in real time only, lightmaps won’t be affected by that light.

ok but in order to get my trees to shadow on my environment I had to set the directional light (sun) in the scene to dynamic. and that light kinda affects everything in some one way or another (even the rooms inside, with light bouncing around). sooo would that consequently mean that now all my lighting is dynamic?


one thing that I didnt quite understand was:

let’s say (as a drastically simplified example) you have a tree + table under the tree and a chair.
all have lightmaps.
the table is in the tree’s shadow. the chair is not. the tree leaves are moving.

  1. I bake the lightmaps, the tree will still be moving but the shadows on the table will be static
  2. I set the directional light to dynamic, the shadows will be moving.
  3. if I hit ‘build lighting’ it bakes the shadow onto the table and the lighting onto the chair.
    … that’s great for the chair, because it’s in full sunlight anyway, but not so great for the table, which needs to have moving shadows.

I think I’m just a bit confused right now when it comes to baked lighting and objects that produce moving shadows.

how would you approach that?

thanks! :slight_smile:

First of all I think its better to call the light status as it is: Static, Stationary or Movable.

Static = Will only be shown on the lightmaps
Stationary = Will be shown the lightmaps but you can change the color and intensity of the light and lit objects get specularity effects. Those lights will have lightmaped shadows when they are far from camera, if you are close they will cas real time shadows.
Movable = nothing is baked at all, the light its 100% real time from far or close

Now, If you build lighting in a scene where there’s only movable lights, nothing will get baked.

If your object is movable it won’t get lightmaps BUT typically real time shadows are only rendered within a certain radius (you don’t want to calculate shadows that are super far from you), so in case of movable objects if you go away they will not have shadows after a certain distance.

Same goes for static objects, when you get close to them you will see them move if you used Stationary lights, when you get further away the lightmaps will take care of the shadows and your performance will stay acceptable. :slight_smile:

hi again :slight_smile:

thanks so much for taking the time to write this down… quite confusing x)

so in the tree/table/chair example above… would you set the OBJECT ground + table to movable to get the moving tree shadows, instead of setting the directional light (sun) to movable?

sorry man if I sound like an idiot right now haha.

the thing that I don’t get is that I have rooms with windows;
they have static lights inside, but (in theory) a dynamic light (sun) coming through the window.
the sunlight isn’t really moving in reality, but I might have to set it to dynamic just to get moving tree shadows outside.

x_x

Hey HSbf6,

To have your moving tree shadows render inside through your windows, yes your dominant light casting the shadows will need to be dynamic.

hi andrew!

thanks! but does that mean that my whole scene has to be rendered dynamically from that point on?
because the directional light is the sun; it kinda affects pretty much everything.
can I still use baked lighting then?

thank you

Stationary lights allow baked lighting and dynamic shadows! And you are quite welcome :slight_smile:

ok thank you andrew! appreciate the swift response :slight_smile: