Proposal: We should avoid user-defined export const OPAQUE_BLOCKS, export const TRANSLUCENT_BLOCKS, export const NON_SELF_CULLING, or at least have a way to automatically generate them.
Reason: minecraft:glass is rendered incorrectly when a proper fix on transparency is installed, but the user incorrectly missed glass in TRANSLUCENT_BLOCKS, causing the correct algorithm to misbehave.
- Since many fixes to transparency-related issues, we no longer need
if (texColor.a < 0.5) discard in the shader. This will ensure that a semi-transparent object is rendered correctly.
- Not defining
minecraft:glass as TRANSLUCENT_BLOCKS is fine with if (texColor.a < 0.5) discard since, unlike stained_glass, glass has binary transparency.
- With a proper transparency fix, we render based on sorted geometry and depth buffer. Not defining
minecraft:glass as TRANSLUCENT_BLOCKS will mess up sorting.
- To prevent this issue from happening, and with Mojang keep introducing new blocks, we need an automatic way to assign these block flags.
Proposal: We should avoid user-defined
export const OPAQUE_BLOCKS,export const TRANSLUCENT_BLOCKS,export const NON_SELF_CULLING, or at least have a way to automatically generate them.Reason:
minecraft:glassis rendered incorrectly when a proper fix on transparency is installed, but the user incorrectly missedglassinTRANSLUCENT_BLOCKS, causing the correct algorithm to misbehave.if (texColor.a < 0.5) discardin the shader. This will ensure that a semi-transparent object is rendered correctly.minecraft:glassasTRANSLUCENT_BLOCKSis fine withif (texColor.a < 0.5) discardsince, unlikestained_glass,glasshas binary transparency.minecraft:glassasTRANSLUCENT_BLOCKSwill mess up sorting.