Description

From Licensee:

When we have Instanced Stereo enabled, all our materials that use Scene expression nodes (SceneDepth, SceneColor, etc...), render incorrectly in the right eye. It only happens to the ones that have something plugged into the UVs slot.

[Image Removed]

[Image Removed]

We were able to fix this issue by changing in TranslucentRendering.cpp:

line 824 in static void UpdateSeparateTranslucencyViewState()

  1. SetupDownsampledTranslucencyViewParameters(InstancedView, TextureExtent, GetScaledRect(InstancedView.ViewRect, ViewportScale), DownsampledTranslucencyViewParameters);

to

  1. SetupDownsampledTranslucencyViewParameters(InstancedView, TextureExtent, GetScaledRect(View.ViewRect, ViewportScale), DownsampledTranslucencyViewParameters);

The size passed to update the instanced buffer for the right eye was wrong.

Follow up from licensee:

Unfortunately we just found out this fix isn't sufficient as it breaks some other stuff.

The main problem here lies in the range of UV's used by different material functions.

For example, TexCoord[0] always gives UV's between 0 and 1.

The SceneColor OffsetFraction mode however uses the ScreenPosition node as internal input UV's to offset. These UV's range from 0 to 2 when using Instanced Stereo.

[Image Removed] 

Thus, as far as I know, there is no situation where the scene color texture can be read correctly for both nodes. Same issues apply to scene depth.

One solution would be to change GetViewportUV() (and normalizing any other nodes using UV's) to return [0,1] but this would require changing a bunch of other functions as well and probably will get pretty messy.

For now we have created a materialnode 'EyeIndex' which returns 0 or 1 based on what view is currently being rendered. Using this node, we can work around some problems manually but some cannot be fixed in this way.

Steps to Reproduce

From Licensee:

  1. Create a new empty UE.26 project

  2. Create a new material -> Blend Mode: Translucent -> Add a 'Scene Color' and 'TexCoord' node -> Plug the TexCoord node in the UV slot of the Scene Color -> Plug the Scene Color into the Base Color output slot.

  3. Create a new level: New Level -> Default

  4. Create a plane and assign the newly created material on it.

  5. Play in VR to check. The right eye should show a different result.

     
    [Link Removed]Attached project reproduced this for me with OpenXR and Oculus Rift S

Have Comments or More Details?

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

2
Login to Vote

Unresolved
ComponentUE - Platform - XR
Affects Versions4.265.1
Target Fix5.5
CreatedJan 19, 2021
UpdatedApr 2, 2024