# class VisibilitySettings

Visibility settings contains the parameters for how to compute the visibility of a scene and how to use it, both in the ReductionProcessor and the RemeshingProcessor. The visibility information is computed for each part of the mesh determined by the visibility from the selected SceneCamera objects. Cameras are selected using the CameraSelectionSetID. The visibility can be used to guide the reducer and/or texture coordinates generator (parameterizer) with the flags UseVisibilityWeightsInReducer respective UseVisibilityWeightsInTexcoordGenerator. There is also an option to completely throw away triangles that are deemed not visible, using the CullOccludedGeometry flag.

# Properties

Property Description
CameraSelectionSetID The ID of the selection set containing all the scene cameras and scene meshes used when computing visibility. If scene meshes are added, all their vertices will be used as omni-directional cameras. If set to -1, all cameras in the scene will be used. If both selection set name and ID are set, the name will be used.
CameraSelectionSetName The name of the selection set containing all the scene cameras and scene meshes used when computing visibility. If scene meshes are added, all their vertices will be used as omni-directional cameras. If set to null, all cameras in the scene will be used. If both selection set name and ID are set, the name will be used.
ComputeVisibilityMode Specifies the renderer type when computing visibility.
ConservativeMode If enabled, will compute the visibility conservatively - meaning that triangles that are visible will be tagged as visible but some non-visible triangles might also be tagged as visible. If this is turned off, then it is no longer guaranteed that all visible triangles are found - but more non-visible triangles will be identified as non-visible.
CullOccludedGeometry If set to true, geometry that is not visible will be removed.
FillNonVisibleAreaThreshold If a group of non-visible triangles (connected to visible triangles) has an area below the FillNonVisibleAreaThreshold - it will receive the same visibility as the neighboring visible triangles. Set to zero to skip filling nonvisible regions.
ForceVisibilityCalculation Set the ForceVisibilityCalculation if true, visibility weights will definitely be computed for the geometry, even if the visibility isn't specifically being used for reduction/materialLOD/culling according to the VisibilitySettings.
OccluderSelectionSetID The ID of the selection set containing all the scene meshes that should occlude the scene when calculating visibility. If set to -1, no occluders will be used. If both selection set name and ID are set, the name will be used.
OccluderSelectionSetName The name of the selection set containing all the scene meshes used when computing visibility. If set to null, no occluders in the scene will be used. If both selection set name and ID are set, the name will be used.
RemoveTrianglesNotOccludingOtherTriangles If enabled, will remove all the visible triangles that are not occluding any other triangle. It will also remove all non-visible triangles.
UseBackfaceCulling Set whether triangles should be regarded visible when viewed from the back.
UseVisibilityWeightsInReducer If set to true, visibility weights will be used in the reducer.
UseVisibilityWeightsInTexcoordGenerator If set to true, visibility weights will be used when generating new texture coordinates.
VisibilityWeightsPower Set how aggressively reducer should handle low visibility weights.

# Methods

Method Description
GetBoolParameter Get a named parameter boolean value.
GetClass Get the name of the VisibilitySettings 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 VisibilitySettings is a or is a descendant of the class named as the type parameter.
IsNull Returns true if the VisibilitySettings 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 spVisibilitySettings, and if this is the case, returns the object cast into spVisibilitySettings.

# Properties details

# CameraSelectionSetID

The ID of the selection set containing all the scene cameras and scene meshes used when computing visibility. If scene meshes are added, all their vertices will be used as omni-directional cameras. If set to -1, all cameras in the scene will be used. If both selection set name and ID are set, the name will be used.

# Syntax

// Setter
void SetCameraSelectionSetID( rid value );

// Getter
rid GetCameraSelectionSetID();

# SetCameraSelectionSetID parameters

Type Name Min Max Description
rid value -1 The desired SelectionSetID value.

# GetCameraSelectionSetID return value

Type: rid

Default: -1

# CameraSelectionSetName

The name of the selection set containing all the scene cameras and scene meshes used when computing visibility. If scene meshes are added, all their vertices will be used as omni-directional cameras. If set to null, all cameras in the scene will be used. If both selection set name and ID are set, the name will be used.

# Syntax

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

// Getter
spString GetCameraSelectionSetName();

# SetCameraSelectionSetName parameters

Type Name Min Max Description
const char * value The desired SelectionSet name.

# GetCameraSelectionSetName return value

Type: spString

Default: nullptr

# ComputeVisibilityMode

Specifies the renderer type when computing visibility.

# Syntax

// Setter
void SetComputeVisibilityMode( Simplygon::EComputeVisibilityMode value );

// Getter
Simplygon::EComputeVisibilityMode GetComputeVisibilityMode();

# SetComputeVisibilityMode parameters

Type Name Min Max Description
EComputeVisibilityMode value The new ComputeVisibilityMode value.

# GetComputeVisibilityMode return value

Type: EComputeVisibilityMode

Default: DirectX

Key Value Comment
DirectX 0 Use DirectX when computing visibility.
Software 1 Use a software renderer when computing visibility.

# ConservativeMode

If enabled, will compute the visibility conservatively - meaning that triangles that are visible will be tagged as visible but some non-visible triangles might also be tagged as visible. If this is turned off, then it is no longer guaranteed that all visible triangles are found - but more non-visible triangles will be identified as non-visible.

# Syntax

// Setter
void SetConservativeMode( bool value );

// Getter
bool GetConservativeMode();

# SetConservativeMode parameters

