Limit on sprites?

Blitz3D Forums/Blitz3D Programming/Limit on sprites?

ICECAP(Posted 2005) [#1]
I seem to have hit a limit on the amount of sprites i can put in one scene. 16500. Is this a known issue? Or is there a way around it?


octothorpe(Posted 2005) [#2]
I'm no expert on the subject, but I believe that Blitz's builtin Sprites system uses one surface per Sprite. While you should be able to display a huge number of triangles without much slowdown, having the same number of triangles spread out on too many surfaces will slow your game down considerably. There may also be a limit on how many surfaces you can have.

If you ditch the Blitz Sprites system, you can achieve the same effect by creating quads (two triangles to make a square). This will allow you to manage your surfaces, doubling up quads which share the same brushes (read: textures.) There are also several libraries out there that take care of the nit-and-grit of this for you.


Baystep Productions(Posted 2005) [#3]
16500 is a preety high number anyways, I wouldn't be disapointed.


BlackD(Posted 2005) [#4]
It may depend on your video card, I recall writing some proof-of-concept voxel code a while back to handle 300,000 sprites on screen. I'm just wondering, what kind of scene are you generating which requires over 16,500 sprites? :)

+BlackD


ICECAP(Posted 2005) [#5]
Yeah i am making a grassy plane. As in lots and lots of grass. I wanted to get it looking as good as i could get it on our companies decent laptop (builtin ati x700). I seem to have cracked it anyway. Here is a shot:



skyfire1(Posted 2005) [#6]
OT: that demo looks great but i think that you should make the grass a little more hanging - if you know what i mean.


ICECAP(Posted 2005) [#7]
You might be right. I will give it a go tomorrow, i'm off home now.


Banshee(Posted 2005) [#8]
If you re-use your grass sprite entities as you move about and you should only need a few hundred entities for the same screenshot and your program will run much faster.


ICECAP(Posted 2005) [#9]
Thanks Becky, i actually never thought of doing it that way. I'll give it a go.


Banshee(Posted 2005) [#10]
My answer to this post may provide some ideas of one way to go about it: http://www.blitzbasic.com/Community/posts.php?topic=51466