change light from static to stationary = half framerate?

Hi there,

I’ve been working with static lights in my VR scene so far. But now that I am introducing movable objects (cubes), I believe I need to set the main scene light (blueish point light high above the ground) from static to stationary, so that the movable objects (A) receive dynamic shadows from the tree and (B) are not completely black.

The problem is once I do that the framerate drops from 90 to 45. Can this be? Can one single stationary light cause such a frame drop?

Any idea how I can tweak the light / shadow settings so that I can keep the 90 fps with the tree casting dynamic shadows on my movable objects and on the floor?

Here are two screenshots to better explain what I mean:

1.

All static lights, movable objects pitch black, no dynamic shadows.

90 FPS

2.

Just one stationary point light in the sky, movable object receive light and shadow, ground receives shadows.

45 FPS

Side question: why does my floor mesh suddenly look to spotty?

Any hint would be appreciated!

Thanks very much,

I just set the point light’s mobility to movable (even though it doesn’t really make sense for a moon):

  • overall shadow quality is much better
  • spotty artefacts on the ground are gone

Still, I have the problem of the aggressive framerate drop.

Two things:

  • The cost of a non-static light is proportional to what it affects. If you have a non-static light which is affecting your entire level, then yes, it can be hugely expensive.

  • Your framerate dropping from 90 to 45 FPS doesn’t indicate that your scene got hugely more expensive, it only indicates that it caused your framerate to dip under 90FPS. If you were running at 90.1 FPS and your change causes you to dip to 89.9 FPS, your project will start running at 45FPS because of VSync.

While it’s certainly possible that you might be able to get things running at 90 FPS again, I’d take a harsh look at whether you really need dynamic shadows in your project. High quality, dynamic shadows are hugely expensive, and you’re going to have to sacrifice a lot to get a VR project running at framerate. At the very least, consider faking the dynamic shadows with cheaper, non-lighting options, such as decals. Failing that, if your heart is set on having dynamic shadows, consider using a directional light instead of a point light so you can use cascaded shadow maps.

Okay, thanks, I think I understand.
I guess dynamic shadows are for smaller lights only, right? Like torches.

So…

Scenario 1:
I disable dynamic shadows alltogether. How do I prevent movable objects from turning pitch black (s. first screenshot).

Scenario 2:
“…faking dynamic shadows with non-lighting options, such as decals.”
How would I do such a thing?

Scenario 3:
Use a directional light instead. If I do that, my whole scene turns bright, but I only want the light to be in the center (under the tree). Is there a way to have the directional light only affect the center?

Thanks again!

I’d have to see your setup to tell why your objects are black. Static lights should have no problem affecting dynamic actors unless you’ve done something weird. The first thing I’d check are the lightning channels on your object and the lights in the scene to ensure they overlap.

The decal route would essentially mean authoring a 2D texture of the shadows which are being cast into the area from the perspective of the light. (Doesn’t need to be exact. Just like, outlines of tree branches. Something like this: Tree Branch Black Shadow Royalty Free Cliparts, Vectors, And Stock Illustration. Image 31543196.) Then add a deferred decal which projects that texture into the area affected by the light, aligned to the direction of the light. Make sure the decal affects dynamic objects.

Directional lights affect the entire scene. I’d thought that’s what you were after. If you just need a small spot on the ground, you may see some performance benefits from using a spotlight with a suitably restricted outer cone since it should affect fewer objects. I’d still try to stay away from dynamic shadows and find an alternative if you can, though.