Sprite slowdown?

Blitz3D Forums/Blitz3D Beginners Area/Sprite slowdown?

Liberator(Posted 2005) [#1]
I have a project thats displaying thousands upon thousands of faces, full collision running, the works. It runs at 60 fps solid, no dips. I went to make a little fire by making a particle system using sprites and a .tga file for the fire texture. I loaded in 200 sprites...and the frame rate drops to 12 fps.....um what?! I looked it over many many times, I tried loading in the sprites with no texture - same results. I even tried loading them in one at a time as the fire burns, and when the fire was at about 100 sprites, the framerate went back down to 12-20. I thought sprites were only 2 poyls! How then does 400 extra polys in a world full of tens of thousands slow it down?!? Is there more going on here under the hood then I'm aware of?


jfk EO-11110(Posted 2005) [#2]
When there is alpha transparency, it may be very slow when you have a lot of sprites across the screen.

Try to

t=loadtexture("whatever.bmp") ; load without alpha
sp=createsprite()
entitytexture sp,t

you may now compare the speed. I guess it's the alpha, but I could be wrong.

Using an Additive Blendmode may be faster.


Liberator(Posted 2005) [#3]
Well like I mentioned in my post, I tried loading the sprite with no texture at all, just that basic white defualt color that's on it when its created. The results were the same. This is very confusing...mabye its somthing somewhere else in my program, perhaps its just my computer...I heard someone mention somthing about the more entities are on the screen or in the program, the slower it will go...is there any truth to that? if so, perhaps thats my problem...


Liberator(Posted 2005) [#4]
Ok I figured out whats causing it, but it brings up more questions then anwsers - I am using many many many LinePick commands, and apparently the more entities there are in the world, the more entities the LinePick commands has to look through.....but doesnt setting EntityPickMode to 0 tell it not to look for that particular entity? Makes me think that the linepick command looks through every single entity in the world, and ignores the ones that arent set to 1 or 2, however it still looks at them. That seems really wasteful, anyone know if there is a way to turn that off?


GfK(Posted 2005) [#5]
LinePick is horrendously slow, particularly when picking over large distances. You simply are not going to get away with using "many many many linepicks".


Damien Sturdy(Posted 2005) [#6]
Linepicks are killing my code too, an alternative would be nice o.-


Ross C(Posted 2005) [#7]
200 sprites are slow too. Each of them would be considered a surface, and lots of them will kill your speed. You could try using a single surface particle system.