raidho36 wrote: ↑Sun Feb 25, 2018 9:03 am
Are you "losing" FPS? As in, compared to not using quads and just drawing individual sprites?
Yes..that's exactly what I'm saying.
I ran many tests and noticed drawing any objects at all even without quads hits the frame rate quite considerably. I set up an object and all it does is add itself to the bump world (see code below) and the more objects I add, the lower the frame rate gets. With just the player standing on a floor with no graphics the fps is 80, adding 90 blank objects to the world takes it down to 60. Then from there other objects can easily take it right down to 40 if they use quads at all.
I tried using a font and we were dead at 10 fps. This was all on an iPhone 6 in the simulator as well. I was adding this object:
Code: Select all
local class = require 'lib.middleclass'
local Object = class('Object')
function Object:initialize(world, l,t,w,h)
self.world, self.l, self.t, self.w, self.h = world, l,t,w,h
self.world:add(self, l,t,w,h)
self.created_at = love.timer.getTime()
end
function Object:getUpdateOrder()
return self.class.updateOrder or 10000
end
function Object:__tostring()
return ("%s %f %f [%f %f]"):format( self.class.name, self.l, self.t, self.w, self.h )
end
return Object
Code: Select all
local class = require 'lib.middleclass'
local Object = require 'entities.object'
local Intang = class('Intang', Object)
function Intang:initialize( world, l,t,w,h, tile, type )
Object.initialize(self, world, l,t,w,h)
end
function Intang:draw()
end
function Intang:update(dt)
end
return Intang
Also they're not sprites, they're just background tiles so why would I need sprite batching?