From licensee:

"Expected behavior (as seen in UE 4.25...also confirmed in 4.24):"
[Image Removed]
"Actual behavior in UE 4.26:"
[Image Removed]

Report from a licensee:


In VR when using custom depth its depthstencil render target seems to get cleared before rendering each eye, causing whatever is being rendered to it to be present only in the right eye.

it's Oculus Rift, deferred and both DX12 and DX11.


In our codebase I actually fixed it when the custom depth pass is created in `FSceneRenderer::RenderCustomDepthPass`

by doing the following (it formats badly here, the column is too narrow):

 ERenderTargetLoadAction LoadAction = (ViewIndex == 0) ? ERenderTargetLoadAction::EClear : ERenderTargetLoadAction::ELoad; // <- ADDED & USED THIS PassParameters->RenderTargets.DepthStencil = FDepthStencilBinding( CustomDepthTextures.CustomDepth, LoadAction,  bWritesCustomStencilValues ? LoadAction : ERenderTargetLoadAction::ENoAction, FExclusiveDepthStencil::DepthWrite_StencilWrite); 
Steps to Reproduce

From [Link Removed]:

  1. Create a new UE4.26 project using the "Blank" template with the following project settings: Blueprint project, Scalable 3D or 2D, Raytracing Disabled, Mobile/Tablet, No Starter Content.
  2. Add a sphere that will be within view of the player when launched in VR.
  3. With that sphere selected, set its Rendering > Render CustomDepth Pass value to "on".
  4. Add a vertically-oriented plane that will also be within view of the VR user but will not be obscured much by the sphere.
  5. Create a new material called "Test_MAT" and open it for editing. We'll use this material as a way to display the custom depth image.
  6. In the Material Editor, select the material result node and set its Blend Mode to "Translucent".
  7. Build the material graph as shown in Figure 1.
    1. [Image Removed]
  8. Save the material and close the material editor.
  9. Apply the material to the plane you created above.
  10. Run the application in "VR Preview" mode and view it through a VR headset (I used the Oculus Quest 2 tether to the computer in "Oculus Link" mode.) Note that the depth information is rendered only in the right eye as seen in the second image above.

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-104823 in the post.

Login to Vote

ComponentUE - Platform - XR
Affects Versions4.26
Target Fix4.27
CreatedDec 19, 2020
ResolvedFeb 8, 2021
UpdatedFeb 10, 2021