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.
|