IMeshDynamic
Description
- Derived from
Base interface for dynamic continuous level-of-detail terrain meshes that perform view-dependent refinement at runtime.
The terrain mesh version (see IVersioned.Version) is incremented during MeshBuffer.MeshUpdate if the mesh structure has changed since the last call.
Dynamic CLOD meshes can be used to generate static terrain meshes: an application may create an instance of IMeshDynamic, poll until it reaches the RefinementStatus.Finished status and then extract vertex data (see IMesh.Vertices) and triangulation data (see IMesh.Triangulator). Refinement of CLOD meshes is not always deterministic, please refer to MeshBuffer for details. For fully deterministic behaviour (for example in a content pipeline), consider using MeshChunkBuilder instead.
Public / Methods
Resume
Resumes background refinement.
This method must be called iff AutoPause has been set to true
and background refinement has finished (i.e. when Status is RefinementStatus.Paused). Otherwise, refinement will not continue and the mesh structure will remain unchanged, even if the parameters of the visibility criterion are changed.
If this method is called in other cases it performs no action and silently returns.
Public / Attributes
AutoPause
Shall refinement be paused when it has finished?
When the background refinement has been paused, the application must explicitly resume it by calling Resume (usually when the visibility criterion parameters have changed).
Defaults to false
.
Locality
Returns the estimate cache-locality of the terrain.
A hypothetical cache page size of 64 vertices is assumed. During mesh refinement, the number of hit cache pages are counted, as well as the number of visited vertices. The cache-locality is then computed as follows:
Locality = PageCount * PageSize / VertexCount
Progress
Returns the estimate progress of the refinement, in percent.
A value of 100
means that refinement has reached an optimal mesh structure, i.e. no more vertices will be added to or removed from any terrain meshes.
QualityThreshold
The quality setting for mesh refinement.
The quality threshold value is passed to the IVisibleCheck.IsVertexVisible method of the meshes Visibility check. Quality increases with smaller threshold values. The interpretation of this value depends on the used visibility check (e.g. screen-space pixels or terrain-space units). The default value is 2.5
.
Visibility
The vertex visibility check that is used for mesh refinement.
The given IVisibleCheck object will be handed over to the refinement thread in a thread-safe manner. Then the IVertexArraysDependent.SetVertexArrays will be called once and the IVisibleCheck.IsVertexVisible method will be called repeatedly by the refinement thread. The implementation of IVisibleCheck should not allow modifications (thus making instances inherently thread-safe). Otherwise, the implementation is responsible for providing proper thread synchronization.
VisibleThreshold
Specifies the target visible vertex count for mesh refinement.
When the target visible vertex count is greater than zero, mesh refinement automatically adjusts the internal quality threshold value, in order to reach resp. maintain the target visible vertex count. In this case, the configured quality threshold (see QualityThreshold) is used as the lower boundary; i.e. the internal value will always be greater than or equal to the configured value.
Defaults to 0
.
- See also