Godot: Non-Euclidean World Geometry

Created on 16 Jan 2019  路  30Comments  路  Source: godotengine/godot

Godot version:
Possibly a Version 4.0 feature request

I just happen to spot the video (Link Below) and at the end it mentions the potential of using Non-Euclidean in VR. Do you think Godot would be capable of doing that someday? Or is it something already implemented:

[Non-Euclidean Worlds Engine]
https://www.youtube.com/watch?v=kEB11PQ9Eo8

P.S. The creator also revealed that It was written in OpenGl and code is posted on Github for anybody to look at: https://github.com/HackerPoet/NonEuclidean (Normally I don't do this type of stuff but sharing source code that shows how it works could inspire a possible new feature for Godot. Plus, figure I give heads up on what was recently discovered.)

archived discussion feature proposal core rendering

Most helpful comment

I think that having a portal system built into Godot is too much to ask from a generic game engine, but it would be nice to have features in each of those systems (rendering and physics mainly, but potentially audio as well) that would allow us to create games using portals.

All 30 comments

I have not looked at the source code but I'm pretty sure it's "just" using multiple cameras as seen in the Portal games and duplicates of rooms to archieve this. The geometry itself is very much euclidean but uses visual tricks (portals), as well as teleporting the player around or resize them to create this illusion.

It's definitely well made but I think one sould be able to do this in Godot right now. Features such as stencil tagging would make this easier / faster in the future but the basic requirements are already there I think.

Edit: That being said, you can definitely do some cool stuff with non-euclidean geometry. I'm just not sure how you would combine it with a traditional 3D renderer, simply because the type of geometry is so different.

My brain melted seeing that video in the previous post. Pretty cool nonetheless.

Eh. This is a very "wishlist" feature but I would really like a built in portal system that "just works" with rendering, lighting and physics and such.

This requires a lot more than rendering too. How do you calculate the physics of something half in a portal? How do you stop it from colliding with the wall or objects behind it?
What happens if the portal closes? which end does it get shoved out and how?

@ElfEars As much as I like Portal, I don't think this functionality is something that belongs into godot's core.

The points you brought up need to be treated a lot differently depending on what you're building. Implementations need to be very specific and making something that "just works" in every case is probably impossible considering how much freedom and possibilities there are.

I think that having a portal system built into Godot is too much to ask from a generic game engine, but it would be nice to have features in each of those systems (rendering and physics mainly, but potentially audio as well) that would allow us to create games using portals.

Yeah. Fair enough.

Admittedly, I was mostly just throwing stuff at the wall. Questions I was having trouble with when thinking on how I'd personally implement it.

I've been thinking how to achieve this with the current state of Godot. According to Portal 2 Developer Commentary on linked_portal_door, it could be used as a very powerful prototyping tool. Maybe it could be implemented as a module similar to GridMap.

Can you achieve this with 3d viewports? Are 3d viewports implemented (showing the screen of the camera on the wall)?

Can you achieve this with 3d viewports?

Yes, but you'll have to go a bit further when you want to implement interaction. For example, you'll have to cut a hole in the wall for the player to actually be able to go "through" the viewport. I assume portal uses some form of CSG to archieve this.

@CptPotato The wall has no collision, so you will only notice the difference when you go through the portal.

I think this would be something you can "cheat" utilizing some tricks. The author of the video said he avoided Unity because of some rending limitations. But, if you pass through a certain set of coordinates set the player size you could achieve most if not all of the tricks the author provided in the video. Even writing your own engine or building similar features into core code wouldn't be as useful as just creating the magic itself. Non-Euclid math is just a trick in the end anyway.

Anyway, those are my basic thoughts. I would love to see this conversation continue. I'm a recent Godot convert and am looking forward to becoming a member of the community 馃檹馃徎馃馃徎

Here is also a nice video (level transitions): https://twitter.com/duckinator/status/1125832679415537665

https://youtu.be/eUJUHO28sLQ
I think this issue can be closed

But it seems like the transition isn't perfect yet.

https://www.youtube.com/watch?v=xQ1b8cmUa8w I haven't added seamless transitions yet but it is definitely possible. Godot 3.1 is very capable of faking a non-euclidean world.

EDIT: Shoutout to this guy for sharing his code on Github :D I took his code and used it for my project: https://github.com/io12/godot-portal-demo

