Class MeshDataPoolManager
- Namespace
- Vintagestory.API.Client
- Assembly
- VintagestoryAPI.dll
Holds a set of pools, usually for one render pass. A new mesh is first offered to the existing pools and if none of them takes it, a new pool is created. 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 pool manager
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 pool manager these pools belong to
frustumCullerFrustumCullingThe frustum culler for the pool
capiICoreClientAPIThe client API
defaultVertexPoolSizeintDefault vertex buffer size
defaultIndexPoolSizeintDefault index buffer size
maxPartsPerPoolintMaximum number of parts in one pool
customFloatsCustomMeshDataPartFloatExtra float data
customShortsCustomMeshDataPartShortExtra short data
customBytesCustomMeshDataPartByteExtra byte data
customIntsCustomMeshDataPartIntExtra int data
Methods
AddModel(MeshData, Vec3i, int, Sphere)
Adds a model to the pool. It first tries every existing pool and if none has room, a new pool is created.
public ModelDataPoolLocation? AddModel(MeshData modeldata, Vec3i modelOrigin, int dimension, Sphere frustumCullSphere)
Parameters
modeldataMeshDataThe model data
modelOriginVec3iModel origin in the world
dimensionintDimension (normal world or mini dimension)
frustumCullSphereSphereThe sphere used for culling
Returns
- ModelDataPoolLocation
A handle to the place of the model in the pool
GetStats(ref long, ref long, ref long)
Collects stats over the pools: how much video memory is used, how many triangles were drawn and how many are allocated
public void GetStats(ref long usedVideoMemory, ref long renderedTris, ref long allocatedTris)
Parameters
usedVideoMemorylongUsed video memory in bytes (added to the passed value)
renderedTrislongDrawn triangles (added)
allocatedTrislongAllocated triangles (added)
Render(Vec3d, string, EnumFrustumCullMode)
Draws the chunk models on the GPU. One of the most important methods in the whole game.
public void Render(Vec3d playerpos, string originUniformName, EnumFrustumCullMode frustumCullMode = EnumFrustumCullMode.CullNormal)
Parameters
playerposVec3dPlayer position
originUniformNamestringName of the uniform that receives the pool origin
frustumCullModeEnumFrustumCullModeCulling mode, CullNormal by default