What I’m trying to achieve:
A 3D flying game in which there is a map, but if you fly off one end of the map, you appear at the other end and continue.
Now, technically achieving this is quite trivial; check player position, and if they fall outside the bounds, teleport them to the other side of the map.
The problem:
From the players perspective this sucks.
You fly to the end of the map and see an empty gray void beyond it… and when you try to fly into it you’re magically teleported.
What you want is to somehow render the ‘other side’ of the scene to the player, so the transition appears seemless.
The question is, how do you do that?
Approaches I’ve already tried:
- Mirroring the actual scene
Totally a non-starter. Everything is wrong with this, it requires you to have multiple copies (up to 8) of all the content in the scene, mirrored in real time. This is not a solution.
- A series of giant quads on the edge that render the ‘other side’ to the texture.
Works well, but you need many many cameras along each edge that render the scene in realtime to the quads.
Seems like you should be able to dynamically control which of these is active at any time, but if you stand right on the border and look down it you have to render many many of these quads.
Super. Slow.
- Dynamically place a render-to-texture quad in front of the player camera that shows the ‘other side’.
This solution is ideal, but it seems impossible to get the edges of the quad to be ‘seemless’; it appears as a floating window into the otherwise empty void with obvious edges.
Remember that you must render both the ‘local’ area and the ‘other side’ when you hit the ‘edge’ of the scene.
–
So, any ideas?
I almost feel like the solution to this is like some kind of magical sky box shader, but I have no idea how I would write it…