https://github.com/EricPlayZ/NonEuclidean-Godot I've posted my whole project on Github if anyone wants to experiment with it, or further develop it. @io12 still takes credit though for a few lines of code (and other stuff) I needed :P

I'm pretty sure I can make this fully seamless (but maybe not performant?) for 3.2.

3.2 has the new frustum camera mode which apparently allows oblique near-planes.

I'm pretty sure I can make this fully seamless (but maybe not performant?) for 3.2.

3.2 has the new frustum camera mode which apparently allows oblique near-planes.

That's nice. I don't need it to be performant though. Can't wait for 3.2 anyway though :D

The only engine I know of that has this as a first-class feature is the Source engine. Not only in the Portal games, but also in other Source games, the 3D skybox is a separate area with "portals" that make it appear huge and outside of the normal play area.

@aaronfranke Speaking of infinite sky, I wonder if this can be reproduced in Godot: http://aras-p.info/blog/2019/02/01/Infinite-sky-shader-for-Unity/

@aaronfranke Speaking of infinite sky, I wonder if this can be reproduced in Godot: http://aras-p.info/blog/2019/02/01/Infinite-sky-shader-for-Unity/

This shouldn't be too hard to reproduce. It just needs a few lines in the vertex shader.

This can be done easily with viewport textures that act like portals. This is the way Portal 2 did it. Just make the portals fill the entire room. As far as I know, the game Portal dosn't use any fancy tricks like CSG and just duplicates the Entity on both sides.

https://www.youtube.com/watch?v=_SmPR5mvH7w
https://twitter.com/zambuseta/status/920379355582357504

@Byzantian Only seamless transitions don't work yet. But non-euclidian geometry is something different: https://github.com/EricPlayZ/NonEuclidean-Godot/issues/1

https://github.com/io12/godot-portal-demo

I tried to implement portals in Godot and at this point I'm pretty sure Godot doesn't have enough features to get them seamless. We still need:

  • stencil buffers
  • a way to do oblique near plane clipping (the new frustum camera mode in 3.2 allows this, but it requires that the camera direction is always perpendicular to the portal plane)
  • some way to cull the section of objects behind the portal (this could either be through clipping planes or some easy way to attach a shader to every object that touches the portal)

The priority right now seems to be getting vulkan support ready, so it's unlikely that portals will be possible any time soon.

@LinuxUserGD
I recently tried a VR Demo at a convention which had seemless non-euclidian geometry working in UE4. They didn't want to tell me how they did it, but if I had to guess they didn't resort to modifying the renderer. I'll go out on a limb here and say that no game engine in existence has "true" non-euclidian/hyperbolic geometry. How would you even handle cartesian coordinates in such a system?

I think something like this is possible with shaders without changing the coordinate system. Don't know how they did it in this video: https://youtu.be/ztsi0CLxmjw
@Byzantian

There's no many any tutorials and code explanation about this to easily replicate the result, so...

As i think, easiest way to make a portal is to use shader, that renders input image behind anything else but in front of object, teleport anything going behind the portal, and disable collisions between wall portal placed on and object touching the portal but portal frame must have collider. IDK how to make it code-wise, im not a great coder, but i think all this can be a solution. Sorry for bad english, i was too sleepy.

You could use my code as a start. https://github.com/io12/godot-portal-demo

At this point, I'm pretty convinced that Godot doesn't yet have enough features to implement portals as seamlessly as in other game engines.

Also, cool username :)

Feature and improvement proposals for the Godot Engine are now being discussed and reviewed in a dedicated Godot Improvement Proposals (GIP) (godotengine/godot-proposals) issue tracker. The GIP tracker has a detailed issue template designed so that proposals include all the relevant information to start a productive discussion and help the community assess the validity of the proposal for the engine.

The main (godotengine/godot) tracker is now solely dedicated to bug reports and Pull Requests, enabling contributors to have a better focus on bug fixing work. Therefore, we are now closing all older feature proposals on the main issue tracker.

If you are interested in this feature proposal, please open a new proposal on the GIP tracker following the given issue template (after checking that it doesn't exist already). Be sure to reference this closed issue if it includes any relevant discussion (which you are also encouraged to summarize in the new proposal). Thanks in advance!

Was this page helpful?
0 / 5 - 0 ratings