I just wondered why love.graphics.circle and love.graphics.arc are so inefficient.
A Mesh or even love.graphics.polygon performs a lot better.
Is there any reason to use love.graphics.circle over love.graphics.polygon?
love.graphics.circle vs love.graphics.polygon
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- slime
- Solid Snayke
- Posts: 3132
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
- Contact:
Re: love.graphics.circle vs love.graphics.polygon
Are you comparing love.graphics.circle to a love.graphics.polygon call which has the same number of segments as the love.graphics.circle? They should have almost the same performance in that case.
Re: love.graphics.circle vs love.graphics.polygon
Hmm, I don't know what the default number of segments for love.graphics.circle is,
but when drawing many circles with different changing radii I get sudden framerate drops that I don't get with love.graphics.polygon.
My custom circle function uses up to 2^12 segments, depending on the radius.
Instead of love.graphics.arc I use a mesh, because when drawing 6 arcs I get 15 FPS with love.graphics.arc, while I get 46 FPS with a mesh.
This may of course not make a difference on stronger hardware.
but when drawing many circles with different changing radii I get sudden framerate drops that I don't get with love.graphics.polygon.
My custom circle function uses up to 2^12 segments, depending on the radius.
Instead of love.graphics.arc I use a mesh, because when drawing 6 arcs I get 15 FPS with love.graphics.arc, while I get 46 FPS with a mesh.
This may of course not make a difference on stronger hardware.
- slime
- Solid Snayke
- Posts: 3132
- Joined: Mon Aug 23, 2010 6:45 am
- Location: Nova Scotia, Canada
- Contact:
Re: love.graphics.circle vs love.graphics.polygon
Meshes will almost always get better performance than love.graphics.circle/polygon/etc. if you aren't calling Mesh:setVertex a bunch every frame, since drawing the mesh just tells the graphics driver to draw vertices that are already living in VRAM, whereas love.graphics.circle/etc. have to upload the vertices and tell the graphics driver to draw them in the same function.
Re: love.graphics.circle vs love.graphics.polygon
Sorry for the necrobump, but I'm having a problem exactly. I need to update only the V texture coordinate for a mesh, but for that I only see mesh:setVertex, and I'm having a significant performance drop because of that. Would there be a way to only update the V texture coordinate, or U and V only, instead of changing all the vertices?
Who is online
Users browsing this forum: Google [Bot] and 115 guests