HandleAdornments not drawn in expected order + rendering artifact

HandleAdornments (with AlwaysOnTop = false) are not sorted appropriately according to their position in the world, and setting ZIndex for them does not have the expected results either. This repro uses ImageHandleAdornments, but I imagine the same holds for other 2D(/3D) adornments.

Repro: see the file ImageHandleAdornment_Sorting_Repro.rbxl (11.0 KB)


Setup from side:

The part with white handle is positioned in front of the part with red handle, and both ImageHandleAdornments have the same value for ZIndex.

278644a1ceb5816ac9b5d500e760fc7561d4c9b5.jpg


Front view in current engine version:

8e4b8f4efc5f850281c5fc0cd02a920e28a87a79.jpg

The red handle is erroneously drawn over the white handle. The white handle is closer to the camera than the red handle, so it should be drawn first. Moreover, notice the strange artifact that appears over part of the brick of the red handle:

9190421ffbcf1b65312f08d95111b8b43220df7c.png


Expected and desired functionality:

b1ef6f8dd43569ca855ff8568c0b27e3b726b231.jpg

The white handle should be displayed in front of the red handle. There should be no weird artifacts where a color is erroneously imprinted over part of the geometry behind it.


Additional notes:

  • Changing ZIndex has no effect whatsoever on inter-handle sorting! Even if I change the ZIndex so that the white part has a higher ZIndex than the red part, this still gives the same result.
  • Reparenting in the right order is a temporary workaround for this (i.e. parent both handles to nil, then first parent red handle to StarterGui and then white handle to StarterGui), but this is not a desirable situation when there are tens/hundreds of handles, because determining the right order and reparenting can be expensive to do frequently.
  • When AlwaysOnTop = true, they are sorted appropriately with different ZIndex values, but if they have the same ZIndex value they are still not sorted appropriately w.r.t. their different positions. Also, I need AlwaysOnTop = false for my use case, because I need them to be hidden by any geometry in front of them.

What I ultimately want to solve by posting this bug report: I want to be able to draw many ImageHandleAdornments as textured quads that interact with other geometry, while still using their functionality. I wouldn’t mind if ZIndex is completely ignored when AlwaysOnTop = false (this is already the case anyway).

5 Likes

dbf736be47bf8ddcd4fd6cd865009425de2174a2.png

Thanks for fixing this!

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.