Download

4.24 - 26 RT shadows ignoring world position shader

Hi,
I’m having an issue with rt shadows for directional light where the shadows ignore the animated leaves on my trees, the leaves are animated using world position offset in the material.
What ends up happening is a weird look on the trees and static shadows on the floor.
Cascade shadows work perfectly but are more taxing on the hardware.

Screen shots wont help as this is only visible in motion.

So is there a way to make the directional light take these materials into account?

Thanks.

For raytracing, WPO has to be enabled per actor.

In your static mesh actor properties there is an option called “Evaluate World Position Offset”, enable it and it should work.

No idea how this will behave on foliage instances.

Hmm interesting, it works for single trees, but Im using foliage, any suggestions there?

Use actor foliage instead of static mesh foliage:

  1. Make a new blueprint class that inherits from static mesh actor
  2. Turn evaluate world position offset on in the static mesh component, set the mesh to your desired mesh
  3. Create an Actor Foliage class that uses your new class as its base class
  4. Use the actor foliage with the foliage tool

I’ve used this trick before in order to use settings that are typically unavailable to foliage, such as indirect distance field shadows. I tested it just a second ago and it works. Can’t vouch for the performance in dense scenes though. I have no suggestions otherwise, the documentation makes it seem like this is a hard limitation.

■■■■, that is a great idea (I will need to try it to see if I can actually do it)
But I tried several times to use the distance field stuff and at the end I gave up.
Will try this.

What I posted works for raytraced shadows, don’t need to use distance fields (unless you want to)

I only brought it up as an example of how you can use actor foliage to get around the limitations of the regular foliage instances.

Got it to work!!
Fantastic man! Awesome, I will do some testing regarding performance and will post back.
Also, will probably use distance field indirect shadows as I had to create a shader-based AO to simulate it since it didnt work before. nice!!