Skip to content

Transparency and antialiasing #901

@almarklein

Description

@almarklein

While thinking about #492, which also relates to the blender, I had to think about transparency some more and had some ideas.

Intro

Transparency is tricky. We've introduced a couple of different blend modes, but unexpected things can still happen, e.g. when transparency is used for aa and blends in ways which are technically correct but look weird, objects are rendered twice because the renderer thinks it might have transparent values, picking.

I want to make it feasible (i.e. possible and good-looking) to use aa and transparency with less use of blending. Opaque fragments are simply much more predictable in terms of how things will behave and look.

Plan

  • Document transparency and aa in the guide.
  • Implement fxaa, to make the results of the fsaa a bit smoother.
  • I hope that the above is good enough so we can set the aa prop of lines and points to False.
  • Improve support for stochastic transparency.
    • Enables transparency without any blending, so can be a great alternative.
    • A basic implementation is available via blend_mode="dither".
    • Add a special filter to reduce noise.
    • Combine with MSAA?
    • Any other advanced tricks we can adopt?
  • Look into MSAA:
    • A compelling feature of MSAA is that the effective resolution can be increased separately for the color texture, while depth and picking can remain small.
    • Primary purpose is to reduce aa for meshes. So not a generic aa approach, but for specific use-cases.
    • Looking deeper, MSAA can perhaps be used more generically, e.g. to implement (advanced) stochastic transparency.

Related issues / prs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions