Main Page   Modules   Alphabetical List   Data Structures   Data Fields  

PlayStation2
[RpMatFX]


Enumerations

enum   RpMatFXSkyPipeline {
  rpNAMATFXSKYPIPELINE = 0, rpMATFXSKYATOMICPS2ALLPIPELINE = 1, rpMATFXSKYATOMICUV2PS2ALLPIPELINE = 2, rpMATFXSKYWORLDSECTORPS2ALLPIPELINE = 3,
  rpMATFXSKYWORLDSECTORUV2PS2ALLPIPELINE = 4, rpMATFXSKYPS2ALLMATPIPELINE = 5, rpMATFXSKYUV2PS2ALLMATPIPELINE = 6, rpMATFXSKYPIPELINEMAX,
  rpMATFXSKYPIPELINEFORCEENUMSIZEINT = RWFORCEENUMSIZEINT
}
enum   RpMatFXSkyRenderState {
  rpMATFXSKYRENDERSTATENARENDERSTATE = 0, rpMATFXSKYRENDERSTATEALPHA, rpMATFXSKYRENDERSTATEFOGCOL, rpMATFXSKYRENDERSTATETEST,
  rpMATFXSKYRENDERSATEFORCEENUMSIZEINT = RWFORCEENUMSIZEINT
}

Functions

RxPipeline RpMatFXGetSkyPipeline (RpMatFXSkyPipeline ps2Pipeline)
RwBool  RpMatFXMaterialSkyRenderStateSet (RpMaterial *material, RpMatFXMaterialFlags effect, RwUInt32 state, void *param)
RwBool  RpMatFXMaterialSkyRenderStateGet (RpMaterial *material, RpMatFXMaterialFlags effect, RwUInt32 state, void *param)

Detailed Description

PlayStation2 specific documentation.

PlayStation 2 RpMatFX Overview

All effects are supported: environment mapping, bump mapping, combined bump and environment mapping, dual pass, UV transform, and dual UV transform.

Environment Mapping

Environment mapping is performed additively in two passes. The blending works differently on PlayStation 2 compared with other platforms:

Bump Mapping

Bump mapping is performed in two passes. With the bump map stored in the alpha channel, an emboss effect is achieved by sampling the texture twice with slightly shifted texture coordinates and using INVSRCALPHA and SRCALPHA blending modes respectively in the two passes. The texture coordinate offsets are calculated from the X and Y projections of the vertex normal in the bump frame.

This method is fast and efficient, and gives the impression of bumps but does not actually approximate a realisitic lighting calculation. A consequence of this is that the sense of the bumps (whether they protrude in or out) cannot be guaranteed with dynamic objects.

More realistic calculations would require expensive per vertex operations on VU1, or a significant amount of additional memory/DMA for arrays containing vertex tangents.

Bump + Environment Mapping

This is performed in 3 passes using a combination of the bump and environment effects. The 'useFrameBufferAlpha' option allows the envmap to be modulated by the bump alpha value from the previous pass. This gives a more realistic effect with specular highlights being affected by the bumps.


Enumeration Type Documentation

enum RpMatFXSkyPipeline
 

RpMatFXSkyPipeline

Enumeration values:
rpMATFXSKYATOMICPS2ALLPIPELINE  PS2All atomic material effect (single set of texture coordinates) rendering pipeline.
rpMATFXSKYATOMICUV2PS2ALLPIPELINE  PS2All atomic material effect (double set of texture coordinates) rendering pipeline.
rpMATFXSKYWORLDSECTORPS2ALLPIPELINE  PS2All world sector material (single set of texture coordinates) effect rendering pipeline.
rpMATFXSKYWORLDSECTORUV2PS2ALLPIPELINE  PS2All world sector material (double set of texture coordinates) effect rendering pipeline.
rpMATFXSKYPS2ALLMATPIPELINE  PS2AllMat material effect (single set of texture coordinates) rendering pipeline.
rpMATFXSKYUV2PS2ALLMATPIPELINE  PS2AllMat material effect (double set of texture coordinates) rendering pipeline.
enum RpMatFXSkyRenderState
 

RpMatFXSkyRenderState

Enumeration values:
rpMATFXSKYRENDERSTATEALPHA  Direct access to the ALPHA register used by the effect with bits 32-39 moved down to 24-31 to allow a single 32 bit value.
rpMATFXSKYRENDERSTATEFOGCOL  Direct access to the FOGCOL register used by the effect.
rpMATFXSKYRENDERSTATETEST  Direct access to the TEST register used by the effect.

Function Documentation

RxPipeline* RpMatFXGetSkyPipeline RpMatFXSkyPipeline    ps2Pipeline
 

RpMatFXGetSkyPipeline

Returns one of the RpMatFX internal PlayStation 2 specific pipelines.

The matfx plugin must be attached before using this function.

Parameters:
ps2Pipeline  Type of the requested pipeline.
Returns:
The RxPipeline requested from the plugin, or NULL if the pipeline wasn't constructed.
RwBool RpMatFXMaterialSkyRenderStateGet RpMaterial   material,
RpMatFXMaterialFlags    effect,
RwUInt32    state,
void *    param
 

RpMatFXMaterialSkyRenderStateGet

Gets a PlayStation 2 specific renderstate element for second or third pass rendering.

The matfx plugin must be attached before using this function.

Parameters:
material  Material to set state on.
effect  Effect to apply state to.
state  The RwRenderState element to be queried.
param  A pointer to memory to receive the value of the renderstate element.
Returns:
Returns TRUE if successful or FALSE if there is an error
See also:
RpMatFXMaterialSkyRenderStateSet
RwBool RpMatFXMaterialSkyRenderStateSet RpMaterial   material,
RpMatFXMaterialFlags    effect,
RwUInt32    state,
void *    param
 

RpMatFXMaterialSkyRenderStateSet

Sets a PlayStation 2 specific renderstate element for second or third pass rendering. These renderstates are currently only supported by environment map, dual pass and dual pass uv transform pipelines.

The matfx plugin must be attached before using this function.

Parameters:
material  Material to set state on.
effect  Effect to apply state to.
state  The RpMatFXSkyRenderState to set.
param  The value of the renderstate, cast to type (void *).
Returns:
Returns TRUE if successful or FALSE if there is an error
See also:
RpMatFXMaterialSkyRenderStateGet

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