Open mitchmindtree opened 6 years ago
What's the state of this feature?
This issue is as much as I've had a chance to do! I'd be happy to review any PRs that want to have a go at this, otherwise it's not particularly high on my priority list at the moment so I can't really give a prediction on when I'll get around to it yet.
It would be nice if certain widgets could opt-in to displaying a drop-shadow on top of whatever surface is below them.
One way of implementing this in a portable manner might be to triangulate from the widget's edges toward the direction of the drop shadow with the given length. If the
DropShadow
is added as a primitive widget, a newPrimitiveKind
could be added to allow the rendering backend to distinguish it from other primitives. EachDropShadow
would be emitted by thePrimitives
iterator prior to all other widgets at the depth of the widget causing the drop shadow.A gradient can be drawn from
BLACK
toTRANSPARENT
and the fragment shader can be used to adjust the curve of the gradient (by multiplying the luminance to some power for example) and to add a blur effect (using some basic, fast noise function). The frag shader can be notified which vertices are intended to be drawn as shadows by adding another constant to the existingmode
vertex attribute. This way shadows could still be drawn in the same pass as the rest of the geometry and text.