-
Notifications
You must be signed in to change notification settings - Fork 117
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
Support shape-rendering="crispEdges"
for aliased shapes in the software renderer
#2499
base: main
Are you sure you want to change the base?
Conversation
@OverloadedOrama Hello, Thanks for your contribution. I am curious about the practical use of this feature in user applications. Could you provide some tips on use cases? |
@OverloadedOrama One more question, do you really need to apply this per shape or scene? or is it applied to the full screen in the ThorVG canvas? |
@hermet Hello! I am working on a pixel art editor made with Godot, and I want to implement support for vector layers in order to have non-destructive shapes, and my idea is to construct a SVG behind the scenes that gets rasterized by Godot/ThorVG in order to be drawn in the canvas. This already can work fine, but all shapes are currently anti-aliased, with no option to turn it off, which doesn't work well with pixel art. So I thought to use the I think this needs to be applied per-shape, just like the attribute is per-shape in SVG, in order to allow users to choose which shapes are anti-aliased and which ones are not. |
@RuiwenTang @SergeyLebedkin Hello, could you please confirm with the GL/WG engine side if they can allow the AA option per shape? |
49972ae
to
25cf78c
Compare
I'm not sure why unit tests are failing. For some reason, if I uncomment either line 90 or line 91 on |
25cf78c
to
64945aa
Compare
64945aa
to
bf7c262
Compare
bf7c262
to
0f5cf9a
Compare
87ee4f3
to
9b43b93
Compare
Implements #1869 for the software renderer. If the
shape-rendering="crispEdges"
attribute is used in the SVG, the software renderer does not use anti-aliasing for the shape's lines. The rest of theshape-rendering
values just default to anti-aliasing, I'm not sure how else to handle them. I tested it with svg2png and Godot and it seems to be working as intended.Tested using the following svg file:
Result png:
This is the first time I'm contributing to ThorVG, hopefully I did everything right. 😅