For "PeachGarden", an Oculus Quest project, I had to develop a custom portal effect. For performance issue and due to the low bandwidth of the hardware, we couldn't rely on any additionnal rendering pass. Instead I decided to fake perspective using very simple shapes (planes, sphere for the background...) directly in the fragment shader. We could have rendered more complexe shapes with raymarching, but the ALU cost would have been too high. Luckily the environment we wanted to render was quite simple (a path going down, water surface, sky...) and fited theses constraints.
Additionnaly to the portal effect, I was also in charge of the environment creation for this scene (modeling, texturing, shading, lighting), excepted for the sky texture inside the portal.
This project is developped by InnerspaceVR, and directed by Hayoun Kwon. Level design : Fabrice Gaston. Lead Artist : Guillaume Bertinet.
This portal effect, working in VR (stereoscopic), does not rely on any additionnal rendering pass. No geometry is used inside the portal, only a fragment shader faking a perspective with given camera position and orientation.
Simple fragment shader, using camera position and orientation to map two checker textures . This basic experimentation with simple shapes (floor and sky mapping) is the base for achieving some more impressive effect (adding more complexe textures, fog...)
Once we have coordinates simulating simple shapes (plane for floor, skysphere...), we add textures for a more complexe effect. Here we sample specific mipmap level to get the blur we want (underwater above water...)
Behind the scenes ! We use triggers to make visible or hide meshes when camera enters the portal, to keep the effect working from any point of view.