Code Monkey home page Code Monkey logo

Comments (5)

dfrg avatar dfrg commented on July 26, 2024 1

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.

eliasnaur avatar eliasnaur commented on July 26, 2024

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.

raphlinus avatar raphlinus commented on July 26, 2024

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.

raphlinus avatar raphlinus commented on July 26, 2024

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.

DJMcNab avatar DJMcNab commented on July 26, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.