Voxel Renderer

A component that lets you draw voxels.

Check out the Getting Started page to see how to use this component.

Properties

Voxel Types used by this renderer.

public List<VoxelType> VoxelTypes { get; set; }

Controls the shadow casting mode of this renderer.

public ShadowCastingMode CastShadows { get; set; }

Controls the rendering layers used by this renderer.

public uint LayerMask { get; set; }

The mesh built for rendering.

public Mesh Mesh { get; private set; }

The mesh built for collisions.

public Mesh CollisionMesh { get; private set; }

The VoxelArray used by this renderer.

public VoxelArray Voxels { get; private set; }

The current status of the renderer.

public VoxelRendererStatus Status { get; private set; }

Events

Called when the renderer finishes building a mesh.

public event Action Built;

Methods

Builds a mesh by transforming the provided VoxelArray into an optimized mesh. The mesh will be drawn by the renderer when the process is completed.

If useMultithreading is true, the meshing algorithm runs on a different thread, improving performance. However, this option can add some delay, so use it only if you don't need the result immediately.

public void Build(VoxelArray voxels, bool useMultithreading = true)

Last updated