Class MeshDataPoolManager
- Namespace
- Vintagestory.API.Client
- Assembly
- VintagestoryAPI.dll
Holds a collection of pools, usually for 1 render pass Open in GitHub
public class MeshDataPoolManager
- Inheritance
-
MeshDataPoolManager
- Inherited Members
- Extension Methods
Constructors
MeshDataPoolManager(MeshDataPoolMasterManager, FrustumCulling, ICoreClientAPI, int, int, int, CustomMeshDataPartFloat, CustomMeshDataPartShort, CustomMeshDataPartByte, CustomMeshDataPartInt)
Creates a new Mesh Data Pool
public MeshDataPoolManager(MeshDataPoolMasterManager masterPool, FrustumCulling frustumCuller, ICoreClientAPI capi, int defaultVertexPoolSize, int defaultIndexPoolSize, int maxPartsPerPool, CustomMeshDataPartFloat customFloats = null, CustomMeshDataPartShort customShorts = null, CustomMeshDataPartByte customBytes = null, CustomMeshDataPartInt customInts = null)
Parameters
masterPoolMeshDataPoolMasterManagerThe master mesh data pool manager
frustumCullerFrustumCullingthe Frustum Culler for the Pool
capiICoreClientAPIThe Client API
defaultVertexPoolSizeintSize allocated for the Vertices.
defaultIndexPoolSizeintSize allocated for the Indices
maxPartsPerPoolintThe maximum number of parts for this pool.
customFloatsCustomMeshDataPartFloatAdditional float data
customShortsCustomMeshDataPartShortcustomBytesCustomMeshDataPartByteAdditional byte data
customIntsCustomMeshDataPartIntadditional int data
Methods
AddModel(MeshData, Vec3i, int, Sphere)
Adds a model to the mesh pool.
public ModelDataPoolLocation AddModel(MeshData modeldata, Vec3i modelOrigin, int dimension, Sphere frustumCullSphere)
Parameters
modeldataMeshDataThe model data
modelOriginVec3iThe origin point of the Model
dimensionintfrustumCullSphereSphereThe culling sphere.
Returns
- ModelDataPoolLocation
The location identifier for the pooled model.
GetStats(ref long, ref long, ref long)
Gets the stats of the model.
public void GetStats(ref long usedVideoMemory, ref long renderedTris, ref long allocatedTris)
Parameters
usedVideoMemorylongThe amount of memory used by this pool.
renderedTrislongThe number of Tris rendered by this pool.
allocatedTrislongThe number of tris allocated by this pool.
Render(Vec3d, string, EnumFrustumCullMode)
Renders the chunk models to the GPU. One of the most important methods in the entire game!
public void Render(Vec3d playerpos, string originUniformName, EnumFrustumCullMode frustumCullMode = EnumFrustumCullMode.CullNormal)
Parameters
playerposVec3dThe position of the Player
originUniformNamestringfrustumCullModeEnumFrustumCullModeThe culling mode. Default is CulHideDelay.