Let me explain it:
I have a little map which can get x layers of the z axis. As long as the map has less then 7 layers it renders normally and my cpu is always smaller then 2%.
If I now get over 6 layers (7+) it still renders totally fine (+- 900 FPS) but my CPU is always at 25% (Maxed out).
The affected code snippets:
Code: Select all
function DrawMap(Level) -- Is the love.draw() callback, I just have implemented a custom Event-System to make it bit easier for me
map:Draw()
end
And here is my drawing code:
Code: Select all
function CMap:Draw()
love.graphics.setColor(1,1,1)
for i = #self.Canvas, 1 , -1 do
love.graphics.draw(self.Canvas[i])
end
end
just stores a canvas which is getting created when the map is getting created tooself.Canvas[X]
Changing the MSAA of the canvas does not solve the problem at all.self.Canvas[d] = love.graphics.newCanvas( Screen.x, Screen.y, {msaa = 16} )
Here are some (may be) helpfull information:
- Canvas does NOT get modified every Update OR Draw (will just get modified when it needs to)
- With a depth of 7 layers it will draw 7 canvases not more, not less
- enabling vsync does not help in this case
- Canvases overdraw each other (obviously xD)
- I dont work with threads at all