-
Notifications
You must be signed in to change notification settings - Fork 140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How: scene.append_with_opacity(scene)
#623
Comments
What you want here is push_layer, and in particular where you get to specify the alpha. You do need to supply a clip shape, which in many cases can be the axis aligned bounding box enclosing the content. If you just want an alpha group, then you should use A couple of notes. If you nest these deeply (more than 4) you might run into problems with the current implementation, as we don't fully implement the overflow of the blend stack. That's a bug though and if it becomes important we can prioritize it. Also, I've explored making the clip shape optional. The stack monoid paper explains how to compute blend bounding boxes and there is prototype code there. However, wiring it all up is nontrivial. It's probably easiest to have the application provide the clip shape for now. |
I think we should close this issue, with this answer. We could open a new issue for making the clip shape optional, if needed. |
I implemented this for SVG/Lottie using a fullsize rect as mentioned. The problem is that raw scenes dont have a size, and therefore no clip shape that makes sense. |
I have a scenario in bevy_vello I want to provide users the ability to fade the entire scene's opacity.
Take for example, an SVG.
An SVG is a static scene, you could even say it I store it as an
Arc<Scene>
.When someone wants to change the opacity of the entire image, how could I draw that opacity? Is there a blend mode that would do the trick?
The text was updated successfully, but these errors were encountered: