# 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.
# 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.
# 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.
# 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.
# 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.
# 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.
# Methods details
# 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 details
# 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.