# class NormalCasterSettings

NormalCasterSettings is the interface used to manage settings for a normal caster

# Properties

Property Description
CalculateBitangentPerFragment If set, the normal caster calculates the bitangent used for encoding per-fragment using the normal, tangent and bitangent sign instead of interpolating the actual bitangent vertex data. This needs to match the behaviour of the renderer to not produce rendering artifacts.
Dilation The Dilation value. Where applicable, such as colors and normals, the caster will fill empty pixels surrounding filled pixels with values mixed from the filled ones. This setting sets how many pixels to fill outside the original filled pixels.
DitherType The type of dithering to use when creating the output object.
FillMode The fill mode determines what to do with the pixels that remain unfilled after both the casting and dilation has been performed. Options are: None = Do not fill remaining pixels Interpolate = linearly interpolate the closest samples NearestNeighbor = use the closest available pixel value without interpolation.
FlipBackfacingNormals If set, then normals will be flipped if they are back facing, i.e. pointing into the surface. This may introduce artifacts on geometries that have correctly facing normals, so only use for geometries with known back-facing normals.
FlipGreen If set, the green channel is assumed to point along the negative bitangent instead of the positive. This is roughly equivalent to switching between left- and righthanded, but some rounding may differ.
GenerateTangentSpaceNormals If set, then the generated normal map will be in tangent space. Please note that the geometry casted to must contain tangent space fields.
MaterialChannel The name of the input material channel to cast. Existing user channels of any arbitrary name in the input materials can be cast.
NormalizeInterpolatedTangentSpace If set, the normal caster normalizes the normal and tangent data used for encoding after interpolation. This needs to match the behaviour of the renderer to not produce rendering artifacts.
OpacityChannel The name of the input opacity channel to use for combining layers in most casters and casting opacity in the opacitycaster. User channels of any arbitrary name can be used.
OpacityChannelComponent The component in the opacity channel to use as opacity value.
OutputDDSCompressionType DDS compression if output format is DDS.
OutputImageFileFormat File format for output texture.
OutputPixelFormat The output pixel format
UseMultisampling Enable or disable multisampling.

# Methods

Method Description
GetBoolParameter Get a named parameter boolean value.
GetClass Get the name of the NormalCasterSettings class.
GetDoubleParameter Get a named parameter floating point value.
GetErrorString Returns a string describing the error that was found the last time ValidateSettings was performed.
GetIntParameter Get a named parameter integer value.
GetStringParameter Get a named parameter string value.
GetUIntParameter Get a named parameter unsigned integer value.
IsA Returns true if NormalCasterSettings is a or is a descendant of the class named as the type parameter.
IsNull Returns true if the NormalCasterSettings object is invalid.
SetBoolParameter Set a named parameter boolean value.
SetDoubleParameter Set a named parameter floating point value.
SetIntParameter Set a named parameter integer value.
SetStringParameter Set a named parameter string value.
SetUIntParameter Set a named parameter unsigned integer value.
SetValidateParameterNames Set if parameter names should be validated or not. Parameters that previously do not exist will generate and error if validation is enabled and be allowed if validation is disabled.
ToJSON Get settings as JSON for debugging purposes.
ValidateSettings Validates the current settings values.

# Static methods

Method Description
IsClassA Returns true if the class is a or is a descendant of the class named as the type parameter.
SafeCast SafeCast makes sure the input object is of a class that can be cast into spNormalCasterSettings, and if this is the case, returns the object cast into spNormalCasterSettings.

# Properties details

# CalculateBitangentPerFragment

If set, the normal caster calculates the bitangent used for encoding per-fragment using the normal, tangent and bitangent sign instead of interpolating the actual bitangent vertex data. This needs to match the behaviour of the renderer to not produce rendering artifacts.

# Syntax

// Setter
void SetCalculateBitangentPerFragment( bool value );

// Getter
bool GetCalculateBitangentPerFragment();

# SetCalculateBitangentPerFragment parameters

Type Name Min Max Description
bool value The value the CalculateBitangentPerFragment bool is to be set.

# GetCalculateBitangentPerFragment return value

Type: bool

Default: true

# Dilation

