Skip to content

Consider implementing order-independent transparency #394

@rdw-software

Description

@rdw-software

The current approach to alpha compositing is fairly simple. While it works for now, it won't once other entities are added:

  1. In the world render pass, objects are rendered in order of their material index (pre-sorted back-to-front)
  2. This currently works because terrain is rendered first, then water planes, and debug meshes don't interact with either
  3. UI elements are blended on top of the resulting scene, with compositing enabled - this is fine and won't need to change

This will break as soon as other alpha-blended elements have to be rendered: 3D props, 2D sprites, effects, or even decals.

A better solution would be order-independent transparency. Can probably check BJS or other rendering engines for inspiration?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions