Main Page   Modules   Alphabetical List   Data Structures   Data Fields  

RpMatFX
[Materials]


Modules

PlayStation2

Enumerations

enum   RpMatFXMaterialFlags {
  rpMATFXEFFECTNULL = 0, rpMATFXEFFECTBUMPMAP = 1, rpMATFXEFFECTENVMAP = 2, rpMATFXEFFECTBUMPENVMAP = 3,
  rpMATFXEFFECTDUAL = 4, rpMATFXEFFECTUVTRANSFORM = 5, rpMATFXEFFECTDUALUVTRANSFORM = 6, rpMATFXEFFECTMAX,
  rpMATFXNUMEFFECTS = rpMATFXEFFECTMAX - 1, rpMATFXFORCEENUMSIZEINT = RWFORCEENUMSIZEINT
}

Functions

void  RpMatFXMaterialDataSetFreeListCreateParams (RwInt32 blockSize, RwInt32 numBlocksToPrealloc)
RwBool  RpMatFXPluginAttach (void)
RpAtomic RpMatFXAtomicEnableEffects (RpAtomic *atomic)
RwBool  RpMatFXAtomicQueryEffects (RpAtomic *atomic)
RpWorldSector RpMatFXWorldSectorEnableEffects (RpWorldSector *worldSector)
RwBool  RpMatFXWorldSectorQueryEffects (RpWorldSector *worldSector)
RpMaterial RpMatFXMaterialSetEffects (RpMaterial *material, RpMatFXMaterialFlags flags)
RpMaterial RpMatFXMaterialSetupBumpMap (RpMaterial *material, RwTexture *texture, RwFrame *frame, RwReal coef)
RpMaterial RpMatFXMaterialSetupEnvMap (RpMaterial *material, RwTexture *texture, RwFrame *frame, RwBool useFrameBufferAlpha, RwReal coef)
RpMaterial RpMatFXMaterialSetupDualTexture (RpMaterial *material, RwTexture *texture, RwBlendFunction srcBlendMode, RwBlendFunction dstBlendMode)
RpMatFXMaterialFlags  RpMatFXMaterialGetEffects (const RpMaterial *material)
RpMaterial RpMatFXMaterialSetBumpMapTexture (RpMaterial *material, RwTexture *texture)
RpMaterial RpMatFXMaterialSetBumpMapFrame (RpMaterial *material, RwFrame *frame)
RpMaterial RpMatFXMaterialSetBumpMapCoefficient (RpMaterial *material, RwReal coef)
RwTexture RpMatFXMaterialGetBumpMapBumpedTexture (const RpMaterial *material)
RwTexture RpMatFXMaterialGetBumpMapTexture (const RpMaterial *material)
RwFrame RpMatFXMaterialGetBumpMapFrame (const RpMaterial *material)
RwReal  RpMatFXMaterialGetBumpMapCoefficient (const RpMaterial *material)
RpMaterial RpMatFXMaterialSetEnvMapTexture (RpMaterial *material, RwTexture *texture)
RpMaterial RpMatFXMaterialSetEnvMapFrame (RpMaterial *material, RwFrame *frame)
RpMaterial RpMatFXMaterialSetEnvMapFrameBufferAlpha (RpMaterial *material, RwBool useFrameBufferAlpha)
RpMaterial RpMatFXMaterialSetEnvMapCoefficient (RpMaterial *material, RwReal coef)
RwTexture RpMatFXMaterialGetEnvMapTexture (const RpMaterial *material)
RwFrame RpMatFXMaterialGetEnvMapFrame (const RpMaterial *material)
RwBool  RpMatFXMaterialGetEnvMapFrameBufferAlpha (const RpMaterial *material)
RwReal  RpMatFXMaterialGetEnvMapCoefficient (const RpMaterial *material)
RpMaterial RpMatFXMaterialSetDualTexture (RpMaterial *material, RwTexture *texture)
RpMaterial RpMatFXMaterialSetDualBlendModes (RpMaterial *material, RwBlendFunction srcBlendMode, RwBlendFunction dstBlendMode)
RwTexture RpMatFXMaterialGetDualTexture (const RpMaterial *material)
const RpMaterial RpMatFXMaterialGetDualBlendModes (const RpMaterial *material, RwBlendFunction *srcBlendMode, RwBlendFunction *dstBlendMode)
RpMaterial RpMatFXMaterialSetUVTransformMatrices (RpMaterial *material, RwMatrix *baseTransform, RwMatrix *dualTransform)
const RpMaterial RpMatFXMaterialGetUVTransformMatrices (const RpMaterial *material, RwMatrix **baseTransform, RwMatrix **dualTransform)

Detailed Description

Material Effects Plugin for RenderWare Graphics.

RpMatFX Plugin Overview

Requirements

Overview

This plugin provides facilities for material effects. Material effects are off the shelf effects such as: Before any of the plugin functions are used, the plugin should be attached using RpMatFXPluginAttach.
Material Effect Atomics
The material effects pipeline must be initialized with RpMatFXAtomicEnableEffects for each atomic that contains material effects.
Material Effect World Sectors
The material effects pipeline must be initialized with RpMatFXWorldSectorEnableEffects for each world sector that contains material effects.
Material Effects
Material effects need to be setup for each material. Before setting any of the effects individual attributes the material should be initialized for the specific material effect with RpMatFXMaterialSetEffects.
Supported material effect types are: The materials effect can be queried with RpMatFXMaterialGetEffects.

Once the material has been setup with a specific effect the attributes should be initialized with the following functions:-

Bump Mapping
These functions are available:-
Environment Mapping
These functions are available:-
Dual Pass
These functions are available:-
Texture Coordinate UV transformation:-
These functions are available:-

Enumeration Type Documentation

enum RpMatFXMaterialFlags
 

RpMatFXMaterialFlags, this type represents the different types of material effects that can be used on a material. The effects are initialized with RpMatFXMaterialSetEffects:

Enumeration values:
rpMATFXEFFECTNULL  No material effect.
rpMATFXEFFECTBUMPMAP  Bump mapping
rpMATFXEFFECTENVMAP  Environment mapping
rpMATFXEFFECTBUMPENVMAP  Bump and environment mapping
rpMATFXEFFECTDUAL  Dual pass
rpMATFXEFFECTUVTRANSFORM  Base UV transform
rpMATFXEFFECTDUALUVTRANSFORM  Dual UV transform (2 pass)

Function Documentation

RpAtomic* RpMatFXAtomicEnableEffects RpAtomic   atomic
 

RpMatFXAtomicEnableEffects is used to enable the material effects object pipeline on an atomic.

The world and material effect plugins must be attached before using this function. The header file rpmatfx.h is required.

Parameters:
atomic  Pointer to the RpAtomic to enable the material effects pipeline on.
Returns:
The source RpAtomic on success, NULL otherwise.
See also:
RpMatFXPluginAttach , RpMatFXAtomicQueryEffects , RpMatFXWorldSectorEnableEffects , RpMatFXMaterialSetEffects , RpMatFXMaterialSetupBumpMap , RpMatFXMaterialSetupEnvMap , RpMatFXMaterialSetupDualTexture
RwBool RpMatFXAtomicQueryEffects RpAtomic   atomic
 

RpMatFXAtomicQueryEffects is used to query whether material effects have been enabled on the given atomic.

The world and material effect plugins must be attached before using this function. The header file rpmatfx.h is required.

Parameters:
atomic  Pointer to an RpAtomic to query for material effects.
Returns:
TRUE if effects are enabled, FALSE otherwise.
See also:
RpMatFXPluginAttach , RpMatFXAtomicEnableEffects
void RpMatFXMaterialDataSetFreeListCreateParams RwInt32    blockSize,
RwInt32    numBlocksToPrealloc
 

RpMatFXMaterialDataSetFreeListCreateParams allows the developer to specify how many rpMatFXMaterialData s to preallocate space for. Call before RwEngineInit.

Parameters:
blockSize  number of entries per freelist block.
numBlocksToPrealloc  number of blocks to allocate on RwFreeListCreateAndPreallocateSpace.
See also:
RwFreeList
RwTexture* RpMatFXMaterialGetBumpMapBumpedTexture const RpMaterial   material
 

RpMatFXMaterialGetBumpMapBumpedTexture is used to retrieve the texture used for the bump mapping material effect. If a texture was set with RpMatFXMaterialSetBumpMapTexture then the resulting constructed texture is returned.

The world and material effect plugins must be attached before using this function. The header file rpmatfx.h is required.

Parameters:
material  Pointer to the RpMaterial.
Returns:
The bump map texture used on success, NULL otherwise.
See also:
RpMatFXMaterialSetEffects , RpMatFXMaterialSetupBumpMap , RpMatFXMaterialGetEffects , RpMatFXMaterialSetBumpMapTexture , RpMatFXMaterialSetBumpMapFrame , RpMatFXMaterialSetBumpMapCoefficient , RpMatFXMaterialGetBumpMapTexture , RpMatFXMaterialGetBumpMapFrame , RpMatFXMaterialGetBumpMapCoefficient
RwReal RpMatFXMaterialGetBumpMapCoefficient const RpMaterial   material
 

RpMatFXMaterialGetBumpMapCoefficient is used to retrieve the bump mapping coefficient.

