Comments (3)
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 Mix::Normal
and Compose::SrcOver
. That's not the default, which I can see can cause problems.
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.
from vello.
I think we should close this issue, with this answer. We could open a new issue for making the clip shape optional, if needed.
from vello.
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.
But I'd maybe argue if a user is rendering a raw scene with bevy_vello, they can apply opacity how they want themselves.
from vello.
Related Issues (20)
- Rendering to a surface and transparency HOT 2
- Minor issue: example 'simple' - when compiled standalone - the render context needs to be unwrapped HOT 2
- Winit example slow on wsl HOT 4
- Lots of wgpu error messages HOT 5
- `vello_shaders` causes recompilation HOT 1
- How to figure out the correspondence of window size and image size HOT 4
- wgpu: Use `write_buffer_with` rather than `write_buffer` HOT 2
- Update ARCHITECTURE.md HOT 2
- Issue with flattening of a stroked cubic around a near-cusp
- Can we re-export `wgpu` with the feature?
- Vello anti-aliasing rendering seems not fine enough, how to improve it? HOT 4
- API question: negative space / cutouts HOT 4
- Snapshot testing
- Add basic tests HOT 3
- Serde support for re-exported Peniko types HOT 1
- Rendering issue when clipping and stroking the same path HOT 5
- IOS app crash 0.2.1 HOT 1
- Drop shadows
- Corruption issue with clipping
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vello.