Post

VOXEL5 Documentation

Documentation of VOXEL5, an Unreal Engine 5 plugin

VOXEL5 Documentation

About Voxel5

Voxel5 is a plugin for Unreal Engine 5 that brings sophisticated voxelization capabilities to your development workflow. Whether you’re working with static meshes, skeletal meshes, or blueprints with multiple renderable components, Voxel5 allows you to transform them into voxel-based representations with precision and flexibility. Key features and Video intro

Sampler

The sampler window

To access the Voxel5 Sampler window, check out window | voxelizer

Open voxel5 sampler from menu

  • The sampler window

Sampler window

  • To sample an object, simply select the object in the scene, then choose a voxel size, then click “Start Sampling” button, the result is saved to <SavePath/SaveName>
  • If the ‘Generate Texture’ option is checked, it generates one texture containing all the base color information for the voxels and another texture with all the PBR attributes. These are additional data you can use as needed, while the voxels still retain their sampled color and PBR information.
  • If the ‘Add voxelized model to current scene’ option is checked, it will add a voxelized model as an instanced static mesh actor.

    Demonstrate

sampling a car

During the process, a progress bar will appear at the bottom-right corner of the screen.

sampling progress

It can sample almost anything that is renderable, including static meshes, skeletal meshes, particles, blueprints with renderable components, and more.

Currently, it captures only static frames, real-time voxelization for animation sequences will be supported in a future version.

Voxelmodel assets

voxel data assets

  • As a sampled result, it will generate a VoxelModelAsset in the Content Browser. This asset contains basic information such as the voxel size, the sampler used, local bounds, and an array of voxel data (including position, base color, and PBR attributes).







    voxel array is empty in details panel
  • In consideration of Unreal Slate’s performance, the items in the voxel array are not displayed in the details panel. However, the voxel array can still be accessed using the ‘Split Voxel Array’ blueprint node in Blueprint, and it is also callable from C++. split voxel array node

Instanced Static Mesh

Apply voxels to Instanced Static Meshes using the Blueprint included with the plugin.

  • The plugin includes a Blueprint named ‘VoxelPlayer’, which is a BP actor with an instanced static mesh component. You can set the VoxelModelAsset in the Blueprint and click the ‘Build Voxel’ button to generate voxels or the ‘Clear Voxels’ button to remove them. split voxel array node

Selecting an instanced static mesh component with thousands of instances may freeze the editor.

Apply voxles to any Instanced Static Mesh Component

  • You can also right-click any actor (in Scene view or Outliner ) that contains an instanced static mesh component and select ‘Fill Voxel’ or ‘Clear Voxel’ from the context menu. The VoxelModelAsset can be applied to any instanced static mesh component

Niagara

Check out the example for a more detailed and practical understanding of how the module works.

The key to making voxels work in Niagara is the Niagara Data Interface UNiagaraDataInterfaceVoxel5Model. This means that voxel data can be utilized in any particle systems you have already created!

Both worked in CPU sim and GPU sim
Voxel5 Niagara Data Interface

User Parameters

Check out the “User Parameter” section of the selected particle to set the voxel style and materials for each particle instance in the world. This allows you to customize the appearance and behavior of your particle system. User Parameters

Modules

/Voxel5Lib/Particles/Modules/NiagaraVoxel5ModelLoader

Module: NiagaraVoxel5ModelLoader

This module allows users to load voxel model data into a Niagara system and assign attributes such as position, PBR material properties, and base color to each particle.

  • Voxel Position -> Position
  • Base Color -> Particle Color
  • PBR Material Attributes -> Dynamic Material Parameter
  • It also save a Initial Voxel Position to the particle for further use.
  • Voxel Size -> Scale Usage: Add after Initialize Particle module in Particle Spawn Stage. niagara_voxel5_model_loader_usage

/Voxel5Lib/Particles/Modules/UpdateBounds

Module:Update Bounds

  • If the particle runs in a GPU simulation, it is necessary to programmatically retrieve the actual bounds. With this module, users can obtain the local bounds of the voxel model and apply them to the particle system.
  • Usage: Add in Emitter Spawn stage. update_bounds_usage

    Examples

niagara examples

  • The Voxel5Particles_SimpleStatic represents a static voxelized mesh with cubes.
  • The Voxel5Particles_SimpleStatic represents a static voxelized mesh with sprites.
  • The Voxel5Particles_Drift is the same as Voxel5Mesh_SimpleStatic but includes a drifting effect.
  • The Voxel5Particles_PopupEffect is the same as Voxel5Mesh_SimpleStatic but includes a progressive popup effect.

Generate Static Mesh From Voxel

You can build a static mesh from a voxel data, just right click the asset data in content browser, and choose “Build StaticMesh” in the context menu. alt text With the build static mesh window shows up, select a voxel shape and material, then click “start”, after a while the mesh will be generated in the output path. alt text

This post is licensed under CC BY 4.0 by the author.