Need Ideas to speed up renderworld()

Blitz3D Forums/Blitz3D Programming/Need Ideas to speed up renderworld()

Nexic(Posted 2004) [#1]
I am currently in the finishing stages of a space invaders/galaxians style game. I displays roughly 20-80 enemy ships on the screen at any one time. The enemy ships are B3D models, the game also has a large number of particle effects and lasers done with standard sprites. After using Micheal Reitzen's (sp?) profiler I found out that the only real place for much speed improvment was at renderworld().

I have done many experiments, removing certain things and recording the speed gain (if any) and almost nothing seems to impact the framerate except not displaying as many ships.

Due to the nature of the game I cannot really physically reduce the enemy numbers, but I was wondering if anyone knew any general ways to speed up the render of a model? I am pretty new to blitz and im sure there must be some undocumented commands which might help out.

Thanks,
-Nex


Sweenie(Posted 2004) [#2]
If you have for example 20 entities that looks the same(uses the same mesh) make sure that they are clones of the original entity.
This should make it a bit faster since the gfxcard would reuse the same vertexbuffer.


JKP(Posted 2004) [#3]
If you can reduce the number of polygons contained in the models then it should make a big difference. Use the TrisRendered() function to find out how many triangles are being rendered during RenderWorld


John Pickford(Posted 2004) [#4]
A single surface particle system is your best bet.


Nexic(Posted 2004) [#5]
The entities are already clones and using lower polygon models didnt really seem to help much.


Beaker(Posted 2004) [#6]
You need a single surface particle system as John said. It might be worth combining it with text if you are doing that with sprites as well.

You could also try combining the ships into one or a handful of surfaces as well, attaching each one to a bone. It will be a balancing act between CPU processing and render time.


John Pickford(Posted 2004) [#7]
Polycount is rarely the issue. Surface count seems to have a bigger impact.


SabataRH(Posted 2004) [#8]
Screen fill-rate plays a big part as well, how large are those ship textures? ?


big10p(Posted 2004) [#9]
Eeek! Don't use blitz sprites for particles - each one is a separate surface. Here's another vote for single surface particles for the best speedup.


John Pickford(Posted 2004) [#10]
Alienhead, Texture size is nothing to do with fillrate. It's the size of the polygon on screen that matters, not the size of the texture. Textures are sampled so size is irrelevant.


JoshK(Posted 2004) [#11]
Use the "fast" flag.

RenderWorld(fast=true)


Jeremy Alessi(Posted 2004) [#12]
LOL


Nexic(Posted 2004) [#13]
Im not really sure how to go about doing single surface particles, or how to combine ships into one surface (each ship can move independently and so i dont think that would work?) Can someone give me a link to an article or tutorial on this?


Beaker(Posted 2004) [#14]
Single surface particles and single surface entity system:
http://www.blitzbasic.com/codearcs/codearcs.php?code=978

Watch out cos it has a few bugs!


Defoc8(Posted 2004) [#15]
1] - store all your texture data in one texture map..
2] - group objects by material under root nodes, i created
some test code for this + it seems to improve fps
in some cases..though mainly for simple geometry..
though if you are storing all your images in one
texture this is pointless...

hmmm..are you using sprites or meshes..erg..if its sprites,
single surface systems are the way to go..
- its a fine balance..state changes vs cpu vs upload time..
supposedly you can improve single surface performance by
updating mesh data bursts..but this is sketchy & very system
dependent..also, i dont know how blitz treats the dynamic
vertex editing code..so it may be totally pointless :/

ok..um..that probably doesnt help...lol ;)


Beaker(Posted 2004) [#16]
Take a look here for more info:
http://www.blitzbasic.com/Community/posts.php?topic=38845