Multipass rendering, instancing, surface order

Blitz3D Forums/Blitz3D Programming/Multipass rendering, instancing, surface order

JoshK(Posted 2004) [#1]
There are two ways Blitz might be rendering things internally:

In this model, slowdown is caused by the "start surface" routines:
Start surface
Render surface
Stop surface
Here is another possibility:
Start surface
Render surface
If this surface is different, start surface
Render surface
If the second model is accurate, multiple surfaces with like brushes could be rendered in a batch, with individual RenderWorld() commands, with none of the slowdown associated with multiple surfaces.

Which is accurate? This requires comment from the man.

Multiple surfaces can be quickly rendered when using instanced meshes, i.e. use CopyEntity, and just position, scale, and rotate each instance of the mesh, like the Unreal engine does. Less vertex data gets passed to VRAM, and it's much easier to control separate mesh matrices, as opposed to a single merged mesh. If you use referenced meshes, discard the whole surfaces method, and use children, with one surface each. This way you can apply separate materials and fx to each subobject. If you tried painting the surfaces, you would just repaint every instance in the scene the same, since they all reference the same surface. However, entity brushes can be stored per instance. It should be noted that unique vertex colors are not possible with instanced meshes. However, since you are rendering each in a separate pass, you can set up a unique lighting environment for each mesh.

Finally, if you do multipass rendering in windowed mode, turn antialiasing off, or you will suffer severe slowdown, probably because it performs the antialiasing operation with each render when in windowed mode.


jfk EO-11110(Posted 2004) [#2]
BTW I heared the higher the number of alpha meshes that are visible behind one another, the more an alpha bottleneck starts slowing down the framerate. Maybe this could be prevented when the hud elements are rendered seperately.


Rob(Posted 2004) [#3]
One reason I wanted AA to be improved is because your render to texture stuff is also *NEEDLESSLY* Antialiased! this seriously limits AA being useful.


JoshK(Posted 2004) [#4]
Jesus, the z-ordering must be the reason it is faster to render each object in a separate pass. I do this, and then render all my transparent objects in one final pass.


ashmantle(Posted 2004) [#5]
You mean like hide/show your objects and do Renderworld after each one? Kinda like sorting your own objects..?


JoshK(Posted 2004) [#6]
Yes. That's how I do staticmeshes.