IFXShaderPainter

The ShaderPainter interface is used to achieve a cartoon style shading of a model. Several parameters can be adjusted to achieve a cartoon style, a gradient style, or a black and white style.

Cartoon style gives the model a cartoon appearance. For each color, only two colors are used to simulate the limited number of colors traditionally used in animation. The color transition line (from highlight to shadow, for example) can be adjusted by changing the resolution or by adjusting the shadow and highlight resolution.

Gradient style renders a transition from one color to another, with discrete transitions between the colors rather than a smooth blend.

Black and White style uses only black and white to shade the models, as in a black and white cartoon.

When to Use

The ShaderPainter is used by the Render() method of the modifier and is part of the Shader chain.

Interface Methods

Description

GetMaterialID

Returns the material ID number

GetScenegraph

Returns a pointer to the scenegraph

GetResolution

Returns number of texels used for shading

GetShadowFactor

Returns weighting on the shadow color

GetHighlightFactor

Returns weighting on highlight color

GetStyle

Returns enum of current style

GetShadowResolution

Returns number of texels used for shadow color

GetHighlightResolution

Returns number of texels used for highlight color

SetMaterialID

Sets the material ID number

SetResolution

Sets number of texels used for shading

SetShadowFactor

Sets weighting on the shadow color

SetHighlightFactor

Sets weighting on highlight color

SetStyle

Sets enum of current style

SetShadowResolution

Sets number of texels used for shadow color

SetHighlightResolution

Sets number of texels used for highlight color


IFXShaderPainter::GetMaterialID(U32 *puID)

This methods gets the material ID number for the shader.

Parameters:

puID

Pointer to the material ID number

Return Values


IFXShaderPainter::GetScenegraph(IFXScenegraph **ppOutSceneGraph)

This method gets the scenegraph that uses the shader.

Parameters:

ppOutSceneGraph

Pointer to the scenegraph

Return Values


IFXShaderPainter::GetResolution(U32 *puResolution)

This method retrieves the number of shading texels.

Parameters:

puResolution

Number of texels used for shading

Return Values

Comments:

Must be power of 2.


IFXShaderPainter::GetShadowFactor(F32 *puShadowFactor)

This method retrieves the shadow color value.

Parameters:

puShadowFactor

Value allowing adjustment of shadow color

Return Values

Comments:

Lighting will compute a value for the material that may be darker or lighter than the author intends. This acts as a bias term on the shadow color.


IFXShaderPainter::GetHighlightFactor(F32 *puHighlightFactor)

This method retrieves the highlight color value.

Parameters:

puShadowFactor

Value allowing adjustment of highlight color

Return Values

Comments:

Lighting will compute a value for the material that may be darker or lighter than the author intends. This acts as a bias term on the shadow color.


IFXShaderPainter::GetStyle(U32 *puStyle)

This method retrieves the style type (gradient, toon, or black and white).

Parameters:

PuStyle

Returns enumeration of style types supported

Enumeration of the type.

IFX_SHADE_STYLE_GRADIENT,

IFX_SHADE_STYLE_TOON,

IFX_SHADE_STYLE_BLACK_AND_WHITE

Return Values


IFXShaderPainter::GetShadowResolution(U32 *puShadowResolution)

This method retrieves the number of shadow texels.

Parameters:

puShadowResolution

Adjusts number of shadow texels

Return Values

Comments:

Allows the adjustment of the hard edge between the shadow and highlight color. Must be less than or equal to the resolution of the whole texture (shadow+highlight resolution).


IFXShaderPainter::GetHighlightResolution(U32 *puHighlightResolution)

This method retrieves the number of highlight texels.

Parameters:

puHighlightResolution

Pointer to the number of highlight texels

Return Values

Comments:

Allows the adjustment of the hard edge between the shadow and highlight color. Must be less than or equal to the resolution of the whole texture (shadow+highlight resolution).


IFXShaderPainter::SetMaterialID(U32 uID)

This methods sets the material ID number for the shader.

Parameters:

uID

Material ID number

Return Values


IFXShaderPainter::SetResolution(U32 uResolution)

This method sets the number of shading texels.

Parameters:

puResolution

Adjusts number of texels used in mesh

Return Values

Comments:

Allows the adjustment of the hard edge between the shadow and highlight color.


IFXShaderPainter::SetShadowFactor(F32 fShadowFactor)

This method sets the shadow color value.

Parameters:

fShadowFactor

Adjusts level of shadow color

Return Values:

None


IFXShaderPainter::SetHighlightFactor(F32 fHighlightFactor)

This method sets the highlight color value.

Parameters:

fHighlightFactor

Adjusts level of highlight color

Return Values:

None


IFXShaderPainter::SetStyle(U32 uToonStyle)

This method sets the style type (toon).

Parameters:

uToonStyle

Enumeration of the type

Return Values


IFXShaderPainter::SetShadowResolution(U32 uShadowResolution)

This method sets the number of shadow texels.

Parameters:

uShadowResolution

Adjusts level of shadow resolution

Return Values


IFXShaderPainter::SetHighlightResolution(F32 fHighlightFactor)

This method sets the number of highlight texels.

Parameters:

fHighlightFactor

Adjusts level of highlight color

Return Values

 

§See asterisked (*) statement at Legal Information © 2001 Intel Corporation.