class ART::IGeometry

Geometry interface for mesh manipulation.

#include <ARTIGeometry.h>

Inherits: IREDObject.

Public functions:

virtual RED_RCAddReflectionProbe ( RED::Object * iReflectionProbe ) = 0
virtual RED_RCDestroyReflectionProbe ( int iIndex ) = 0
virtual intGetCSMCount ( ) const = 0
virtual doubleGetGICachesMultiplier ( ) const = 0
virtual intGetGISamplesCount ( ) const = 0
virtual RED::Object *GetLight ( int iIndex ) const = 0
virtual intGetLightsCount ( ) const = 0
virtual RED::Object *GetMaterial ( int iIndex ) const = 0
virtual intGetMaterialsCount ( ) const = 0
virtual voidGetMemoryUsage ( RED::uint64 & oCPU, RED::uint64 & oGPU ) const = 0
virtual RED::Object *GetPlanet ( ) const = 0
virtual doubleGetPrivateShadowBias ( ) const = 0
virtual intGetPrivateShadowMapSize ( ) const = 0
virtual RED::Object *GetReflectionProbe ( int iIndex ) const = 0
virtual intGetReflectionProbesCount ( ) const = 0
virtual const RED::Matrix &GetRootMatrix ( ) const = 0
virtual const RED::Map< int, bool > &GetSelectedSubMeshes ( ) const = 0
virtual doubleGetTextureDefinition ( ) const = 0
virtual doubleGetTextureLodBias ( ) const = 0
virtual RED_RCGetVertexAO ( RED::Vector< unsigned char > & oAOValues, int & oAOSizeOpaque, int & oAOSizeTranspar, int & oAOSizeMasked, int & oAOSizePBROpaque ) = 0
virtual RED_RCGetVertexGI ( RED::Vector< unsigned char > & oGIValues, int & oGISizeOpaque, int & oGISizeTranspar, int & oGISizeMasked, int & oGISizePBROpaque ) = 0
virtual RED_RCGetVerticesCount ( int & oCount, ART::GEOMETRY_SHAPE iShape ) const = 0
virtual boolHasPrivateShadowMap ( ) const = 0
virtual RED_RCInsertReflectionProbe ( RED::Object * iReflectionProbe, int iIndex ) = 0
virtual boolIsAutomaticSetOnGround ( ) const = 0
virtual boolIsSelected ( ) const = 0
virtual boolIsSelectedLight ( int iIndex ) const = 0
virtual boolIsSelectedSubMesh ( int iID ) const = 0
virtual RED_RCRefreshMaterial ( bool & oNeedPlanetRefresh, int iMaterialIndex = -1, bool iCreateAtlas = true, bool iSkipMeshRebuild = false ) = 0
virtual voidSetAutomaticSetOnGround ( bool iAuto ) = 0
virtual voidSetCSMCount ( int iCSMCount ) = 0
virtual RED_RCSetGICaches ( 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_RCSetGICachesMultiplier ( double iMult ) = 0
virtual RED_RCSetGroundAOCache ( const RED::Vector< unsigned char > & iGroundAO, int iGroundAORes, const double iGroundBC[3] ) = 0
virtual voidSetPrivateShadowBias ( double iBias ) = 0
virtual voidSetPrivateShadowMap ( bool iPrivate ) = 0
virtual voidSetPrivateShadowMapSize ( int iSize ) = 0
virtual RED_RCSetRootMatrix ( const RED::Matrix & iMatrix ) = 0
virtual voidSetSelected ( bool iSelect ) = 0
virtual RED_RCSetSelectedLight ( int iIndex, bool iSelect ) = 0
virtual RED_RCSetSelectedSubMesh ( int iID, bool iSelect ) = 0
virtual voidSetTextureDefinition ( double iTextureDefinition ) = 0
virtual voidSetTextureLodBias ( double iTextureLodBias ) = 0
virtual RED_RCSetVertexAO ( const RED::Vector< unsigned char > & iAOValues, int iAOSizeOpaque, int iAOSizeTranspar, int iAOSizeMasked, int iAOSizePBROpaque, double iAOProfile ) = 0
virtual RED_RCSetVertexGI ( const RED::Vector< unsigned char > & iGIValues, int iGISizeOpaque, int iGISizeTranspar, int iGISizeMasked, int iGISizePBROpaque, double iGIMult ) = 0

Public static functions:

static RED::CIDGetClassID ( )

Functions documentation

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_OK if the method has succeeded,
RED_BAD_PARAM if iReflectionProbe is not a valid ART::ReflectionProbe object,
RED_FAIL otherwise.

Removes and deletes the reflection probe at the given index from the geometry.

Parameters:

iIndex:Position where to remove the reflection probe.

Returns:

RED_OK if the method has succeeded,
RED_BAD_PARAM if iIndex is not a valid index,
RED_FAIL otherwise.
public virtual int ART::IGeometry::GetCSMCount() const = 0

Returns:

The number of star cascaded shadow maps for which this geometry casts shadows.
public virtual double ART::IGeometry::GetGICachesMultiplier() const = 0

Returns:

The GI caches intensity multiplier value.
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:

the number of GI cache samples.
public virtual RED::Object * ART::IGeometry::GetLight(intiIndex) const = 0

Gets the light by its index.

Parameters:

iIndex:the index of the light.

Returns:

the light as ART::ILight.
public virtual int ART::IGeometry::GetLightsCount() const = 0

Gets the number of lights associated to the geometry.

Returns:

the number of lights.
public virtual RED::Object * ART::IGeometry::GetMaterial(intiIndex) const = 0

Gets a material by its index.

Parameters:

iIndex:Index of the material to retrieve.

Returns:

the material at the iIndex position as a ART::IMaterial.
public virtual int ART::IGeometry::GetMaterialsCount() const = 0

Gets the number of materials in the geometry.

Returns:

the number of materials.
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

Gets the planet holding the geometry.

Returns:

the planet as a ART::IPlanet, NULL if it has none.
public virtual double ART::IGeometry::GetPrivateShadowBias() const = 0

Gets the private shadow bias.

Returns:

the private shadow bias.
public virtual int ART::IGeometry::GetPrivateShadowMapSize() const = 0

Gets the private shadow map size.

Returns:

the private shadow map size in pixel.
public virtual RED::Object * ART::IGeometry::GetReflectionProbe(intiIndex) const = 0

Gets a reflection probe by its index.

Parameters:

iIndex:Index of the reflection probe to retrieve.

Returns:

the reflection probe as a ART::IReflectionProbe.

Gets the number of reflection probes in the geometry.

Returns:

the number of reflection probes.
public virtual const RED::Matrix & ART::IGeometry::GetRootMatrix() const = 0

Returns:

The root matrix of the geometry.
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:

The list of selected sub-meshes.
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:

the texture definition (pix/m).
public virtual double ART::IGeometry::GetTextureLodBias() const = 0

Gets the texture lod bias value.

Returns:

the texture lod bias value.
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_SHAPEiShape
)const = 0

