Skip to content

Expose Material Doublesidedness and Alpha Mode #987

Description

@bjornbytes

In glTF, materials can be double sided and have different alpha modes (opaque, mask, blend). LÖVR currently ignores these. Historically you've been able to work around it by changing blend mode and face culling graphics states when drawing the model. However, it's not per-material (unless you use Pass:drawPart), and it doesn't work for an arbitrary model -- you have to know/assume which mode you want.

There's a design problem around whether LÖVR should actually use these material properties during rendering, like using the material of each primitive to change the cull mode in between draws when drawing a model. It makes LÖVR opinionated about face culling (and blending, for alpha mode), so LÖVR would be ignoring your :setFaceCull and :setBlendMode, which could be undesirable sometimes.

A smaller immediate improvement might be to at least import and expose the cull mode and alpha mode on Material, without using them for anything during drawing. It would be up to you to use them along with Pass:draw or Pass:drawPart if desired. Current workarounds involve string matching on node/material names, and this would improve on that.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions