Pixel Depth Offset and Contact Shadows

Hi

I have been looking into contact shadows

https://dev.epicgames.com/documentation/en\-us/unreal\-engine/contact\-shadows\-in\-unreal\-engine

It has a section talking about using Pixel Depth Offset so then the contact shadows pick it up and cast shadows

I can’t for the life of me get it to work proprely, it always looks broken

The idea being that you should be able to use a height texture and then you will get shadows being cast on it as it modifies the depth buffer to do so.

Is there any really basic sample available showing a setup where it is working?

Thanks

Hi,

I attached a quick example project containing a plane with a parallax occlusion material that uses the pixel depth offset parameter. Just open the NewMap level and hide or turn off the DirectionalLight.

I believe these are the most important settings:

On the PointLight:

- Contact Shadow Length: 0.1 (too low values increase stepping artifacts)

- Contact Shadow Length in World Space Units: false

- Contact Shadow Casting Intensity: 0.98

- Contact Shadow Non Casting Intensity: 0.98

On the plane:

- Contact Shadow (under Lighting > Advanced): checked

- Dynamic Shadow: unchecked (if checked, the geometry will shadow itself because of the pixel depth offset and cause artifacts)

Please let me know if that helps or if you have any further questions.

Sam

Hi,

I added it as an attachment to this case (at the top right of this page), but I’ll add it here to this message as well in case that doesn’t show up.

The setup of the parallax occlusion material:

[Image Removed]

And the result:

[Image Removed]

Sam

No problem. I will close the ticket, but feel free to open a new one if you encounter more issues.

Sam

Hi

I cannot seem to see any attachments on your message

This has been super useful, thank you so much