-
Notifications
You must be signed in to change notification settings - Fork 464
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
Atlas Opacity #2528
Comments
Could the issue be that colors are expected to be premultiplied? e.g: rgba(${255 * opacity}, ${255 * opacity}, ${255 * opacity}, ${opacity}). I'm closing it for now but let me know if that doesn't fix the issue. |
@wcandillon Same here. I've built a prototype and my results are exactly as @nathan-ahn mentioned: blendMode = srcOut used along with any color uses color alpha channel for specifying opacity of an individual sprite, but when sprites overlap, next rendered sprite completely overrides previously rendered one. I've tried both: managed expo and prebuilt skia: 1.5.0 and 1.8.2 respectively, but results were the same. #2809 I've also tried attaching a shader to atlas, but that didn't work either - shader has been completely ignored. So, I'm assuming, atlas is using it's own shaders that don't let any other shaders to come into play (not sure of that, just an assumption). Or maybe I were attaching it in a wrong way. So, what would be a better approach to implement call batching for sprites? Maybe, a custom blending mode? Or maybe a custom fragment shader? And, by the way, does Skia have call batching on it's own? @wcandillon Kindly advice. |
@wcandillon William, I'm willing to contribute into this too, if possible. Pre-multiplied colors didn't work, unfortunately. |
Description
Description
I believe Atlas could cover a wider range of use-cases with support for individual opacity. I've done some experimentation, and as far as I can tell, it's not possible even with creative usage of
colors
andblendMode
. (Closest I've gotten was setting colors usingrgba(255, 255, 255, ${opacity})
andblendMode="srcOut"
, but that loses the opacity of the original texture).If this is possible, I'd be happy to help out with a pull request with guidance.
Thanks as always for all the awesome work on this package!
The text was updated successfully, but these errors were encountered: