Polygon is too bitmap.

General discussion about LÖVE, Lua, game development, puns, and unicorns.
1Minus2P1Stringer2
Prole
Posts: 6
Joined: Mon May 13, 2024 4:05 pm

Polygon is too bitmap.

Post 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?
User avatar
mön
Prole
Posts: 13
Joined: Thu Sep 18, 2008 8:53 am
Location: Zurich
Contact:

Re: Polygon is too bitmap.

Post 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
User avatar
togFox
Party member
Posts: 797
Joined: Sat Jan 30, 2021 9:46 am
Location: Brisbane, Oztralia

Re: Polygon is too bitmap.

Post by togFox »

img:setFilter("linear", "nearest")


??
Last project:
https://togfox.itch.io/hwarang
A card game that brings sword fighting to life.
Current project:
Turn-based PBEM horse stable (racing) management sim: https://togfox.itch.io/horse-stable-manager
https://discord.gg/HeHgwE5nsZ
User avatar
dusoft
Party member
Posts: 531
Joined: Fri Nov 08, 2013 12:07 am
Location: Europe usually
Contact:

Re: Polygon is too bitmap.

Post 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?
User avatar
togFox
Party member
Posts: 797
Joined: Sat Jan 30, 2021 9:46 am
Location: Brisbane, Oztralia

Re: Polygon is too bitmap.

Post by togFox »

polygon and image are different beasts maybe so it might not be the filter but agree it should be the default option.
Last project:
https://togfox.itch.io/hwarang
A card game that brings sword fighting to life.
Current project:
Turn-based PBEM horse stable (racing) management sim: https://togfox.itch.io/horse-stable-manager
https://discord.gg/HeHgwE5nsZ
User avatar
slime
Solid Snayke
Posts: 3143
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: Polygon is too bitmap.

Post 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.
1Minus2P1Stringer2
Prole
Posts: 6
Joined: Mon May 13, 2024 4:05 pm

Re: Polygon is too bitmap.

Post by 1Minus2P1Stringer2 »

What I mean by bitmap is like it looks like this. Love2d polygons have to have higher res capabilities right?
Attachments
Screenshot 2024-05-17 194611.png
Screenshot 2024-05-17 194611.png (592 Bytes) Viewed 892 times
User avatar
pgimeno
Party member
Posts: 3589
Joined: Sun Oct 18, 2015 2:58 pm

Re: Polygon is too bitmap.

Post 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.
1Minus2P1Stringer2
Prole
Posts: 6
Joined: Mon May 13, 2024 4:05 pm

Re: Polygon is too bitmap.

Post 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.
User avatar
zorg
Party member
Posts: 3449
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: Polygon is too bitmap.

Post 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.
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests