Skip to content

feat(vello_hybrid): Add clipping support for image rendering #1086

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

grebmeg
Copy link
Contributor

@grebmeg grebmeg commented Jul 4, 2025

This PR adds clipping support for image rendering in vello_hybrid, allowing images to be correctly clipped by multiple nested clip layers.

SCR-20250704-owuq

The x, y coordinates used for sampling depend on clip depth. If a strip is not in clipped space, it receives global strip view coordinates. Otherwise, it uses local slot coordinates, which results in incorrect image sampling — since sampling must occur relative to the global strip position. To address this, position data is now passed for all strips associated with image paints.

Additionally, the logic for determining whether to sample color from a solid rgba value, an image texture, or a slot texture has been refined. The flag used for this distinction was reduced from an 8-bit field to a 1-bit discriminator, enabling the rgba_or_slot field to be reused as a payload across different paint modes.

@nicoburns nicoburns added the C-hybrid Applies to the vello_hybrid crate label Jul 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-hybrid Applies to the vello_hybrid crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants