Main Page   Modules   Alphabetical List   Data Structures   Data Fields  

RtAltPipe
[Alternative Pipelines (deprecated)]


Modules

RwIm3d
RpAtomic
RpWorldSector

Data Structures

union   RxObjUnion
struct   RxPS2DMASessionRecord
struct   RxPS2Mesh

Typedefs

typedef void(*  RxWorldApplyLightFunc )(const RpLight *light, const RwMatrix *inverseMat, RwReal invScale, RwReal recipInvScale)
typedef RwBool(*  RxPipelineNodePS2ManagerInstanceCallBack )(void **clusterData, RwUInt32 numClusters)
typedef RwBool(*  RxPipelineNodePS2ManagerPostObjectCallBack )(RxPS2DMASessionRecord *dmaSesRec)

Functions

RxPipelineNode RxPipelineNodePS2ManagerSetInstanceCallBack (RxPipelineNode *node, RxPipelineNodePS2ManagerInstanceCallBack callBack)
RxPipelineNode RxPipelineNodePS2ManagerSetPostObjectCallBack (RxPipelineNode *self, RxPipelineNodePS2ManagerPostObjectCallBack callBack)
RxPipelineNode RxPipelineNodePS2ManagerGenerateCluster (RxPipelineNode *self, RxClusterDefinition *cluster2generate, RwUInt32 type)
RxPipelineNode RxPipelineNodePS2ManagerSetVUBufferSizes (RxPipelineNode *self, RwInt32 strideOfInputCluster, RwInt32 vuTSVertexMaxCount, RwInt32 vuTLTriMaxCount)
RxPipelineNode RxPipelineNodePS2ManagerSetPointListVUBufferSize (RxPipelineNode *self, RwInt32 strideOfInputCluster, RwInt32 vuPLVertexMaxCount)
RwInt32  RxPipelineNodePS2ManagerGetVUBatchSize (RxPipelineNode *self, RpMeshHeaderFlags flags)
void  RxPipelineNodePS2ManagerSetLighting (RxPipelineNode *self, RxWorldLightingCallBack newLightingFunc)
RxPipelineNode RxPipelineNodePS2ManagerSetVU1CodeArray (RxPipelineNode *self, void **VU1CodeArray)
const void **  RxPipelineNodePS2ManagerGetVU1CodeArray (RxPipelineNode *self)
RxPipelineNode RxPipelineNodePS2ManagerSetVIFOffset (RxPipelineNode *self, int vifOffset)
RxPipelineNode RxPipelineNodePS2ManagerNoTexture (RxPipelineNode *self, RwBool noTexture)
RxNodeDefinition RxNodeDefinitionGetPS2Manager (RwInt32 objType)
RxPipelineNode RxPipelineNodePS2MatBridgeSetVIFOffset (RxPipelineNode *self, RwInt32 vifOffset)
RxPipelineNode RxPipelineNodePS2MatBridgeSetVU1CodeArray (RxPipelineNode *self, void **VU1CodeArray)
const void **  RxPipelineNodePS2MatBridgeGetVU1CodeArray (RxPipelineNode *self)
RxPipelineNode RxPipelineNodePS2MatBridgeNoTexture (RxPipelineNode *self, RwBool noTexture)
RxNodeDefinition RxNodeDefinitionGetPS2MatBridge (void)
RxPipelineNode RxPipelineNodePS2MatInstanceGenerateCluster (RxPipelineNode *self, RxClusterDefinition *cluster2generate, RwUInt32 type)
RxPipelineNode RxPipelineNodePS2MatInstanceSetVUBufferSizes (RxPipelineNode *self, RwInt32 strideOfInputCluster, RwInt32 vuTSVertexMaxCount, RwInt32 vuTLTriMaxCount)
RxPipelineNode RxPipelineNodePS2MatInstanceSetPointListVUBufferSize (RxPipelineNode *self, RwInt32 strideOfInputCluster, RwInt32 vuPLVertexMaxCount)
RxNodeDefinition RxNodeDefinitionGetPS2MatInstance (void)
void  RxPipelineNodePS2ManagerApplyLight (const RpLight *light, const RwMatrix *inverseMat, RwReal invScale, RwReal recipInvScale)
RxPipelineNode RxPipelineNodePS2ObjAllInOneSetGrouping (RxPipelineNode *node, RwBool groupMeshes)
void  RxPipelineNodePS2ObjAllInOneSetLighting (RxPipelineNode *node, RxWorldLightingCallBack newLightingFunc)
RxNodeDefinition RxNodeDefinitionGetPS2ObjAllInOne (RwInt32 objType)

Detailed Description

Alternative Pipeline Toolkit for RenderWare.

RtAltPipe Toolkit Overview

Requirements

Overview

This toolkit provides alternative pipelines which have been part of RpWorld in previous releases of RenderWare. It is supplied for compatibility with existing code only and should not be used in new projects.

Typedef Documentation

typedef RwBool(* RxPipelineNodePS2ManagerInstanceCallBack)(void **clusterData, RwUInt32 numClusters)
 

RxPipelineNodePS2ManagerInstanceCallBack is the callback to be called, for the owning PS2Manager pipeline node, after standard instancing has occurred. Within this callback, code may instance data for user clusters and setup other DMA data (such as a second texture to upload for use in environment mapping).

This callback will receive pointers to cluster data for all clusters (requested through RxPipelineNodePS2ManagerGenerateCluster) which have CL_ATTRIB_READ or CL_ATTRIB_WRITE attributes. This is guaranteed to include, in addition to user-generated clusters, the RxPS2Mesh cluster (placed first in the array) and the RxPS2DMASessionRecord cluster (placed second in the array). Even if there are no other user-generated clusters with CL_ATTRIB_READ or CL_ATTRIB_WRITE attributes, the callback is still called.

If the callback returns FALSE then the current mesh will not be rendered. The rest of the object's meshes will be processed as normal.

Parameters:
clusterData  An array of pointers to the data of clusters with CL_ATTRIB_READ or CL_ATTRIB_WRITE attributes.
numClusters  A count of the number of pointers in the clusterData array. This value is guaranteed to be at least two.
Returns:
TRUE to continue rendering, FALSE to skip rendering this mesh.
See also:
RxPipelineNodePS2ManagerSetInstanceCallBack , RxPipelineNodePS2ManagerSetPostObjectCallBack , RxPipelineNodePS2ManagerGenerateCluster
typedef RwBool(* RxPipelineNodePS2ManagerPostObjectCallBack)(RxPS2DMASessionRecord *dmaSesRec)
 

RxPipelineNodePS2ManagerPostObjectCallBack is the callback to be called, for the owning PS2Manager pipeline node, after all meshes in an object have been processed (remember that PS2Manager is used in object pipelines, not material pipelines), such that cleanup may be performed at the end of the object's pipeline execution (without having to interfere with the object's render callback).

This callback will receive a pointer to the data of the RxPS2DMASessionRecord cluster.

The callback should return FALSE to indicate an error.

Parameters:
dmaSesRec  a pointer to the data of the RxPS2DMASessionRecord cluster
Returns:
TRUE on success, FALSE otherwise
See also:
RxPipelineNodePS2ManagerSetInstanceCallBack , RxPipelineNodePS2ManagerSetPostObjectCallBack , RxPipelineNodePS2ManagerGenerateCluster
typedef void(* RxWorldApplyLightFunc)(const RpLight *light, const RwMatrix * inverseMat, RwReal invScale, RwReal recipInvScale)
 

RxWorldApplyLightFunc RxWorldApplyLightFunc is a call back function for lighting See RxPipelineNodePS2AllObjectSetupCallBack or RxPipelineNodePS2ManagerSetLighting for details.

Parameters:
light  A pointer to the light
inverseMat  The world-space-to-object-space transform matrix
invScale  The scaling value of the matrix
recipInvScale  The reciprocal of invScale

Function Documentation

RxNodeDefinition* RxNodeDefinitionGetPS2Manager RwInt32    objType
 

RxNodeDefinitionGetPS2Manager returns a pointer to the "PS2ManagerWorldSector.csl", "PS2ManagerAtomic.csl" or "PS2ManagerIm3D.csl" node definition - these being to render, respectively, world sectors, atomics or the geometry submitted through calls to RwIm3D render functions.

