Main Page   Modules   Alphabetical List   Data Structures   Data Fields  

RpLtMap
[Lighting]


Modules

PlayStation 2

Enumerations

enum   RpLtMapStyle {
  rpLTMAPSTYLENASTYLE = 0x0, rpLTMAPSTYLERENDERBASE = 0x1, rpLTMAPSTYLERENDERLIGHTMAP = 0x2, rpLTMAPSTYLEPOINTSAMPLE = 0x4,
  rpLTMAPSTYLEFORCEENUMSIZEINT = 0x7FFFFFFF
}

Functions

RwUInt32  RpLtMapGetRasterFormat (void)
RwBool  RpLtMapSetRasterFormat (RwUInt32 format)
RwTexture RpLtMapAtomicGetLightMap (RpAtomic *atomic)
RpAtomic RpLtMapAtomicSetLightMap (RpAtomic *atomic, RwTexture *lightMap)
RwTexture RpLtMapWorldSectorGetLightMap (RpWorldSector *sector)
RpWorldSector RpLtMapWorldSectorSetLightMap (RpWorldSector *sector, RwTexture *lightMap)
RwBool  RpLtMapSetRenderStyle (RpLtMapStyle style, RpWorld *world)
RpLtMapStyle  RpLtMapGetRenderStyle (void)
RxPipeline RpLtMapGetPlatformAtomicPipeline (void)
RxPipeline RpLtMapGetPlatformWorldSectorPipeline (void)
RwUInt32  RpLtMapWorldLightMapsQuery (RpWorld *world)
RwBool  RpLtMapPluginAttach (void)

Detailed Description

Lightmap Plugin for RenderWare Graphics.

RpLtMap Plugin Overview

Requirements

Overview

The lightmap plugin provides a means to render geometry using detailed, full color, static lighting information from lightmap textures.

Before any of the lightmap functionality can be used the plugin must be registered with RenderWare with :-

Lightmap generation functionality is provided by the RtLtMap toolkit. At run-time, each light-mapped RpWorldSector or RpAtomic may reference one lightmap (several such objects may share a single lightmap for efficiency). These lightmaps are loaded (from individual texture files or the current texture dictionary) automatically when the objects are read from disk. At this point, platform-specific lightmap rendering pipelines will also be attached to the objects. Note that these pipelines are object pipelines, not material pipelines (i.e it is not possible, currently, to vary rendering effects within lightmapped objects on a mesh-by-mesh basis).

The supplied lightmap rendering pipelines will take into account dynamic vertex lighting correctly on all platforms (this will be added to the light in the lightmaps). There are also several rendering modes available for inspection of lightmaps (see RpLtMapSetRenderStyle).


Enumeration Type Documentation

enum RpLtMapStyle
 

RpLtMapStyle Flags specifying the rendering style of the lightmap plugin.

See also:
RpLtMapGetRenderStyle , RpLtMapSetRenderStyle
Enumeration values:
rpLTMAPSTYLERENDERBASE  The base texture should be rendered
rpLTMAPSTYLERENDERLIGHTMAP  The lightmap should be rendered
rpLTMAPSTYLEPOINTSAMPLE  The lightmap should be point-sampled

Function Documentation

RwTexture* RpLtMapAtomicGetLightMap RpAtomic   atomic
 

RpLtMapAtomicGetLightMap returns the lightmap in use by a given RpAtomic, if any.

The lightmaps used by RpAtomic's are exposed so that they may be analysed, processed or replaced by the user. If an RpAtomic has no lightmap (calls to RtLtMapLightMapsCreate have not yet created one, or the RpAtomic is not flagged with rtLTMAPOBJECTLIGHTMAP) then NULL will be returned.

The lightmap plugin must be attached before using this function.

Parameters:
atomic  A pointer to an RpAtomic for which the lightmap should be returned
Returns:
A pointer to the RpAtomic's lightmap on success, NULL if the RpAtomic has no lightmap or on error.
See also:
RpLtMapAtomicSetLightMap , RpLtMapWorldSectorGetLightMap , RpLtMapWorldSectorSetLightMap
RpAtomic* RpLtMapAtomicSetLightMap RpAtomic   atomic,
RwTexture   lightMap
 

RpLtMapAtomicSetLightMap is used to set the lightmap used by an RpAtomic.

Note that lightmaps must be square and of power-of-two side length. A NULL lightmap cannot be passed (instead, clear the rtLTMAPOBJECTLIGHTMAP flag for this RpAtomic, prior to creating lightmaps). If the RpAtomic contains an existing lightmap, it will be destroyed.

