pmndrs / lamina

🍰 An extensible, layer based shader material for ThreeJS
MIT License
1.01k stars 41 forks source link

Simplify inputs for common symbols/types #10

Closed DennisSmolek closed 2 years ago

DennisSmolek commented 2 years ago

Consider this blend effect

        <LayerMaterial transparent depthWrite={false} side={THREE.FrontSide} blending={THREE.AdditiveBlending}>

With strings:

        <LayerMaterial transparent depthWrite={false} side="front" blending="additive">

Side has 3 options, front, back, both. Blending does have a lot more, so you could still allow it to be passed, but otherwise make it easier...

FarazzShaikh commented 2 years ago

I agree this is better to look at. Currently LayerMaterial accepts all ShaderMaterial props. I just think it would break consistency with other Materials in the library

For blending, isn't it possible to define a custom blending function in that prop?

FarazzShaikh commented 2 years ago

Closed via 1.1.1