close
Skip to content

Add Luminance based clipping#1121

Closed
mTvare6 wants to merge 1 commit into
linebender:mainfrom
mTvare6:add-luminance
Closed

Add Luminance based clipping#1121
mTvare6 wants to merge 1 commit into
linebender:mainfrom
mTvare6:add-luminance

Conversation

@mTvare6
Copy link
Copy Markdown
Contributor

@mTvare6 mTvare6 commented Jul 23, 2025

Requires peniko#116

SVG has support for Luminance based clipping but vello doesn't support luminance based clipping. If the PR mentioned is merged, then this would allow the vello to use that.
https://developer.mozilla.org/en-US/docs/Web/SVG/Reference/Attribute/mask-type

@LaurenzV
Copy link
Copy Markdown
Collaborator

In vello_cpu, you can already use Mask::new_luminance, I don't think more is needed here to implement what's required for SVG?

@mTvare6
Copy link
Copy Markdown
Contributor Author

mTvare6 commented Jul 23, 2025

In vello_cpu, you can already use Mask::new_luminance, I don't think more is needed here to implement what's required for SVG?

I'm mainly concerned with classic vello as it in required in GraphiteEditor/Graphite, so we would still require a new mix mode for classic vello, don't we?

@LaurenzV
Copy link
Copy Markdown
Collaborator

I'm not familiar with vello classic, but that's possible, yes. Then I would suggest removing the parts from vello_cpuand just keeping the ones in vello.

@DJMcNab DJMcNab requested a review from raphlinus July 23, 2025 08:22
@nicoburns
Copy link
Copy Markdown
Contributor

In vello_cpu, you can already use Mask::new_luminance, I don't think more is needed here to implement what's required for SVG?

@LaurenzV In vello_cpu, what is the different between specifying a mask using the mask paramter to a layer vs. creating an extra later and using blend modes to achieve a masking effect (which I believe is the only available approach in vello classic)? Is there an advantage (performance?) to the mask parameter, or is it just a convenience?

@LaurenzV
Copy link
Copy Markdown
Collaborator

I think this was discussed in the Zulip before, basically I wasn't aware you can use blending to simulate this effect, but in any case blending is super slow on the CPU, so I think having masks as an explicit special case makes sense there.

@Keavon
Copy link
Copy Markdown
Contributor

Keavon commented Aug 28, 2025

I haven't followed closely as to the technical aspects of this and how it aligns with the desired approach within Vello's engineering direction, but I did want to pop in and just mention that this is a blocker for Graphite in its current form (unless we can use a workaround of some sort).

@DJMcNab DJMcNab removed the request for review from raphlinus September 2, 2025 14:50
github-merge-queue Bot pushed a commit that referenced this pull request Sep 4, 2025
Supersedes #1121

cc @Keavon does this address your need/use case?

cc @mTvare6, as this impacts your PRs

---------

Co-authored-by: mtvare6 <mtvare6@proton.me>
@mTvare6 mTvare6 closed this Sep 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants