Bug 461801 - Several layer styles don't tile properly when used with vector shapes in wraparound mode
Summary: Several layer styles don't tile properly when used with vector shapes in wrap...
Status: CONFIRMED
Alias: None
Product: krita
Classification: Applications
Component: layer styles (other bugs)
Version First Reported In: 5.1.3
Platform: Manjaro Linux
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-11-14 05:19 UTC by varkatope
Modified: 2024-08-22 16:39 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
Krita file that illustrates the problem. Turn on wrap-around mode to see. (332.57 KB, application/x-krita)
2022-11-14 05:19 UTC, varkatope
Details

Note You need to log in before you can comment on or make changes to this bug.
Description varkatope 2022-11-14 05:19:24 UTC
Created attachment 153729 [details]
Krita file that illustrates the problem. Turn on wrap-around mode to see.

SUMMARY
***
Not sure how fixable this is, but using most layer styles with vector shapes in wraparound mode produces artifacts at the image bounds. I guess it's not exactly an artifact and more that the layer style's effect terminates at the image bounds, but the result is that it doesn't tile properly in any case.
***


STEPS TO REPRODUCE
1. Create a new square image.
2. Turn on wraparound mode.
3. Create a raster shape that extends past the edges of the original image size so that it's perfectly wrapping around.
4. Do the same with a vector shape, either to the image bounds or past it.
5. Apply the same layer style to both: This seems to manifest with outer glow, inner glow, bevel and emboss, drop shadow, possibly others.

OBSERVED RESULT
The vector shape with the layer style applied will exhibit artifacts at the edges of the original image bounds, whereas the raster shape will wrap around perfectly with the layer style applied.

EXPECTED RESULT
I would expect the two shapes to look the same when wrapping around. This does work in Photoshop, but I don't know the technical of that. PS seems to calculate the layer style differently when the object touches the image bounds.

Strangely, if I drag around the raster layer (with the same layer style applied) over the vector area where the artifacts occur, then move it back to where it was and redraw the canvas manually (from script or the plugin I'm writing), the artifacts on the vector layer go away. I can even then export the image without artifacts if I do this. However, if I hide the vector layer and bring it back, the artifacts reappear. Not sure if that means it's just a rendering bug then, but it is weird that this works even temporarily.

I did have some issues with more serious drawing artifacts getting baked into the image at the layer bounds, even when redrawing the canvas, but I deactivated "Use texture buffer" (I'm on Radeon mobile) and that seems to have at least fixed the "getting baked into the image" part. I still see artifacts, but redrawing the canvas or hiding/unhiding the layer now fixes that. Doesn't fix this tiling vector layer with layer styles issue, though.

I also tried deactivating rendering acceleration altogether just in case, but that doesn't solve this issue (you can't use wrap around mode, but the issue is still evident at the edges).

SOFTWARE/OS VERSIONS
Manjaro Linux 22.0.0 all up to date
XFCE 4.16
AMD Ryzen 5 2500U
Device-1: AMD Raven Ridge [Radeon Vega Series / Radeon Mobile Series]
    driver: amdgpu v: kernel
API: OpenGL v: 4.6 Mesa 22.2.1 renderer: AMD Radeon Vega 8 Graphics
    (raven LLVM 14.0.6 DRM 3.48 6.0.6-1-MANJARO)

ADDITIONAL INFORMATION

The plugin I'm writing is to streamline normal map creation (using the height to normal filter layer) for making tiling normal maps (for trim sheets and the like) for game engines and DCC programs, and ideally, I'd be able to offer a workflow that involves creating complex vector shapes using boolean operations and then applying layer styles to create effects like beveled edges and gradients, and have them tile properly across image boundaries. It all works fairly well with raster layers, and vector shapes as long as they don't extend past the image bounds, but I'd like to also be able to use vectors in a tiling way since cutting up raster layers is more destructive/less editable.
Comment 1 wolthera 2023-01-12 12:33:57 UTC
Hi, thank you for your report.

I can confirm with the Krita Version: 5.2.0-prealpha (git 5c98a72) Appimage with Qt 5.15.7

Not sure what is causing it though, maybe layer styles are applied to the projection somehow instead of the full layer?
Comment 2 Dmitry Kazakov 2024-08-22 16:39:07 UTC
Remove triaged keyword from CONFIRMED bugs