My engine discussion thread

Blitz3D Forums/Blitz3D Programming/My engine discussion thread

This thread is for discussing rendering and other techniques in the context of a structured engine.

Related threads:
Design
Terrain
Actors
Rendering

After trimming down my skeleton, I was able to boost the framerate to acceptable levels. I also implemented an extensive statistics feedback system that helped me to optimize the outer rendering loop. I am very proud of all I have going on here, the mesh density, the view distance, number of actors, and a decent framerate. The next step will be creating super-low-res version of the skeletons and actor meshes, so that a minimum number of bones is used. The FPS is 76 without actors, so there is still a lot of improvement I can make.



Another tip for rendering animations is to still use Blitz's animation system, but only call it once before the outer rendering loop, then hide the animated mesh after you update and render it. Only update animation for meshes that are not hidden or far away:
Function AnimateFrame(entity,sequence,frame#,percent=False)
Animate entity,3,1,sequence,0
length=AnimLength(entity)
If percent
	frame=frame*length
	Else
	frame=frame/length
	EndIf
Animate entity,1,frame,sequence
End Function


So you animation routine would look like this:
For each model
If Visible(model)
	ShowEntity model
	Next
UpdateWorld
Renderworld
For each model
	HideEntity model
	Next


I actually render each model in a separate pass. This lets you set up a unique lighting environment for each model, based on visibility between the model and light sources. Just do an EntityVisible() to see of the model is in the light or the shadow.