The Dilation value. Where applicable, such as colors and normals, the caster will fill empty pixels surrounding filled pixels with values mixed from the filled ones. This setting sets how many pixels to fill outside the original filled pixels.

# Syntax

// Setter
void SetDilation( unsigned int value );

// Getter
unsigned int GetDilation();

# SetDilation parameters

Type Name Min Max Description
unsigned int value 0 1000 The value to which Dilation will be set.

# GetDilation return value

Type: unsigned int

Default: 10

# DitherType

The type of dithering to use when creating the output object.

# Syntax

// Setter
void SetDitherType( Simplygon::EDitherPatterns value );

// Getter
Simplygon::EDitherPatterns GetDitherType();

# SetDitherType parameters

Type Name Min Max Description
EDitherPatterns value The desired value of the DitherType to use.

# GetDitherType return value

Type: EDitherPatterns

Default: FloydSteinberg

Key Value Comment
NoDither 0 Use no dithering
FloydSteinberg 1 Use Floys-Steinberg dithering
JarvisJudiceNinke 2 Use Jarvis, Judice, and Ninke dithering
Sierra 3 Use Sierra-3 (three row) dithering

# FillMode

The fill mode determines what to do with the pixels that remain unfilled after both the casting and dilation has been performed. Options are: None = Do not fill remaining pixels Interpolate = linearly interpolate the closest samples NearestNeighbor = use the closest available pixel value without interpolation.

# Syntax

// Setter
void SetFillMode( Simplygon::EAtlasFillMode value );

// Getter
Simplygon::EAtlasFillMode GetFillMode();

# SetFillMode parameters

Type Name Min Max Description
EAtlasFillMode value The mode to which the fill mode will be set.

# GetFillMode return value

Type: EAtlasFillMode

Default: Interpolate

Key Value Comment
Interpolate 0 linearly interpolate the closest samples
NearestNeighbor 1 use the closest available pixel value without interpolation
NoFill 2 Do not fill remaining pixels

# FlipBackfacingNormals

If set, then normals will be flipped if they are back facing, i.e. pointing into the surface. This may introduce artifacts on geometries that have correctly facing normals, so only use for geometries with known back-facing normals.

# Syntax

// Setter
void SetFlipBackfacingNormals( bool value );

// Getter
bool GetFlipBackfacingNormals();

# SetFlipBackfacingNormals parameters

Type Name Min Max Description
bool value The value to which the FlipBackfacingNormals bool is to be set.

# GetFlipBackfacingNormals return value

Type: bool

Default: false

# FlipGreen

If set, the green channel is assumed to point along the negative bitangent instead of the positive. This is roughly equivalent to switching between left- and righthanded, but some rounding may differ.

# Syntax

// Setter
void SetFlipGreen( bool value );

// Getter
bool GetFlipGreen();

# SetFlipGreen parameters

Type Name Min Max Description
bool value The value the FlipGreen bool is to be set.

# GetFlipGreen return value

Type: bool

Default: false

# GenerateTangentSpaceNormals

If set, then the generated normal map will be in tangent space. Please note that the geometry casted to must contain tangent space fields.

# Syntax

// Setter
void SetGenerateTangentSpaceNormals( bool value );

// Getter
bool GetGenerateTangentSpaceNormals();

# SetGenerateTangentSpaceNormals parameters

Type Name Min Max Description
bool value The value to which the GenerateTangentSpaceNormals bool is to be set.

# GetGenerateTangentSpaceNormals return value

Type: bool

Default: true

# MaterialChannel

The name of the input material channel to cast. Existing user channels of any arbitrary name in the input materials can be cast.

# Syntax

// Setter
void SetMaterialChannel( const char * value );

// Getter
spString GetMaterialChannel();

# SetMaterialChannel parameters

Type Name Min Max Description
const char * value The input material channel name.

# GetMaterialChannel return value

Type: spString

Default: nullptr

# NormalizeInterpolatedTangentSpace

If set, the normal caster normalizes the normal and tangent data used for encoding after interpolation. This needs to match the behaviour of the renderer to not produce rendering artifacts.

# Syntax

// Setter
void SetNormalizeInterpolatedTangentSpace( bool value );

