• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Legacy GM which is better drawing optimized ?

kerim

Member
Hey,
Lets say i do draw 5000 sprites in a room with all 32x32 and room is 3200x1600.

should i direct draw them ahead or should i use a surface which is in gui length and width (1408,800)
and draw the sprites on there?
 
Last edited:

Simon Gust

Member
Only tiles have that automatic not-drawing-outside-view Thing.

With sprites, if you draw 5000 of them I think your gpu will explode.
You should definetly look into tiles.
 

kerim

Member
actually i have tested many times game runs on 40-50 fps with 5k sprites and 5k shadows(just black draw of sprite)
ok i'll look at tiles
 

GMWolf

aka fel666
should i direct draw them ahead or should i use a surface which is in gui length and width (1408,800)
and draw the sprites on there?
drawing them to another surface will not help whatsoever. You are still drawing the sprites!
Room size means nothing for performance. Its just a number. the back buffer will only be the size of your window. it is not tied to room size.

Why/how are you drawing your 5k sprites? could we have a look at the code? we might be able to point out some ineficiencies. (5k sprites at 50fps is pretty bad. IDK what is acheivable with GM by my own 3D engine was able to churn out hundreds of thousands models at over 60 fps on a old mid range GPU. I would expect GM to be able to render more sprites than that).
 
For anything that is static (doesn't move, or moves in a deterministic way), look into using vertex buffers. Nothing will beat that.

If you just try to draw huge numbers of random sprites using gml, gml is just too slow for that. Actually, instance sprites outside of the (2d) view will never even be written to a vertex buffer or sent to the gpu. The gpu would easily be able to handle 5000 sprites under most circumstances. However, whatever gml is doing to process the sprites before even writing them to a vertex buffer, is not efficient. So drawing lots of sprites this way will not be good for performance.
 

Simon Gust

Member
Why/how are you drawing your 5k sprites? could we have a look at the code? we might be able to point out some ineficiencies. (5k sprites at 50fps is pretty bad. IDK what is acheivable with GM by my own 3D engine was able to churn out hundreds of thousands models at over 60 fps on a old mid range GPU. I would expect GM to be able to render more sprites than that).
To put it into perspective, my gpu could just barely handle a filled screen worth of 16x16 sprites with the draw_sprite command last time I checked. Thats like 8000 calls. Still though, you might not want to give out processing power for rendering like that. Its also electrical power that you're using. Notebook users do not approve.
 

GMWolf

aka fel666
To put it into perspective, my gpu could just barely handle a filled screen worth of 16x16 sprites with the draw_sprite command last time I checked. Thats like 8000 calls. Still though, you might not want to give out processing power for rendering like that. Its also electrical power that you're using. Notebook users do not approve.
Hmmm, thats pretty rubbish. I was sure GM could handle more than that...
 
Top