Table of Contents

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

masterPool MeshDataPoolMasterManager

The master pool manager these pools belong to

frustumCuller FrustumCulling

The frustum culler for the pool

capi ICoreClientAPI

The client API

defaultVertexPoolSize int

Default vertex buffer size

defaultIndexPoolSize int

Default index buffer size

maxPartsPerPool int

Maximum number of parts in one pool

customFloats CustomMeshDataPartFloat

Extra float data

customShorts CustomMeshDataPartShort

Extra short data

customBytes CustomMeshDataPartByte

Extra byte data

customInts CustomMeshDataPartInt

Extra 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

modeldata MeshData

The model data

modelOrigin Vec3i

Model origin in the world

dimension int

Dimension (normal world or mini dimension)

frustumCullSphere Sphere

The 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

usedVideoMemory long

Used video memory in bytes (added to the passed value)

renderedTris long

Drawn triangles (added)

allocatedTris long

Allocated 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

playerpos Vec3d

Player position

originUniformName string

Name of the uniform that receives the pool origin

frustumCullMode EnumFrustumCullMode

Culling mode, CullNormal by default