Spritebatches and perspective

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.
KayleMaster
Party member
Posts: 234
Joined: Mon Aug 29, 2016 8:51 am

Re: Spritebatches and perspective

Post by KayleMaster »

You can only trade limitations for other limitations so you are correct. I guess we won't know for sure until we measure it.
User avatar
raidho36
Party member
Posts: 2063
Joined: Mon Jun 17, 2013 12:00 pm

Re: Spritebatches and perspective

Post by raidho36 »

Exactly. The #1 principle you should use when optimizing things is "Don't Guess; Measure".

I'm eager to see what Vulkan upgrade could bring to the engine. New API is substantially better suited for large amounts of draw calls. Hopefully this will eliminate the need for sprite batching as well as using atlases.
User avatar
Positive07
Party member
Posts: 1014
Joined: Sun Aug 12, 2012 4:34 pm
Location: Argentina

Re: Spritebatches and perspective

Post by Positive07 »

for i, person in ipairs(everybody) do
[tab]if not person.obey then person:setObey(true) end
end
love.system.openURL(github.com/pablomayobre)
User avatar
raidho36
Party member
Posts: 2063
Joined: Mon Jun 17, 2013 12:00 pm

Re: Spritebatches and perspective

Post by raidho36 »

Vulkan is a successor to OpenGL so it will get deprecated eventually. No point in clinging to it now.
User avatar
Positive07
Party member
Posts: 1014
Joined: Sun Aug 12, 2012 4:34 pm
Location: Argentina

Re: Spritebatches and perspective

Post by Positive07 »

Well remember that OpenGL 2.1 (the oldest supported version used by LÖVE) is 10 years old, so if we say that 10 years need to pass in order for LÖVE to deprecate an OpenGL version then in order to deprecate the latest (OpenGL 4.5) entirely that would be around 2024.

So yeah LÖVE will use Vulkan at some point, but not anytime soon.

Plus it is another backend that LÖVE needs to support and I don't think there is someone that is interested in writing code for that, with no observable benefit at the short run (there may be far more benefits in the long run, by changing LÖVE API's to better fit the Vulkan ones), and it being a really new API it is not completely stable nor supported by most GPU's.

So yeah, my point was, that I don't think LÖVE will use Vulkan anytime soon, ask slime or other dev if you want to, but there is no point in us discussing this since we won't decide on the future of LÖVE and we are derailing the thread so we better stop
for i, person in ipairs(everybody) do
[tab]if not person.obey then person:setObey(true) end
end
love.system.openURL(github.com/pablomayobre)
User avatar
slime
Solid Snayke
Posts: 3132
Joined: Mon Aug 23, 2010 6:45 am
Location: Nova Scotia, Canada
Contact:

Re: Spritebatches and perspective

Post by slime »

KayleMaster wrote:It doesn't send anything to the gpu, I use :flush to send the whole sprite batch to the gpu after adding the 4096 tiles using :add.
Correct. And many SpriteBatch:add calls every frame is still a lot more efficient than the same number of love.graphics.draw calls, since the former uses batching (both when transferring the data to the GPU and when drawing it) and the latter doesn't.
raidho36 wrote:I'm eager to see what Vulkan upgrade could bring to the engine. New API is substantially better suited for large amounts of draw calls. Hopefully this will eliminate the need for sprite batching as well as using atlases.
Vulkan's API is verbose and difficult to use - it requires a lot of code and careful use of its memory allocation and synchronization functionality... just to get roughly on par with OpenGL in terms of performance (and correctness).

Vulkan can reduce the overhead for draw calls, but the reality is that the underlying GPU hardware doesn't like small vertex counts in draw calls either. Batching will always bring better performance, lower power usage, and better utilization of the GPU.

That said, there are other things that can be done in love's code and APIs besides using a different graphics API, to improve performance in cases like this. Stay tuned... :)
User avatar
Positive07
Party member
Posts: 1014
Joined: Sun Aug 12, 2012 4:34 pm
Location: Argentina

Re: Spritebatches and perspective

Post by Positive07 »

Oh, totally forgot about flushing! The "inefficient" 4096 add calls may be better than sorted draw calls, and far more efficient than 1x1 clusters

And damn you clickbait slime, you got me hooked!
for i, person in ipairs(everybody) do
[tab]if not person.obey then person:setObey(true) end
end
love.system.openURL(github.com/pablomayobre)
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 152 guests