limit on number of pivots

Blitz3D Forums/Blitz3D Programming/limit on number of pivots

Ross C(Posted 2003) [#1]
hey, firstly, sorry for hogging the board right now!

My questions is, will using ALOT of pivots slow blitz down any? the number i'm talking about is 129,000 at the very most. thanks again ppl!


Koriolis(Posted 2003) [#2]
129,000 ???
Then the answer is yes, of course! Each pivot requires memory to hold the data (position, rotation, etc...). Mutliply this by 129000, and you're requesting far more memory thant your computer can give you.
May I ask what in the world requires 129,000 pivots?


Binary_Moon(Posted 2003) [#3]
Graphics3D 640,480,16,2

For i=1 To 129000
	CreatePivot()
Next

cube=CreateCube()

camera=CreateCamera()
MoveEntity camera,0,0,-5

Repeat

	TurnEntity cube,1,1,1
	
	RenderWorld
	
	Flip

Until KeyHit(1)

End


It'll work (at least it will on my pc) but the frame rates are going to be rubbish

BTW i want to know why you need 129000 pivots as well.


Ross C(Posted 2003) [#4]
it's for a particle system my partner in crime is working on. can't go into specifics but he uses emittor and lots of pivots. that's a therotical max. i know it sounds crazy, but the effects are brilliant looking. Thank you for your answers ^_^


Ricky Smith(Posted 2003) [#5]
Hi joker
If its a Particle system why not use particles instead of pivots ?
Pivots are invisible entities - like a joint - if you propose to then parent a sprite to each of those 129,000 pivots then you will have serious slowdown.
It would make more sense to use a pivot as an emitter rather than as a reference to the particle itself, and Sprites/Tris for the actual particles.
You wouldn't need 129,000 emitters !
Maybe were just confusing terminology here ?


Ross C(Posted 2003) [#6]
hey, the pivots are for the particles to follow producing cool effects. as i say tho, it isn't me that's doing it, was just concerned bout the pivot count, but he seems to have that under control. its nothing to do with parenting, my other post was about a pivot animation shop i am making the now :)

sorry bout the confusion, the pivot as i say are used for various effects. can't say anymore, he wants it kept secret so shhhhhhhhhhhh :o)

thanks for your reply tho!


RetroBooster(Posted 2003) [#7]
Joker I presume I pretty much know where you are going, I made things like pathfollower particles, meshform particles, flocking particles, etc. before. So go save your partner in crime's ass and tell him to use a custom datastructure! ;)

AND

If he cant work without pivots instance any ammount of pivots you need at one time from the datastructure (I'm talking about types when I say datastructure) and re-use them on all occasions!

ANYTHING you can do with 129000 pivots which will kill your game :P, you can also do with no pivots (if you like 3dmaths) or no more then 2 pivots that are being re-used.

good luck with it.


Koriolis(Posted 2003) [#8]
Yep, you should listen what have been said kojer, it's just plain good sense.
Also I must mention that when I said it would take more memory than your computer could give you, I exagerated a little bit. On my PC it takes *only* about 100 MB (gasp!).
Maybe you could believe that then it's affordable, or that you could lower your number of pivots just a very little bit. Wrong.
That number of pivots can really put your computer on his knees. In fact the sample of Binary_Moon didn't even show the problem in all his glory. It just creates the pivot and never touches them again. But if you try to access them regularly, ouch! Try that:
Graphics3D 640,480,16,2

world%=CreatePivot()
For i=1 To 129000
	CreatePivot(world)
Next

cube=CreateCube()

camera=CreateCamera()
MoveEntity camera,0,0,-5

frame% = 0
Repeat

	index% = 1+frame*129
	For i = 1 To 129
		x# = EntityX(GetChild(world, index))
		index = index + 1
	Next

	TurnEntity cube,1,1,1
	
	RenderWorld
	
	Flip
	frame = (frame + 1) Mod 1000
Until KeyHit(1)

End

I only added a loop that will get the x position of each pivot, accessing only 1/1000th of the whole bunch at eahc frame. See how the frame rate slows down constantly (if it's fine on your computer, then you have more memory than me -> change 129 to something like 500).

As said previously, when you have such heavy things to do, use your own computation and data strucutre.
But I'm afraid anyway that if you wanted to use it for particles, don't expect to be able to draw that much particles at each frame on screen. That becomes to be a fair amount for just flat untextured triangles, but for textured and above all blended polygons, ouch, ouch, ouch!


BlitzSupport(Posted 2003) [#9]
Bear in mind Blitz could easily be used to programmatically render high-poly/high-data stuff for output to BMP/AVI, etc -- doesn't necessarily have to be realtime...


simonb(Posted 2003) [#10]
James has made a really good point.

Creating a very complex scene that looks absolutly gorgeous, but takes Blitz a whole fifth of a second to render may sound like a pointless exercise, but it compares very favourably against waiting the several minutes per frame that a full ray-trace could take.


Ricky Smith(Posted 2003) [#11]
Yes - that is a very good point - sometimes we get obsessed with high polycounts and frame rates - probably because we always think real-time gaming and forget about frame by frame rendering !
Just imagine what cool output you could get from Blitz as an avi not having to worry about frame rate !


Koriolis(Posted 2003) [#12]
And again, yes a pretty good point. But he asked if there would be any slow down, he didn't just asked if it was doable (and the answer is yes, ther is an important slow-down). So I guess it does matter for him. Which makes me say that even if he wants non-realtime rendering, it may be worth considering to do his job "by hand" as suggested.


Ross C(Posted 2003) [#13]
thanks for all your replys folks! The pivot count is now around 800 i'm pretty sure. i appreciate what is being said, i really do, but it's not my particle system. i was concerned about the pivot count, which i have been told is at 800 odd. the code looks a bit complicated and is still being worked on at the mo so i'm sure it will be all good when it's finished. next time i make a particle system, i'll take al these points on board as they are very good ones :)