VoxelForge Plugin Documentation (Unreal Marketplace - WIP)
Open Unreal Marketplace (WIP)
Language: >English< | 中文
Preface: This plugin implements Minecraft-style voxel rendering in UE.
Quick Start
To quickly create a voxel world, use the VoxelForgeSubsystem
class. Call its Create Level
function in Blueprints or C++.
Prerequisite: Configure global settings using Set Voxel Global Setting Override
.
-
Material: Use the default material
Material/M_VoxelChunkInstance
from plugin content.
-
Texture Resource Setting:
- For Texture2D Arrays: Assign to
Texture Array
parameter and disableUse Outside Directory Textures
. A sample array is provided inMaterial
folder.
- For external PNG textures: Enable
Use Outside Directory Textures
and specify path inOutside Directory Textures Path
. Example:
D:\\Project\\AstralReactor\Plugins\\VoxelForge\\Resources\\DefaultTextures\\
(Use absolute path or relative path).
SetOutside Texture Size X/Y
according to texture dimensions. Use "Nearest" filter for Minecraft-style sampling.
- For Texture2D Arrays: Assign to
-
Block Register: Use provided
BP_DefaultBlockRegister
(customization explained later).
After configuration, call Create Level
with parameters:
- Save path
- Level name
- Pre-generation range (chunks to generate/load at startup)
Launch PIE to see generated world:
Player Setup
Actors with Voxel Player Component
gain chunk loading/unloading capabilities.
- Add
Voxel Player Component
to your player blueprint - Call
Update Surrounding Chunks
(no need for Tick call - smart throttling included)
Sample implementation inTemplate/VoxelPlayer
:
Adjust view distance in component details:
World Interaction
Key functions:
-
Voxel Line Trace: Returns hit block position and ID.
Outside Pos
: When enabled, returns adjacent position for block placement
-
Set Block Immediately: Updates block at world position. Predefined IDs:
Vanilla::Air
,Vanilla::Grass
,Vanilla::Stone
,Vanilla::Log
,Vanilla::Leaf
Block Registration
Create Blueprint child of Voxel Block Register
and override in global settings.
Each block requires:
- Unique Namespaced ID (e.g.,
Vanilla::Grass
) - Block Type (
Block
orAir
) - Face UV indices (X coordinate = texture array index)
Texture Ordering: For external textures, name files numerically (e.g., 00001-GrassSide.png
) to ensure correct array indexing.
C++ Registration: Add built-in blocks in VoxelForgeSubsystem.cpp line:133
:
SetVoxelBlock({TEXT("Vanilla"), TEXT("Grass")}, FBlock_Grass());
SetVoxelBlock({TEXT("Vanilla"), TEXT("Stone")}, FBlock_Stone());
Remove corresponding entries from Blueprint registers after C++ implementation.