![WorldEditCUI](https://media.forgecdn.net/avatars/thumbnails/75/514/256/256/636166153154339907.png)
Glass/Water in front of selections. Toggle?
Ecconia opened this issue ยท 3 comments
I recently started using CUI since I am writing a selection plugin.
Water and glass seems to be in front of the selections.
I am not familiar enough with liteloader/CUI to know why that is the case.
Q1: Is there a special reason for it to be the case?
Q2: If shaders are that reason, is there a way to add a toggle? Since I don't use shaders.
I am using a freshly downloaded liteloader with CUI only. Nothing else.
PS: Please don't answer months later again :P (I have a PR running here too...)
The simple answer is that the Minecraft world is drawn in several "passes" in order to generate the appearance that it does. Transparency requires that certain elements are drawn before the partially transparent areas in front of them, this draw order allows the transparent elements to be drawn with knowledge of the "depth" of other elements in the scene (eg. which bits they should be "in front" of and which bits they should be "behind") because the contents of the depth buffer are intact.
When a mod is drawing "fake" elements which need to look like they are in the world, it can hook into the rendering process at various points in order to draw the fake elements as if they existed in world space. WECUI hooks in via liteloader after the world draw pass but before the transparent elements pass while the depth buffer is still intact in order to appear like the world is interacting with the selection. Toggling the always on top mode in the options, instead draws the grid later in the rendering process, but after the depth buffer contents have been destroyed. This is a compatibility option which means that if something else screws with the rendering or otherwise mucks up the depth buffer that the grid can still be displayed.
Basically, you can draw "in the world" using the default setting, or you can ignore the depth buffer and draw "on top" if you set the always on top mode.