ClipsDescendants on rotated GUIs has been an unresolved issue for years now, and I would love to see it fixed. I know it may not be a focusing point for the ROBLOX devs because the use of rotation on UI is very uncommon/rare.
But there are times where I find myself wanting to use the rotation on a UI object realizing that it’s not possible with these current issues in place.
A good example that would be very useful having ClipsDescendants work with rotated UI would be Minimaps. It’s something I find utterly frustrating when most games use rotation based minimaps depending on where your character is facing in the map it will turn accordingly. But rotation breaking the clips makes this pretty much impossible. (Here are some example pics)
I’m hoping that you can at least take this into consideration and maybe look into fixing this in maybe the future rendering updates ROBLOX pushes out every month. It would be very beneficial to a lot of devs who find the need to rotate a GUI while using clips.
Not gonna lie, I'm still quite upset that Roblox is never planning to consider Rotation + ClipsDescendants support
I’ve seen the explanations saying “it’s too hard” and “it’s not worth implementing” (seriously? Who even assumed this?), though I still don’t understand why Roblox doesn’t see this as a priority requested feature. We’ve already had enormous amounts of people both trying to make GUI minimaps and requesting rotation clipping, as posted above. Is it really so hard to try and implement a small scale of it?
I know one of the most prevalent issues is the fact that Roblox would never be able to calculate a mess of rotated and clipped GUIs, but couldn’t we just have an absolutely simple version that only clips GUIs if their ancestors aren’t rotated?
Sorry, I don’t mean to sound this hypocritical, I simply fail to understand why Roblox doesn’t want anything to do with such an important UI element.
I agree with this. The Minimap example is great, and something I’m running into right now. Check out the minimap in my game here, and notice how freakin’ large the border is around the minimap. It’s so large because I have to overlap the rotated minimap image.
Although I think the idea of UI masks could also be thrown into this.
I don’t think I ever said it’s not worth implementing? It’s hard - our entire UI clipping pipeline is designed around rectangles - but it’s definitely a bug, it’s just hard to fix. We had other bugs that were hard to fix before (like the 3D UI render order), it just takes time and requires this to become a priority to fix.
It’s not an easy fix. The way clipping works right now is based on adjusting vertices, while arbitrarily rotated GUIs would require the use of the stencil buffer. This has performance implications for mobile.
In this diagram, the leftmost square is the parent, and it is clipping. The inner square is offset out of the clipped region. What happens is we adjust the vertices and texcoords of the square to obtain the “2” versions of the vertices, and then render using that. Specifically, this is computing the intersection rectangle of the two rectangles. At no point is there any kind of alpha masking or stencil buffer use involved.
You may notice a couple things with this approach:
It is trivially extended for rotations == 180 degrees
It can be less trivially extended for rotations that are multiples of 90 degrees
It can work when the GUI is rotated, as long as it is not rotated relative to the clipping ancestor. This is a nontrivial modification.
Web browsers also use this system, but only as an optimization. They will fall back to stencil buffering in more complex cases.
I think we should implement this feature, but it will require substantial amounts of time from a rendering engineer like zeuxcg said.
Update (October 2022)
There is a CanvasGroup instance, which renders all UI underneath it into a texture. This can be used to make a minimap, such as the one shown in the original post.
It comes with a significant performance and memory cost, so don’t use more than a few, and avoid using fullscreen frames. Using 1 for a minimap is a great usecase though.
I’m not sure if it’s a credible source but this is one instance of someone mentioning it’s not worth supporting. Thanks for the technical explanations, too, it’s easier to see the problem with more visual detail (sometimes I get a little too passionate when writing about features we desperately need).
Thanks for explaining the issue in detail, It does help to know that it comes down to a more technical problem. But I do hope it’s still something considered in the future as I know many devs like myself who would love to be able to rotate GUIs while keeping them clipped to the parent.
She never stated that they were actively working on a fix, but it is on their roadmap to fix the issue. Often, smaller issues or features like this will get pushed back due to other features or bug fixes being prioritized.
Also, the roadmap you linked is only for high-level features and not an internal roadmap run by each team so that they can keep track.
We’re in Q2 of 2020 now and ClipDescendants support for rotated UI objects is still very much needed. With recent ‘bonus’ additions to the UI system like UIGradient, which multiplies any given UI object with a given color range and supports rotation, support for ClipDescendants with rotated objects (even if it only works for rotated objects inside of grid-aligned objects) seems like a great candidate to implement/fix next.
We are continuing to evaluate hardware features and different approaches to implementing this. Right now it’s scheduled for later this year, but no promises. This is a complex feature and we want to be sure we deliver a performant solution that works on all devices, particularly mobile platforms where graphics APIs are somewhat limited in capability. This is currently on our roadmap for Q4 of this year, but it could be pushed back depending on how things stand then.
Been well over 4 years since this request was made, over 7 years since the first request for this and over a year with no further word, and still not implemented how hard can it possibly be?
All these awesome UI features like UICorner, UIStroke, Richtext, all (I’d imagine) would be a lot more complex to add. But simple clipping of rotated items still isn’t here? Hell, since the introduction of CSG, I’d imagine something like this, which is only 2D, would be infinitely easier to implement.
Not even on this years roadmap either, so we can’t even expect it to come out till 2022 (or at this rate, another decade)