-
Notifications
You must be signed in to change notification settings - Fork 11
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
Alpha should apply to layer as a whole, not every element in layer #37
Comments
This is known. There's a workaround for full-image alpha: (apologies for formatting, this is copy/pasted from bevy_vello) let scene_buffer = Scene::new();
let scene = velato...render(...);
scene_buffer.push_layer(
vello::peniko::Mix::Normal,
*alpha,
*affine,
&vello::kurbo::Rect::new(
0.0,
0.0,
asset.width as f64,
asset.height as f64,
),
);
}
scene_buffer.append(scene, None);
scene_buffer.pop_layer(); |
@dfrg or @DJMcNab or @waywardmonkeys - Do we have any opinions about whether we should change the render method to match user expectations for alpha? |
Considering this also applies to layers and groups with transparency, what would be the reason for not changing the behavior? Just to reduce the number of clip layers? Because as is, Velato will not correctly render any layer or group with transparency that contains overlapping shapes. That is, this problem isn't specific to the |
I think I agree, this could be easily fixed and a PR would be appreciated. For historic context - If I recall correctly, some of the friction was that you need a shape to clip by, and that's not always correct or obvious. For a lottie file, we could use the |
I’d say it should either be fixed or the parameter should be removed since the behavior is clearly incorrect. If lottie layers are exhibiting the same problem, which seems likely, we should surround them with vello layers when alpha is non-unity. |
I agree, we should probably use a Vello layer here. I think we probably should have an issue in Vello tracking the implementation of linebender/vello#623 |
When modifying the with_winit example to render with a non-unity alpha, such as
the result looks like
with each component of the tiger having alpha applied to it individually. Instead, the alpha should apply to the rendered image as a whole.
I suspect, but haven't confirmed, that the same issue exists for layers specified by the lottie file.
The text was updated successfully, but these errors were encountered: