Plethora Peripherals

Plethora Peripherals

3M Downloads

2d text elements cause hotbar to solidify

Allymonies opened this issue ยท 1 comments

commented

If you add a text component to a canvas, the hotbar will no longer be partially transparent.

Steps to reproduce:

modules = peripheral.wrap("back")
canvas = modules.canvas()
canvas.addText({1, 1}, "Test", 0xFFFFFFFF)

p1738 1
oxuyy 1

commented

81d431a fixes this, but I'm not satisfied with it - setupFlat already enables blending at the start of Text2d's render method (and all other objects):

protected fun setupFlat() {
RenderSystem.disableCull()
RenderSystem.enableBlend()
RenderSystem.disableTexture()
RenderSystem.setShader { GameRenderer.getPositionColorProgram() }
}

But nothing I can find in textRenderer will disable blending. So, unless I'm missing something, I'm not fully confident that re-enabling blending at the end of Text2d is the correct state to leave the renderer in. Perhaps some of the other methods involved (like tex2d) disable blending as a side effect, I don't actually know.

This could just be a side effect of Overlay Glasses using immediate rendering. As prep for holograms, I do need to make all the methods use the vertex consumers instead, which could either resurface issues similar to this or squash them all entirely.

When this fix makes it into a release, let me know if you find any similar issues with improper render state.