The world and material effect plugins must be attached before using this function. The header file rpmatfx.h is required.

Parameters:
material  A pointer to a RpMaterial.
Returns:
Returns bump map coefficient value.
See also:
RpMatFXMaterialSetEffects , RpMatFXMaterialSetupBumpMap , RpMatFXMaterialGetEffects , RpMatFXMaterialSetBumpMapTexture , RpMatFXMaterialSetBumpMapFrame , RpMatFXMaterialSetBumpMapCoefficient , RpMatFXMaterialGetBumpMapTexture , RpMatFXMaterialGetBumpMapBumpedTexture , RpMatFXMaterialGetBumpMapFrame
RwFrame* RpMatFXMaterialGetBumpMapFrame const RpMaterial   material
 

RpMatFXMaterialGetBumpMapFrame is used to retrieve the frame used for the bump map material effect.

The world and material effect plugins must be attached before using this function. The header file rpmatfx.h is required.

Parameters:
material  Pointer to the RpMaterial.
Returns:
The bump map frame used on success, NULL otherwise.
See also:
RpMatFXMaterialSetEffects , RpMatFXMaterialSetupBumpMap , RpMatFXMaterialGetEffects , RpMatFXMaterialSetBumpMapTexture , RpMatFXMaterialSetBumpMapFrame , RpMatFXMaterialSetBumpMapCoefficient , RpMatFXMaterialGetBumpMapTexture , RpMatFXMaterialGetBumpMapBumpedTexture , RpMatFXMaterialGetBumpMapCoefficient
RwTexture* RpMatFXMaterialGetBumpMapTexture const RpMaterial   material
 

RpMatFXMaterialGetBumpMapTexture is used to retrieve the texture set with RpMatFXMaterialSetBumpMapTexture.

The world and material effect plugins must be attached before using this function. The header file rpmatfx.h is required.

Parameters:
material  Pointer to the RpMaterial.
Returns:
The bump map texture used on success, NULL otherwise.
See also:
RpMatFXMaterialSetEffects , RpMatFXMaterialSetupBumpMap , RpMatFXMaterialGetEffects , RpMatFXMaterialSetBumpMapTexture , RpMatFXMaterialSetBumpMapFrame , RpMatFXMaterialSetBumpMapCoefficient , RpMatFXMaterialGetBumpMapBumpedTexture , RpMatFXMaterialGetBumpMapFrame , RpMatFXMaterialGetBumpMapCoefficient
const RpMaterial* RpMatFXMaterialGetDualBlendModes const RpMaterial   material,
RwBlendFunction   srcBlendMode,
RwBlendFunction   dstBlendMode
 

RpMatFXMaterialGetDualBlendModes is used to retrieve the source and destination blend modes used in the dual pass material effect.

The world and material effect plugins must be attached before using this function. The header file rpmatfx.h is required.

Parameters:
material  A pointer to a RpMaterial.
srcBlendMode  A pointer to a RwBlendFunction used to retrieve the srource blend mode.
dstBlendMode  A pointer to a RwBlendFunction used to retrieve the destination blend mode.
Returns:
The material used on success, NULL otherwise.
See also:
RpMatFXMaterialSetEffects , RpMatFXMaterialSetupDualTexture , RpMatFXMaterialGetEffects , RpMatFXMaterialSetDualTexture , RpMatFXMaterialSetDualBlendModes , RpMatFXMaterialGetDualTexture
RwTexture* RpMatFXMaterialGetDualTexture const RpMaterial   material
 

RpMatFXMaterialGetDualTexture is used to retrieve the texture used in the dual pass material effect.

The world and material effect plugins must be attached before using this function. The header file rpmatfx.h is required.

Parameters:
material  A pointer to a RpMaterial.
Returns:
The dual pass texture on success, NULL otherwise
See also:
RpMatFXMaterialSetEffects , RpMatFXMaterialSetupDualTexture , RpMatFXMaterialGetEffects , RpMatFXMaterialSetDualTexture , RpMatFXMaterialSetDualBlendModes , RpMatFXMaterialGetDualBlendModes
RpMatFXMaterialFlags RpMatFXMaterialGetEffects const RpMaterial   material
 

RpMatFXMaterialGetEffects is used to get type of material effect of the material set with RpMatFXMaterialSetEffects.

The world and material effect plugins must be attached before using this function. The header file rpmatfx.h is required.

Parameters:
material  Pointer to the RpMaterial.
Returns:
The type of effect used
See also:
RpMatFXMaterialSetEffects , RpMatFXMaterialSetupBumpMap , RpMatFXMaterialSetupEnvMap , RpMatFXMaterialSetupDualTexture , RpMatFXMaterialGetEffects
RwReal RpMatFXMaterialGetEnvMapCoefficient const RpMaterial   material
 

RpMatFXMaterialGetEnvMapCoefficient is used to retrieve the environment coefficient.

The world and material effect plugins must be attached before using this function. The header file rpmatfx.h is required.

Parameters:
material  A pointer to a RpMaterial.
Returns:
Returns environment coefficient value.
See also:
RpMatFXMaterialSetEffects , RpMatFXMaterialSetupEnvMap , RpMatFXMaterialGetEffects , RpMatFXMaterialSetEnvMapTexture , RpMatFXMaterialSetEnvMapFrame , RpMatFXMaterialSetEnvMapFrameBufferAlpha , RpMatFXMaterialSetEnvMapCoefficient , RpMatFXMaterialGetEnvMapTexture , RpMatFXMaterialGetEnvMapFrame , RpMatFXMaterialGetEnvMapFrameBufferAlpha
RwFrame* RpMatFXMaterialGetEnvMapFrame const RpMaterial   material
 

RpMatFXMaterialGetEnvMapFrame is used to retrieve the RwFrame used for projecting the environment map.

The world and material effect plugins must be attached before using this function. The header file rpmatfx.h is required.

Parameters:
material  A pointer to a RpMaterial.
Returns:
Returns a pointer to the environment map's RwFrame.
See also:
RpMatFXMaterialSetEffects , RpMatFXMaterialSetupEnvMap , RpMatFXMaterialGetEffects , RpMatFXMaterialSetEnvMapTexture , RpMatFXMaterialSetEnvMapFrame , RpMatFXMaterialSetEnvMapFrameBufferAlpha , RpMatFXMaterialSetEnvMapCoefficient , RpMatFXMaterialGetEnvMapTexture , RpMatFXMaterialGetEnvMapFrameBufferAlpha , RpMatFXMaterialGetEnvMapCoefficient
RwBool RpMatFXMaterialGetEnvMapFrameBufferAlpha const RpMaterial   material
 

RpMatFXMaterialGetEnvMapFrameBufferAlpha is used to retreive the useFrameBufferAlpha flag.

The world and material effect plugins must be attached before using this function. The header file rpmatfx.h is required.

Parameters:
material  A pointer to a RpMaterial.
Returns:
Returns the useFrameBufferAlpha flag of the material.
See also:
RpMatFXMaterialSetEffects , RpMatFXMaterialSetupEnvMap , RpMatFXMaterialGetEffects , RpMatFXMaterialSetEnvMapTexture , RpMatFXMaterialSetEnvMapFrame , RpMatFXMaterialSetEnvMapFrameBufferAlpha , RpMatFXMaterialSetEnvMapCoefficient , RpMatFXMaterialGetEnvMapTexture , RpMatFXMaterialGetEnvMapFrame , RpMatFXMaterialGetEnvMapCoefficient
RwTexture* RpMatFXMaterialGetEnvMapTexture const RpMaterial   material
 

RpMatFXMaterialGetEnvMapTexture is used to retrieve the texture used for the environment map effect.

The world and material effect plugins must be attached before using this function. The header file rpmatfx.h is required.

Parameters:
material  A pointer to a RpMaterial.
Returns:
Returns a pointer to the environment map's RwTexture.
See also:
RpMatFXMaterialSetEffects , RpMatFXMaterialSetupEnvMap , RpMatFXMaterialGetEffects , RpMatFXMaterialSetEnvMapTexture , RpMatFXMaterialSetEnvMapFrame , RpMatFXMaterialSetEnvMapFrameBufferAlpha , RpMatFXMaterialSetEnvMapCoefficient , RpMatFXMaterialGetEnvMapFrame , RpMatFXMaterialGetEnvMapFrameBufferAlpha , RpMatFXMaterialGetEnvMapCoefficient
const RpMaterial* RpMatFXMaterialGetUVTransformMatrices const RpMaterial   material,
RwMatrix **    baseTransform,
RwMatrix **    dualTransform
 

RpMatFXMaterialGetUVTransformMatrices is used to retrieve the base pass and dual pass texture coordinate transform matrices.

The world and material effect plugins must be attached before using this function. The header file rpmatfx.h is required.

Parameters:
material  Pointer to a RpMaterial.
baseTransform  Pointer to retrieve the base matrix transform.
dualTransform  Pointer to retrieve the dual matrix transform.
Returns:
The material used on success, NULL otherwise.
See also:
RpMatFXMaterialSetEffects , RpMatFXMaterialGetEffects , RpMatFXMaterialSetUVTransformMatrices , RpMatFXMaterialSetDualTexture , RpMatFXMaterialGetDualTexture , RpMatFXMaterialGetDualBlendModes , RpMatFXMaterialSetDualBlendModes
RpMaterial* RpMatFXMaterialSetBumpMapCoefficient RpMaterial   material,
RwReal    coef
 

RpMatFXMaterialSetBumpMapCoefficient controls the amount of the bump effect applied to the material (the bumpiness). Useful values typically lie in the range -10 to 10, depending on the scale of the bumps, and the depth of the effect required.

The world and material effect plugins must be attached before using this function. The header file rpmatfx.h is required.

Parameters:
material  Pointer to the material.
coef  Bump coefficient.
Returns:
The material used on success, NULL otherwise.
See also:
RpMatFXMaterialSetEffects , RpMatFXMaterialSetupBumpMap , RpMatFXMaterialGetEffects , RpMatFXMaterialSetBumpMapTexture , RpMatFXMaterialSetBumpMapFrame , RpMatFXMaterialGetBumpMapTexture , RpMatFXMaterialGetBumpMapBumpedTexture , RpMatFXMaterialGetBumpMapFrame , RpMatFXMaterialGetBumpMapCoefficient
RpMaterial* RpMatFXMaterialSetBumpMapFrame RpMaterial   material,
RwFrame   frame
 

RpMatFXMaterialSetBumpMapFrame sets the frame associated with the bump mapping material effect.

The world and material effect plugins must be attached before using this function. The header file rpmatfx.h is required.

Parameters:
material  Pointer to the RpMaterial.
frame  RwFrame affecting the bump map.
Returns:
The material used on success, NULL otherwise.
See also:
RpMatFXMaterialSetEffects , RpMatFXMaterialSetupBumpMap , RpMatFXMaterialGetEffects , RpMatFXMaterialSetBumpMapTexture , RpMatFXMaterialSetBumpMapCoefficient , RpMatFXMaterialGetBumpMapTexture , RpMatFXMaterialGetBumpMapBumpedTexture , RpMatFXMaterialGetBumpMapFrame , RpMatFXMaterialGetBumpMapCoefficient
RpMaterial* RpMatFXMaterialSetBumpMapTexture RpMaterial   material,
RwTexture   bumpTexture
 

RpMatFXMaterialSetBumpMapTexture sets the bump map required for the material effect.

The world and material effect plugins must be attached before using this function. The header file rpmatfx.h is required.

Parameters:
material  Pointer to the RpMaterial.
bumpTexture  Pointer to the RwTexture used as the bump map mask. This texture will be merged into the alpha channel of the with the material's base texture. The result is stored as the texture used for bump mapping. If the pointer is NULL then just the material's base texture will be used instead of constructing a new texture.
Returns:
The material used on success, NULL otherwise.
See also:
RpMatFXMaterialSetEffects , RpMatFXMaterialSetupBumpMap , RpMatFXMaterialGetEffects , RpMatFXMaterialSetBumpMapFrame , RpMatFXMaterialSetBumpMapCoefficient , RpMatFXMaterialGetBumpMapTexture , RpMatFXMaterialGetBumpMapBumpedTexture , RpMatFXMaterialGetBumpMapFrame , RpMatFXMaterialGetBumpMapCoefficient
RpMaterial* RpMatFXMaterialSetDualBlendModes RpMaterial   material,
RwBlendFunction    srcBlendMode,
RwBlendFunction    dstBlendMode
 

RpMatFXMaterialSetDualBlendModes is used to set the source and destination blend modes used in the dual pass material effect.

The world and material effect plugins must be attached before using this function. The header file rpmatfx.h is required.

Parameters:
material  A pointer to a RpMaterial.
srcBlendMode  A pointer to a RwBlendFunction used to set the source blend mode.
dstBlendMode  A pointer to a RwBlendFunction used to set the destination blend mode.
Returns:
The material used on success, NULL otherwise.
See also:
RpMatFXMaterialSetEffects , RpMatFXMaterialSetupDualTexture , RpMatFXMaterialGetEffects , RpMatFXMaterialSetDualTexture , RpMatFXMaterialGetDualTexture , RpMatFXMaterialGetDualBlendModes
RpMaterial* RpMatFXMaterialSetDualTexture RpMaterial   material,
RwTexture   texture
 

RpMatFXMaterialSetDualTexture sets the texture used in the second pass

The world and material effect plugins must be attached before using this function. The header file rpmatfx.h is required.

Parameters:
material  Pointer to the RpMaterial.
texture  Pointer to the RwTexture to use in the second pass.
Returns:
The material used on success, NULL otherwise.
See also:
RpMatFXMaterialSetEffects , RpMatFXMaterialSetupDualTexture , RpMatFXMaterialGetEffects , RpMatFXMaterialSetDualBlendModes , RpMatFXMaterialGetDualTexture , RpMatFXMaterialGetDualBlendModes
RpMaterial* RpMatFXMaterialSetEffects RpMaterial   material,
RpMatFXMaterialFlags    flags
 

RpMatFXMaterialSetEffects is used to enable a particular effect on a material. When an effect is selected, the material is cleaned of any old effect.

The material effect should then be setup using:

Which will setup the individual components of the effect type.

The world and material effect plugins must be attached before using this function. The header file rpmatfx.h is required.

Parameters:
material  Pointer to the RpMaterial to set the effect type of.
flags  Flag to indicate which material type to setup.
Supported material effect types are:
Returns:
The source RpMaterial on success, NULL otherwise
See also:
RpMatFXPluginAttach , RpMatFXAtomicEnableEffects , RpMatFXWorldSectorEnableEffects , RpMatFXMaterialSetupBumpMap , RpMatFXMaterialSetupEnvMap , RpMatFXMaterialSetupDualTexture , RpMatFXMaterialGetEffects
RpMaterial* RpMatFXMaterialSetEnvMapCoefficient RpMaterial   material,
RwReal    coef
 

RpMatFXMaterialSetEnvMapCoefficient affects the reflectivity of the material, i.e. the intensity of the environment map (which is rendered additively on top of the material). The value should normally be in the range 0 to 1, but note that values outside this range may be used on PlayStation 2 (see the MatFX Platform Specific section for details).

The world and material effect plugins must be attached before using this function. The header file rpmatfx.h is required.

Parameters:
material  Pointer to the RpMaterial.
coef  RwReal representing the reflection coefficient of the material
Returns:
The material used on success, NULL otherwise.
See also:
RpMatFXMaterialSetEffects , RpMatFXMaterialSetupEnvMap , RpMatFXMaterialGetEffects , RpMatFXMaterialSetEnvMapTexture , RpMatFXMaterialSetEnvMapFrame , RpMatFXMaterialSetEnvMapFrameBufferAlpha , RpMatFXMaterialGetEnvMapTexture , RpMatFXMaterialGetEnvMapFrame , RpMatFXMaterialGetEnvMapFrameBufferAlpha , RpMatFXMaterialGetEnvMapCoefficient
RpMaterial* RpMatFXMaterialSetEnvMapFrame RpMaterial   material,
RwFrame   frame
 

RpMatFXMaterialSetEnvMapFrame sets the frame associated with the environment mapping material effect. This will affect the position of the environment map on the object.

The world and material effect plugins must be attached before using this function. The header file rpmatfx.h is required.

Parameters:
material  Pointer to the RpMaterial.
frame  Pointer to the RwFrame affecting environment mapping.
Returns:
The material used on success, NULL otherwise.
See also:
RpMatFXMaterialSetEffects , RpMatFXMaterialSetupEnvMap , RpMatFXMaterialGetEffects , RpMatFXMaterialSetEnvMapTexture , RpMatFXMaterialSetEnvMapFrameBufferAlpha , RpMatFXMaterialSetEnvMapCoefficient , RpMatFXMaterialGetEnvMapTexture , RpMatFXMaterialGetEnvMapFrame , RpMatFXMaterialGetEnvMapFrameBufferAlpha , RpMatFXMaterialGetEnvMapCoefficient
RpMaterial* RpMatFXMaterialSetEnvMapFrameBufferAlpha RpMaterial   material,
RwBool    useFrameBufferAlpha
 

RpMatFXMaterialSetEnvMapFrameBufferAlpha determines whether the environment map will be multiplied by frame buffer alpha before being added to the rendered object. This allows for effects (for example bump mapping) to attenuate the environment map on a per-pixel basis, lending the rendered surface a detailed variation in appearance.

The world and material effect plugins must be attached before using this function. The header file rpmatfx.h is required.

Parameters:
material  Pointer to the RpMaterial.
useFrameBufferAlpha  RwBool to set the flag.
  • TRUE to use frame buffer alpha,
  • FALSE to ignore it.
Returns:
The material used on success, NULL otherwise.
See also:
RpMatFXMaterialSetEffects , RpMatFXMaterialSetupEnvMap , RpMatFXMaterialGetEffects , RpMatFXMaterialSetEnvMapTexture , RpMatFXMaterialSetEnvMapFrame , RpMatFXMaterialSetEnvMapCoefficient , RpMatFXMaterialGetEnvMapTexture , RpMatFXMaterialGetEnvMapFrame , RpMatFXMaterialGetEnvMapFrameBufferAlpha , RpMatFXMaterialGetEnvMapCoefficient
RpMaterial* RpMatFXMaterialSetEnvMapTexture RpMaterial   material,
RwTexture   texture
 

