Pixel Depth Offset - self shadowing issue

For anyone, looking for the solution, the following needs to be done:

EITHER

  1. Arrange extra space in gbuffer to store pixel depth offset with sufficient precision.
  2. Modify base pass (AND/OR pre-pass) to output pixel depth offset to extra render target/channel from previous step.
  3. Modify shadow projection to subtract separately stored pixel depth offset value from scene depth before comparing with shadow depth.

This will incur significant rendering cost increase and will produce occasional artifacts, where pixel depth offset was large enough.

OR

  1. Modify shadow depth pass to write depth at an offset.
  2. In case of parallax occlusion mapping, implement it differently for shadow depth passes using pass switch material expression.

If first approach cost was already large, this one will have simply insane overhead.

ALTERNATIVELY

Work with shadow bias and other shadow settings on your lights and keep PDO low.
This is the only practicable way of dealing with it.

Anyone who thinks otherwise is welcome to try.

3 Likes