4 ms·
I recently made a VR mod for The Stanley Parable: Ultra Deluxe, and was met with an immediate challenge related to this. Turns out the game uses portals extensi
by Raicuparta 4y ago
I recently made a VR mod for The Stanley Parable: Ultra Deluxe, and was met with an immediate challenge related to this. Turns out the game uses portals extensively as a way to create rooms with impossible or fake non euclidean geometry.
First I had to make sure the portal cameras also followed the VR headset movement. Then I had to actually make the portals render in stereo, which is easy enough (just do everything twice from each eye's point of view). But the trickiest part to fix is the actual teleporting of the camera when going through a portal.
Unless you walk perfectly perpendicular to the portal plane, your eyes don't go through the portal at the same time. That means you need to teleport each eye individually through the portals, independently of the actual player object's position. This is annoying because Unity and most other engines conveniently abstract stereo cameras as a single entity. Meaning you have to separate it into two individual cameras, and make sure they have the correct distance, angles. Which isn't difficult, but in the end I decided it wasn't worth the effort and just moved on.
Without fixing this issue, the worst you get is a brief flash when going through some of the portals. The original devs of the game actually seem to have prepared for this by having similar partial rooms on the other side of some of the portals, so the flashing is barely noticeable in those cases.
It seems like this issue would be made worse if trying to make a native VR game instead of an unofficial mod like I was doing. Most game engines give you the option of "single pass" stereo rendering, which performs much better than just rendering two cameras completely separately. This rendering mode is used in pretty much every VR game made today. As far as I know, it isn't possible to take advantage of this while controlling the eye cameras individually, but I could be wrong. This kind of optimization is critical in mobile platforms like the Meta Quest.
- NoToP 4y agoCan't you put the teleportation plane slightly ahead of the rendering plane so that by the time either eye would clip over the render plane the player has already been teleported?
- Raicuparta 4y agoNo, because then you'd either have to teleport the player to a slightly different position in the exit portal, or you'd end up behind the exit portal. If you're behind the exit portal, you'll be able to see stuff you aren't meant to.
- djmips 4y agoIn Unreal Engine you have always have the option of modifying the rendering to suit your needs. It's a pity that Unity took most of the VR / stereo rendering behind the wall.