// Getter
bool GetNormalizeInterpolatedTangentSpace();

# SetNormalizeInterpolatedTangentSpace parameters

Type Name Min Max Description
bool value The value the NormalizeInterpolatedTangentSpace bool is to be set.

# GetNormalizeInterpolatedTangentSpace return value

Type: bool

Default: false

# OpacityChannel

The name of the input opacity channel to use for combining layers in most casters and casting opacity in the opacitycaster. User channels of any arbitrary name can be used.

# Syntax

// Setter
void SetOpacityChannel( const char * value );

// Getter
spString GetOpacityChannel();

# SetOpacityChannel parameters

Type Name Min Max Description
const char * value The desired material channel.

# GetOpacityChannel return value

Type: spString

Default: Opacity

# OpacityChannelComponent

The component in the opacity channel to use as opacity value.

# Syntax

// Setter
void SetOpacityChannelComponent( Simplygon::EColorComponent value );

// Getter
Simplygon::EColorComponent GetOpacityChannelComponent();

# SetOpacityChannelComponent parameters

Type Name Min Max Description
EColorComponent value The desired component in the opacity material channel to use as opacity value.

# GetOpacityChannelComponent return value

Type: EColorComponent

Default: Red

Key Value Comment
Red 0 Red color component
Green 1 Green color component
Blue 2 Blue color component
Alpha 3 Alpha color component

# OutputDDSCompressionType

DDS compression if output format is DDS.

# Syntax

// Setter
void SetOutputDDSCompressionType( Simplygon::EDDSCompressionType value );

// Getter
Simplygon::EDDSCompressionType GetOutputDDSCompressionType();

# SetOutputDDSCompressionType parameters

Type Name Min Max Description
EDDSCompressionType value The desired DDS compression type.

# GetOutputDDSCompressionType return value

Type: EDDSCompressionType

Default: NoCompression

Key Value Comment
NoCompression -1
BC1 0
BC2 1
BC3 2
BC4 3
BC5 4

# OutputImageFileFormat

File format for output texture.

# Syntax

// Setter
void SetOutputImageFileFormat( Simplygon::EImageOutputFormat value );

// Getter
Simplygon::EImageOutputFormat GetOutputImageFileFormat();

# SetOutputImageFileFormat parameters

Type Name Min Max Description
EImageOutputFormat value The desired file format.

# GetOutputImageFileFormat return value

Type: EImageOutputFormat

Default: PNG

Key Value Comment
BMP 0
DDS 1
JPEG 2
PNG 3
TGA 4
TIFF 5

# OutputPixelFormat

The output pixel format

# Syntax

// Setter
void SetOutputPixelFormat( Simplygon::EPixelFormat value );

// Getter
Simplygon::EPixelFormat GetOutputPixelFormat();

# SetOutputPixelFormat parameters

Type Name Min Max Description
EPixelFormat value The desired value to which OutputChannels will be set.

# GetOutputPixelFormat return value

Type: EPixelFormat

Default: R8G8B8A8

Key Value Comment
R8G8B8A8 0 RGBA color channels with 8 bit depth per color channel
R8G8B8 1 RGB color channels with 8 bit depth per color channel
R8 2 R color channel with 8 bit depth per color channel
R16G16B16A16 3 RGBA color channels with 16 bit depth per color channel
R16G16B16 4 RGB color channels with 16 bit depth per color channel
R16 5 R color channel with 16 bit depth per color channel

# UseMultisampling

Enable or disable multisampling.

# Syntax

// Setter
void SetUseMultisampling( bool value );

// Getter
bool GetUseMultisampling();

# SetUseMultisampling parameters

Type Name Min Max Description
bool value The desired value of the flag.

# GetUseMultisampling return value

Type: bool

Default: true

# Methods details

# GetBoolParameter

Get a named parameter boolean value.

# Syntax

bool GetBoolParameter( const char * name );

# Parameters

Type Name Min Max Description
const char * name Parameter name.

# Return value

Type: bool

# GetClass

Get the name of the NormalCasterSettings class.

# Syntax

spString GetClass();

# Parameters

GetClass takes no parameters.

