Main Page   Modules   Alphabetical List   Data Structures   Data Fields  

RpToon
[FXPack]


Modules

RpToonInk
RpToonInkDictionary
RpToonPaintDictionary
RpToonPaint
RpToonGeo
RpToonMaterial
PlayStation 2

Data Structures

struct   RpToonGeo
struct   RpToonInk
struct   RpToonInkDictionary
struct   RpToonPaint
struct   RpToonPaintDictionary

Functions

void  RpToonSetCreaseZBias (RwReal zBias)
RwReal  RpToonGetCreaseZBias (void)
RwBool  RpToonAtomicEnable (RpAtomic *atomic)
RwBool  RpToonWorldSectorEnable (RpWorldSector *sector)
RwBool  RpToonPluginAttach (void)

Detailed Description

Toon Plugin for RenderWare.

RpToon Plugin Overview

Requirements

Overview

RpToon provides rendering of outlines and "cel shaded" texture based lighting for RenderWare objects to achieve cartoon-like 3D graphics.

Toon rendering can be applied to static, morphed, dmorphed and skinned atomics, and world sectors. An art path is provided to specify line and shading styles for toon objects. Some functionality for this is provided in the RpToon API for the benefit of our exporters, which you can safely ignore unless you need to customize the tool chain.

Caveats

Good quality toon rendering, especially silhouette edge rendering, is expensive. Expect to use much lower polygon counts than you would in a realistically rendered game to achieve satisfactory performance, and/or enable toon rendering on only a subset of game objects. Note that existing toon games often take various shortcuts to reduce the rendering cost, such as painting edges into textures of "less important" objects rather than rendering them as geometry.

RpToon is implemented differently on each platform, and some features are not supported on all platforms because of hardware limitations. Be sure to check the relevant platform specific documentation for details. Furthermore, toon rendering can NOT be applied to an object that has RpMatFX effects applied to ANY of its materials. In addition, note that prelit colors, native data, parallel cameras, and alpha blending are not supported on RpToon objects in this release.

Only 1 directional light is supported for shading.

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

Objects

RpToon adds a number of objects to RenderWare, and also extends several RenderWare objects as follows:

RpToonInk defines the style (thickness, color and scaling properties) used to render silhouette and crease edges as 2D outlines of objects. RpToonInk's are named and have reference counts.

RpToonInkDictionary organizes a collection of RpToonInk's analogously to how an RwTexDictionary organizes a collection of RwTexture's. You can look up by name, add and remove RpToonInk's in an RpToonInkDictionary. It also provides the most convenient way of applying streamed ink styles to a scene of toon objects.

RpToonPaint defines the style (texture and type) of shading used on a toon object's materials. RpToonPaint's are also named and have reference counts.

RpToonPaintDictionary organizes a collection of RpToonPaint's and that is the only difference between it and RpToonInkDictionary.

RpToon extends RpGeometry and RpWorldSector with an RpToonGeo object which holds additional information on geometry connectivity and other properties necessary for silhouette and crease edge rendering. Once you have an RpToonGeo object, it doesn't matter whether it came from an RpGeometry or an RpWorldSector - you can treat it the same way. In addition, "default" ink and paint styles for an object are stored on an RpToonGeo so it is not necessary to define explicit settings for every material or edge if you don't need to, which is often the case.

RpToon extends RpMaterial to hold an RpToonMaterial. RpToonMaterial in turn has a pointer to an RpToonPaint which if defined, takes precedence over the default paint in an RpToonGeo object. The shading from the RpToonPaint is blended with the RpMaterial's color and texture.

On some platforms, additional information in RpToonMaterial is used for identifying the RpToonInk used for silhouette rendering on a particular mesh referencing that material. To support this, the art path must re-partition an object's meshes and sometimes introduce additional materials if you define multiple silhouette ink styles on an object.


Function Documentation

RwBool RpToonAtomicEnable RpAtomic   atomic
 

RpToonAtomicEnable is used to enable the toon pipeline on an atomic. If the atomic has no RpToonGeo associated with it, a default one is created by RpToonGeometryCreateToonGeo.

Note:
This function should not be called on the same atomic more than once.
Parameters:
atomic  Pointer to the RpAtomic to enable the toon pipeline on.
Returns:
TRUE on success, FALSE otherwise.
See also:
RpToonWorldSectorEnable , RpToonGeometryCreateToonGeo , RpToonGeo
RwReal RpToonGetCreaseZBias void   
 

RpToonGetCreaseZBias gets the zbias used to offset crease edge polygons z coordinates in camera space. Tweaking this value can help avoid the crease edges being obscured by z fighting.

Returns:
The zBias value.
See also:
RpToonSetCreaseZBias
RwBool RpToonPluginAttach void   
 

RpToonPluginAttach is used to attach the toon plugin.The toon plugin must be attached between initializing the system with RwEngineInit and opening it with RwEngineOpen and the world plugin must already be attached.

Returns:
Returns TRUE if successful or FALSE if there is an error
See also:
RwEngineInit , RwEngineOpen , RwEngineStart
void RpToonSetCreaseZBias RwReal    zBias
 

RpToonSetCreaseZBias sets the zbias used to offset crease edge polygons z coordinates in camera space.

Tweaking this value can help avoid the crease edges being obscured by z fighting.

Parameters:
zBias  The new value.
Returns:
none.
See also:
RpToonGetCreaseZBias
RwBool RpToonWorldSectorEnable RpWorldSector   sector
 

RpToonWorldSectorEnable is used to enable the toon pipeline on a world sector. If the sector has no RpToonGeo associated with it, a default one is created by RpToonGeometryCreateToonGeo.

Parameters:
sector  Pointer to the RpWorldSector to enable the toon pipeline on.
Returns:
TRUE on success, FALSE otherwise.
See also:
RpToonAtomicEnable , RpToonGeometryCreateToonGeo , RpToonGeo

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)