Skip to content

Avoid User-defined Block-flags (to avoid transparency-related issues) #64

@KokeCacao

Description

@KokeCacao

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions