Main Page   Modules   Alphabetical List   Data Structures   Data Fields  

RpADC
[Basic Geometry]


Data Structures

struct  RpADCDataTag

Typedefs

typedef RwBool(* RpADCMeshCallback )(RpMesh *mesh)

Functions

RwBool RpADCPluginAttach (void)
RwBool RpADCGeometryConvertIgnoreWinding (RpGeometry *geometry)
RwBool RpADCGeometryConvertPreserveWinding (RpGeometry *geometry)
RwBool RpADCWorldSectorConvertIgnoreWinding (RpWorldSector *sector)
RwBool RpADCWorldSectorConvertPreserveWinding (RpWorldSector *sector)
RwInt8RpADCGeometryGetADCSupport (RpGeometry *geometry)
RwInt8RpADCWorldSectorGetADCSupport (RpWorldSector *sector)
RpADCMeshCallback RpADCGetMeshCallback (void)
void RpADCSetMeshCallback (RpADCMeshCallback callback)

Detailed Description

Address Control flag generation plugin for RenderWare Graphics.

RpADC Plugin Overview

Requirements

Overview

This plugin provides tools for triangle-strips degenerated vertices reduction on the PlayStation 2 platform.

In order to build continuous triangle-strip structure suitable for rendering on platforms such as the PlayStation 2, degenerated vertices are inserted to create jumps from triangle to triangle through zero sized triangles. Even zero size triangles have no effect on the final scene rendering result, their vertices are as expensive to store and process as useful triangles vertices.

The ADC plugin uses a PlayStation 2 platform ability to flag triangles as not to be drawn instead of degenerated vertices insertion, reducing the amount of memory, DMA upload, and Vector Unit processing cost.

Triangle-strips indices are purged from degenerated vertex indices, and an extra array of information is used to store an ADC flag information for each index. The ADC information is instanced in the fourth field of the position cluster. To allow this instancing format, the CL_XYZW cluster is used in place of the usual CL_XYZ position cluster. This extra 32-bit word as a memory cost that is absorbed by the reduction of vertices to be instanced after degenerated vertices elimination. An ADC converted geometry or world sector can only be rendered through a rendering pipeline crafted to support the ADC flag information.

Before any of the plugin functions are used, the plugin should be attached using RpADCPluginAttach.

Basic Usage
The ADC plugin conversion tools can be used on any triangle stripped object. Geometries and world sectors can be converted respectively using
and

The PreserveWinding functions are suitable for objects that require facing information, for example, a world to be rendered with back face culling turned on. A few degenerated vertices are still used in order to preserve the strip structure from winding inversions.

In order to query if a geometry or a world sector is formatted for ADC flag support, the two following functions can be invoked


Typedef Documentation

typedef RwBool(* RpADCMeshCallback)(RpMesh *mesh)
 

RpADCMeshCallback Optional per-mesh callback, allowing the application to opt out of conversion of specific meshes by returning FALSE.

Parameters:
mesh  Pointer to the mesh.
Returns:
TRUE to generate ADC flags.


Function Documentation

RwBool RpADCGeometryConvertIgnoreWinding RpGeometry   geometry
 

RpADCGeometryConvertIgnoreWinding is used to convert a geometry into an ADC support geometry while ignoring the triangle strip winding order.

Parameters:
geometry  A pointer to the geometry
Returns:
TRUE on success, FALSE otherwise.
See also:
RpADCGeometryConvertPreserveWinding , RpADCGeometryGetADCSupport

RwBool RpADCGeometryConvertPreserveWinding RpGeometry   geometry
 

RpADCGeometryConvertPreserveWinding is used to convert a geometry into an ADC support geometry while preserving the triangle strip winding order.

Parameters:
geometry  A pointer to the geometry
Returns:
TRUE on success, FALSE otherwise.
See also:
RpADCGeometryConvertIgnoreWinding , RpADCGeometryGetADCSupport

RwInt8* RpADCGeometryGetADCSupport RpGeometry   pGeom
 

RpADCGeometryGetADCSupport is used to test if a geometry is formated as an ADC flagged geometry.

Parameters:
pGeom  A pointer to the geometry
Returns:
A pointer to the ADC flag array if successfull. NULL otherwise
See also:
RpADCGeometryConvertPreserveWinding , RpADCGeometryConvertIgnoreWinding

RpADCMeshCallback RpADCGetMeshCallback void   
 

RpADCGetMeshCallback is used to get the callback the plugin calls on each mesh during the ADC converison process.

Returns:
A pointer to the per-mesh callback if it exists, NULL otherwise
See also:
RpADCSetMeshCallback , RpADCGeometryConvertPreserveWinding , RpADCGeometryConvertIgnoreWinding , RpADCWorldSectorConvertPreserveWinding , RpADCWorldSectorConvertIgnoreWinding

RwBool RpADCPluginAttach void   
 

RpADCPluginAttach is used to attach the ADC plugin to the RenderWare system. The plugin must be attached between initializing the system with RwEngineInit and opening it with RwEngineOpen.

Note that the include file rpadc.h is required and must be included by an application wishing to use this facility. The ADC library is contained in the file rpadc.lib.

Returns:
Returns TRUE if successful, FALSE otherwise an error.

void RpADCSetMeshCallback RpADCMeshCallback    callback
 

RpADCSetMeshCallback is used to set the callback the plugin calls on each mesh during the ADC converison process.

Parameters:
callback  A pointer to the callback
See also:
RpADCGetMeshCallback , RpADCGeometryConvertPreserveWinding , RpADCGeometryConvertIgnoreWinding , RpADCWorldSectorConvertPreserveWinding , RpADCWorldSectorConvertIgnoreWinding

RwBool RpADCWorldSectorConvertIgnoreWinding RpWorldSector   sector
 

RpADCWorldSectorConvertIgnoreWinding is used to convert a sector into an ADC support sector while ignoring the triangle strips winding order.

Parameters:
sector  A pointer to the sector
Returns:
TRUE on success, FALSE otherwise.
See also:
RpADCWorldSectorConvertPreserveWinding , RpADCWorldSectorGetADCSupport

RwBool RpADCWorldSectorConvertPreserveWinding RpWorldSector   sector
 

RpADCWorldSectorConvertPreserveWinding is used to convert a sector into an ADC support sector while preserving the triangle strips winding order.

Parameters:
sector  A pointer to the sector
Returns:
TRUE on success, FALSE otherwise.
See also:
RpADCWorldSectorConvertIgnoreWinding , RpADCWorldSectorGetADCSupport

RwInt8* RpADCWorldSectorGetADCSupport RpWorldSector   sector
 

RpADCWorldSectorGetADCSupport is used to test if a sector is formated as an ADC flagged sector.

Parameters:
sector  A pointer to the sector
Returns:
A pointer to the ADC flag array if successfull. NULL otherwise
See also:
RpADCWorldSectorConvertPreserveWinding , RpADCWorldSectorConvertIgnoreWinding


Criterion Software © 1993-2004 Criterion Software Limited. All rights reserved. Built Thu Feb 12 13:47:00 2004. Send Feedback