Download

Shadow optimization 4.12(From Trello)

Hi
I am trying to figure out what was done on shadows optimization side in 4.12
Originally it comes form Ue4 Trello board
https://trello.com/c/Rvb29Gz9/524-done-4-12-per-object-shadow-optimizations-to-improve-performance-of-projects-utilizing-many-stationary-lights
I`ve done some test, and it looks like nothing was changed or I am missing something?
4.11
441c47cc70f6d67fc7402dfe71af76deb97664d0.jpeg

4.12
eac96b1e09f952636f75f1f12d8e6f73ef5c05ce.jpeg

Thx

Your lights don’t seem to cast any shadows in your pic.

It`s because I have 4 lights around object

Can anyone confirm?

I believe it is an optimization for full levels built with dozens or hundreds of stationary lights

It was probably referring to this optimization which is now on Primitive Components.

/** 
 * Whether the whole component should be shadowed as one from stationary lights, which makes shadow receiving much cheaper.
 * When enabled shadowing data comes from the volume lighting samples precomputed by Lightmass, which are very sparse.
 * This is currently only used on stationary directional lights.  
 */
UPROPERTY(EditAnywhere, AdvancedDisplay, BlueprintReadOnly, Category=Lighting)
uint32 bSingleSampleShadowFromStationaryLights:1;

We use this on Paragon for all minion shadows. It gives much cheaper shadow receiving for Movable components with a stationary directional light.

Oh it is for stationary directional light only, now it make sense, I used to think it refers to all stationary lights since trello board says: “many-stationary-lights”
Thx

The directional light only thing is nasty. It can be made to work with any number of stationary lights, I just haven’t gotten around to it yet.

Why Unreal developers treat point lights and spot lights as stepchild anyway ?
Directional lights have much more features for anything.

I have noticed that a great optimization (dynamic shadow caching) on dynamic shadows is commited on master branch, but it is only restricted to point and spot lights.

However:

Since MaxCascades only affects directional lights, could I interpret it as a caching mechanism will come out later for directional lights, just as CryEngine did?

We don’t have any plans to implement caching for CSM at the moment. It’s quite a bit more complicated than what I did for point and spot lights, as CSM is view dependent and constantly moving around, you have to scroll the contents of the CSM from past frames. The real dealbreaker IMO is the lack of ability to handle World Position Offset animation, which most outdoor scenes are going to use abundantly. You can render all the vertex animated stuff every frame and combine it with the cached depths of static stuff, but I don’t think the savings will be very good since vertex animated meshes are what costs so much in shadow depth passes in the first place. Anyway, it’s still a good optimization, just not one we will be tackling soon.