Speed drop when rotating

BlitzMax Forums/MiniB3D Module/Speed drop when rotating

North(Posted 2007) [#1]
Hi its me again,

i just noticed that a scene that usually runs at ~30fps slows down tremendously when rotating a few entities.
I this example only 5 spheres are rotated and the fps drops from 32 to 8 on my office computer.



Am i doing something wrong? Because if i am not i just can't imagine populating a real scene with entities.


Panno(Posted 2007) [#2]
hmm

rotatemesh with sphere(12) are also slow here

use this ?

spherearray[j].TurnEntity (0,1,0)


simonh(Posted 2007) [#3]
The problem is you're using RotateMesh with several spheres with large amounts of polys. With RotateMesh, each vertex is rotated individually by MiniB3D itself which is quite slow.

Use RotateEntity where possible for real-time stuff.


North(Posted 2007) [#4]
Thing is when i substitute RotateEntity for RotateMesh nothing rotates. Thats why i used RotateMesh in the first place.
Your explanation that every vertex is rotated when using RotateMesh explains the speeddrop. Now i just need to figure out why RotateEntity has no effect in this example.

TurnEntity works nice and quick - thanks.

Now whats wrong with RotateEntity...?

And whats the difference while im at it ;)


simonh(Posted 2007) [#5]
RotateEntity uses absolute values, you need to increment the rotation values for it to rotate.


North(Posted 2007) [#6]
And sorry for another post but your explanation that a sphere with 16 Segments is considered high-poly got me worried. This is very low poly in my book.

So could you please provide some info what polycounts are the norm when working with (mini)B3D?
How many total scene polys are acceptable?
Whats low-poly? eg. 10-1000 poly?
Whats high-poly? 4000-8000?

Whats a good ballpark for e.g. a main character mesh?
Enemy-characters?
Terrains?

Maybe there is info like has already been compiled over the past years of B3D usage? Linky?


simonh(Posted 2007) [#7]
Don't worry about high poly and low poly. Just use whatever works for you.

When I said high poly I was taking into account the fact there were five spheres.


Beaker(Posted 2007) [#8]
They are high-poly for entities being pushed to the graphics card every frame. When you use RotateEntity its only pushing a small amount of data (probably a matrix or similar), whereas RotateMesh pushes all the vertex and triangle data - which is huge.

Its a seperate issue, but polycounts depend on many things: type of game, target hardware, style of graphics, distance from camera, number of surfaces (at least in Blitz3D), use of alpha/masking etc. ie. very hard to pin down.


simonh(Posted 2007) [#9]
Actually without vertex buffers all the vertex data is passed to the graphics card every frame. With RotateMesh however, the vertex positions are rotated in Blitz itself, rather than using the gfx card to do it.


Beaker(Posted 2007) [#10]
Aah! Interesting. My mistake.


North(Posted 2007) [#11]
Thanks - ills just keep adding entities over time and see where the limit is.