Giter Club home page Giter Club logo

Comments (3)

raphlinus avatar raphlinus commented on July 27, 2024

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.

DJMcNab avatar DJMcNab commented on July 27, 2024

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.

simbleau avatar simbleau commented on July 27, 2024

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)

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.