Comments (5)
This is an interesting take. It looks like neither web nor COLRv1 support selecting both blend and Porter Duff compositing modes for a single operation— the blend modes seem to imply source over. I do think offering both is forward looking and the correct path for piet-gpu.
I have the GLSL for these mostly done. My simple experiments seem to work well so my next step is to plug it into EndClip with constants for the modes and test there.
from vello.
Also, it seems to me compositing should happen in sRGB color space. Right now, alpha compositing happens in linear sRGB space, which can give superior antialiasing but may not be compatible. We probably need a mode to set this, either at compile or run time.
Compositing in sRGB is a disappointing part of the spec, because not only can anti-aliasing suffer, but also colors. I find https://blog.johnnovak.net/2016/09/21/what-every-coder-should-know-about-gamma/ compelling, in particular this example.
Maybe I'm naive, but I don't understand why color standards don't specify linear sRGB. Even upcoming standards seem to lack enthusiasm for it: google/iconvg#37.
from vello.
I agree, this is something I'd like to see addressed better. But for now I think the best approach is to take what we're given and render it the best we can. When the client is in control over the scene, we can provide more options.
I should note that since the RAVG paper (and going through MPVG) they tout a subsampling approach, where the composition is computed in whatever color space the scene description requires (say, sRGB), while supersampled AA happens in a linear space. I think we might want to go for that as a long term goal, though of course it does demand some changes in fine rasterization.
from vello.
I actually wasn't sure on the details. I was thinking about how to represent "three way" blends - backdrop, src, and mask - and I imagined various combinations of blend and composite. It's possible you can get most of the effects from doing just one or the other (ie assuming "over" for the blends). At the back of my mind I'm imagining some algebraic simplification before doing fine raster. I guess where I am is, do both if it's straightforward, but if it's a simplification or performance bump, also fine to restrict it to web/COLRv1 semantics.
from vello.
Blending is currently supported. According to @raphlinus , there may still be some follow-up needed, but this issue doesn't really capture that anyway.
from vello.
Related Issues (20)
- rustfmt settings (linebender-wide?) HOT 2
- Switch from `dialoguer` to `inquire` HOT 5
- Introduce a changelog HOT 1
- Appending an `Encoding` to a `Scene` HOT 5
- Simple example doesn't work on web. HOT 2
- Trouble drawing emojis HOT 8
- Improving bump estimation accuracy and performance
- API Issue for `Renderer`
- Full system hang on Apple M1 8GB HOT 13
- 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
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.