Non euclidean space demo

A quick demo with non euclidean space.

Playground:
card non euclidean | Babylon.js Playground

The rendering is in 2 parts. First one is done in a texture with a camera that has the same properties as the one used for rendering the scene (angles, distance, …)
The texture with the ship and its background is then projected on screen but only displayed for a part of the tradecard mesh.
With layerMask, I could enable ship rendering only for the 2d texture. Texture projection is done with a shader. Basically, compute the 2D coordinates on screen for the clipspace coordinates (divide by w, then transform each component from [-1,1] to [0,1])

Let me know if you want to know more about a specific detail.

18 Likes

This is amazing. I was brought here after a quick search in the babylonjs forums for “non euclidean” after seeing this demo: Non-Euclidean Worlds Engine - YouTube on youtube.

I wonder if something like this can be used to create Dr. Strange type of portals where you see through the portal hole and it’s another world at the other side and be able to step through it maintaining continuity?

@owen
cool portal in the playground. i put it in an iframe cause, you know… portal. arrow keys move you
.https://playground.babylonjs.com/#ACPMQL#3

not mine btw. <3 whoever made it
4 Likes