Page 1 of 1

Scissor Speed

Posted: Sat Mar 16, 2013 5:58 pm
by Pinkishu
Hey there,

so i'm drawing a level on the screen, basically just a set of tiles (which each are 16x16px)
But the level is likely to exceed the space on the screen, thus i'm wondering if its enough to set a scissor of the full window size (or is that unneeded/the default) to not waste time trying to draw tiles that aren't on the screen anyway; or if it would performance-wise be better to calculate which tiles are actually on the screen and only draw those anyway.

Re: Scissor Speed

Posted: Sat Mar 16, 2013 6:57 pm
by slime
The best tile optimization you can do is to use a SpriteBatch (explained a bit more here.)
If you're drawing individual tiles with love.graphics.draw, it will probably be much more efficient to calculate and draw only the onscreen tiles rather than just using a scissor, depending on how your tile data structure is set up.

SpriteBatches and Sprite Sheets go hand-in-hand: http://www.codeandweb.com/what-is-a-spr ... erformance

Re: Scissor Speed

Posted: Sun Mar 17, 2013 1:25 am
by Pinkishu
Ok, looked into that and had some help on the LÖVE IRC also :3 Thanks ^^