RpMatFXMaterialSetEnvMapTexture sets the texture for the environment mapping material effect. The texture is rendered with dynamically generated UVs using a spherical environment mapping.

The world and material effect plugins must be attached before using this function. The header file rpmatfx.h is required.

Parameters:
material  Pointer to the RpMaterial.
texture  Pointer to the RwTexture for the environment map.
Returns:
The material used on success, NULL otherwise.
See also:
RpMatFXMaterialSetEffects , RpMatFXMaterialSetupEnvMap , RpMatFXMaterialGetEffects , RpMatFXMaterialSetEnvMapFrame , RpMatFXMaterialSetEnvMapFrameBufferAlpha , RpMatFXMaterialSetEnvMapCoefficient , RpMatFXMaterialGetEnvMapTexture , RpMatFXMaterialGetEnvMapFrame , RpMatFXMaterialGetEnvMapFrameBufferAlpha , RpMatFXMaterialGetEnvMapCoefficient
RpMaterial* RpMatFXMaterialSetupBumpMap RpMaterial   material,
RwTexture   texture,
RwFrame   frame,
RwReal    coef
 

RpMatFXMaterialSetupBumpMap is used to setup the various attributes needed for the bump map material effect.

Warning:
RpMatFXMaterialSetupBumpMap should only be used after calling RpMatFXMaterialSetEffects with either:
  • rpMATFXEFFECTBUMPMAP
  • rpMATFXEFFECTBUMPENVMAP as the effect type.
The world and material effect plugins must be attached before using this function. The header file rpmatfx.h is required.
Parameters:
material  Pointer to the RpMaterial to setup the bump map effect on.
texture  Pointer to the RwTexture to use as the bump map.
frame  Pointer to the RwFrame to simulate the location of the light source.
coef  Coefficient controlling the bumpiness. There are no specific limits, but useful values typically lie between -10 and 10, depending on the scale of the bumps.
Returns:
The source RpMaterial on success, NULL otherwise
See also:
RpMatFXMaterialSetEffects , RpMatFXMaterialGetEffects , RpMatFXMaterialSetBumpMapTexture , RpMatFXMaterialSetBumpMapFrame , RpMatFXMaterialSetBumpMapCoefficient , RpMatFXMaterialGetBumpMapTexture , RpMatFXMaterialGetBumpMapBumpedTexture , RpMatFXMaterialGetBumpMapFrame , RpMatFXMaterialGetBumpMapCoefficient
RpMaterial* RpMatFXMaterialSetupDualTexture RpMaterial   material,
RwTexture   texture,
RwBlendFunction    srcBlendMode,
RwBlendFunction    dstBlendMode
 

RpMatFXMaterialSetupDualTexture is used to setup the various attributes needed for the dual pass material effect.

Warning:
RpMatFXMaterialSetupEnvMap should only be used after calling RpMatFXMaterialSetEffects with:
  • rpMATFXEFFECTDUAL as the effect type.
The world and material effect plugins must be attached before using this function. The header file rpmatfx.h is required.
Parameters:
material  Pointer to the RpMaterial to setup the dual pass effect on.
texture  Pointer to the RwTexture to use as the dual pass texture.
srcBlendMode  RwBlendFunction source blend mode to use.
dstBlendMode  RwBlendFunction destination blend mode to use.
Returns:
The source RpMaterial on success, NULL otherwise
See also:
RpMatFXMaterialSetEffects , RpMatFXMaterialGetEffects , RpMatFXMaterialSetDualTexture , RpMatFXMaterialSetDualBlendModes , RpMatFXMaterialGetDualTexture , RpMatFXMaterialGetDualBlendModes
RpMaterial* RpMatFXMaterialSetupEnvMap RpMaterial   material,
RwTexture   texture,
RwFrame   frame,
RwBool    useFrameBufferAlpha,
RwReal    coef
 

RpMatFXMaterialSetupEnvMap is used to setup the various attributes needed for the environment map material effect.

Warning:
RpMatFXMaterialSetupEnvMap should only be used after calling RpMatFXMaterialSetEffects with either:
  • rpMATFXEFFECTENVMAP
  • rpMATFXEFFECTBUMPENVMAP as the effect type.
