inexorgame-obsolete / deprecated-cube-engine-inexor

UNMAINTAINED: Please have a look at the vulkan-renderer
https://inexor.org
zlib License
11 stars 1 forks source link

Integrate UIs into 3d world #473

Open a-teammate opened 6 years ago

a-teammate commented 6 years ago

UIs are 2D, the world is 3D. We have 3D editing. We have a great 2D UI framework (CEF).

We don't want to invent a 3D UI since its

UIs need to be easy.

We can combine both by pinning UIs onto the faces of cubes.
Those UIs should exhibit the settings of the cube its pinned to. *E.g. you modify the texture of the selected cube. (instead of operating globally a button could exist like 'repeat on all similar'. Possibly with a filters like "on all cubes with same texture/same shader/same shaderparameter/same xy).**

Usecases:

Todo

Control

Rendering

Possible follow up issues:

Possible integration into Visual Scripting System

IAmNotHanni commented 6 years ago

Great! This feature is also essential for the implementation of our visual scripting system! What we need are billboard surfaces with a HTML5 texture that has been rendered by CEF. In this picture you can see one of my experiments from ui-prototype\hanni\entity-editor. screenshot_12051

MartinMuzatko commented 6 years ago

I am not too sure if CEF is capable of rendering websites on top of 2D faces of a cube. We would need to calculate where on which surface a CEF layer is pinned to - is that possible @a-teammate ?

I imagine other use-cases as well. UIs always used to be private - per client. Only the user having the menu open can look at it.

If you could have a public shared UI like an ingame texture browser that you can look at together with others, you could also collaboratively select textures, edit textures.

This would make collaboration a lot easier and fun but possibly also a bit more chaotic.

For maps that are finished, I also imagine a few use-cases. You could also integrate a publicly visible scoreboard into an arena.

Generally, binding websites to cubes sounds very fancy and opens opportunity to many things, but I imagine that implementation (especially with the shared input) and performance might be very tough.

Public UIs bound to textures could also still spawn private UIs if you click on them or select them or interact them in a way, depending on gamemode. For this, it is important for the UI to know in what mode the focused player is, in order to interact with.

a-teammate commented 6 years ago

CEF gives back a texture (this is btw also the reason for issue #387: the different textures/layers of different browser windows can be drawn at different positions as usual OpenGL textures)

Pinning it on a cube is generally just a matter of drawing that texture at the right position, nothing special. A publicly visible scoreboard as part of an arena (a HUD as an element of the map) would be straight forward then: Just render another HUD layer at a different position.

Sharing the UI is in so far a different kind of story, that probably the mouse input must be shared among players (alternatively the state changes of the website must be shared or the texture CEF gives back). So a limit to only those people ultimately involved is probably recommended for that (network performance wise).

For this, it is important for the UI to know in what mode the focused player is, in order to interact with.

True, the player would go into a 'viewing UI xy'-state. Then the camera acts accordingly and other players also viewing 'UI xy' would be notified to share their input.

Generally the number of concurrently visible layers should be limited in case we find out that it impacts performance.