Depending upon the platform, BRender will exploit dedicated hardware wherever possible to perform some of the phases.
In terms of how the process appears when using the BRender API, the following gives a simplified C skeleton of a possible application.
BrBegin(); /* The BRender library is Initialised */
...
/* The application is initialised */
...
BrZbBegin();/* The rendering engine is initialised */
...
/* Set up a scene in terms of an actor hierarchy */
...
/* Elements in the scene are pre-processed by being added to the registry (models, materials, textures, shade tables) */
...
do/* Main loop */
{do /* Perform rendering of the scene from each camera */
{ ...
/* Start supply of scene details to renderer */
BrZbSceneRenderBegin(world,camera,colour_buffer,depth_buffer);
...
for (...; ...; ...)/* Rendering one or more actor hierarchies */
{ ...
/* Specify each branch of world hierarchy to include in rendering */
BrZbSceneRenderAdd(...);
...
}
...
/* End supply of scene details to renderer */
BrZbSceneRenderEnd();
...
} while (...);
...
/* Update the scene */
...
} while (...);
...
BrZbEnd();/* Close down the rendering engine */
...
BrEnd();/* Terminate the BRender library */
In order for the three rendering phases to take place the application must call BRender API functions to enable it to traverse an actor hierarchy. A `Begin' function (BrZbSceneRenderBegin()
35 in the example above) let's BRender know that we're about to supply it with a selection of actors in a specific hierarchy, that should be viewed from a certain camera actor within it, and the resulting image to be placed in a supplied pixel map, with a certain method used to remove hidden surfaces. Each actor in our selection to be included in the rendering is then supplied by using an `Add' function (
BrZbSceneRenderAdd()
36
BrZbSceneRenderEnd()
37
in the example). The output from the renderer is not defined until the `End' function returns. Therefore you may make no assumptions about the contents of any output image buffers between the `Begin' and `End' functions, i.e. custom model and render bounds call-backs should not access the buffers. Furthermore, no assumption should be made regarding how the actor hierarchy is traversed during rendering, e.g. whether branch by branch or generation by generation.
Pixel map type of buffer to render into.
Pixel map type of Z-buffer.
Initialising the Renderer
Before rendering anything, the rendering engine must be initialised. This should be performed after library initialisation and before anything is added to the registry. Given that the registry is for performing pre-rendering preprocessing, it unsurprisingly needs to know beforehand which rendering engine is going to be used.
Description:
Initialise the Z-buffer renderer. This is a rendering engine which utilises a depth buffer (a pixel map matching the colour buffer) containing z values for each pixel, which can be used to determine whether another pixel at the same position should be drawn over the existing one.BrZbBegin()
void BrZbBegin(br_uint_8 colour_type, br_uint_8 depth_type)
br_uint_8 colour_type
br_uint_8 depth_type
BrBegin()
10 &
BrEnd()
11
Effects: Checks that the specified colour and depth types can be supported, initialises registry for this renderer.
See Also:
BrZbEnd()
40
, BrZsBegin()
28
Pixel map type of buffer to render into.
Non-
Size of primitive heap. To ensure that everything is rendered completely, this should be large enough for the renderer to store the temporary data structures used to hold details of each rendered primitive and the transformed vertices indexed by them. A primitive can be anything from a point to a triangle (possibly a quad). For the purposes of estimation you should allow 26 bytes for each primitive and 64 bytes for each unique vertex. The number of unique vertices can be calculated from the number of primitives, according to how vertices are shared by models' faces. At best there will be an average of one vertex per face primitive (a tetrahedron - four faces, four vertices), at worst there will be an average of three vertices per face primitive (a scene of independent triangles)*3.
Note that clipping is likely to increase the number of vertices.
If you estimate that there is an upper limit of about 1,000 faces (of front facing surfaces) in a rendering sequence with an average of 2.5 vertices per triangular face (including increases due to clipping) then the value of this member should be 1,000(26+2.564), i.e. 186,000 bytes, call it 200KB.
Description:
Initialise the Z-sort renderer. This is a rendering engine which uses a bucket sort to determine the order in which primitives (faces, lines, points) should be rendered.BrZsBegin()
void BrZsBegin(br_uint_8 colour_type, void* primitive, br_uint_32 size)
br_uint_8 colour_type
void * primitive
Null
pointer to an allocated block of memory to be used as a heap to hold rendered*2 primitives and referenced vertices generated during rendering.br_uint_32 size
BrBegin()
10 &
BrEnd()
11. The registry is empty. No rendering engine is currently enabled.
Effects: Checks that the specified colour types can be supported, initialises registry for this renderer.
Remarks: If
size
is insufficiently large, some primitives will be omitted from the rendering. In border line cases, these are likely to be faces of models toward the end of the traversal of the actor hierarchy (which may manifest itself as deterioration of models in a particular lineage).See Also:
BrZsEnd()
40
, BrZbBegin()
28
BrModelAdd()
235
. Any time an item is modified the preprocessing that BRender needs to be performed, will have to be redone. This is achieved by explicitly updating changed items using functions such as BrMaterialUpdate()
159
. As one would hope, such updating only needs to be performed just before rendering takes place - rather than after each change. If no actor in a scene uses a registry item then that item doesn't need to be updated. Conversely, if a actor uses a model, material, texture or shade table, that item must be in the registry and if changed must be updated before the actor is supplied to the renderer (even if indirectly).
If an item is no longer involved in a scene, then it can be removed from the registry using a function such as BrTableRemove()
284.
Functions to search the registry for a particular item or to enumerate over all items of a certain type can be found in the supplementary sections of structures br_model
228,
br_material
151, and
br_pixelmap
272.
How the depth buffer works is platform dependent, but it generally consists of a memory buffer corresponding to the display buffer, with a depth value for each pixel. The values it contains typically represent distances from the front - zero would thus represent the position of the front clip plane. Each time a face is rendered, the z value of each pixel is converted into a depth value, and only if it has a nearer (lesser) z value than the one in the depth buffer will it be plotted (the depth value in the buffer is then updated).
BRender supports 16 and 32 bit Z-Buffers, and a description of how the current implementation generally works now follows.
The depth buffer contains unsigned values representing distance from the front clip plane. A view z ordinate of
Note that as depth buffer values are treated by the rendering engine as unsigned words, before rendering the depth buffer should be filled to the maximum depth, i.e.
Hidden Surface Removal Schemes
There are various schemes for rendering faces such that overlapping or intersecting faces are drawn correctly, i.e. nearer faces are in front of, and hide, farther faces. Each scheme is a different compromise between, quality, processing overhead, and memory overhead. The Z-Buffer
The z buffer, or depth buffer, is a fast, high quality scheme, but uses a considerable amount of memory (something not likely to be found in abundance on games consoles). hither_z
(as specified in the camera) would correspond to a depth of zero. A view z ordinate of -
yon_z
corresponds to a depth of Depthmax, which is an unsigned value of 0xFFFFFFFF
(in 32 bpp depth buffers, but 0xFFFF0000
in 16 bpp).0xFFFFFFFF
. The following example call will suffice whatever the word size of the depth buffer:
BrPixelmapFill(view->depth_buffer,0xFFFFFFFF);
Thus when reading values from a depth buffer, the value will be in the range [0, Depthmax], with unwritten pixels having depth buffer values of whatever was used to Initialise them, e.g. 0xFFFFFFFF
., BrZbSceneRender()
34
The following functions are provided to convert between depths, screen and view co-ordinates.
A 32 bit value read from the z buffer pixel map.
A non-NULL pointer to the camera being used for rendering, i.e. relevant to the depth values used in the z buffer.
The corresponding screen z value.
Description:
Convert z buffer depth [0,0xFFFFFFFF] to screen z [32,768,+~32,767.9].BrZbDepthToScreenZ()
br_scalar BrZbDepthToScreenZ(br_uint_32 depth_z, const br_camera* camera)
br_uint_32 depth_z
const br_camera* camera
br_scalar
BrScreenZToCamera()
23,
BrScreenXYZToCamera()
24.
A screen z value as obtained from functions such as
Description:
Convert screen z [32,768,+~32,767.9] to z buffer depth [0,0xFFFFFFFF].BrZbScreenZToDepth()
br_uint_32 BrZbScreenZToDepth(br_scalar sz, const br_camera* camera)
br_scalar sz
BrOriginToScreenXYZO()
252
const br_camera* camera
A non-NULL pointer to the camera being used for rendering, i.e. relevant to the depth values used in the z buffer.
Result:
br_uint_32
A 32 bit depth value suitable for writing to a z buffer pixel map.
See Also:
BrScreenZToCamera()
23
, BrScreenXYZToCamera()
24
.
br_order_table
260
{}
The Z-Sort is a very fast, low quality scheme using relatively little memory (particularly for simple scenes). Before rendering, all primitives (faces or smaller elements, such as lines or points) are sorted according to the z value of one or more of their vertices. The primitives are then rendered farthest first.
Clipping of intersecting faces involves a severe performance hit and is only likely to be implemented on very capable platforms. Checking for cyclic overlaps reduces performance still further.
The particular method BRender uses to sort primitives is to use a bucket sort. This involves the use of one or more order tables. Each order table divides a stratum (depth range) of the observer's z-axis into a number of equal sub-strata (depths). The model geometry of each model actor (using a particular order table) will be converted into rendering primitives, and each primitive will be added to the bucket (a linked list) corresponding to the sub-strata appropriate to its z-values. It is called a bucket sort because the order table may be considered as an ordered row of buckets into which items are thrown (in any order) according to their value (one bucket per range of values). Thus the order in which primitives of the same sub-strata are drawn is undefined.
Each order table effectively defines a separate layer of the rendered image, like an acetate. One should thus take care if order tables' depth ranges overlap, to avoid far faces being drawn over near faces. This is only likely to be a problem for intersecting models in separate order tables. Order tables are drawn in order of
The application is responsible for ensuring model actors are using appropriate order tables. The rendering process can then traverse the actor hierarchy, processing each model into primitives and inserting these into the appropriate order tables. Actors can be assigned to order tables specifically, or by inheritance - there is a default, single bucket order table (spanning the entire view volume) which will be inherited if no ancestral actor defines one. Each new order table that is encountered during this process is inserted into an ordered linked list of order tables. When complete, the list of order tables is traversed, with the primitives rendered from each bucket in turn (from back to front).
Performance is relatively independent of the number of buckets you have, given the use of a radix sort to determine into which bucket a primitive should be placed. Performance does decrease however, the more order tables you have. This is due to the overhead, as each new order table is encountered, required to insert the order table at the correct position in the linked list of order tables. This is only likely to be significant with a large number of order tables.
It is difficult to give guidelines, as approaches to determining an appropriate set of order tables depends so much on the type of scene (sometimes, even from frame to frame, as models rotate and intersect). Approaches can vary from having a single order table with a large number of buckets, to a single bucket order table for each model.sort_z
(typically the nearest end of an order table).BrZsSceneRender()
34
The following functions provide means of converting between z sort depth values (as required by order tables and supplied to primitive call-back functions). Note that the z sort depths are actually in a different range from view z values, i.e. depths are in the range
A depth value read from an order table or obtained from a z sort primitive call-back.
A non-NULL pointer to the camera being used for rendering, i.e. relevant to the depth values used in primitives and order tables.
The corresponding screen z value.
[hither_z
,+yon_z]
whereas view z values are in the range [hither_z,yon_z]
(both ranges near to far).
Description:
Convert z sort depth [BrZsDepthToScreenZ()
-hither_z
,+yon_z
] to screen z [32,768,+~32,767.9].br_scalar BrZsDepthToScreenZ(br_scalar depth_z, const br_camera* camera)
br_scalar depth_z
const br_camera* camera
br_scalar
BrScreenZToCamera()
23,
BrScreenXYZToCamera()
24
A screen z value as obtained from functions such as
Description:
Convert screen z [32,768,+~32,767.9] to z sort depth [BrZsScreenZToDepth()
-hither_z
,+yon_z
].br_scalar BrZsScreenZToDepth(br_scalar sz, const br_camera* camera)
br_scalar sz
BrOriginToScreenXYZO()
252
const br_camera* camera
A non-NULL pointer to the camera being used for rendering, i.e. relevant to the depth values used in primitives and order tables.
Result:
br_scalar
A depth value suitable for writing to an order table or comparing with values of z obtained from a z sort primitive call-back.
See Also:
BrScreenZToCamera()
23
, BrScreenXYZToCamera()
24
.
Br
[Zb
|Zs
]SceneRender()
34
|
34
, this effectively wraps up the three functions required for the latter case, Br
[Zb
|Zs
]SceneRenderBegin()
35
|
35
, Br
[Zb
|Zs
]SceneRenderAdd()
36
|
37
, and Br
[Zb
|Zs
]SceneRenderEnd()
37
|
37
. Note that in both cases, the camera must be a descendant of the scene root actor, as should all the sub-trees. If an environment actor is currently specified then it must also be a descendant of the scene root.
Note that there are two key call-back functions that can get called during rendering. These are a custom model rendering call-back (see br_renderbounds_cbfn
307) and a render bounds call-back (see
br_model_custom_cbfn
247). The custom model rendering call-back is specified within the
br_model
228 structure defined for a model actor and enables an application to make a model's rendering dependent upon information only available at the time it's processed by the renderer. For similar reasons, the render bounds call-back is called for every model that affects the output image, allowing the application to take note of information only available at the time the model's are processed by the renderer. The trivial use of the render bounds call-back is to keep track of modified rectangles of the output image. The render bounds call-back is specified before rendering commences, using
Br
[Zb
|Zs
]RenderBoundsCallbackSet()
38|
38
.
There is also a special call-back, br_primitive_cbfn
307, only used in the Z-Sort renderer. This allows customised insertion of primitives into order tables.
A non-
A non-
A non-
Description:
All-in-one function to render a scene using the Z-Buffer renderer.BrZbSceneRender()
void BrZbSceneRender(br_actor* world, br_actor* camera, br_pixelmap* colour_buffer, br_pixelmap* depth_buffer)
br_actor * world
Null
pointer to the root actor of a scene.br_actor * camera
Null
pointer to a camera actor that is a descendant of the root actor.br_pixelmap * colour_buffer
Null
pointer to the pixel map to render the scene into, whose type is colour_type
as supplied to BrZbBegin()
28
br_pixelmap * depth_buffer
A non-Null
pointer to the pixel map to be used as a depth buffer whose type is depth_type
as supplied to BrZbBegin()
28. It must have the same width and height as the colour buffer. See
BrPixelmapMatch()
286.
Preconditions: Between
BrBegin()
10
& BrEnd()
11
. Between BrZbBegin()
28
& BrZbEnd()
40
. Not currently rendering.Effects: Equivalent to a call of
BrZbSceneRenderBegin(
world
,
camera
,
colour_buffer
,
depth_buffer
)
35
followed by BrZbSceneRenderAdd(
world
)
36
and BrZbSceneRenderEnd()
37
.Remarks: The colour buffer and depth buffer should not be texture maps (or even shade tables), though they can of course be subsequently added as such once the rendering has completed.
See Also:
BrZbRenderBoundsCallbackSet()
38
, BrZbModelRender()
249
.
A non-
A non-
A non-
Description:
All-in-one function to render a scene using the Z-Sort renderer.BrZsSceneRender()
void BrZsSceneRender(br_actor* world, br_actor* camera, br_pixelmap* colour_buffer)
br_actor * world
Null
pointer to the root actor of a scene.br_actor * camera
Null
pointer to a camera actor that is a descendant of the root actor.br_pixelmap * colour_buffer
Null
pointer to the pixel map to render the scene into, whose type is colour_type
as supplied to BrZsBegin()
28
Preconditions: Between
BrBegin()
10
& BrEnd()
11
. Between BrZsBegin()
28
& BrZsEnd()
40
. Not currently rendering.Effects: Equivalent to a call of
BrZsSceneRenderBegin(
world
,
camera
,
colour_buffer
)
35
followed by BrZsSceneRenderAdd(
world
)
37
and BrZsSceneRenderEnd()
37
.Remarks: The colour buffer should not be a texture map (or even a shade table), though it can of course be subsequently added as such once the rendering has completed.
See Also:
BrZsRenderBoundsCallbackSet()
38
, BrZsModelRender()
249
, BrZsPrimitiveCallbackSet()
39
.
A non-
A non-
A non-
Description:
Set up a new scene to be rendered using the Z-Buffer renderer, processing the camera, lights and environment.BrZbSceneRenderBegin()
void BrZbSceneRenderBegin(br_actor* world, br_actor* camera, br_pixelmap* colour_buffer, br_pixelmap* depth_buffer)
br_actor * world
Null
pointer to the root actor of a scene.br_actor * camera
Null
pointer to a camera actor that is a descendant of the root actor.br_pixelmap * colour_buffer
Null
pointer to the pixel map to render the scene into, whose type is colour_type
as supplied to BrZbBegin()
28
br_pixelmap * depth_buffer
A non-Null
pointer to the pixel map to be used as a depth buffer whose type is depth_type
as supplied to BrZbBegin()
28. It must have the same width and height as the colour buffer. See
BrPixelmapMatch()
286.
Preconditions: Between
BrBegin()
10
& BrEnd()
11
. Between BrZbBegin()
28
& BrZbEnd()
40
. Not currently rendering.Effects: Enter rendering state, prepare for destination buffers, preprocess view, screen and environment transforms, preprocess enabled lights, handle environment actor, preprocess enabled clip planes.
Remarks: The colour buffer and depth buffer should not be texture maps (or even shade tables), though they can of course be subsequently added as such once the rendering has completed.
See Also:
BrZbSceneRenderAdd()
36
, BrZbSceneRenderEnd()
37
, BrZbRenderBoundsCallbackSet()
38
, BrZbModelRender()
249
.
A non-
A non-
A non-
Description:
Set up a new scene to be rendered using the Z-Sort renderer, processing the camera, lights and environment.BrZsSceneRenderBegin()
void BrZsSceneRenderBegin(br_actor* world, br_actor* camera, br_pixelmap* colour_buffer)
br_actor * world
Null
pointer to the root actor of a scene.br_actor * camera
Null
pointer to a camera actor that is a descendant of the root actor.br_pixelmap * colour_buffer
Null
pointer to the pixel map to render the scene into, whose type is colour_type
as supplied to BrZsBegin()
28
Preconditions: Between
BrBegin()
10
& BrEnd()
11
. Between BrZsBegin()
28
& BrZsEnd()
40
. Not currently rendering.Effects: Enter rendering state, prepare for destination buffer, preprocess view, screen and environment transforms, preprocess enabled lights, handle environment actor, preprocess enabled clip planes.
Remarks: The colour buffer should not be a texture map (or even a shade table), though it can of course be subsequently added as such once the rendering has completed.
See Also:
BrZsSceneRenderAdd()
37
, BrZsSceneRenderEnd()
37
, BrZsRenderBoundsCallbackSet()
38
, BrZsPrimitiveCallbackSet()
39
, BrZsModelRender()
249
.
A non-
Description:
Include an actor (and its descendants) of the BrZbSceneRenderAdd()
world
in the current rendering.void BrZbSceneRenderAdd(br_actor* tree)
br_actor * tree
Null
pointer to an actor hierarchy, which must be a descendant of the world
hierarchy supplied to BrZbSceneRenderBegin()
35
Preconditions: Between
BrBegin()
10
& BrEnd()
11
. Between BrZbBegin()
28
& BrZbEnd()
40
. Currently rendering, i.e. between BrZbSceneRenderBegin()
35
and BrZbSceneRenderEnd()
37
. Not within a custom model render call-back or render bounds call-backEffects: Add actor to list of actors to be rendered.
Remarks: Whether rendering takes place during this function or sometime before the return of
BrZbSceneRenderEnd()
37
is undefined. When custom model render and render bounds call-back functions are called is similarly undefined.See Also:
BrZbSceneRenderBegin()
35
, BrZbSceneRenderEnd()
37
, BrZbRenderBoundsCallbackSet()
38
, BrZbModelRender()
249
.
A non-
Description:
Include an actor (and its descendants) of the BrZsSceneRenderAdd()
world
in the current rendering.void BrZsSceneRenderAdd(br_actor* tree)
br_actor * tree
Null
pointer to an actor hierarchy, which must be a descendant of the world
hierarchy supplied to BrZsSceneRenderBegin()
35
Preconditions: Between
BrBegin()
10
& BrEnd()
11
. Between BrZsBegin()
28
& BrZsEnd()
40
. Currently rendering, i.e. between BrZsSceneRenderBegin()
35
and BrZsSceneRenderEnd()
37
. Not within a custom model render call-back, render bounds call-back or primitive call-back.Effects: Add actor to list of actors to be rendered.
Remarks: Whether rendering takes place during this function or sometime before the return of
BrZsSceneRenderEnd()
37
is undefined. When custom model render, render bounds and primitive call-back functions are called is similarly undefined.See Also:
BrZsSceneRenderBegin()
35
, BrZsSceneRenderEnd()
37
, BrZsRenderBoundsCallbackSet()
38
, BrZsPrimitiveCallbackSet()
39
, BrZsModelRender()
249
.
Description:
Complete the specification of actors to be rendered in a scene, and their rendering.BrZbSceneRenderEnd()
void BrZbSceneRenderEnd(void)
BrBegin()
10 &
BrEnd()
11. Between
BrZbBegin()
28
& BrZbEnd()
40. Currently rendering, i.e. after
BrZbSceneRenderBegin()
35. Not within a custom model render call-back or render bounds call-back
Effects: By the time this function ends, the scene as specified in terms of world root, camera and sub-trees, will have been rendered to the output buffers.
Remarks: Whether rendering takes place during this function or sometime before the return of
BrZbSceneRenderEnd()
37
is undefined. When custom model render and render bounds call-back functions are called is similarly undefined.See Also:
BrZbSceneRenderBegin()
35
, BrZbSceneRenderAdd()
36
, BrZbRenderBoundsCallbackSet()
38
, BrZbModelRender()
249
.
Description:
Complete the specification of actors to be rendered in a scene, and their rendering.BrZsSceneRenderEnd()
void BrZsSceneRenderEnd(void)
BrBegin()
10 &
BrEnd()
11. Between
BrZsBegin()
28
& BrZsEnd()
40. Currently rendering, i.e. after
BrZsSceneRenderBegin()
35. Not within a custom model render call-back, render bounds call-back, or primitive call-back.
Effects: By the time this function ends, the scene as specified in terms of world root, camera and sub-trees, will have been rendered to the output buffer.
Remarks: Whether rendering takes place during this function or sometime before the return of
BrZsSceneRenderEnd()
37
is undefined. When custom model render, render bounds, and primitive call-back functions are called is similarly undefined.See Also:
BrZsSceneRenderBegin()
35
, BrZsSceneRenderAdd()
37
, BrZsRenderBoundsCallbackSet()
38
, BrZsPrimitiveCallbackSet()
39
, BrZsModelRender()
249
.
A pointer to the new call-back function. Specify the old call-back function when a function call-back is not required.
Description:
Set the call-back function invoked for each rendered actor. For example, a call-back can be set up to log those rectangles in the colour buffer that have been written to (dirty rectangle flagging).BrZbRenderBoundsCallbackSet()
br_renderbounds_cbfn* BrZbRenderBoundsCallbackSet(br_renderbounds_cbfn* new_cbfn)
br_renderbounds_cbfn * new_cbfn
BrBegin()
10 &
BrEnd()
11. Between
BrZbBegin()
28
& BrZbEnd()
40. Not currently rendering.
Effects: Defines a function that will be called during rendering for each model that affects the output buffers.
Result:
br_renderbounds_cbfn *
Returns a pointer to the old call-back function.
Remarks: Exactly when the call-back function gets called is undefined except that it will be sometime between
BrZbSceneRenderBegin()
35
and BrZbSceneRenderEnd()
37
. It is also not necessarily associated with a particular point in the rendering process.See Also:
br_renderbounds_cbfn
307
, br_model_custom_cbfn
247
.
A pointer to the new call-back function. Specify the old call-back function when a function call-back is not required.
Description:
Set the call-back function invoked for each rendered actor. For example, a call-back can be set up to log those rectangles in the colour buffer that have been written to (dirty rectangle flagging).BrZsRenderBoundsCallbackSet()
br_renderbounds_cbfn* BrZsRenderBoundsCallbackSet(br_renderbounds_cbfn* new_cbfn)
br_renderbounds_cbfn * new_cbfn
BrBegin()
10 &
BrEnd()
11. Between
BrZsBegin()
28
& BrZsEnd()
40. Not currently rendering.
Effects: Defines a function that will be called during rendering for each model that affects the output buffer.
Result:
br_renderbounds_cbfn *
Returns a pointer to the old call-back function.
Remarks: The actor order table will be supplied to the call-back function.
Exactly when the call-back function gets called is undefined except that it will be sometime between BrZsSceneRenderBegin()
35
and BrZsSceneRenderEnd()
37. It is also not necessarily associated with a particular point in the rendering process.
See Also:
br_renderbounds_cbfn
307
, br_model_custom_cbfn
247
.
A pointer to the new call-back function. Specify the old call-back function when a function call-back is not required.
Description:
Set the call-back function invoked for each primitive generated by the Z-Sort renderer. This call-back can be used to perform customised insertion of primitives into order tables.BrZsPrimitiveCallbackSet()
br_primitive_cbfn* BrZsPrimitiveCallbackSet(br_primitive_cbfn* new_cbfn)
br_renderbounds_cbfn * new_cbfn
Null
will indicate that the default call-back function should be used.BrBegin()
10 &
BrEnd()
11. Between
BrZsBegin()
28
& BrZsEnd()
40. Not currently rendering.
Effects: Defines a function that will be called during rendering for each front facing primitive that is to be inserted into the order table.
Result:
br_renderbounds_cbfn *
Returns a pointer to the old call-back function.
Remarks: Exactly when the call-back function gets called is undefined except that it will be sometime between
BrZsSceneRenderBegin()
35
and BrZsSceneRenderEnd()
37
. However, it may be assumed that rendering to the output buffer has not yet commenced.See Also:
br_primitive_cbfn
307
, br_model_custom_cbfn
247
.
Description:
Close down the Z-Buffer renderer.BrZbEnd()
void BrZbEnd(void)
BrBegin()
10 &
BrEnd()
11
BrZbBegin()
28
has been called, and BrZbEnd()
40
has not yet been called since. The registry is empty. No other rendering engine is currently enabled.Effects: Releases resources used by the Z-Buffer renderer.
See Also:
BrZbBegin()
28
Description:
Close down the Z-Sort renderer.BrZsEnd()
void BrZsEnd(void)
BrBegin()
10 &
BrEnd()
11.
BrZsBegin()
28
has been called, and BrZsEnd()
40
has not yet been called since. The registry is empty. No other rendering engine is currently enabled.
Effects: Releases resources used by the Z-Sort renderer.
See Also:
BrZsBegin()
28