I did this once I learned how to do instancing in DBPro. Yeah, I'm rather new to the language even though I've been here since 2003. O.o
sync on : sync rate 0
hide mouse
autocam off
speed#=.1
spherenumber=10
spherenumberold=0
type spherefield
X as float
Y as float
Z as float
distance as float
offset as float
time as float
endtype
dim sphere(spherenumber) as spherefield
for n=spherenumberold+1 to spherenumber
make object sphere n,1,16,16
sphere(n).distance=rnd(10)
sphere(n).offset=rnd(360)
sphere(n).time=0
next n
position camera 0,1,-20
while 1
if spacekey()=1 and pressed=0
pressed=1
spherenumberold=spherenumber
spherenumber=spherenumber+10
dim sphere(spherenumber) as spherefield
for n=spherenumberold+1 to spherenumber
make object sphere n,1,16,16
sphere(n).distance=rnd(10)
sphere(n).offset=rnd(360)
sphere(n).time=0
next n
endif
if spacekey()=0 then pressed=0
for n=1 to spherenumber
sphere(n).time=sphere(n).time+speed#
sphere(n).x=sin(sphere(n).time+sphere(n).offset)*sphere(n).distance
sphere(n).y=cos(sphere(n).time+sphere(n).offset)*sphere(n).distance
sphere(n).z=sphere(n).x*sphere(n).y
position object n,sphere(n).x,sphere(n).y,sphere(n).z
next n
text 0,440,"Spheres: "+str$(spherenumber)
text 0,460,"Polygons: "+str$(statistic(1))+" FPS: "+str$(screen fps())
sync
endwhile
It's kind of like a benchmark. It starts off with ten moving spheres, and pressing Space adds ten more.
How many spheres can you get before your framerate drops below 60 (640x480, Windowed)?
I got 1620 here. That's 720,000 polygons! Wow. And for those who are wondering, my card is an ATI Radeon X1800 Series. No wonder.
AMD Athlon 64 X2 4200+
1GB DDR-SDRAM (May increase to 2GB one day)
512MB ATI Radeon X1800 Series - Finally! A card that does pixel shaders correctly!