This node does everything required to render an object, with minor restrictions. It performs the function of the PS2ObjAllInOne.csl, PS2MatInstance.csl and PS2MatBridge.csl nodes combined. This node will not pass packets on to subsequent nodes in the pipeline nor will accept them from previous nodes - it was designed to be the only node in a pipeline, for maximum speed (the PVSWorldSector.csl node, if placed before it, will still work since it doesn't use packets). PS2Manager.csl will also ignore material pipelines, so that all meshes in objects will be rendered in the same style (that defined by the object pipeline). This node will be made more customizable in future releases so that it will be the only node (bar PVSWorldSector.csl) that you need on PlayStation 2.

Parameters:
objType  An RxPS2ObjectType specifying the object type to be rendered by this node (rxOBJTYPE_IM3D, rxOBJTYPE_WORLDSECTOR or rxOBJTYPE_ATOMIC are valid)
Returns:
A pointer to the RxNodeDefinition on success, otherwise NULL
See also:
RxPipelineNodePS2ManagerSetInstanceCallBack , RxPipelineNodePS2ManagerSetPostObjectCallBack , RxPipelineNodePS2ManagerGenerateCluster , RxPipelineNodePS2ManagerSetVUBufferSizes , RxPipelineNodePS2ManagerSetPointListVUBufferSize , RxPipelineNodePS2ManagerGetVUBatchSize , RxPipelineNodePS2ManagerSetVIFOffset , RxPipelineNodePS2ManagerSetVU1CodeArray , RxPipelineNodePS2ManagerGetVU1CodeArray , RxPipelineNodePS2ManagerSetLighting , RxNodeDefinitionGetPS2MatInstance , RxNodeDefinitionGetPS2MatBridge , RxNodeDefinitionGetPS2ObjAllInOne
RxNodeDefinition* RxNodeDefinitionGetPS2MatBridge void   
 

RxNodeDefinitionGetPS2MatBridge returns a pointer to a node to bridge the bottom of a main CPU based material pipeline to a set of VU1 based pipelines. This node has an API for use both during and after pipeline construction.

First, the appropriate chunk of VU1 code (see RxPipelineNodePS2MatBridgeSetVU1CodeArray) is uploaded (unless it is already on VU1), then renderstate is specified (including management of the texture cache, with respect to this mesh's material's texture). Finally, material color and surface properties are uploaded and the transfer of mesh geometry data is kicked off (or queued, rather, since older DMA transfers will still be executing).

This node destroys packets after it has initiated dispatch to the VU1 (this may change but it is done this way currently to avoid mesh data being modified before its DMA transfer has completed).

The node has no outputs The input requirements of this node:

  • RxClPS2DMASessionRecord - required
  • RxClPS2Mesh - required
Returns:
pointer to a node to bridge packets between the CPU and VU1
See also:
RxPipelineNodePS2MatInstanceGenerateCluster , RxPipelineNodePS2MatInstanceSetVUBufferSizes , RxPipelineNodePS2MatBridgeSetVIFOffset , RxPipelineNodePS2MatBridgeSetVU1CodeArray , RxPipelineNodePS2MatBridgeGetVU1CodeArray , RxNodeDefinitionGetPS2MatInstance , RxNodeDefinitionGetPS2ObjAllInOne
RxNodeDefinition* RxNodeDefinitionGetPS2MatInstance void   
 

RxNodeDefinitionGetPS2MatInstance returns a pointer to a node to "instance" a mesh. Note that this node has a construction time API.

On the PlayStation 2, instancing of data is performed in the material pipeline on a per-mesh basis. This is because different material pipelines can require data to be instanced into a different format, depending on what the nodes in the pipeline and VU1 code (associated with the pipeline) require. This node can instance meshes containing any RwPrimitiveType, indexed or unindexed.

For every data type required to be "broken out" (vertex positions, normals, prelight colors, UVs or user-defined data types), a cluster is created (see the documentation for RxPipelineNodePS2MatInstanceGenerateCluster - briefly, it is requested by the application at pipeline construction time that these data types are exposed in clusters to the subsequent nodes in the CPU-side material pipeline. The default is for data to be invisible, since the optimal format for instanced data is a complex, packed DMA-readable structure which is not suitable for referencing as cluster data).

The node checks which parts of the mesh's data need reinstancing. It instances this (from the source world sector or atomic) into the DMA-readable structure in a RwResEntry which is referenced by the RxClPS2Mesh cluster. Every data type exposed by a cluster is instanced into a suitable form (again see the documentation for RxPipelineNodePS2MatInstanceGenerateCluster). Depending on how much has changed in the mesh (from modified UVs to a completely rebuilt mesh) only a subset of the data may be reinstanced or (more costly) the entire RwResEntry may be thrown away and the DMA structure rebuilt from scratch.

   The node has one output, through which the instanced mesh passes.
   The input requirements of this node:

   RxClPS2DMASessionRecord  - required
   RxClPS2Mesh              - required

   The characteristics of this node's first output:

   RxClPS2DMASessionRecord  - valid
   RxClPS2Mesh              - valid
   
Returns:
pointer to a node to "instance" a mesh
See also:
RxPipelineNodePS2MatInstanceSetVUBufferSizes , RxPipelineNodePS2MatInstanceSetPointListVUBufferSize , RxPipelineNodePS2MatInstanceGenerateCluster , RxPipelineNodePS2MatBridgeSetVIFOffset , RxPipelineNodePS2MatBridgeSetVU1CodeArray , RxNodeDefinitionGetPS2ObjAllInOne , RxNodeDefinitionGetPS2MatBridge
RxNodeDefinition* RxNodeDefinitionGetPS2ObjAllInOne RwInt32    objType
 

RxNodeDefinitionGetPS2ObjAllInOne returns a pointer to the "PS2ObjWorldSectorAllInOne.csl" or "PS2ObjAtomicAllInOne.csl" node definition - these being to generate a packet for each mesh in, respectively, world sectors or atomics.

RxNodeDefinitionGetPS2ObjAllInOne has one parameter which you use to choose whether you want a node to handle world sectors or atomics.

On the PlayStation 2, instancing of data is performed in the material pipeline on a per-mesh basis. This is because different material pipelines can require data to be instanced into a different format, depending on what the VU1 code (associated with the pipeline) requires. This means that PS2*ObjAllInOne.csl is not the equivalent of AtomicInstance.csl or WorldSectorInstance.csl which form the default generic atomic and world sector object pipelines. Instead, it does some per-object setup and then generates a packet per mesh and dispatches them to their associated material pipelines.

PS2*ObjAllInOne.csl determines if the object's bounding volume crosses the frustum (this is the large PlayStation 2 overdraw frustum) and selects a clipping transform if so or a non-clipping transform if not. It also checks to see if the object is made of trilists or tristrips and selects a trilist transform or a tristrip transform respectively. The selected transform is specified in a PS2DMASessionRecord structure and an inFrustum state is stored there also.

The node then calculates the object-to-camera matrix and finds all the lights which affect the object. These pieces of information are added to a VU1 packet and uploaded (just once since they are per-object not per-mesh).

Next, a packet is generated for every mesh, containing a reference to the RxPS2DMASessionRecord structure in a RxClPS2DMASessionRecord cluster. An RxClPS2Mesh cluster containing a RxPS2Mesh structure is also created which contains a reference to the RpMesh and also the RwResEntry used for caching the instanced data for each mesh - plugin data attached to the world sector or atomic contains a list of references to these RwResEntry.

The node will output each packet to the pipeline referenced in its mesh's associated material. There is an alternative, potentially more efficient mode of execution (where all meshes get passed down this pipeline to 'inlined' material rendering nodes), which is described in detail in the docs for RxPipelineNodePS2ObjAllInOneSetGrouping.

Parameters:
objType  An RxPS2ObjectType specifying the object type the returned node shoudl handle (rxOBJTYPE_IM3D, rxOBJTYPE_WORLDSECTOR or rxOBJTYPE_ATOMIC are valid)
The node has one output (used in the alternative execution mode), but by default all packets are sent to material pipelines The input requirements of this node:
  • RxClPS2DMASessionRecord - don't want
  • RxClPS2Mesh - don't want
The characteristics of this node's first output:
  • RxClPS2DMASessionRecord - valid
  • RxClPS2Mesh - valid
Returns:
pointer to a node to generate a packet for each mesh in world sectors or atomics.
See also:
RxPipelineNodePS2ObjAllInOneSetGrouping , RxNodeDefinitionGetPS2MatBridge , RxNodeDefinitionGetPS2MatInstance
void RxPipelineNodePS2ManagerApplyLight const RpLight   light,
const RwMatrix   inverseMat,
RwReal    invScale,
RwReal    recipInvScale
 

RxPipelineNodePS2ManagerApplyLight is the default RxWorldApplyLightFunc which may be called, for each light affecting an object, to get lighting information uploaded to VU1 by a PS2Manager-based object pipeline.

Lighting is performed in object-space (to avoid transforming object normals), hence this function requires a matrix to transform lights from world-space into object-space (i.e. it should be the inverse of the object's LTM matrix). This matrix must be orthogonal, though it need not be normalized. Both the scaling factor (1.0 if the matrix IS normalized) and its reciprocal need to be passed to this function so that the light's radius and direction vector may be scaled and renormalized after transform.

Note that the matrix and scaling values need only be supplied for the first light affecting an object - they are only uploaded once.

Parameters:
light  A pointer to the light
inverseMat  The world-space-to-object-space transform matrix
invScale  The scaling value of the matrix
recipInvScale  The reciprocal of invScale
See also:
RxWorldApplyLightFunc , RxPipelineNodePS2ManagerSetLighting
RxPipelineNode* RxPipelineNodePS2ManagerGenerateCluster RxPipelineNode   self,
RxClusterDefinition   cluster2generate,
RwUInt32    type
 

RxPipelineNodePS2ManagerGenerateCluster is used to force this node to generate clusters. It should be called with a pointer to this node and each of the RxClPS2* clusters required. This function must be called before the pipeline containing this node is unlocked because that is when cluster attributes are finalized.

These are the PlayStation 2-specific clusters you can request for this node (see also RxPS2ClusterType):

  • RxClPS2xyz - Object-space position of vertices
  • RxClPS2uv - Base texture coordinates of vertices
  • RxClPS2uv2 - Two texture coordinate sets
  • RxClPS2rgba - Prelight colors of vertices
  • RxClPS2normal - Object-space normals at each vertex
  • RxClPS2user1 - User-defined cluster 1
  • RxClPS2user2 - User-defined cluster 2
  • RxClPS2user3 - User-defined cluster 3
  • RxClPS2user4 - User-defined cluster 4
PlayStation 2-specific attributes (in the RxPS2AttributeSet namespace, which has the identifier string "PS2") are used to define two properties of the above PlayStation 2-specific clusters. Firstly, the RxPS2ClusterAttrib flags define how the data's instancing into DMA chains is handled by the instancing portion of PS2manager.csl (see the docs for these flags for details). Secondly, the RxPS2ClusterFormatAttrib flags define what format the data will be in as interpreted by the DMA engine and VIF when the data is uploaded to VU1.

Currently, PS2Manager.csl is in a nascent form but in its final incarnation, PS2Manager.csl will be all that you will need on PlayStation 2 and will allow instancing of custom data and customizable per-object, per-mesh and per-vertex data. The recently-added RxPipelineNodePS2ManagerSetInstanceCallBack should provide as much flexibility as with pipelines constructed from the separated PS2ObjAllInOne.csl, PS2MatInstance.csl and PS2MatBridge.csl nodes with additional inserted user nodes. The exception is that PS2Manager.csl ignores material pipelines so that all meshes within an object are rendered in the same style (that defined by the object pipeline).

You must request at least one cluster for the pipeline to function. This function should be called before unlocking the pipeline containing this node.

Parameters:
self  A pointer to a PS2Manager.csl pipeline node
cluster2generate  A pointer to a PlayStation 2-specific cluster definition
type  PlatStation 2-specific cluster type specifier
Returns:
a pointer to the input pipeline node on success, otherwise NULL.
See also:
RxPipelineNodePS2MatInstanceGenerateCluster , RxPipelineNodePS2ManagerSetInstanceCallBack , RxPipelineNodePS2ManagerSetPostObjectCallBack , RxPipelineNodePS2ManagerSetVUBufferSizes , RxPipelineNodePS2ManagerSetPointListVUBufferSize , RxPipelineNodePS2ManagerGetVUBatchSize , RxPipelineNodePS2ManagerSetLighting , RxPipelineNodePS2ManagerSetVU1CodeArray , RxPipelineNodePS2ManagerGetVU1CodeArray , RxPipelineNodePS2ManagerSetVIFOffset , RxClusterGetAttributes , RxClusterSetAttributes , RxPipelineClusterGetCreationAttributes , RxPipelineClusterSetCreationAttributes , RxNodeDefinitionGetPS2Manager , RxNodeDefinitionGetPS2MatInstance , RxNodeDefinitionGetPS2MatBridge , RxNodeDefinitionGetPS2ObjAllInOne
const void** RxPipelineNodePS2ManagerGetVU1CodeArray RxPipelineNode   self
 

RxPipelineNodePS2ManagerGetVU1CodeArray is a node API function which retrieves an array of pointers to the VU code fragments currently to be used by this pipeline. It mirrors RxPipelineNodePS2ManagerSetVU1CodeArray

This function must be called after unlocking the pipeline containing the PS2Manager.csl node.

Parameters:
self  A pointer to the current RxPipelineNode
Returns:
a pointer to the current VU1 code array on success, otherwise NULL.
See also:
RxPipelineNodePS2ManagerSetInstanceCallBack , RxPipelineNodePS2ManagerSetPostObjectCallBack , RxPipelineNodePS2ManagerGenerateCluster , RxPipelineNodePS2ManagerSetVUBufferSizes , RxPipelineNodePS2ManagerSetPointListVUBufferSize , RxPipelineNodePS2ManagerGetVUBatchSize , RxPipelineNodePS2ManagerSetLighting , RxPipelineNodePS2ManagerSetVU1CodeArray , RxPipelineNodePS2ManagerSetVIFOffset , RxNodeDefinitionGetPS2Manager , RxNodeDefinitionGetPS2MatInstance , RxNodeDefinitionGetPS2MatBridge , RxNodeDefinitionGetPS2ObjAllInOne
RwInt32 RxPipelineNodePS2ManagerGetVUBatchSize RxPipelineNode   self,
RpMeshHeaderFlags    flags
 

RxPipelineNodePS2ManagerGetVUBatchSize is used to query the batch size used for uploading data to the VU.

This function should be called after unlocking the pipeline containing this node.

Parameters:
self  A pointer to the current RxPipelineNode
flags  RpMeshHeaderFlags specifying what sort of mesh the returned values should relate to. Valid values are zero or rpMESHHEADERTRISTRIP - for pointlist rendering, use zero
Returns:
the batch size on success, zero otherwise
See also:
RxPipelineNodePS2ManagerSetVUBufferSizes , RxPipelineNodePS2ManagerSetPointListVUBufferSize , RxPipelineNodePS2ManagerSetInstanceCallBack , RxPipelineNodePS2ManagerSetPostObjectCallBack , RxPipelineNodePS2ManagerGenerateCluster , RxPipelineNodePS2ManagerSetLighting , RxPipelineNodePS2ManagerSetVU1CodeArray , RxPipelineNodePS2ManagerGetVU1CodeArray , RxPipelineNodePS2ManagerSetVIFOffset , RxNodeDefinitionGetPS2Manager , RxNodeDefinitionGetPS2MatInstance , RxNodeDefinitionGetPS2MatBridge , RxNodeDefinitionGetPS2ObjAllInOne
RxPipelineNode* RxPipelineNodePS2ManagerNoTexture RxPipelineNode   self,
RwBool    noTexture
 

RxPipelineNodePS2ManagerNoTexture is a post construction time API which permits preventing the manager node from uploading any texture information.

By default, the manager node will upload the raster for each mesh's texture to video memory, just before the geometry of that mesh is processed by VU1. It will also set up the appropriate filtering and addressing modes for the texture. This API function can be used to prevent this from happening. This is useful if a user-supplied instance callback (see RxPipelineNodePS2ManagerSetInstanceCallBack) is able to set up textures itself more efficiently than can the manager node (given that it is written based on knowledge of the current application), if the instance callback needs to choose the texture to upload from somewhere other than the object's materials, etc.

This function must be called after unlocking the pipeline containing the PS2Manager.csl node.

Parameters:
self  A pointer to the current RxPipelineNode
noTexture  TRUE to prevent the manager node from uploading texture information, FALSE (default) to allow it
Returns:
a pointer to this node on success, otherwise NULL.
See also:
RxPipelineNodePS2ManagerSetInstanceCallBack , RxPipelineNodePS2ManagerSetPostObjectCallBack , RxPipelineNodePS2ManagerGenerateCluster , RxPipelineNodePS2ManagerSetVUBufferSizes , RxPipelineNodePS2ManagerSetPointListVUBufferSize , RxPipelineNodePS2ManagerGetVUBatchSize , RxPipelineNodePS2ManagerSetLighting , RxPipelineNodePS2ManagerSetVU1CodeArray , RxPipelineNodePS2ManagerGetVU1CodeArray , RxNodeDefinitionGetPS2Manager , RxNodeDefinitionGetPS2MatInstance , RxNodeDefinitionGetPS2MatBridge , RxNodeDefinitionGetPS2ObjAllInOne
RxPipelineNode* RxPipelineNodePS2ManagerSetInstanceCallBack RxPipelineNode   self,
RxPipelineNodePS2ManagerInstanceCallBack    callBack
 

RxPipelineNodePS2ManagerSetInstanceCallBack is used to register a callback to instance data or set up additional DMA data.

The registered callback will be called after standard instancing has occurred - standard instancing being that done by PS2Manager. User cluster or clusters with CL_ATTRIB_DONT_FILL or CL_ATTRIB_PLACEHOLDER attributes will not be instanced by PS2Manager. The instance callback will receive an array of pointers to cluster data for all clusters which have CL_ATTRIB_READ or CL_ATTRIB_WRITE specified (the clusters that can be filled in by user CPU-side code). The first pointer will always be to the RxPS2Mesh cluster and the second to the RxPS2DMASessionRecord cluster. There need not be any further (CL_ATTRIB_READ or CL_ATTRIB_WRITE) clusters for the callback to be called (a plug-in may, for example, only want to upload a texture or some static data).

The default instancing code (called for all standard, non-read-or-write clusters) can instance from meshes containing any RwPrimitiveType, indexed or unindexed. User-supplied callbacks, however, need only handle meshes of the types required by the user.

This function should be called after unlocking the pipeline containing this node.

Parameters:
self  A pointer to a PS2Manager.csl pipeline node
callBack  A pointer to a callback (NULL disables a prior callback)
Returns:
a pointer to the input pipeline node on success, otherwise NULL.
See also:
RxPipelineNodePS2ManagerSetPostObjectCallBack , RxPipelineNodePS2ManagerGenerateCluster , RxPipelineNodePS2ManagerSetVUBufferSizes , RxPipelineNodePS2ManagerSetPointListVUBufferSize , RxPipelineNodePS2ManagerGetVUBatchSize , RxPipelineNodePS2ManagerSetLighting , RxPipelineNodePS2ManagerSetVU1CodeArray , RxPipelineNodePS2ManagerGetVU1CodeArray , RxPipelineNodePS2ManagerSetVIFOffset , RxNodeDefinitionGetPS2Manager , RxNodeDefinitionGetPS2MatInstance , RxNodeDefinitionGetPS2MatBridge , RxNodeDefinitionGetPS2ObjAllInOne
void RxPipelineNodePS2ManagerSetLighting RxPipelineNode   self,
RxWorldLightingCallBack    newLightingFunc
 

RxPipelineNodePS2ManagerSetLighting allows you to overload PS2Manager.csl with your own lighting system.

The Lighting function you pass must have the following format:

   void RxWorldLightingCallBack *(RwInt32 objectType, void *object)
   
where objectType is the type of object being passed (currently an atomic or a world sector) and object is a pointer to it. You should evaluate which lights affect this atomic and for each one call RxPipelineNodePS2ManagerApplyLight (of type RxWorldApplyLightFunc), passing the pointer to the light, the inverse LTM of the object, the matrix scaling factor and its reciprocal.

This function should be called after unlocking the pipeline containing this node.

Parameters:
self  A pointer to the current RxPipelineNode
newLightingFunc  The RxWorldLightingCallBack to use
See also:
RxPipelineNodePS2ManagerSetInstanceCallBack , RxPipelineNodePS2ManagerSetPostObjectCallBack , RxPipelineNodePS2ManagerGenerateCluster , RxPipelineNodePS2ManagerSetVUBufferSizes , RxPipelineNodePS2ManagerSetPointListVUBufferSize , RxPipelineNodePS2ManagerGetVUBatchSize , RxPipelineNodePS2ManagerSetVU1CodeArray , RxPipelineNodePS2ManagerGetVU1CodeArray , RxPipelineNodePS2ManagerSetVIFOffset , RxNodeDefinitionGetPS2Manager , RxNodeDefinitionGetPS2MatInstance , RxNodeDefinitionGetPS2MatBridge , RxNodeDefinitionGetPS2ObjAllInOne
RxPipelineNode* RxPipelineNodePS2ManagerSetPointListVUBufferSize RxPipelineNode   self,
RwInt32    strideOfInputCluster,
RwInt32    vuPLVertexMaxCount
 

RxPipelineNodePS2ManagerSetPointListVUBufferSize is used to set the maximum number of vertices for pointlists that may be passed to the VU code section of the pipe containing this node. The stride (in quad words) of the input buffer in vector memory is also set by this function.

This function should be called instead of RxPipelineNodePS2ManagerSetVUBufferSizes, they should not both be called. Pipelines set up with this function will only be able to handle pointlist objects, not triangle- or line-based objects. For pipelines feeding user supplied VU code, the values to pass to this function may be obtained from the pipeline specific header file created by processing stddata.i. Note that for a pointlist pipeline, the first half of the VU1 code array should be used - i.e the TRANSTRI slots are reused. (see RxPipelineNodePS2ManagerSetVU1CodeArray)

This function should be called before unlocking the pipeline containing this node.

Parameters:
self  A pointer to the current RxPipelineNode
strideOfInputCluster  stride of cluster in VU memory
vuPLVertexMaxCount  maximum number of vertices per PointList batch
Returns:
a pointer to this node on success, otherwise NULL
See also:
RxPipelineNodePS2ManagerSetVUBufferSizes , RxPipelineNodePS2ManagerGetVUBatchSize , RxPipelineNodePS2ManagerSetInstanceCallBack , RxPipelineNodePS2ManagerSetPostObjectCallBack , RxPipelineNodePS2ManagerGenerateCluster , RxPipelineNodePS2ManagerSetLighting , RxPipelineNodePS2ManagerSetVU1CodeArray , RxPipelineNodePS2ManagerGetVU1CodeArray , RxPipelineNodePS2ManagerSetVIFOffset , RxNodeDefinitionGetPS2Manager , RxNodeDefinitionGetPS2MatInstance , RxNodeDefinitionGetPS2MatBridge , RxNodeDefinitionGetPS2ObjAllInOne
RxPipelineNode* RxPipelineNodePS2ManagerSetPostObjectCallBack RxPipelineNode   self,
RxPipelineNodePS2ManagerPostObjectCallBack    callBack
 

RxPipelineNodePS2ManagerSetPostObjectCallBack is used to register a callback to perform post-object cleanup.

The registered callback will be called, for the owning PS2Manager pipeline node, after all meshes in an object have been processed (remember that PS2Manager is used in object pipelines, not material pipelines), such that cleanup may be performed at the end of the object's pipeline execution (without having to interfere with the object's render callback).

This callback will receive a pointer to the data of the RxPS2DMASessionRecord cluster.

This function should be called after unlocking the pipeline containing this node.

Parameters:
self  A pointer to a PS2Manager.csl pipeline node
callBack  A pointer to a callback (NULL disables a prior callback)
Returns:
a pointer to the input pipeline node on success, otherwise NULL.
See also:
RxPipelineNodePS2ManagerSetInstanceCallBack , RxPipelineNodePS2ManagerGenerateCluster , RxPipelineNodePS2ManagerSetVUBufferSizes , RxPipelineNodePS2ManagerSetPointListVUBufferSize , RxPipelineNodePS2ManagerGetVUBatchSize , RxPipelineNodePS2ManagerSetLighting , RxPipelineNodePS2ManagerSetVU1CodeArray , RxPipelineNodePS2ManagerGetVU1CodeArray , RxPipelineNodePS2ManagerSetVIFOffset , RxNodeDefinitionGetPS2Manager , RxNodeDefinitionGetPS2MatInstance , RxNodeDefinitionGetPS2MatBridge , RxNodeDefinitionGetPS2ObjAllInOne
RxPipelineNode* RxPipelineNodePS2ManagerSetVIFOffset RxPipelineNode   self,
int    vifOffset
 

RxPipelineNodePS2ManagerSetVIFOffset is used to set the VIF offset that is used when processing multiple batches of data. If this function is not called, a value suitable for the default code fragments and static data allocations will be used. For user provided VU1 code, this value can be obtained from the pipeline specific headerfile generated by processing stddata.i

This function must be called after unlocking the pipeline containing the PS2Manager.csl node.

Parameters:
self  A pointer to the current RxPipelineNode
vifOffset  Value of VIF double buffer offset to be used by this pipe
Returns:
a pointer to this node on success, otherwise NULL.
See also:
RxPipelineNodePS2ManagerSetInstanceCallBack , RxPipelineNodePS2ManagerSetPostObjectCallBack , RxPipelineNodePS2ManagerGenerateCluster , RxPipelineNodePS2ManagerSetVUBufferSizes , RxPipelineNodePS2ManagerSetPointListVUBufferSize , RxPipelineNodePS2ManagerGetVUBatchSize , RxPipelineNodePS2ManagerSetLighting , RxPipelineNodePS2ManagerSetVU1CodeArray , RxPipelineNodePS2ManagerGetVU1CodeArray , RxNodeDefinitionGetPS2Manager , RxNodeDefinitionGetPS2MatInstance , RxNodeDefinitionGetPS2MatBridge , RxNodeDefinitionGetPS2ObjAllInOne
RxPipelineNode* RxPipelineNodePS2ManagerSetVU1CodeArray RxPipelineNode   self,
void **    VU1CodeArray
 

RxPipelineNodePS2ManagerSetVU1CodeArray is a node API function which permits setting of the VU code fragments to be used by this pipeline.

The bridge node connects its main CPU based pipeline to up to 16 different VU1 based pipelines. These are provided as an array of 16 pointers to callable DMA chain mode packets that will upload code to location 0 onward on VU1. The array is indexed using the TRANS* bit values stored in the RxClPS2DMASessionRecord cluster (there are 4 such toggles, hence 16 combinations - note that user created code fragments may be used and TRANS* values set by a user node if the default clip/list/iso/fog values set by PS2WorldSectorObjAllInOne.csl/ PS2AtomicObjAllInOne.csl are not appropriate).

  • TRANSFOG: This transform fogs.
  • TRANSCLIP: This transform can cope with geometry which will project out side the overdraw area.
  • TRANSLIST: This is a trilist transform.
  • TRANSISO: This transform is used for isometric projection.
  • TRANSLINE: Draw linelists/linestrips, not trilists/tristrips.
TRANSNFOG, TRANSNCL, TRANSSTRIP, TRANSPER and TRANSTRI (all value zero) are provided for convience. If this function is not called, or is called with NULL, the default VU1 based code fragments will be used. If an array element is NULL, the default VU1 code fragment for that combination of types will be used (a useful debugging procedure is to fill unused slots with some simple VU1 code that ignores input data and merely serves to alert you that that code slot is being used when it shouldn't - a big red triangle drawn over the screen for instance, something immediately recognisable)..

NOTE: For a pointlist pipeline, the first half of the code array should be used - i.e the TRANSTRI slots are reused. (see RxPipelineNodePS2ManagerSetPointListVUBufferSize)

This function must be called after unlocking the pipeline containing the PS2Manager.csl node.

Parameters:
self  A pointer to the current RxPipelineNode
VU1CodeArray  An array of 16 pointers to a callable dma chain which will upload code and return. This is used by reference.
Returns:
a pointer to this node on success, otherwise NULL.
See also:
RxPipelineNodePS2ManagerSetInstanceCallBack , RxPipelineNodePS2ManagerSetPostObjectCallBack , RxPipelineNodePS2ManagerGenerateCluster , RxPipelineNodePS2ManagerSetVUBufferSizes , RxPipelineNodePS2ManagerSetPointListVUBufferSize , RxPipelineNodePS2ManagerGetVUBatchSize , RxPipelineNodePS2ManagerSetLighting , RxPipelineNodePS2ManagerGetVU1CodeArray , RxPipelineNodePS2ManagerSetVIFOffset , RxNodeDefinitionGetPS2Manager , RxNodeDefinitionGetPS2MatInstance , RxNodeDefinitionGetPS2MatBridge , RxNodeDefinitionGetPS2ObjAllInOne
RxPipelineNode* RxPipelineNodePS2ManagerSetVUBufferSizes RxPipelineNode   self,
RwInt32    strideOfInputCluster,
RwInt32    vuTSVertexMaxCount,
RwInt32    vuTLTriMaxCount
 

RxPipelineNodePS2ManagerSetVUBufferSizes is used to set the maximum number of triangles (for trilists) and vertices (for tristrips) that may be passed to the VU code section of the pipe containing this node. The stride (in quad words) of the input buffer in vector memory is also set by this function. If this function is not called the defaults required by the standard transforms will be used. For pipelines feeding user supplied VU code, these vaules may be obtained from the pipeline specific header file created by processing stddata.i

This function should be called before unlocking the pipeline containing this node.

Parameters:
self  A pointer to the current RxPipelineNode
strideOfInputCluster  stride of cluster in VU memory
vuTSVertexMaxCount  maximum number of vertices per TriStrip batch
vuTLTriMaxCount  maximum number of triangles per TriList batch
Returns:
a pointer to this node on success, otherwise NULL
See also:
RxPipelineNodePS2ManagerSetPointListVUBufferSize , RxPipelineNodePS2ManagerGetVUBatchSize , RxPipelineNodePS2ManagerSetInstanceCallBack , RxPipelineNodePS2ManagerSetPostObjectCallBack , RxPipelineNodePS2ManagerGenerateCluster , RxPipelineNodePS2ManagerSetLighting , RxPipelineNodePS2ManagerSetVU1CodeArray , RxPipelineNodePS2ManagerGetVU1CodeArray , RxPipelineNodePS2ManagerSetVIFOffset , RxNodeDefinitionGetPS2Manager , RxNodeDefinitionGetPS2MatInstance , RxNodeDefinitionGetPS2MatBridge , RxNodeDefinitionGetPS2ObjAllInOne
const void** RxPipelineNodePS2MatBridgeGetVU1CodeArray RxPipelineNode   self
 

RxPipelineNodePS2MatBridgeGetVU1CodeArray is a post construction time API function which retrieves an array of pointers to the VU code fragments currently to be used by this pipeline. It mirrors RxPipelineNodePS2MatBridgeSetVU1CodeArray

Parameters:
self  A pointer to the current RxPipelineNode
Returns:
a pointer to the current VU1 code array on success, otherwise NULL.
See also:
RxPipelineNodePS2MatInstanceGenerateCluster , RxPipelineNodePS2MatInstanceSetVUBufferSizes , RxPipelineNodePS2MatBridgeSetVU1CodeArray , RxPipelineNodePS2MatBridgeSetVIFOffset , RxNodeDefinitionGetPS2MatInstance , RxNodeDefinitionGetPS2ObjAllInOne
RxPipelineNode* RxPipelineNodePS2MatBridgeNoTexture RxPipelineNode   self,
RwBool    noTexture
 

RxPipelineNodePS2MatBridgeNoTexture is a post construction time API which permits preventing the bridge node from uploading any texture information.

By default, the bridge node will upload the raster for each mesh's texture to video memory, just before the geometry of that mesh is processed by VU1. It will also set up the appropriate filtering and addressing modes for the texture. This API function can be used to prevent this from happening. This is useful if a custom user node (inserted in the pipeline before the bridge node) is able to set up textures itself more efficiently than can the bridge node (given that it is written based on knowledge of the current application), if the custom node needs to choose the texture to upload from somewhere other than the object's materials, etc.

This function must be called after unlocking the pipeline containing the bridge node.

Parameters:
self  A pointer to the current RxPipelineNode
noTexture  TRUE to prevent the bridge node from uploading texture information, FALSE (default) to allow it
Returns:
a pointer to this node on success, otherwise NULL.
See also:
RxPipelineNodePS2MatInstanceGenerateCluster , RxPipelineNodePS2MatInstanceSetVUBufferSizes , RxPipelineNodePS2MatBridgeSetVU1CodeArray , RxPipelineNodePS2MatBridgeGetVU1CodeArray , RxPipelineNodePS2MatBridgeSetVIFOffset , RxNodeDefinitionGetPS2MatInstance , RxNodeDefinitionGetPS2ObjAllInOne
RxPipelineNode* RxPipelineNodePS2MatBridgeSetVIFOffset RxPipelineNode   self,
RwInt32    vifOffset
 

RxPipelineNodePS2MatBridgeSetVIFOffset is used to set the VIF offset that is used when processing multiple batches of data. If this function is not called, a value suitable for the default code fragments and static data allocations will be used. For user provided VU1 code, this value can be obtained from the pipeline specific header file generated by processing stddata.i

Parameters:
self  A pointer to the current RxPipelineNode
vifOffset  Value of VIF double buffer offset to be used by this pipe
Returns:
a pointer to this node on success, otherwise NULL.
See also:
RxPipelineNodePS2MatInstanceGenerateCluster , RxPipelineNodePS2MatInstanceSetVUBufferSizes , RxPipelineNodePS2MatBridgeSetVU1CodeArray , RxPipelineNodePS2MatBridgeGetVU1CodeArray , RxNodeDefinitionGetPS2MatInstance , RxNodeDefinitionGetPS2ObjAllInOne
RxPipelineNode* RxPipelineNodePS2MatBridgeSetVU1CodeArray RxPipelineNode   self,
void **    VU1CodeArray
 

RxPipelineNodePS2MatBridgeSetVU1CodeArray is a post construction time API function which permits setting of the VU code fragments to be used by this pipeline.

The bridge node connects its main CPU based pipeline to up to 16 different VU1 based pipelines. These are provided as an array of 16 pointers to callable DMA chain mode packets that will upload code to location 0 onward on VU1. The array is indexed using the TRANS* bit values stored in the RxClPS2DMASessionRecord cluster (there are 4 such toggles, hence 16 combinations - note that user created code fragments may be used and TRANS* values set by a user node if the default clip/list/iso/fog values set by PS2WorldSectorObjAllInOne.csl/ PS2AtomicObjAllInOne.csl are not appropriate).

  • rxSKYTRANSTYPEFOG: This transform fogs.
  • rxSKYTRANSTYPECLIP: This transform can cope with geometry which will project out side the overdraw area.
  • rxSKYTRANSTYPELIST: This is a trilist transform.
  • rxSKYTRANSTYPEISO: This transform is used for isometric projection.
  • rxSKYTRANSTYPELINE: Draw linelists/linestrips, not trilists/tristrips.
If this function is not called, or is called with NULL, the default VU1 based code fragments will be used. If an array element is NULL, the default VU1 code fragment for that combination of types will be used (a useful debugging procedure is to fill unused slots with some simple VU1 code that ignores input data and merely serves to alert you that that code slot is being used when it shouldn't - a big red triangle drawn over the screen for instance, something immediately recognisable)..

NOTE: For a pointlist pipeline, the first half of the code array should be used - i.e the TRANSTRI slots are reused. (see RxPipelineNodePS2MatInstanceSetPointListVUBufferSize)

Parameters:
self  A pointer to the current RxPipelineNode
VU1CodeArray  An array of 16 pointers to a callable dma chain which will upload code and return. This is used by reference.
Returns:
a pointer to this node on success, otherwise NULL.
See also:
RxPipelineNodePS2MatInstanceGenerateCluster , RxPipelineNodePS2MatInstanceSetVUBufferSizes , RxPipelineNodePS2MatInstanceSetPointListVUBufferSize , RxPipelineNodePS2MatBridgeGetVU1CodeArray , RxPipelineNodePS2MatBridgeSetVIFOffset , RxNodeDefinitionGetPS2MatInstance , RxNodeDefinitionGetPS2ObjAllInOne
RxPipelineNode* RxPipelineNodePS2MatInstanceGenerateCluster RxPipelineNode   self,
RxClusterDefinition   cluster2generate,
RwUInt32    type
 

RxPipelineNodePS2MatInstanceGenerateCluster is used to force this node to generate clusters. It should be called with a pointer to this node and each of the RxClPS2* clusters required. This function must be called before the pipeline containing this node is unlocked because that is when cluster attributes are finalized.

These are the PlayStation 2-specific clusters you can request for this node (see also RxPS2ClusterType):

  • RxClPS2xyz - Object-space position of vertices
  • RxClPS2uv - Base texture coordinates of vertices
  • RxClPS2uv2 - Two texture coordinate sets
  • RxClPS2rgba - Prelight colors of vertices
  • RxClPS2normal - Object-space normals at each vertex
  • RxClPS2user1 - User-defined cluster 1
  • RxClPS2user2 - User-defined cluster 2
  • RxClPS2user3 - User-defined cluster 3
  • RxClPS2user4 - User-defined cluster 4
PlayStation 2-specific attributes (in the RxPS2AttributeSet namespace, identifier string "PS2") are used to define two properties of the above PlayStation 2-specific clusters. Firstly, the RxPS2ClusterAttrib flags define how the data's instancing into DMA chains is handled by PS2MatInstance.csl. Secondly, the RxPS2ClusterFormatAttrib flags define what format the data will be in as interpreted by the DMA engine and VIF when the data is uploaded to VU1.

The format attributes of the first four of the above PlayStation 2-specific clusters are fixed and you cannot change them, however the instance flags can be changed. The user-defined clusters can have any attributes you please. Since these cluster definitions are static globals and provided really as examples, it is suggested that you create copies, modify their attributes as appropriate and submit these copies to this function. See RxClusterSetAttributes for details on changing cluster attributes.

Only clusters which are specified with CL_ATTRIB_READ or CL_ATTRIB_WRITE will result in RxCluster actually being present in packets flowing down this pipeline. Other clusters are only present from the point of view of the instancing and DMA code and you will not be able to access them using RxClusterLockRead or RxClusterLockWrite. Visible clusters will be 'broken out' from the usual (complex, packed) format of DMA packet data such that their data is still accessible as a simple, contiguous array of data just like non-PlayStation 2-specific clusters. However, their data will always be flagged as rxCLFLAGS_EXTERNALMODIFIABLE because it is in a fixed location with a fixed size - you cannot free or resize it, but, if CL_ATTRIB_WRITE is set you can modify it. This is useful for things like CPU-side particle system animation. For example, you might request the CL_RGBA and CL_XYZ clusters and specify the CL_XYZ cluster as CL_ATTRIB_READWRITE. Then a node placed after PS2MatInstance.csl and before PS2MatBridge.csl could modify the positions of vertices (particles) before they are uploaded to VU1 (remembering to flush cache on this data of course!).

You have to have at least one cluster and can have a maximum of eight (with at most four user-defined clusters). Clusters currently have a maximum stride of one quadword though this limitation will be removed in the future.

Returns:
a pointer to the input pipeline node on success, otherwise NULL.
See also:
RxClusterGetAttributes , RxClusterSetAttributes , RxPipelineClusterGetCreationAttributes , RxPipelineClusterSetCreationAttributes , RxPipelineNodePS2MatInstanceSetVUBufferSizes , RxPipelineNodePS2MatInstanceSetPointListVUBufferSize , RxPipelineNodePS2MatBridgeSetVIFOffset , RxPipelineNodePS2MatBridgeSetVU1CodeArray , RxNodeDefinitionGetPS2Manager , RxNodeDefinitionGetPS2MatInstance , RxNodeDefinitionGetPS2MatBridge , RxNodeDefinitionGetPS2ObjAllInOne
Parameters:
self  pointer to a PS2MatInstance.csl pipeline node
cluster2generate  A pointer to a PlayStation 2-specific cluster definition
type  PlayStation 2-specific cluster type specifier
RxPipelineNode* RxPipelineNodePS2MatInstanceSetPointListVUBufferSize RxPipelineNode   self,
RwInt32    strideOfInputCluster,
RwInt32    vuPLVertexMaxCount
 

RxPipelineNodePS2MatInstanceSetPointListVUBufferSize is used to set the maximum number of vertices for pointlists that may be passed to the VU code section of the pipe containing this node. The stride (in quad words) of the input buffer in vector memory is also set by this function.

This function should be called instead of RxPipelineNodePS2MatInstanceSetVUBufferSizes, they should not both be called. Pipelines set up with this function will only be able to handle pointlist objects, not triangle- or line-based objects. For pipelines feeding user supplied VU code, the values to pass to this function may be obtained from the pipeline specific header file created by processing stddata.i. Note that for a pointlist pipeline, the first half of the VU1 code array should be used - i.e the TRANSTRI slots are reused. (see RxPipelineNodePS2MatBridgeSetVU1CodeArray)

Note that the buffer size submitted may be rounded down. For pointlists, it will be rounded down to (4n) due to DMA read alignment requirements.

This function should be called before unlocking the pipeline containing this node.

Parameters:
self  A pointer to a PS2MatInstance.csl RxPipelineNode
strideOfInputCluster  stride of cluster in VU memory
vuPLVertexMaxCount  maximum number of vertices per PointList batch
Returns:
a pointer to this node on success, otherwise NULL
See also:
RxPipelineNodePS2MatInstanceSetVUBufferSizes , RxPipelineNodePS2MatInstanceGenerateCluster , RxPipelineNodePS2MatBridgeSetVIFOffset , RxPipelineNodePS2MatBridgeSetVU1CodeArray , RxNodeDefinitionGetPS2MatInstance , RxNodeDefinitionGetPS2ObjAllInOne
RxPipelineNode* RxPipelineNodePS2MatInstanceSetVUBufferSizes RxPipelineNode   self,
RwInt32    strideOfInputCluster,
RwInt32    vuTSVertexMaxCount,
RwInt32    vuTLTriMaxCount
 

RxPipelineNodePS2MatInstanceSetVUBufferSizes is used to set the maximum number of triangles (for trilists) and vertices (for tristrips) that may be passed to the VU code section of the pipe containing this node. The stride (in quad words) of the input buffer in vector memory is also set by this function. If this function is not called the defaults required by the standard transforms will be used. For pipelines feeding user supplied VU code, these values may be obtained from the pipeline specific header file created by processing stddata.i

Note that the buffer sizes submitted may be rounded down. For trilists, buffer sizes will be rounded to a multiple of four triangles (or twelve vertices) due to DMA read alignment requirements. For tristrips, if your vertices contain any broken-out clusters (that is flagged with CL_ATTRIB_READ or CL_ATTRIB_WRITE in their attributes) then the buffer size will be rounded down to (4n + 2) and if there are no broken-out clusters then (4n). This is due again to DMA read alignment requirements and also internal vertex duplication used to continue tristrips between batches.

This function must be called before the pipeline containing this node is unlocked.

Parameters:
self  A pointer to a PS2MatInstance.csl RxPipelineNode
strideOfInputCluster  stride of cluster in VU memory
vuTSVertexMaxCount  maximum number of vertices per TriStrip batch
vuTLTriMaxCount  maximum number of triangles per TriList batch
Returns:
a pointer to this node on success, otherwise NULL
See also:
RxPipelineNodePS2MatInstanceSetPointListVUBufferSize , RxPipelineNodePS2MatInstanceGenerateCluster , RxPipelineNodePS2MatBridgeSetVIFOffset , RxPipelineNodePS2MatBridgeSetVU1CodeArray , RxNodeDefinitionGetPS2MatInstance , RxNodeDefinitionGetPS2ObjAllInOne
RxPipelineNode* RxPipelineNodePS2ObjAllInOneSetGrouping RxPipelineNode   node,
RwBool    groupMeshes
 

RxPipelineNodePS2ObjAllInOneSetGrouping allows you to specify whether this instance of the PS2ObjAllInOne.csl node will send meshes in packets to pipelines specified by their associated materials, or whether it will send them to the (hopefully connected!) first output of this node.

For objects in which all meshes use the same pipeline, it can be more efficient to have those meshes processed by just one pipeline, since passing packets between pipelines can incur a significant cost. If you tell this node to group its meshes, it will dispatch them all to the first output of this node, where the application should arrange that the nodes of a suitable material pipeline are connected.

Note that one application of this process might be as a form of LOD - when objects are close up, you may apply localized special effects by giving different meshes within the object different pipelines, but when the object gets far away it becomes less worthy of processor time, so you switch to uniform rendering of the object where all meshes pass down this "atomic rendering pipeline" (which differs from the usual atomic pipeline by containing 'inlined' material rendering nodes).

This function can be called when the pipeline node's containing pipeline is unlocked.

Parameters:
node  The pipeline node to set up
groupMeshes  A boolean specifying whether the pipeline node should group meshes or not (default is not - FALSE)
Returns:
pointer to the pipeline node on success, NULL otherwise
See also:
RxNodeDefinitionGetPS2ObjAllInOne
void RxPipelineNodePS2ObjAllInOneSetLighting RxPipelineNode   node,
RxWorldLightingCallBack    newLightingFunc
 

RxPipelineNodePS2ObjAllInOneSetLighting allows you to overload PS2ObjAllInOne.csl with your own lighting system.

The Lighting function you pass must have the following format:

   void RxWorldLightingCallBack *(RwInt32 objectType, void *object)
   
where objectType is the type of object being passed (currently an atomic or a world sector) and object is a pointer to it. You should evaluate which lights affect this atomic and for each one call RxPipelineNodePS2ManagerApplyLight (of type RxWorldApplyLightFunc), passing the pointer to the light, the inverse LTM of the object, the matrix scaling factor and its reciprocal.

This function should be called after unlocking the pipeline containing this node.

Parameters:
node  The pipeline node to set up
newLightingFunc  The RxWorldLightingCallBack to use
See also:
RxNodeDefinitionGetPS2ObjAllInOne

Criterion Software © 1993-2003 Criterion Software Limited. All rights reserved. Built Tue Apr 22 12:46:52 2003. Send Feedback
Converted from CHM to HTML with chm2web Pro 2.85 (unicode)