VR Instanced Stereo breaks ScreenPosition material node

I need to render different textures for each eye for a stereo 3d effect.
This is the simplified material:

This is what it should look like in VR with Instanced Stereo On:

And this is what it looks like with Instanced Stereo Off:

I tested this with both the deferred and the forward renderer.

I hope this can be resolved soon.

1 Like

Hey Congaz2,

So I believe this is expected due to how the Instanced Stereo Rendering works. Instead of drawing each eye sequentially (the left and then the right eye), they are drawn simultaneously (left and right at same time).

Since we stretch the viewport out that technique wont work, but I do have a way to determine which eye is being rendered if you want to do eye specific shader work that will work with and without ISR.

There’s a view uniform called stereo pass index you can access with a custom shader. You’ll want to use ResolvedView.StereoPassIndex. It will be 0 for the left eye or mono and 1 for the right eye. Here’s an example which makes the material red in the left eye and green in the right (or just red in mono):

This should work as you want for Mono, Stereo, and ISR.

Cheers,

2 Likes

Thanks Andrew! That should work for me