Simply resampling a lightmap to a different resolution will most likely result in visual artifacts.

The lightmap plugin must be attached before using this function.

Parameters:
atomic  A pointer to an RpAtomic
lightMap  A pointer to an RwTexture
Returns:
A pointer to the RpAtomic on success, NULL otherwise
See also:
RpLtMapAtomicGetLightMap , RpLtMapWorldSectorGetLightMap , RpLtMapWorldSectorSetLightMap
RxPipeline* RpLtMapGetPlatformAtomicPipeline void   
 

RpLtMapGetPlatformAtomicPipeline is used to retrieve the platform-specific pipeline which is used to render lightmapped RpAtomic's.

The operation of the lightmap rendering pipelines may be altered using RpLtMapSetRenderStyle.

The lightmap plugin must be attached before using this function.

Returns:
The platform-specific RxPipeline for rendering RpAtomic's on success, otherwise NULL
See also:
RpLtMapGetPlatformWorldSectorPipeline , RpLtMapSetRenderStyle. , RpLtMapGetRenderStyle.
RxPipeline* RpLtMapGetPlatformWorldSectorPipeline void   
 

RpLtMapGetPlatformWorldSectorPipeline is used to retrieve the platform-specific pipeline which is used to render lightmapped RpWorldSector's.

The operation of the lightmap rendering pipelines may be altered using RpLtMapSetRenderStyle.

The lightmap plugin must be attached before using this function.

Returns:
The platform-specific RxPipeline for rendering RpWorldSector's on success, otherwise NULL
See also:
RpLtMapGetPlatformAtomicPipeline , RpLtMapSetRenderStyle. , RpLtMapGetRenderStyle.
RwUInt32 RpLtMapGetRasterFormat void   
 

RpLtMapGetRasterFormat returns the raster format used for creating new lightmap.

The raster format used for creating lightmap textures varies between different platforms for performance reasons. A default format is preset during initialization that is most suitable to the host plaform.

The lightmap plugin must be attached before using this function.

Returns:
The raster format.
See also:
RtLtMapLightMapsCreate , RpLtMapSetRasterFormat , RwRasterGetFormat , RwRasterSetFormat
RpLtMapStyle RpLtMapGetRenderStyle void   
 

RpLtMapGetRenderStyle gets the rendering style being used by the rendering pipelines of the lightmap plugin.

Rendering style is specified using flags of type RpLtMapStyle:

  • rpLTMAPSTYLERENDERBASE The base texture should be rendered
  • rpLTMAPSTYLERENDERLIGHTMAP The lightmap should be rendered
  • rpLTMAPSTYLEPOINTSAMPLE The lightmap should be point-sampled
rpLTMAPSTYLEPOINTSAMPLE is useful for "debugging" lightmaps as it makes lightmap texels more clearly visible.

The lightmap plugin must be attached before using this function.

Returns:
The current rendering style of the lightmap plugin
See also:
RpLtMapSetRenderStyle
RwBool RpLtMapPluginAttach void   
 

RpLtMapPluginAttach is used to attach the lightmap plugin to the RenderWare system to enable the rendering of lightmapped RpWorldSector's and RpAtomic's.

The plugin must be attached between initializing the system with RwEngineInit and opening it with RwEngineOpen.

Note:
The lightmap plugin requires the world plugin to be attached. The include file rpltmap.h is also required and must be included by an application wishing to use this plugin.
Returns:
TRUE if successful, FALSE if an error occurs.
See also:
RpLtMapGetPlatformAtomicPipeline , RpLtMapGetPlatformWorldSectorPipeline , RpLtMapGetRenderStyle , RpLtMapSetRenderStyle , RpLtMapWorldSectorGetLightMap , RpLtMapWorldSectorSetLightMap , RpLtMapAtomicGetLightMap , RpLtMapAtomicSetLightMap
RwBool RpLtMapSetRasterFormat RwUInt32    format
 

RpLtMapSetRasterFormat set the raster format to be used for creating new lightmap.

The raster format used for creating lightmap textures varies between different platforms for performance reasons. A default format is preset during initialization that is most suitable to the host plaform.

If the lightmap textures is intended for a different target platform, then the texture format should be in the target's recommended format.

