You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When painting an image on a surface that have already some content without clipping the paint with a path or a clipping operation, the alpha channel of the whole target surface is affected, and set to 0 even where the source surface is no drawn, making previous content invisible (colors are still present, but alpha is 0)
On screen, the problem should not appear, because swapchain's images have no alpha channel, but when saving to png with vkvg_surface_write_to_png(surf, "test.png"); the problem appears.
I'm not completely sure this should be considered as a bug. Paint(ctx) calls do full surface painting, if VKVG_EXTEND_* are used, affecting the whole target is the expected behavior. Default image extend is VKVG_EXTEND_NONE, if preventing affecting the whole alpha channel imply small or easy changes, this could be corrected. If not, the current behavior should be explained in documentation.
The text was updated successfully, but these errors were encountered:
I didn't use your vkvg project to try rendering multiple images. Instead, I wrote a Vulkan project myself to render multiple images, and it has been successfully implemented. The effect is great. This new project has its own VkPipelineLayout and VkPipeline, as well as its own Shader. I'm currently modifying your vkvg code, and I plan to incorporate the code of my new project into your vkvg project. This will be a substantial amount of work. If I manage to implement it later, I will also upload it to GitHub. Thank you for your explanation, and I will also keep a close eye on this issue.
I think I found the problem. When loading an image with alpha into a new surface (vkvg_surface_create_from_bitmap), the blit operation used to copy the pixels is not affecting region with alpha set to 0, so the resulting image surface was having some undefined pixels.
I added a surface clear operation before the blit, and the problem looks solved. I'll push to master the correction.
When painting an image on a surface that have already some content without clipping the paint with a path or a clipping operation, the alpha channel of the whole target surface is affected, and set to 0 even where the source surface is no drawn, making previous content invisible (colors are still present, but alpha is 0)
The following code reproduce the problem:
A simple workaround for now is to clip the drawing either with a path or a clipping operation:
On screen, the problem should not appear, because swapchain's images have no alpha channel, but when saving to png with
vkvg_surface_write_to_png(surf, "test.png");
the problem appears.I'm not completely sure this should be considered as a bug.
Paint(ctx)
calls do full surface painting, ifVKVG_EXTEND_*
are used, affecting the whole target is the expected behavior. Default image extend isVKVG_EXTEND_NONE
, if preventing affecting the whole alpha channel imply small or easy changes, this could be corrected. If not, the current behavior should be explained in documentation.The text was updated successfully, but these errors were encountered: