Skip to content

Conversation

DJMcNab
Copy link
Member

@DJMcNab DJMcNab commented Aug 29, 2025

Previously, the base_color is used to initialise the backdrop, but if e.g. the backdrop were overwritten (such as by a destructive blend operation - see #1183), then it was possible to "punch through" the background, which effectively looked like drawing onto a transparent black layer.

The biggest impact here is around transparency, as the default base colour normally ensures that no transparency reaches the render target, but with destructive layers, it is possible for it to. This means that detail in the alpha channel can be lost.

(I'm not completely sure what the right behaviour here is; this is open to discussion. Note that the old version of base_color can still be cheaply emulated, whereas emulating this behaviour requires adding a "dummy" layer around the entire scene)

@DJMcNab DJMcNab added the C-classic Applies to the classic `vello` crate label Aug 29, 2025
@DJMcNab DJMcNab requested a review from raphlinus August 29, 2025 15:21
@DJMcNab
Copy link
Member Author

DJMcNab commented Sep 5, 2025

There is some evidence in the spec in favour of this reading:

Browsers often use an infinite white, 100% opaque root group, for final compositing, but this is not required.

@dfrg
Copy link
Collaborator

dfrg commented Sep 5, 2025

Seems like we might want to differentiate between a base color that is equivalent to an initial fill vs a base color that is “sticky” and survives destructive blends. Maybe a config option?

@DJMcNab
Copy link
Member Author

DJMcNab commented Sep 5, 2025

I'm not sure there are all that many use cases for such a non-sticky base colour; certainly in the web blending spec, every context seems to be either rendered Over the background, or into a fully transparent context (which is in turn rendered over the background).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-classic Applies to the classic `vello` crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants