Cookies   I display ads to cover the expenses. See the privacy policy for more information. You can keep or reject the ads.

Video thumbnail
I've been working on a rendering engine for non-euclidean worlds.
It's a little tricky to explain. So I'll just show you some of the things you can do before I go into how it works.
First example is this tunnel.
You can see it's really long from the outside...
...but it's actually really short on the inside.
And then this tunnel is the opposite.
It appears short, but it takes a long time to travel through it.
The shortest path between two points is not necessarily a straight line anymore.
Here's another example of a house.
See if you notice anything suspicious as I walk through it.
Did you catch it?
This four-room house actually only has three rooms, red, green, and blue.
This demo surprised me a lot because I originally thought it would be super jarring
but actually everyone I show this to doesn't notice it at all unless I tell them that something is off.
I guess our brains just aren't used to thinking this way.
Here's the same house, but with the opposite twist.
There's actually six rooms in this house.
And in fact, I could cram an infinite amount of space into any finite space.
Here's another room.
There's just a pillar on one side and an object on the other.
But if we walk around the pillar, we actually end up in another room.
The object isn't changing. We're actually in another unique space.
If I walk around again we enter a third room.
And this cycle repeats, clockwise and counter-clockwise.
And notice how you can see both objects at once.
This is a weird one, we're on a hill that's sloped up
but to get up the hill we can go down the tunnel, and end up on top.
It's also an example of your grandpa's stories about walking uphill both ways, maybe he just lived in a non-Euclidean plane of existence.
Here's where things get really interesting.
We've got a tunnel that's too small to pass through.
But as I walk through THIS tunnel, my scale also changes.
Still not small enough to get through, but if I go around one more time...
I can finally fit through.
I can go the other way around too, to keep getting bigger. But eventually I won't be able to fit into the tunnel anymore.
So how does all this work?
Well, it's basically the same as the game Portal but the portals have no seams and there's often more than two of them
There are several surfaces that are actually solid geometry. It's just that I draw a texture on top of it
that's actually a virtual camera rendering what it would have seen from that perspective
And when you walk through it, it teleports you seamlessly to where you're supposed to end up and the illusion is complete.
The rendering is a lot harder than it sounds though.
Each surface has to recursively render surfaces behind it conditionally depending on if it's occluded or not from each perspective.
I originally was trying to do this in Unity,
but I'm pretty sure it's impossible without lower level access to the rendering, even the scriptable pipeline didn't work for me.
So I was forced to create my own rendering engine in OpenGL. Why do I keep writing engines...
Anyway, the last thing I wanted to talk about are the use cases.
Other than just for puzzle games. This is actually incredibly useful for virtual reality.
You see, normally for room scale VR, you're limited to a small area to walk around in.
You can't really explore larger open worlds without breaking the illusion, like teleporting.
But this engine can compress entire levels to fit into a single room.
Here I have a single 20 foot by 20 foot room that you can walk around in and explore.
But it actually contains a volume four times larger.
And although I haven't actually tested this in VR. I'm entirely convinced that this illusion feels just as real as playing from the screen
I've uploaded the source and executable to github. So if you're curious you can try out this demo.
Thanks for watching, and I'll see you all next time.