Show different geometry for each eye on an Oculus Rift

For an experiment on binocular disparities we want to show different geometries for each eye using UE4 and an Oculus Rift.

We already implemented some Materials that make use of the ScreenPosition of each pixel to determine if it is rendered for the left or the right eye and show different textures. But there seems to be no “trick” to do the same for geometry.

Is there a way to render different geometry for each eye on an oculus rift? Alternatively: Where would such a feature be implemented in code?

Thanks for your answers!

I got an answer from user JohnMcPineapple https://www.reddit.com/user/JohnMcPineapple

How about just making the material of
the geometries invisible for one eye?

Since we can manipulate materials per eye, this question is answered for me.

Can you send link to his answer? It will be very helpful.

1 Like

Here is the link to the post:

Could you share the details of how you implemented your Materials to show different textures for each eye - this is something I need to do as well!

This is quite simple and works for the Oculus Rift (I don’t know if it works for other HMDs too):

  • Read the “ScreenPosition” value in the material
  • If the value is below 0.5 the material is rendered for the left eye (above 0.5 it is rendered for the right eye)
  • switch the texture based on this

322199-

Thank you! This idea is very useful.