Ray Traced Shadows With World Position Offset on Instanced Static Mesh or Foliage

WorldPositionOffset works for great Ray Traced Shadows/Reflections on a static mesh. (Have to check Evaluate World Position Offset in mesh rendering section).

However, using the mesh in an Instanced Static Mesh or as Foliage breaks it shadows and reflections.

This is critical for foliage that uses wind among other effects.

Much thanks for any feedback / help with this

This needs to be fixed/reworked. The WPO evaluation check should be moved inside the actual mesh or material properties, not on the placed mesh.

I just spent 2 hours trying to figure out why my grass looks weird and shadow doesnt register WPO… All because of 1 checkbox…

1 Like

Agreed its difficult to find… but more importantly, it doesnt work with instanced static meshes, hierarchical ISMs, or foliage at all…


Is this a bug or have they just not implemented it properly yet? I’ve been messing around with it thinking I must be doing something wrong as shadows are there with wind in the preview but static in my scene. Or is the only option CSM…which seems to have other problems with foliage.

Yes, this one is also driving me nuts. Really needs to be a setting inside the actual mesh and turned on by default when ray tracing is enabled. Really needed this to work for ray traced shadows in my scene, now I have to revert back to shadow maps. :confused: Is this fixed in 4.27?

I doubt this will be changed (at least not until they add a raytracing LOD bias), I assume it was intentionally set up this way because it costs a lot to evaluate WPO for raytracing.

Doesn’t the nvidia raytracing branch actually do this?
I was under the impression it did (based on the post of the nvidia employee that posts on here some times).

Going deeper into this topic I found out that r.RayTracing.Geometry.InstancedStaticMeshes.EvaluateWPO 1 solves the problem, at least partially. In my cases in fact it makes raytraced shadows react to WPO, but the shadows are misplaced, like a lot!
Take a look at my example, have anyone found a way to fix a similar problem?

Animated video showing my case:

Ok, I found out what was wrong, at least in my case. Command (…).EvaluateWPO works fine, shadows are shifted because the environment level was on a sub-level which was offset in Level Options. After I zeroed sub-levels offset, raytraced shadows of objects that evaluate WPO offset jumped back to the proper place. It seems like a bug to me, I think that evaluating WP) should include sub-level offset.

About evaluating WPO in general, there are checkboxes, both in static mesh components and in foliage.

In the case of the static mesh component, all you need to do is just check the Evaluate World Position Offset checkbox.

In the case of foliage, you need to change editor mode to Foliage, select all foliage instances and look for Evaluate World Position Offset checkbox and check it.