Gets the number of vertices of the meshes under the geometry.

Parameters:

oCount:returned number of vertices.
iShape:the mesh shape to get the vertices count.

Returns:

RED_OK if the method has succeeded,
RED_FAIL otherwise.
public virtual bool ART::IGeometry::HasPrivateShadowMap() const = 0

Tests whether the geometry uses a private shadow map or not.

Returns:

true if the geometry uses a private shadow map. False otherwise.
public virtual RED_RC ART::IGeometry::InsertReflectionProbe(RED::Object *iReflectionProbe,
intiIndex
) = 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_OK if the method has succeeded,
RED_BAD_PARAM if iReflectionProbe is not a valid ART::ReflectionProbe object,
RED_FAIL otherwise.
public virtual bool ART::IGeometry::IsAutomaticSetOnGround() const = 0

Returns:

true if the geometry has an automatic on ground placement.
public virtual bool ART::IGeometry::IsSelected() const = 0

Gets the geometry selection feedback flag.

Returns:

true if the geometry is selected, false otherwise.
public virtual bool ART::IGeometry::IsSelectedLight(intiIndex) const = 0

Tests if the light at the given index is selected.

Parameters:

iIndex:The index of the light to query.

Returns:

true if the iIndex-th light of the geometry is selected, false otherwise.
public virtual bool ART::IGeometry::IsSelectedSubMesh(intiID) const = 0

Tests if sub-meshes with a given material ID are selected.

Parameters:

iID:The ID to query.

Returns:

true if sub-meshes whose ID is iID are selected, false otherwise.
public virtual RED_RC ART::IGeometry::RefreshMaterial(bool &oNeedPlanetRefresh,
intiMaterialIndex = -1,
booliCreateAtlas = true,
booliSkipMeshRebuild = 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:

RED_OK if the operation has succeeded,
Any other RED_RC otherwise.
public virtual void ART::IGeometry::SetAutomaticSetOnGround(booliAuto) = 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(intiCSMCount) = 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,
floatiLandscapeAO
) = 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:

RED_OK if the method has succeeded,
RED_FAIL otherwise.
public virtual RED_RC ART::IGeometry::SetGICachesMultiplier(doubleiMult) = 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:

RED_OK if the method has succeeded,
RED_BAD_PARAM if iGICacheMult was negative.
public virtual RED_RC ART::IGeometry::SetGroundAOCache(const RED::Vector< unsigned char > &iGroundAO,
intiGroundAORes,
const doubleiGroundBC[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_OK if the method has succeeded,
RED_BAD_PARAM if the method has received an invalid parameter,
RED_FAIL otherwise.
public virtual void ART::IGeometry::SetPrivateShadowBias(doubleiBias) = 0

Sets the private shadow bias used in shading.

Parameters:

iBias:bias to set to the private shadow.
public virtual void ART::IGeometry::SetPrivateShadowMap(booliPrivate) = 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(intiSize) = 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

Sets the root shape matrix of the geometry.

Parameters:

iMatrix:the new root shape matrix.

Returns:

RED_OK if the method has succeeded,
RED_FAIL otherwise.
public virtual void ART::IGeometry::SetSelected(booliSelect) = 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(intiIndex,
booliSelect
) = 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_OK if the operation has succeeded,
RED_ALLOC_FAILURE if a memory allocation has failed,
RED_FAIL otherwise.
public virtual RED_RC ART::IGeometry::SetSelectedSubMesh(intiID,
booliSelect
) = 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_OK if the operation has succeeded,
RED_ALLOC_FAILURE if a memory allocation has failed,
RED_FAIL otherwise.
public virtual void ART::IGeometry::SetTextureDefinition(doubleiTextureDefinition) = 0

Sets the texture texel definition in pixel per meter.

Parameters:

iTextureDefinition:texture definition value.
public virtual void ART::IGeometry::SetTextureLodBias(doubleiTextureLodBias) = 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,
intiAOSizeOpaque,
intiAOSizeTranspar,
intiAOSizeMasked,
intiAOSizePBROpaque,
doubleiAOProfile
) = 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:

RED_OK if the method has succeeded,
RED_FAIL otherwise.
public virtual RED_RC ART::IGeometry::SetVertexGI(const RED::Vector< unsigned char > &iGIValues,
intiGISizeOpaque,
intiGISizeTranspar,
intiGISizeMasked,
intiGISizePBROpaque,
doubleiGIMult
) = 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:

RED_OK if the method has succeeded,
RED_FAIL otherwise.