The rounded rectangle in fill mode has strong aliasing.

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
yangsiyu
Prole
Posts: 3
Joined: Mon Jun 10, 2024 1:15 am

The rounded rectangle in fill mode has strong aliasing.

Post by yangsiyu »

* fill mode
2024-06-10_09-19.png
2024-06-10_09-19.png (58.72 KiB) Viewed 1936 times
* line mode
2024-06-10_09-26.png
2024-06-10_09-26.png (72.58 KiB) Viewed 1936 times
Looking at the source image, they are quite different.
yangsiyu
Prole
Posts: 3
Joined: Mon Jun 10, 2024 1:15 am

Re: The rounded rectangle in fill mode has strong aliasing.

Post by yangsiyu »

Drawing filled circles also has the same issue.
User avatar
slime
Solid Snayke
Posts: 3166
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: The rounded rectangle in fill mode has strong aliasing.

Post by slime »

Lines have their own custom antialiasing/smoothing applied by default (the "smooth" line style) which is only for lines and not other things like images or filled shapes. To have antialiasing on filled shapes, two common approaches are to enable MSAA on the window or to draw a line shape at the same spot as the filled shape.
yangsiyu
Prole
Posts: 3
Joined: Mon Jun 10, 2024 1:15 am

Re: The rounded rectangle in fill mode has strong aliasing.

Post by yangsiyu »

slime wrote: Mon Jun 10, 2024 2:21 am Lines have their own custom antialiasing/smoothing applied by default (the "smooth" line style) which is only for lines and not other things like images or filled shapes. To have antialiasing on filled shapes, two common approaches are to enable MSAA on the window or to draw a line shape at the same spot as the filled shape.
Thanks :awesome:
RNavega
Party member
Posts: 385
Joined: Sun Aug 16, 2020 1:28 pm

Re: The rounded rectangle in fill mode has strong aliasing.

Post by RNavega »

Also see this alternative, drawing a quad Mesh and using a shader for antialiasing the round corners:
viewtopic.php?p=259055#p259055

If you need the rectangle to be drawn while rotated then you'd need a different shader, one that smooths not only the round corners but also the straight sides.
Post Reply

Who is online

Users browsing this forum: Google [Bot], Majestic-12 [Bot] and 9 guests