Why Nanite lost shadow when I use PDO blending in Unreal Engine 5.1

Hello!

I heard that nanite objects support the use of pixel depth offset in ue5.1. PDO did work When I tried it! but at the same time, nanite objects lost their cast shadows. How can I solve this problem?


Before Using PDO

After Using PDO
The main lights in this scene are sunlight and skylight
Many thanks for any time and help

same problem.have you solved?

Currently also in the same boat. Any solutions found yet?

It’s a tradeoff unfortunately. You are literally offsetting the pixel depth, as the feature name says. So when the light renders its projected shadow map, it doesn’t project it onto the surface, but under the surface since the depth is offset. This makes the shadows disappear. I am afraid it was that way long before nanite.

I see. Thanks for the answer. Is there a common practice to get around it? Getting a blend between assets and not losing the casting shadows. I’ve seen pdo used alot before so surely a workflow is there?
Or maybe pdo is the wrong approach

It’s not a wrong approach, but it comes with limitations. The issues usually don’t show in the soft diffuse lighting, but only arise once there is a sharp directional light around.

More modern alternative of blending the assets together are virtual textures. There are some tutorials on the topic, but that approach also comes with some limitations.

I didnt know about the difference between diffuse or sharp light. Pretty interesting. Someone suggested i take a look at the shadow pass to bypass the problem. But so far that doesnt seem to be quite successful https://i.imgur.com/wqyvHzA.jpeg

Ive seen virtual textures but from what i can gather it utilizes a landscape meaning that has to be present. And what im trying is to blend assets with each other and not a landscape

You do not need to utilize landscape. It can be any mesh. But yes, it’s not a good choice for Blending assets with each other. Instead, a set of actors is meant to be blended with some other set of actors, which have been captured into a virtual texture beforehand.

As for the shadow pass switch, you’d actually use that in the PDO slot, if it works. So that the PDO would be 0 for shadow input and the multiplied dither for the default input.

1 Like

In case other people are interested, this seems to fix it for me:
Try the console cvar “r.Nanite.ProgrammableRaster.Shadows=0” and check if that fixes your issue.

/e

This breaks Nanite masked material shadowing…

2 Likes

Apparently Nanite also has issues with the material node “Shadow Pass Switch”. Just letting everyone know in case you come across this problem.
You can either disable Nanite on your mesh and properly use the shadowpass node again.
Or do the “r.Nanite.ProgrammableRaster.Shadows 0” console command like kaffeekranz suggested.
(However this removes nanite shadows for stuff that is using “masked” shading like foliage cards)

Kind of hoping that Nanite in 5.2 might fix issues like this! :slight_smile:

2 Likes