class ART::IGeometry
Geometry interface for mesh manipulation.
#include <ARTIGeometry.h>
Inherits: IREDObject.
Public functions:
virtual RED_RC | AddReflectionProbe ( RED::Object * iReflectionProbe ) = 0 |
virtual RED_RC | DestroyReflectionProbe ( int iIndex ) = 0 |
virtual int | GetCSMCount ( ) const = 0 |
virtual double | GetGICachesMultiplier ( ) const = 0 |
virtual int | GetGISamplesCount ( ) const = 0 |
virtual RED::Object * | GetLight ( int iIndex ) const = 0 |
virtual int | GetLightsCount ( ) const = 0 |
virtual RED::Object * | GetMaterial ( int iIndex ) const = 0 |
virtual int | GetMaterialsCount ( ) const = 0 |
virtual void | GetMemoryUsage ( RED::uint64 & oCPU, RED::uint64 & oGPU ) const = 0 |
virtual RED::Object * | GetPlanet ( ) const = 0 |
virtual double | GetPrivateShadowBias ( ) const = 0 |
virtual int | GetPrivateShadowMapSize ( ) const = 0 |
virtual RED::Object * | GetReflectionProbe ( int iIndex ) const = 0 |
virtual int | GetReflectionProbesCount ( ) const = 0 |
virtual const RED::Matrix & | GetRootMatrix ( ) const = 0 |
virtual const RED::Map< int, bool > & | GetSelectedSubMeshes ( ) const = 0 |
virtual double | GetTextureDefinition ( ) const = 0 |
virtual double | GetTextureLodBias ( ) const = 0 |
virtual RED_RC | GetVertexAO ( RED::Vector< unsigned char > & oAOValues, int & oAOSizeOpaque, int & oAOSizeTranspar, int & oAOSizeMasked, int & oAOSizePBROpaque ) = 0 |
virtual RED_RC | GetVertexGI ( RED::Vector< unsigned char > & oGIValues, int & oGISizeOpaque, int & oGISizeTranspar, int & oGISizeMasked, int & oGISizePBROpaque ) = 0 |
virtual RED_RC | GetVerticesCount ( int & oCount, ART::GEOMETRY_SHAPE iShape ) const = 0 |
virtual bool | HasPrivateShadowMap ( ) const = 0 |
virtual RED_RC | InsertReflectionProbe ( RED::Object * iReflectionProbe, int iIndex ) = 0 |
virtual bool | IsAutomaticSetOnGround ( ) const = 0 |
virtual bool | IsSelected ( ) const = 0 |
virtual bool | IsSelectedLight ( int iIndex ) const = 0 |
virtual bool | IsSelectedSubMesh ( int iID ) const = 0 |
virtual RED_RC | RefreshMaterial ( bool & oNeedPlanetRefresh, int iMaterialIndex = -1, bool iCreateAtlas = true, bool iSkipMeshRebuild = false ) = 0 |
virtual void | SetAutomaticSetOnGround ( bool iAuto ) = 0 |
virtual void | SetCSMCount ( int iCSMCount ) = 0 |
virtual RED_RC | SetGICaches ( const RED::Vector< RED::Vector< RED::Object * > > & iGICaches, const RED::Vector< RED::Vector< RED::Object * > > & iGICachesBakedLights, const RED::Vector< RED::Object * > & iAOCaches, float iLandscapeAO ) = 0 |
virtual RED_RC | SetGICachesMultiplier ( double iMult ) = 0 |
virtual RED_RC | SetGroundAOCache ( const RED::Vector< unsigned char > & iGroundAO, int iGroundAORes, const double iGroundBC[3] ) = 0 |
virtual void | SetPrivateShadowBias ( double iBias ) = 0 |
virtual void | SetPrivateShadowMap ( bool iPrivate ) = 0 |
virtual void | SetPrivateShadowMapSize ( int iSize ) = 0 |
virtual RED_RC | SetRootMatrix ( const RED::Matrix & iMatrix ) = 0 |
virtual void | SetSelected ( bool iSelect ) = 0 |
virtual RED_RC | SetSelectedLight ( int iIndex, bool iSelect ) = 0 |
virtual RED_RC | SetSelectedSubMesh ( int iID, bool iSelect ) = 0 |
virtual void | SetTextureDefinition ( double iTextureDefinition ) = 0 |
virtual void | SetTextureLodBias ( double iTextureLodBias ) = 0 |
virtual RED_RC | SetVertexAO ( const RED::Vector< unsigned char > & iAOValues, int iAOSizeOpaque, int iAOSizeTranspar, int iAOSizeMasked, int iAOSizePBROpaque, double iAOProfile ) = 0 |
virtual RED_RC | SetVertexGI ( const RED::Vector< unsigned char > & iGIValues, int iGISizeOpaque, int iGISizeTranspar, int iGISizeMasked, int iGISizePBROpaque, double iGIMult ) = 0 |
Public static functions:
static RED::CID | GetClassID ( ) |
Functions documentation
public static RED::CID ART::IGeometry::GetClassID | ( | ) |
public virtual RED_RC ART::IGeometry::AddReflectionProbe | ( | RED::Object * | iReflectionProbe | ) = 0 |
Adds a reflection probe to the geometry.
Parameters:
iReflectionProbe: | The ART::ReflectionProbe object to add to the geometry. |
Returns:
RED_BAD_PARAM if iReflectionProbe is not a valid ART::ReflectionProbe object,
RED_FAIL otherwise.
public virtual RED_RC ART::IGeometry::DestroyReflectionProbe | ( | int | iIndex | ) = 0 |
Removes and deletes the reflection probe at the given index from the geometry.
Parameters:
iIndex: | Position where to remove the reflection probe. |
Returns:
RED_BAD_PARAM if iIndex is not a valid index,
RED_FAIL otherwise.
public virtual int ART::IGeometry::GetCSMCount | ( | ) const = 0 |
Returns:
public virtual double ART::IGeometry::GetGICachesMultiplier | ( | ) const = 0 |
Returns:
public virtual int ART::IGeometry::GetGISamplesCount | ( | ) const = 0 |
Gets the number of samples stored in the GI cache of the geometry (does not consider light caches).
Returns:
public virtual RED::Object * ART::IGeometry::GetLight | ( | int | iIndex | ) const = 0 |
Gets the light by its index.
Parameters:
iIndex: | the index of the light. |
Returns:
public virtual int ART::IGeometry::GetLightsCount | ( | ) const = 0 |
Gets the number of lights associated to the geometry.
Returns:
public virtual RED::Object * ART::IGeometry::GetMaterial | ( | int | iIndex | ) const = 0 |
Gets a material by its index.
Parameters:
iIndex: | Index of the material to retrieve. |
Returns:
public virtual int ART::IGeometry::GetMaterialsCount | ( | ) const = 0 |
Gets the number of materials in the geometry.
Returns:
public virtual void ART::IGeometry::GetMemoryUsage | ( | RED::uint64 & | oCPU, |
RED::uint64 & | oGPU | ||
) | const = 0 |
Get the memory used by the geometry, both CPU and GPU.
Memory returned is approximative and based on the amount of data stored, not on allocated memory that may be paged or not by the system.
Parameters:
oCPU: | CPU memory being used. |
oGPU: | GPU memory being used. |
public virtual RED::Object * ART::IGeometry::GetPlanet | ( | ) const = 0 |
public virtual double ART::IGeometry::GetPrivateShadowBias | ( | ) const = 0 |
Gets the private shadow bias.
Returns:
public virtual int ART::IGeometry::GetPrivateShadowMapSize | ( | ) const = 0 |
Gets the private shadow map size.
Returns:
public virtual RED::Object * ART::IGeometry::GetReflectionProbe | ( | int | iIndex | ) const = 0 |
Gets a reflection probe by its index.
Parameters:
iIndex: | Index of the reflection probe to retrieve. |
Returns:
public virtual int ART::IGeometry::GetReflectionProbesCount | ( | ) const = 0 |
Gets the number of reflection probes in the geometry.
Returns:
public virtual const RED::Matrix & ART::IGeometry::GetRootMatrix | ( | ) const = 0 |
Returns:
public virtual const RED::Map< int, bool > & ART::IGeometry::GetSelectedSubMeshes | ( | ) const = 0 |
Gets a list of all the selected sub-meshes.
The return map is the list of sub-mesh ids associated to a boolean set to true if the sub-mesh is selected and false otherwise.
Returns:
public virtual double ART::IGeometry::GetTextureDefinition | ( | ) const = 0 |
Gets the atlas texture definition in pixel per meter.
This value is used to control the mipmap change threshold.
Returns:
public virtual double ART::IGeometry::GetTextureLodBias | ( | ) const = 0 |
Gets the texture lod bias value.
Returns:
public virtual RED_RC ART::IGeometry::GetVertexAO | ( | RED::Vector< unsigned char > & | oAOValues, |
int & | oAOSizeOpaque, | ||
int & | oAOSizeTranspar, | ||
int & | oAOSizeMasked, | ||
int & | oAOSizePBROpaque | ||
) | = 0 |
Access the vertex AO values.
Parameters:
oAOValues: | Ambient occlusion values for each vertex of the geometry. |
oAOSizeOpaque: | Number of values for the opaque mesh. |
oAOSizeTranspar: | Number of values for the transparent mesh. |
oAOSizeMasked: | Number of values for the masked mesh. |
oAOSizePBROpaque: | Number of values for the PBR opaque mesh. |
public virtual RED_RC ART::IGeometry::GetVertexGI | ( | RED::Vector< unsigned char > & | oGIValues, |
int & | oGISizeOpaque, | ||
int & | oGISizeTranspar, | ||
int & | oGISizeMasked, | ||
int & | oGISizePBROpaque | ||
) | = 0 |
Access vertex GI values.
Parameters:
oGIValues: | GIvalues for each vertices of the geometry. |
oGISizeOpaque: | Number of values for the opaque mesh. |
oGISizeTranspar: | Number of values for the transparent mesh. |
oGISizeMasked: | Number of values for the masked mesh. |
oGISizePBROpaque: | Number of values for the PBR opaque mesh. |
public virtual RED_RC ART::IGeometry::GetVerticesCount | ( | int & | oCount, |
ART::GEOMETRY_SHAPE | iShape | ||
) | const = 0 |
public virtual bool ART::IGeometry::HasPrivateShadowMap | ( | ) const = 0 |
Tests whether the geometry uses a private shadow map or not.
Returns:
public virtual RED_RC ART::IGeometry::InsertReflectionProbe | ( | RED::Object * | iReflectionProbe, |
int | iIndex | ||
) | = 0 |
Adds a reflection probe to the geometry at a given index.
Parameters:
iReflectionProbe: | The ART::ReflectionProbe object to add to the geometry. |
iIndex: | Position where to insert the reflection probe. |
Returns:
RED_BAD_PARAM if iReflectionProbe is not a valid ART::ReflectionProbe object,
RED_FAIL otherwise.
public virtual bool ART::IGeometry::IsAutomaticSetOnGround | ( | ) const = 0 |
Returns:
public virtual bool ART::IGeometry::IsSelected | ( | ) const = 0 |
Gets the geometry selection feedback flag.
Returns:
public virtual bool ART::IGeometry::IsSelectedLight | ( | int | iIndex | ) const = 0 |
Tests if the light at the given index is selected.
Parameters:
iIndex: | The index of the light to query. |
Returns:
public virtual bool ART::IGeometry::IsSelectedSubMesh | ( | int | iID | ) const = 0 |
Tests if sub-meshes with a given material ID are selected.
Parameters:
iID: | The ID to query. |
Returns:
public virtual RED_RC ART::IGeometry::RefreshMaterial | ( | bool & | oNeedPlanetRefresh, |
int | iMaterialIndex = -1, | ||
bool | iCreateAtlas = true, | ||
bool | iSkipMeshRebuild = false | ||
) | = 0 |
Refreshes the materials of the geometry.
This method must be called to apply any ART::IMaterial update to the geometry materials.
If the geometry have multiple instances, this method must be called once on a single instance. The other instances must be updated using the ART::IGeometry::InstanceSetup method.
If oNeedPlanetRefresh is true after calling this function, a call to ART::IPlanet::RefreshGeometry is necessary to visualize the refresh.
Parameters:
oNeedPlanetRefresh: | returned boolean indicating if the planet needs to refresh the geometry after the call. |
iMaterialIndex: | index of the material to update. -1 to force update all the materials. |
iCreateAtlas: | This parameter should be equal to the same parameter in ART::IAssetManager::CreateGeometry. If false, no atlas creation will take place. |
iSkipMeshRebuild: | If true, the mesh layout will not be updated and it must be done outside this method. |
Returns:
public virtual void ART::IGeometry::SetAutomaticSetOnGround | ( | bool | iAuto | ) = 0 |
Defines if the geometry should be placed on the planet ground or not.
This method works with the ART::IPlanet::AddGeometry call. On adding a geometry, if iAuto is true, the geometry is automatically set on the landscape ground. If iAuto is false, the geometry remains at the specified input position. By default, a geometry is automatically set on ground.
Parameters:
iAuto: | true to automatically set the geometry on the ground when it gets added to a planet. |
public virtual void ART::IGeometry::SetCSMCount | ( | int | iCSMCount | ) = 0 |
Sets the number of star cascaded shadow maps for which this geometry casts shadows.
Parameters:
iCSMCount: | The number of CSMs to consider. Silently clamped to [ 0, world->GetStarCSMCount() ]. |
public virtual RED_RC ART::IGeometry::SetGICaches | ( | const RED::Vector< RED::Vector< RED::Object * > > & | iGICaches, |
const RED::Vector< RED::Vector< RED::Object * > > & | iGICachesBakedLights, | ||
const RED::Vector< RED::Object * > & | iAOCaches, | ||
float | iLandscapeAO | ||
) | = 0 |
Sets the GI cache data.
If the geometry is a reference geometry, GI caches received are stored by it and will be deleted by it. These caches must have been generated or loaded by the ART::IAssetManager. A set of caches retrieved from the resource manager can be set once into a geometry reference, otherwise redundant destructions will occur. If the geometry is an instance geometry, GI caches are only pointed to.
Parameters:
iGICaches: | List of GI caches for each sun position of the geodesic sphere. |
iGICachesBakedLights: | List of GI caches for each baked light. |
iAOCaches: | List of ambient occlusion caches. |
iLandscapeAO; | The value of the AO field surrounding the geometry. |
Returns:
public virtual RED_RC ART::IGeometry::SetGICachesMultiplier | ( | double | iMult | ) = 0 |
Apply an intensity multiplier to the geometry GI caches.
The value of iMultiplier is applied to the GI cache of the geometry in order to strengthen or to weaken the GI of that geometry in the context of a given scene, relatively to other elements displayed.
Parameters:
iMult: | Intensity multiplier applied to GI caches. Must be positive or zero. |
Returns:
public virtual RED_RC ART::IGeometry::SetGroundAOCache | ( | const RED::Vector< unsigned char > & | iGroundAO, |
int | iGroundAORes, | ||
const double | iGroundBC[3] | ||
) | = 0 |
Sets the geometry ambient occlusion cache for the ground.
Parameters:
iGroundAO: | ground AO cache. |
iGroundAORes: | Size in pixels of the ground AO cache which is (res x res). |
iGroundBC: | bounding circle of the ground AO (x, y, radius). |
Returns:
RED_BAD_PARAM if the method has received an invalid parameter,
RED_FAIL otherwise.
public virtual void ART::IGeometry::SetPrivateShadowBias | ( | double | iBias | ) = 0 |
Sets the private shadow bias used in shading.
Parameters:
iBias: | bias to set to the private shadow. |
public virtual void ART::IGeometry::SetPrivateShadowMap | ( | bool | iPrivate | ) = 0 |
Sets a private shadow map for this geometry.
The private shadow map replaces the global CSM for this geometry.
Parameters:
iPrivate: | true to use a private shadow map. |
public virtual void ART::IGeometry::SetPrivateShadowMapSize | ( | int | iSize | ) = 0 |
Sets the private shadow map size.
Parameters:
iSize: | size to set to the private shadow map. |
public virtual RED_RC ART::IGeometry::SetRootMatrix | ( | const RED::Matrix & | iMatrix | ) = 0 |
public virtual void ART::IGeometry::SetSelected | ( | bool | iSelect | ) = 0 |
Sets the geometry selection feedback flag.
The geometry selection feedback flag can be directly set to highlight or unhighlight the geometry.
Parameters:
iSelect: | Set to true to have the geometry selected and highlighted, set to false to unselect it. |
public virtual RED_RC ART::IGeometry::SetSelectedLight | ( | int | iIndex, |
bool | iSelect | ||
) | = 0 |
Selects a light by its number.
Parameters:
iIndex: | The index of the light to select. |
iSelect: | Set to true to that light selected, set to false to unselect it. |
Returns:
RED_ALLOC_FAILURE if a memory allocation has failed,
RED_FAIL otherwise.
public virtual RED_RC ART::IGeometry::SetSelectedSubMesh | ( | int | iID, |
bool | iSelect | ||
) | = 0 |
Selects sub-meshes by the material IDs they own.
Parameters:
iID: | The ID to select. |
iSelect: | Set to true to have all sub-meshes using iID selected and highlighted, set to false to unselect them. |
Returns:
RED_ALLOC_FAILURE if a memory allocation has failed,
RED_FAIL otherwise.
public virtual void ART::IGeometry::SetTextureDefinition | ( | double | iTextureDefinition | ) = 0 |
Sets the texture texel definition in pixel per meter.
Parameters:
iTextureDefinition: | texture definition value. |
public virtual void ART::IGeometry::SetTextureLodBias | ( | double | iTextureLodBias | ) = 0 |
Sets the texture lod bias value.
Parameters:
iTextureLodBias: | texture lod bias value. |
public virtual RED_RC ART::IGeometry::SetVertexAO | ( | const RED::Vector< unsigned char > & | iAOValues, |
int | iAOSizeOpaque, | ||
int | iAOSizeTranspar, | ||
int | iAOSizeMasked, | ||
int | iAOSizePBROpaque, | ||
double | iAOProfile | ||
) | = 0 |
Sets the vertex AO values.
This function must be called in place of ART::IGeometry::SetGICache to get a cheaper ambient occlusion.
The array of values must contains all the AO values for opaque mesh vertices followed by all the AO values for transparent mesh vertices and then masked and PBR. Its size is iAOSizeOpaque + iAOSizeTranspar + iAOSizeMasked + iAOSizePBROpaque.
Values are supplied as unsigned char, 255 being no occlusion, 0 being fully occluded. If no values are supplied (empty array and zero sizes) a white (255) AO is being setup.
The number of vertices in a geometry can be queried using ART::IGeometry::GetVerticesCount. The ART::IAssetManager::GenerateGeometryVertexGI calculates AO and GI values for a given geometry.
Parameters:
iAOValues: | Ambient occlusion values for each vertex of the geometry. |
iAOSizeOpaque: | Number of values for the opaque mesh. |
iAOSizeTranspar: | Number of values for the transparent mesh. |
iAOSizeMasked: | Number of values for the masked mesh. |
iAOSizePBROpaque: | Number of values for the PBR opaque mesh. |
iAOProfile: | Profiling of the AO ao = pow( ao, iAOProfile ). |
Returns:
public virtual RED_RC ART::IGeometry::SetVertexGI | ( | const RED::Vector< unsigned char > & | iGIValues, |
int | iGISizeOpaque, | ||
int | iGISizeTranspar, | ||
int | iGISizeMasked, | ||
int | iGISizePBROpaque, | ||
double | iGIMult | ||
) | = 0 |
Sets the vertex GI color.
This function must be called in place of ART::IGeometry::SetGICache to get a cheaper global illumination.
The array of values must contains all the GI values for opaque mesh vertices followed by all the AO values for transparent mesh vertices and then masked and PBR. Its size is iAOSizeOpaque + iAOSizeTranspar + iAOSizeMasked + iAOSizePBROpaque.
Values are supplied using colors: (R,G,B) unsigned chars for each vertex. So the side of iGIValues is x 3 the number of vertices.
If no values are supplied (empty array and zero sizes), a dark grey tint is setup ( 64, 64, 64 ).
The number of vertices in a geometry can be queried using ART::IGeometry::GetVerticesCount. The ART::IAssetManager::GenerateGeometryVertexGI calculates AO and GI values for a given geometry.
Parameters:
iGIValues: | GIvalues for each vertices of the geometry. |
iGISizeOpaque: | Number of values for the opaque mesh. |
iGISizeTranspar: | Number of values for the transparent mesh. |
iGISizeMasked: | Number of values for the masked mesh. |
iGISizePBROpaque: | Number of values for the PBR opaque mesh. |
iGIMult: | Multiplier of the GI intensity. GI values are clamped to white. |
Returns: