I am trying to make a portal effect using a render texture and shadergraph following this tutorial: Making Portals with Shader Graph in Unity! (Tutorial) - YouTube
This sets up a second camera that moves corresponding to the main cameras movements, uses a render texture to display the second cameras image onto the portal, and uses a custom shader to use the screen position rather than the position on the portal to render the texture.
Basically, I got everything working as it does in the tutorial. Now, I am trying to convert the projet to VR.
Depending on the stereo rendering mode I choose (multi-pass or single-pass), the correct image shows in either the left or the right eye, while the other eye has a big offset and doesn’t work.
Without using a custom shader, the render texture works in VR, but the problem there is that the proportions are wrong.
I have tried multiple different things and to be honest, any way to make a portal effect would be great. I can’t find proper tutorials or answered questions, because everyone seems to use different versions of unity. (I am currently working with Unity 2019.4.1, with the Universal Render Pipeline, and SteamVR 2.6.1. But I am happy to upgrade to a different version, if you think that might help)
So these are the things I have tried (if you have tips for any of them, please help me!):
-
I tried adjusting the shader graph to work with stereo rendering. The simplified graph looks like this:
The problem is the screen position bit, that just doesnt seem to work in VR. -
I tried making seperate render textures for the left and the right eye. I can’t seem to render to one eye only. In any post i have seen about this, it says that you can just select left or right as the target eye in the camera settings. But any way that i have tried this, the VR image just freezes while the game preview in unity still looks right. I have no idea why this is happening and apparently noone else has the same problem.
-
i tried different rendering pipelines, but the shadergraphs don’t seem to work there, or it doesnt make a difference.
Thank you so much for helping!!
Let me know if you need any more information…