RenderWare V2.1

Previous Page Index Next Page

Overview


Immediate mode rendering differs from the 'retained' mode rendering style with which existing RenderWare developers are familiar. The finest granularity of geometry in the latter is the RenderWare 'clump'. The clump is a collection of vertices and polygons, automatically rendered in the correct order as a single unit in 'retained' mode. Immediate mode rendering is a lower level approach in which more responsibility is placed on the user to render geometry is the order producing the desired visibility. Immediate mode allows direct access to the basic RenderWare primitives -- triangles and lines. This gives finer grain control, but means more work for the user since triangle or line must be handled individually -- it is entirely the responsibility of the user to draw the triangles and lines in such a way to give the desired 'hidden surface removal' with the correct image being produced. This extra work has payoffs; in particular immediate mode rendering offers flexibility and fine grain rendering control.

Immediate mode rendering primitives can be exploited in two situations - via an immediate mode clump callback function and within an RwImmediateBegin() and RwImmediateEnd() cliché. Vertices can be specified in 3 ways in immediate mode - by specifying vertices in a clump, by specifying '3-D co-ordinates' and by specifying 2-D pixel space co-ordinates.

Clump callback functions are the simplest mechanism for immediate mode rendering. The alternative mechanism is to create an immediate mode rendering 'context' with RwImmediateBegin()and RwImmediateEnd(), which imposes more responsibility on the user. Because of extra obligations it places on the user, immediate mode rendering is not an easy option. It is more difficult to exploit than the standard RenderWare retained mode rendering model, but the extra flexibility can confer great performance improvements and more creative forms of rendering.