[Discussion] What to do with Depth in Stride UI?
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 7.8k
- Forks
- 1.2k
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 49
Description
Currently the Stride runtime UI supports depth and thickness in the UI. This is a very cool feature when making world space UI. However part of this is the ability to make elements with depth/thickness. But there are some limitations and caveats that make it impracticle to use, and harder to add new features.
The main limitation that prevents it from being useful in its current form is that it only supports solid color cubes, meaning textures will just appear as flat planes. As such I don't see it ever actually being useful for a game's UI, and even if it was, it would be limited to a very small number of games with a very specific UI style.
Examples:
Keeping it in as it is, also hase some issues. It adds complexity to the editor when creating the UI, and complexity to the engine codebase.
In the future, doing any form of vector graphic based UI also becomes many times more expensive to render, and shader based UI is more complex.
An example of this is if we wanted to have rounded corners. For 2D that is straightforward, but handling it for 3D cubes becomes much more complex because it introduces the concept of edges, along with 2x the number of corners (not impossible, just more complex).
So, with these in mind I want to start a discussion on what the ideal solution would be with how to handle elements being 3D, as currently I feel it is safe to say it is a 'useless' (though neat) feature for actual games.
Here are a few options I have thought of.
-
Remove it.
Pro: Easy and most straightforward option.
Con: Could be removing a potentially cool and unique feature from the engine. -
Change it so the texture gets 'stretched' along the side (like what dropped items in Minecraft look like)
Pro: Keeps and supports a unique feature of the engine.
Pro: Supports a wide range of styles.
Con: Would require a custom shader or possibly mesh generation for the sides of the UIElement so that it would look correct for non-square textures. Meaning it would be more expensive to render, and develop and maintain.
Con: Only works for UIs that have a flatter shaded style, as the outerpixels of a texture would be stretched, and look bad for more textured styles. -
Don't support textures, but do support rounded corners. But only along the 'depth edge', meaning like you take a normal 2D rect with rounded corners and just extruded it. (This includes supporting borders as well)
Pro: Keeps and supports a unique feature of the engine.
Pro: Adds support for rounded corners to 2D as well without the use of hand made textures.
Con: Only works for UIs that have a flatter shaded style.
Con: Could be expensive to render/generate.
Please share your thoughts and suggestions! And if you disagree with me on something, that's fine too!
Just as a note, I want to figure out what we want to do, not what feels like the easiest solution (though if the easiest is what we want to do, that works too haha). And as some additional context, I am working on a plan for how to improve the Stride UI, and so this factors in to that.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the current Stride runtime UI depth and thickness behavior described in the issue, along with the provided examples. Compare the three proposed directions and document the trade-offs for rendering, textures, rounded corners, and engine complexity. Done means reaching a project decision and recording a concrete plan; no files or tests are identified in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- design, game-dev
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100