The world and material effect plugins must be attached before using this function. The header file rpmatfx.h is required.
Parameters:
material  Pointer to the RpMaterial to setup the environment map effect on.
texture  Pointer to the RwTexture to use as the environment map.
frame  Pointer to the RwFrame to use for the environment map projection.
useFrameBufferAlpha  RwBool flag used to specify if frame buffer alpha should be used when applying the environment map.
coef  Specifies the environment map coefficient. This should normally be in the range 0 to 1. (Note: values outside this range may be used on PlayStation 2. See the MatFX Platform Specific section for details.)
Returns:
The source RpMaterial on success, NULL otherwise
See also:
RpMatFXMaterialSetEffects , RpMatFXMaterialGetEffects , RpMatFXMaterialSetEnvMapTexture , RpMatFXMaterialSetEnvMapFrame , RpMatFXMaterialSetEnvMapFrameBufferAlpha , RpMatFXMaterialSetEnvMapCoefficient , RpMatFXMaterialGetEnvMapTexture , RpMatFXMaterialGetEnvMapFrame , RpMatFXMaterialGetEnvMapFrameBufferAlpha , RpMatFXMaterialGetEnvMapCoefficient
RpMaterial* RpMatFXMaterialSetUVTransformMatrices RpMaterial   material,
RwMatrix   baseTransform,
RwMatrix   dualTransform
 

RpMatFXMaterialSetUVTransformMatrices is used to set the base pass and dual pass texture coordinate transform matrices. If the base effect is set to rpMATFXEFFECTUVTRANSFORM then the dualTransform should be set to NULL.

The transform matrices allow 2D rotation, scaling, and translation of the texture coordines. For this purpose, only a 6-component subset of the RwMatrix values are used when calculating the transformed texture coordinates, as follows:

   (matrix) | rx ry - | (right)
            | ux uy - | (up)
            | -  -  - | (at)
            | px py - | (pos) 

The transformed UV texture coordinates will be:

   u' = rx * u + ux * v + px
   v' = ry * u + uy * v + py 

Such matrices may be constructed directly, or by using the RwMatrixRotate (about z-axis), RwMatrixTranslate, and RwMatrixScale functions. UV animation can be achieved by modifying the matrix values each frame.

If either of the transform matrix pointers are set to NULL, then an identity transform will be assumed.

The world and material effect plugins must be attached before using this function. The header file rpmatfx.h is required.

Parameters:
material  Pointer to a RpMaterial.
baseTransform  Pointer to the base pass UV transform matrix.
dualTransform  Pointer to the dual pass UV transform matrix.
Returns:
The material used on success, NULL otherwise.
See also:
RpMatFXMaterialSetEffects , RpMatFXMaterialGetEffects , RpMatFXMaterialGetUVTransformMatrices , RpMatFXMaterialSetDualTexture , RpMatFXMaterialGetDualTexture , RpMatFXMaterialGetDualBlendModes , RpMatFXMaterialSetDualBlendModes
RwBool RpMatFXPluginAttach void   
 

RpMatFXPluginAttach is called by the application to indicate that the material effects plugin should be used. The call to this function should be placed between RwEngineInit and RwEngineOpen and the world plugin must already be attached.

Warning:
The include files rpmatfx.h and rpworld.h are also required and must be included by an application wishing to generate material effects.
Warning:
The material effects plugin requires
  • the material effects plugin rpmatfx.lib and
  • the world plugin rpworld.lib to be linked into the application and attached at run time.
Returns:
True on success, false otherwise
See also:
RpWorldPluginAttach , RpMatFXAtomicEnableEffects , RpMatFXWorldSectorEnableEffects , RpMatFXMaterialSetEffects
RpWorldSector* RpMatFXWorldSectorEnableEffects RpWorldSector   worldSector
 

RpMatFXWorldSectorEnableEffects is used to enable the material effects object pipeline on a world sector.

The world and material effect plugins must be attached before using this function. The header file rpmatfx.h is required.

Parameters:
worldSector  Pointer to the RpWorldSector to enable the material effects pipeline on.
Returns:
The source RpWorldSector on success, NULL otherwise.
See also:
RpMatFXPluginAttach , RpMatFXWorldSectorQueryEffects , RpMatFXAtomicEnableEffects , RpMatFXMaterialSetEffects , RpMatFXMaterialSetupBumpMap , RpMatFXMaterialSetupEnvMap , RpMatFXMaterialSetupDualTexture
RwBool RpMatFXWorldSectorQueryEffects RpWorldSector   worldSector
 

RpMatFXWorldSectorQueryEffects is used to query whether material effects have been enabled in the given world sector.

The world and material effect plugins must be attached before using this function. The header file rpmatfx.h is required.

Parameters:
worldSector  Pointer to the RpWorldSector to query for effects.
Returns:
TRUE if effects are enabled, FALSE otherwise.
See also:
RpMatFXPluginAttach , RpMatFXWorldSectorEnableEffects

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)