VR Instanced Stereo causes PART of Instanced Static Mesh to only render to right eye

I have several simple objects in my game – simple cubes that are elements of a puzzle – each face of every cube uses Instanced Static Mesh components (there are a LOT of cubes on screen).

Today I switched to use the VR Instanced Stereo setting, which works great EXCEPT one of the 16 face types only renders in the right eye. And even then, only PART of it has this problem (a portion of the model does render in both eyes).

The ONLY unusual or different aspect to this model is that it has 2 texture slots, but, oddly, they are both using the same material. Fixing this (either by setting one slot to a different material, or fixing the imported model to only use one slot) makes the problem go away.

Not a question I guess… just an issue.

Confirmed this issue is still present in UE 4.17.1. Walls are missing in left eye but trim is still visible (both are part of the same SM, different material IDs)

212821-instancedsm-renderbug.jpg

could be an occluding issue. please post a picture what the scene is supposed to look like.

This appears to still be happening in 4.17.2 and seems to be caused by instanced static meshes not being correctly drawn into both eyes in the depth only pass if the same material is used for multiple instance meshes. It can be fixed by changing the comparison in TDepthOnlyVS::SetInstancedEyeIndex (DepthRendering.cpp) from ‘EyeIndex > 0’ to ‘EyeIndex >= 0’.

Later edit: There are some other instances of this same bug in other shaders as well, a search for “EyeIndex > 0” will find them.

1 Like

Is there any comparable fix for this in Blueprints in 4.16?

I’m also having the same issue in 4.16. Instanced Static Meshes (ISM) with multiple materials are not rendered correctly in the right eye. I’ve tested the same mesh as just a static mesh actor and as an ISM and only had the issue for the ISM.

Is there any report for this issue yet?

Hi uw19,
This is caused by a bug in the rendering code so you won’t be able to fix it in blueprints. You should be able to avoid the issue by turning off Instanced Stereo in your rendering settings, but that will have a performance impact on the render/rhi threads.

That code change is great - I’ve been trying forever to figure out why this happens.

The question I had is whether or not this affects any of the performance gains afforded by instanced stereo rendering. I haven’t gone into the rendering pipeline to see how this change would affect the actual rendering, nor do I know very much about rendering at all, but if they intentionally left off the EyeIndex = 0 case for performance gains, this obviously negates those gains.

I believe it’s just a typo, you might get a performance difference if you had a lot of things that weren’t rendering correctly. Since I posted that answer I found a couple more places where that same mistake has been made, just search for “EyeIndex > 0” to find them, they look the same as the depth only VS one, but for other shaders.