Single surface part sys enquiry

Blitz3D Forums/Blitz3D Programming/Single surface part sys enquiry

I got an Athlon something or other with a geforce 4.

How much of the screen? As much as you like. It would go faster if I wasn't changing the uv coordinates and vertex colours every frame.

Resolution? 640*480. I just tried it at 1024*768 and I get 320 frames per second.

Here's a screenshot. The text is written as Text over the rendered background so that could slow it down as well.



Below is the texture I am using in the demo. You specify a texture and frame rate and the system automatically plays the animation for you. Each particle can have its own colour as well so you can get a lot of variation from a single texture.



I'd just like to point out that until I saw this thread I hadn't considered selling the system and doubt I ever will. It will one day be free for use to all registered ExGen users though :) - hopefully one or two of them will make use of it... I intend to myself.

Heres the code for the demo (without the system functions)

;----
;demo
;----
;setup graphics
Graphics3D 640,480,16,1
camera=CreateCamera() : CameraClsColor camera,0,0,30
light=CreateLight(camera)

;load systems
system1=ExG_LoadSystem("systems/lite_test.bmp",16,64,64)

;create particles
For i=1 To 500
	p=ExG_AddParticle(system1,Rand(10,50))
	ExG_setParticle ExG_position,p,Rnd(-20,20),Rnd(-20,20),Rnd(-20,20)
	ExG_setParticle ExG_scale,p,Rnd(1.5,2.5)
	ExG_setParticle ExG_color,p,Rand(150,200),Rand(150,200),Rand(150,200)

ExG_color,p,Rand(150,200),Rand(150,200),Rand(150,200)
Next

oldtime=MilliSecs()
timer=CreateTimer(40) : usetimer=False

Repeat

	;simple frame timer (not very good - but fine for an example)
	If usetimer WaitTimer(timer)

	;simple frame counter
	framecount=framecount+1
	If MilliSecs()-oldTime>=1000
		framerate=framecount
		framecount=0
		oldtime=MilliSecs()
	EndIf

	;update particles
	ExG_update camera

	;render scene
	RenderWorld

	;camera controls
	If KeyDown(200) MoveEntity camera,0,0,.3
	If KeyDown(208) MoveEntity camera,0,0,-.3
	If KeyDown(203) TurnEntity camera,0,1,0
	If KeyDown(205) TurnEntity camera,0,-1,0

	If KeyDown(30) TurnEntity camera,1,0,0
	If KeyDown(44) TurnEntity camera,-1,0,0

	;slow things down - press space to toggle frame timer
	If KeyHit(57) usetimer=Not usetimer


	Color 0,0,0
	Rect 5,5,295,85

	Color 255,255,255
	Text 10,10,"FPS = "+framerate
	Text 10,25,"Press space to toggle frame rate"
	Text 10,40,"between 40 fps And fastest possible"
	Text 10,55,"Use arrow keys to move"
	Text 10,70,"use a + z to rotate up + down"
	
	Flip False

Until KeyHit(1)

End


BTW I have just removed some code that has taken it up to 660 frames per second :D