# Return value

Type: spString

# GetDoubleParameter

Get a named parameter floating point value.

# Syntax

double GetDoubleParameter( const char * name );

# Parameters

Type Name Min Max Description
const char * name Parameter name.

# Return value

Type: double

# GetErrorString

Returns a string describing the error that was found the last time ValidateSettings was performed.

# Syntax

spString GetErrorString();

# Parameters

GetErrorString takes no parameters.

# Return value

Type: spString

# GetIntParameter

Get a named parameter integer value.

# Syntax

int GetIntParameter( const char * name );

# Parameters

Type Name Min Max Description
const char * name Parameter name.

# Return value

Type: int

# GetStringParameter

Get a named parameter string value.

# Syntax

spString GetStringParameter( const char * name );

# Parameters

Type Name Min Max Description
const char * name Parameter name.

# Return value

Type: spString

# GetUIntParameter

Get a named parameter unsigned integer value.

# Syntax

unsigned int GetUIntParameter( const char * name );

# Parameters

Type Name Min Max Description
const char * name Parameter name.

# Return value

Type: unsigned int

# IsA

Returns true if NormalCasterSettings is a or is a descendant of the class named as the type parameter.

# Syntax

bool IsA( const char * type );

# Parameters

Type Name Min Max Description
const char * type Name of the class to check if NormalCasterSettings is, or is a descendant of.

# Return value

Type: bool

# IsNull

Returns true if the NormalCasterSettings object is invalid.

# Syntax

bool IsNull();

# Parameters

IsNull takes no parameters.

# Return value

Type: bool

# SetBoolParameter

Set a named parameter boolean value.

# Syntax

bool SetBoolParameter( const char * name , bool value );

# Parameters

Type Name Min Max Description
const char * name Parameter name.
bool value New value for parameter.

# Return value

Type: bool

# SetDoubleParameter

Set a named parameter floating point value.

# Syntax

bool SetDoubleParameter( const char * name , double value );

# Parameters

Type Name Min Max Description
const char * name Parameter name.
double value New value for parameter.

# Return value

Type: bool

# SetIntParameter

Set a named parameter integer value.

# Syntax

bool SetIntParameter( const char * name , int value );

# Parameters

Type Name Min Max Description
const char * name Parameter name.
int value New value for parameter.

# Return value

Type: bool

# SetStringParameter

Set a named parameter string value.

# Syntax

bool SetStringParameter( const char * name , const char * value );

# Parameters

Type Name Min Max Description
const char * name Parameter name.
const char * value New value for parameter.

# Return value

Type: bool

# SetUIntParameter

Set a named parameter unsigned integer value.

# Syntax

bool SetUIntParameter( const char * name , unsigned int value );

# Parameters

Type Name Min Max Description
const char * name Parameter name.
unsigned int value New value for parameter.

# Return value

Type: bool

# SetValidateParameterNames

Set if parameter names should be validated or not. Parameters that previously do not exist will generate and error if validation is enabled and be allowed if validation is disabled.

# Syntax

void SetValidateParameterNames( bool validate );

# Parameters

Type Name Min Max Description
bool validate Flag indicating if validation is performed or not.

# ToJSON

Get settings as JSON for debugging purposes.

# Syntax

spString ToJSON();

# Parameters

ToJSON takes no parameters.

# Return value

Type: spString

# ValidateSettings

Validates the current settings values.

# Syntax

bool ValidateSettings();

# Parameters

ValidateSettings takes no parameters.

# Return value

Type: bool

# Static methods details

# IsClassA

Returns true if the class is a or is a descendant of the class named as the type parameter.

# Syntax

static bool IsClassA( const char * type );

# Parameters

Type Name Min Max Description
const char * type Name of the class to check if the class is, or is a descendant of.

# Return value

Type: bool

# SafeCast

SafeCast makes sure the input object is of a class that can be cast into spNormalCasterSettings, and if this is the case, returns the object cast into spNormalCasterSettings.

# Syntax

static spNormalCasterSettings SafeCast( spObject object );

# Parameters

Type Name Min Max Description
Object object Object to cast.

# Return value

Type: NormalCasterSettings