The recommended formats are

  • PlayStation 2, rwRASTERTYPETEXTURE | rwRASTERFORMAT8888 | rwRASTERFORMATPAL8.
  • Direct X, rwRASTERTYPETEXTURE | rwRASTERFORMAT888 | rwRASTERFORMATMIPMAP | rwRASTERFORMATAUTOMIPMAP.
  • OpenGL, rwRASTERTYPETEXTURE | rwRASTERFORMAT888 | rwRASTERFORMATMIPMAP | rwRASTERFORMATAUTOMIPMAP.
  • GameCube, rwRASTERTYPETEXTURE | rwRASTERFORMAT565 | rwRASTERFORMATMIPMAP | rwRASTERFORMATAUTOMIPMAP.
  • XBoX, rwRASTERTYPETEXTURE | rwRASTERFORMAT888 | rwRASTERFORMATMIPMAP | rwRASTERFORMATAUTOMIPMAP.
The lightmap plugin must be attached before using this function.
Returns:
TRUE.
See also:
RtLtMapLightMapsCreate , RpLtMapGetRasterFormat , RwRasterGetFormat , RwRasterSetFormat
RwBool RpLtMapSetRenderStyle RpLtMapStyle    style,
RpWorld   world
 

RpLtMapSetRenderStyle sets the rendering style to be used by the the rendering pipelines of the lightmap plugin.

Rendering style is specified using flags of type RpLtMapStyle:

  • rpLTMAPSTYLERENDERBASE The base texture should be rendered
  • rpLTMAPSTYLERENDERLIGHTMAP The lightmap should be rendered
  • rpLTMAPSTYLEPOINTSAMPLE The lightmap should be point-sampled
rpLTMAPSTYLEPOINTSAMPLE is useful for "debugging" lightmaps as it makes lightmap texels more clearly visible. The world parameter is used to find lightmaps whose filter mode should be changed if this flag is changed. The lightmaps modified will be those used by the RpAtomic's and RpWorldSector's inside the world.

The lightmap plugin must be attached before using this function.

Parameters:
style  The RpLtMapStyle rendering style to use
world  An optional pointer to an RpWorld
Returns:
TRUE on success, otherwise FALSE
See also:
RpLtMapGetRenderStyle
RwUInt32 RpLtMapWorldLightMapsQuery RpWorld   world
 

RpLtMapWorldLightMapsQuery returns the number of lightmaps used by the RpWorldSector's and RpAtomic's in an RpWorld.

Note that several RpWorldSector's and/or RpAtomic's may share a single lightmap.

The lightmap plugin must be attached before using this function.

Parameters:
world  An RpWorld to query for lightmaps
Returns:
The number of lightmaps used by this RpWorld
See also:
RpLtMapWorldSectorGetLightMap , RpLtMapAtomicGetLightMap , RtLtMapLightMapsCreate
RwTexture* RpLtMapWorldSectorGetLightMap RpWorldSector   sector
 

RpLtMapWorldSectorGetLightMap returns the lightmap in use by a given RpWorldSector, if any.

The lightmaps used by RpWorldSector's are exposed so that they may be analysed, processed or replaced by the user. If an RpWorldSector has no lightmap (calls to RtLtMapLightMapsCreate have not yet created one, or the RpWorldSector is not flagged with rtLTMAPOBJECTLIGHTMAP) then NULL will be returned.

The lightmap plugin must be attached before using this function.

Parameters:
sector  A pointer to an RpWorldSector for which the lightmap should be returned
Returns:
A pointer to the RpWorldSector's lightmap on success, NULL if the RpWorldSector has no lightmap or on error.
See also:
RpLtMapWorldSectorSetLightMap , RpLtMapAtomicGetLightMap , RpLtMapAtomicSetLightMap
RpWorldSector* RpLtMapWorldSectorSetLightMap RpWorldSector   sector,
RwTexture   lightMap
 

RpLtMapWorldSectorSetLightMap is used to set the lightmap used by an RpWorldSector.

Note that lightmaps must be square and of power-of-two side length. A NULL lightmap cannot be passed (instead, clear the rtLTMAPOBJECTLIGHTMAP flag for this RpWorldSector, prior to creating lightmaps). If the RpWorldSector contains an existing lightmap, it will be destroyed.

Simply resampling a lightmap to a different resolution will most likely result in visual artifacts.

The lightmap plugin must be attached before using this function.

Parameters:
sector  A pointer to an RpWorldSector
lightMap  A pointer to an RwTexture
Returns:
A pointer to the RpWorldSector on success, NULL otherwise
See also:
RpLtMapWorldSectorGetLightMap , RpLtMapAtomicGetLightMap , RpLtMapAtomicSetLightMap

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