Page 1 of 2

Polygon is too bitmap.

Posted: Mon May 13, 2024 4:10 pm
by 1Minus2P1Stringer2
Im using love.graphics.polygon, and its working, but the resulting polygon looks to pixelated to me, is there a way to make it have a higher quality to make it look more closer to an svg?

Re: Polygon is too bitmap.

Posted: Tue May 14, 2024 6:46 am
by mön
Pixelated like aliased? You could enable multi-sampled antialiasing by adding a conf.lua to your project with following code:

Code: Select all

function love.conf(t)
    t.window.msaa = 4                   -- The number of samples to use with multi-sampled antialiasing (number)
end
https://love2d.org/wiki/Config_Files

Re: Polygon is too bitmap.

Posted: Tue May 14, 2024 11:09 am
by togFox
img:setFilter("linear", "nearest")


??

Re: Polygon is too bitmap.

Posted: Tue May 14, 2024 7:51 pm
by dusoft
togFox wrote: Tue May 14, 2024 11:09 am img:setFilter("linear", "nearest")


??
Probably that. Shouldn't this be a default option, anyway? I see many people having these issues on the forums. What does @slime think?

Re: Polygon is too bitmap.

Posted: Tue May 14, 2024 9:55 pm
by togFox
polygon and image are different beasts maybe so it might not be the filter but agree it should be the default option.

Re: Polygon is too bitmap.

Posted: Wed May 15, 2024 2:51 am
by slime
dusoft wrote: Tue May 14, 2024 7:51 pm What does @slime think?
As-is, people who use nearest talk about setFilter / setDefaultFilter. And people who use linear don't. So just listening to who's talking about it won't tell you how many people are using each mode. :)

Both have valid uses for different art / aesthetic styles. Personally I don't think changing the default has enough value to offset the fact that it would be an unwanted change for many people. But my opinion could be changed with a strong argument, I just haven't seen one so far.

Either way the choice has no effect on polygons and other shape APIs.

Re: Polygon is too bitmap.

Posted: Fri May 17, 2024 11:48 pm
by 1Minus2P1Stringer2
What I mean by bitmap is like it looks like this. Love2d polygons have to have higher res capabilities right?

Re: Polygon is too bitmap.

Posted: Sat May 18, 2024 6:26 am
by pgimeno
Have you tried what mön said? Filled polygons and circles are made of OpenGL triangles, which are usually rendered by default without antialiasing. setFilter won't help in this case though.

Re: Polygon is too bitmap.

Posted: Sat May 18, 2024 11:48 pm
by 1Minus2P1Stringer2
pgimeno wrote: Sat May 18, 2024 6:26 am Have you tried what mön said? Filled polygons and circles are made of OpenGL triangles, which are usually rendered by default without antialiasing. setFilter won't help in this case though.
Yes. I have. But, i mean, the Pixel res has to have higher capabilities right? Like with circles? Triangles look basically great but circles are a bit mid.

Re: Polygon is too bitmap.

Posted: Sun May 19, 2024 8:04 pm
by zorg
You said polygon before, not specifically circle;
love.graphics.circle has an extra segments parameter you can give a high enough number so it looks smoother; try that.