C# Class Axiom.Core.InstancedGeometry

Pre-transforms and batches up meshes for efficient use as instanced geometry in a scene Shader instancing allows to save both memory and draw calls. While StaticGeometry stores 500 times the same object in a batch to display 500 objects, this shader instancing implementation stores only 80 times the object, and then re-uses the vertex data with different shader parameter. Although you save memory, you make more draw call. However, you still make less draw calls than if you were rendering each object independently. Plus, you can move the batched objects independently of one another which you cannot do with StaticGeometry.
Afficher le fichier Open project: WolfgangSt/axiom Class Usage Examples

Protected Properties

Свойство Type Description
mBatchInstanceDimensions Vector3
mBuilt bool
mCastShadows bool
mHalfBatchInstanceDimensions Vector3
mName String
mOrigin Vector3
mOwner SceneManager
mSquaredUpperDistance float
mUpperDistance float
mVisible bool

Méthodes publiques

Méthode Description
AddEntity ( Entity ent, Vector3 position ) : void
AddEntity ( Entity ent, Vector3 position, Quaternion orientation ) : void
AddEntity ( Entity ent, Vector3 position, Quaternion orientation, Vector3 scale ) : void

Adds an Entity to the static geometry. This method takes an existing Entity and adds its details to the list of elements to include when building. Note that the Entity itself is not copied or referenced in this method; an Entity is passed simply so that you can change the materials of attached SubEntity objects if you want. You can add the same Entity instance multiple times with different material settings completely safely, and destroy the Entity before destroying this InstancedGeometry if you like. The Entity passed in is simply Must be called before 'Build'.

AddEntity ( Entity ent, Vector3 position, Vector3 scale ) : void
AddSceneNode ( SceneNode node ) : void

adds all the Entity objects attached to a SceneNode and all it's children to the static geometry. This method performs just like addEntity, except it adds all the entities attached to an entire sub-tree to the geometry. The position / orientation / scale parameters are taken from the node structure instead of being specified manually.

DetermineGeometry ( SubMesh sm ) : List

Look up or calculate the geometry data to use for this SubMesh

InstancedGeometry ( SceneManager owner, String name ) : System
SplitGeometry ( VertexData vd, IndexData id, Axiom.Core.SubMeshLodGeometryLink &targetGeomLink ) : void

Split some shared geometry into dedicated geometry.

Private Methods

Méthode Description
BuildIndexRemap ( uint pBuffer, int numIndexes, int>.Dictionary &remap ) : void
BuildIndexRemap ( ushort pBuffer, int numIndexes, int>.Dictionary &remap ) : void
RemapIndexes ( uint src, uint dst, int>.Dictionary &remap, int numIndexes ) : void
RemapIndexes ( ushort src, ushort dst, int>.Dictionary &remap, int numIndexes ) : void

Method Details

AddEntity() public méthode

public AddEntity ( Entity ent, Vector3 position ) : void
ent Entity
position Vector3
Résultat void

AddEntity() public méthode

public AddEntity ( Entity ent, Vector3 position, Quaternion orientation ) : void
ent Entity
position Vector3
orientation Axiom.Math.Quaternion
Résultat void

AddEntity() public méthode

Adds an Entity to the static geometry. This method takes an existing Entity and adds its details to the list of elements to include when building. Note that the Entity itself is not copied or referenced in this method; an Entity is passed simply so that you can change the materials of attached SubEntity objects if you want. You can add the same Entity instance multiple times with different material settings completely safely, and destroy the Entity before destroying this InstancedGeometry if you like. The Entity passed in is simply Must be called before 'Build'.
public AddEntity ( Entity ent, Vector3 position, Quaternion orientation, Vector3 scale ) : void
ent Entity The Entity to use as a definition (the Mesh and Materials /// referenced will be recorded for the build call).
position Vector3 The world position at which to add this Entity
orientation Axiom.Math.Quaternion The world orientation at which to add this Entity
scale Vector3
Résultat void

AddEntity() public méthode

public AddEntity ( Entity ent, Vector3 position, Vector3 scale ) : void
ent Entity
position Vector3
scale Vector3
Résultat void

AddSceneNode() public méthode

adds all the Entity objects attached to a SceneNode and all it's children to the static geometry. This method performs just like addEntity, except it adds all the entities attached to an entire sub-tree to the geometry. The position / orientation / scale parameters are taken from the node structure instead of being specified manually.
public AddSceneNode ( SceneNode node ) : void
node SceneNode
Résultat void

DetermineGeometry() public méthode

Look up or calculate the geometry data to use for this SubMesh
public DetermineGeometry ( SubMesh sm ) : List
sm SubMesh
Résultat List

InstancedGeometry() public méthode

public InstancedGeometry ( SceneManager owner, String name ) : System
owner SceneManager
name String
Résultat System

SplitGeometry() public méthode

Split some shared geometry into dedicated geometry.
public SplitGeometry ( VertexData vd, IndexData id, Axiom.Core.SubMeshLodGeometryLink &targetGeomLink ) : void
vd Axiom.Graphics.VertexData
id Axiom.Graphics.IndexData
targetGeomLink Axiom.Core.SubMeshLodGeometryLink
Résultat void

Property Details

mBatchInstanceDimensions protected_oe property

protected Vector3 mBatchInstanceDimensions
Résultat Vector3

mBuilt protected_oe property

protected bool mBuilt
Résultat bool

mCastShadows protected_oe property

protected bool mCastShadows
Résultat bool

mHalfBatchInstanceDimensions protected_oe property

protected Vector3 mHalfBatchInstanceDimensions
Résultat Vector3

mName protected_oe property

protected String mName
Résultat String

mOrigin protected_oe property

protected Vector3 mOrigin
Résultat Vector3

mOwner protected_oe property

protected SceneManager,Axiom.Core mOwner
Résultat SceneManager

mSquaredUpperDistance protected_oe property

protected float mSquaredUpperDistance
Résultat float

mUpperDistance protected_oe property

protected float mUpperDistance
Résultat float

mVisible protected_oe property

protected bool mVisible
Résultat bool