Type Name Min Max Description
bool value The new ConservativeMode value.

# GetConservativeMode return value

Type: bool

Default: false

# CullOccludedGeometry

If set to true, geometry that is not visible will be removed.

# Syntax

// Setter
void SetCullOccludedGeometry( bool value );

// Getter
bool GetCullOccludedGeometry();

# SetCullOccludedGeometry parameters

Type Name Min Max Description
bool value The new CullOccludedGeometry value.

# GetCullOccludedGeometry return value

Type: bool

Default: false

# FillNonVisibleAreaThreshold

If a group of non-visible triangles (connected to visible triangles) has an area below the FillNonVisibleAreaThreshold - it will receive the same visibility as the neighboring visible triangles. Set to zero to skip filling nonvisible regions.

# Syntax

// Setter
void SetFillNonVisibleAreaThreshold( real value );

// Getter
real GetFillNonVisibleAreaThreshold();

# SetFillNonVisibleAreaThreshold parameters

Type Name Min Max Description
real value 0 REAL_MAX The new FillNonVisibleAreaThreshold value.

# GetFillNonVisibleAreaThreshold return value

Type: real

Default: 0.0

# ForceVisibilityCalculation

Set the ForceVisibilityCalculation if true, visibility weights will definitely be computed for the geometry, even if the visibility isn't specifically being used for reduction/materialLOD/culling according to the VisibilitySettings.

# Syntax

// Setter
void SetForceVisibilityCalculation( bool value );

// Getter
bool GetForceVisibilityCalculation();

# SetForceVisibilityCalculation parameters

Type Name Min Max Description
bool value The new ForceVisibilityCalculation value.

# GetForceVisibilityCalculation return value

Type: bool

Default: false

# OccluderSelectionSetID

The ID of the selection set containing all the scene meshes that should occlude the scene when calculating visibility. If set to -1, no occluders will be used. If both selection set name and ID are set, the name will be used.

# Syntax

// Setter
void SetOccluderSelectionSetID( rid value );

// Getter
rid GetOccluderSelectionSetID();

# SetOccluderSelectionSetID parameters

Type Name Min Max Description
rid value -1 The desired OccluderSelectionSetID value.

# GetOccluderSelectionSetID return value

Type: rid

Default: -1

# OccluderSelectionSetName

The name of the selection set containing all the scene meshes used when computing visibility. If set to null, no occluders in the scene will be used. If both selection set name and ID are set, the name will be used.

# Syntax

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

// Getter
spString GetOccluderSelectionSetName();

# SetOccluderSelectionSetName parameters

Type Name Min Max Description
const char * value The desired SelectionSet name.

# GetOccluderSelectionSetName return value

Type: spString

Default: nullptr

# RemoveTrianglesNotOccludingOtherTriangles

If enabled, will remove all the visible triangles that are not occluding any other triangle. It will also remove all non-visible triangles.

# Syntax

// Setter
void SetRemoveTrianglesNotOccludingOtherTriangles( bool value );

// Getter
bool GetRemoveTrianglesNotOccludingOtherTriangles();

# SetRemoveTrianglesNotOccludingOtherTriangles parameters

Type Name Min Max Description
bool value The new RemoveTrianglesNotOccludingOtherTriangles value.

# GetRemoveTrianglesNotOccludingOtherTriangles return value

Type: bool

Default: false

# UseBackfaceCulling

Set whether triangles should be regarded visible when viewed from the back.

# Syntax

// Setter
void SetUseBackfaceCulling( bool value );

// Getter
bool GetUseBackfaceCulling();

# SetUseBackfaceCulling parameters

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

# GetUseBackfaceCulling return value

Type: bool

Default: true

# UseVisibilityWeightsInReducer

If set to true, visibility weights will be used in the reducer.

# Syntax

// Setter
void SetUseVisibilityWeightsInReducer( bool value );

// Getter
bool GetUseVisibilityWeightsInReducer();

# SetUseVisibilityWeightsInReducer parameters

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

# GetUseVisibilityWeightsInReducer return value

Type: bool

Default: false

# UseVisibilityWeightsInTexcoordGenerator

If set to true, visibility weights will be used when generating new texture coordinates.

# Syntax

// Setter
void SetUseVisibilityWeightsInTexcoordGenerator( bool value );

// Getter
bool GetUseVisibilityWeightsInTexcoordGenerator();

# SetUseVisibilityWeightsInTexcoordGenerator parameters

Type Name Min Max Description
bool value The new UseVisibilityWeightsInTexcoordGenerator value.

# GetUseVisibilityWeightsInTexcoordGenerator return value

Type: bool

Default: false

# VisibilityWeightsPower

Set how aggressively reducer should handle low visibility weights.

# Syntax

// Setter
void SetVisibilityWeightsPower( real value );

// Getter
real GetVisibilityWeightsPower();

# SetVisibilityWeightsPower parameters

Type Name Min Max Description
real value 0 REAL_MAX Power of influence (default 1.0).

# GetVisibilityWeightsPower return value

Type: real

Default: 1.0

# 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 VisibilitySettings 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 VisibilitySettings 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 VisibilitySettings is, or is a descendant of.

# Return value

Type: bool

# IsNull

Returns true if the VisibilitySettings 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 spVisibilitySettings, and if this is the case, returns the object cast into spVisibilitySettings.

# Syntax

static spVisibilitySettings SafeCast( spObject object );

# Parameters

Type Name Min Max Description
Object object Object to cast.

# Return value

Type: VisibilitySettings