Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non-Euclidean World Geometry #25031

Closed
Corruptinator opened this issue Jan 16, 2019 · 37 comments
Closed

Non-Euclidean World Geometry #25031

Corruptinator opened this issue Jan 16, 2019 · 37 comments

Comments

@Corruptinator
Copy link
Contributor

Corruptinator commented Jan 16, 2019

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.)

@CptPotato
Copy link
Contributor

CptPotato commented Jan 16, 2019

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.

@Corruptinator
Copy link
Contributor Author

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

@ElfEars
Copy link

ElfEars commented Jan 16, 2019

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?

@CptPotato
Copy link
Contributor

CptPotato commented Jan 16, 2019

@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.

@bojidar-bg
Copy link
Contributor

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.

@ElfEars
Copy link

ElfEars commented Jan 16, 2019

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.

@ghost
Copy link

ghost commented Jan 17, 2019

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.

@LinuxUserGD
Copy link
Contributor

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

@CptPotato
Copy link
Contributor

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.

@LinuxUserGD
Copy link
Contributor

LinuxUserGD commented Jan 31, 2019

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

@LinuxUserGD
Copy link
Contributor

@wayjake
Copy link

wayjake commented Apr 26, 2019

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 🙏🏻🤙🏻

@LinuxUserGD
Copy link
Contributor

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

@LinuxUserGD
Copy link
Contributor

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

@LinuxUserGD
Copy link
Contributor

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

@EricPlayZ
Copy link

EricPlayZ commented Jun 18, 2019

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

@EricPlayZ
Copy link

EricPlayZ commented Jun 19, 2019

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

@io12
Copy link

io12 commented Jun 19, 2019

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.

@EricPlayZ
Copy link

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

@aaronfranke
Copy link
Member

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.

@Calinou
Copy link
Member

Calinou commented Jul 15, 2019

@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/

@CptPotato
Copy link
Contributor

@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.

@akien-mga akien-mga changed the title Non-Euclidean World Geometry for Godot 4.0 or Later? Non-Euclidean World Geometry Jul 16, 2019
@Byzantian
Copy link

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

@LinuxUserGD
Copy link
Contributor

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

@io12
Copy link

io12 commented Aug 1, 2019

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.

@Byzantian
Copy link

@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?

@LinuxUserGD
Copy link
Contributor

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

@CaveJohnson376
Copy link

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.

@io12
Copy link

io12 commented Aug 12, 2019

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 :)

@clayjohn
Copy link
Member

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!

@Drachenbauer
Copy link

The stuff in the video is not really non-euclidian geometry, it´s just tricks of viewport-rendering on planes inside the structures and teleporting to the shown position.

Check out hyprrrogue and hyperbolica (both on steam) for actual non euclidian geometry.

These games act in hyperbolic spaces, what causes shrinking and deforming of distant structures in order to squeeze the floor flat again.
The area looks small at first glimpse but reveals it´s true gigantic space, when you wander around in it

@AThousandShips
Copy link
Member

This isn't the place to discuss this any longer, if you want to discuss the feature please open a proposal, otherwise this was closed four years ago and don't think anyone here are active on this topic, if there was an interest I'd say a proposal would have been opened

@wayjake
Copy link

wayjake commented Feb 1, 2024

Where else would we discuss this? This is great conversations and I took two things away (game recs, thanks, @Drachenbauer).

@AThousandShips
Copy link
Member

See the comment above explaining this in detail #25031 (comment)

@wayjake
Copy link

wayjake commented Feb 1, 2024

Yea, I read that. But you're claiming this thread needs to die because you're tired of seeing replies to it? We're just having a conversation.

@AThousandShips
Copy link
Member

No... I'm saying this isn't the place for proposals this is for bugs

Please behave professionally and follow the code of conduct your behaviour isn't acceptable, accusing me of things I've never done isn't okay, and you aren't having a conversation, you just joined now, a conversation that ended almost four years ago, with someone saying to move it to the right place

Come on...

@AThousandShips
Copy link
Member

If you want to continue this topic open a proposal, and link it here, otherwise this isn't the place for this kind of discussions, it stopped being that four years ago, and this conversation was revived only today, the conversation was dead before then

Be reasonable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests