Beautliful voxel engine like enshrouded
Find a file
2026-03-31 20:04:00 +02:00
docs Commit plan and iteration instructions 2026-03-31 20:04:00 +02:00
shaders Fix HDR screenshot, reduce sun size, windowed 1080p by default 2026-03-31 14:58:44 +02:00
src Commit plan and iteration instructions 2026-03-31 20:04:00 +02:00
.gitignore Phase 2: GPU-driven voxel rendering pipeline 2026-03-25 14:24:05 +01:00
blending_experiments.md Phase 3: PS-based texture blending with winner-takes-all heightmap 2026-03-26 12:14:08 +01:00
CLAUDE.md Commit plan and iteration instructions 2026-03-31 20:04:00 +02:00
CMakeLists.txt Phase 6.3: RT ambient occlusion with bilateral blur 2026-03-29 09:31:19 +02:00
plan_phase4.md Phase 4.1: TopingSystem infrastructure + procedural mesh generation 2026-03-26 15:27:15 +01:00
README.md Phase 5.2-5.3: CPU perf optimizations + GPU compute Surface Nets 2026-03-27 22:30:43 +01:00
research_connected_meshes.md Phase 4.1: TopingSystem infrastructure + procedural mesh generation 2026-03-26 15:27:15 +01:00
TROUBLESHOOTING.md Fix VRAM leak: capacity-based BLAS/TLAS + deferred toping BLAS upload 2026-03-30 21:37:39 +02:00
voxel_engine_spec.docx Phase 2: GPU-driven voxel rendering pipeline 2026-03-25 14:24:05 +01:00
voxel_engine_spec.md Commit plan and iteration instructions 2026-03-31 20:04:00 +02:00
Wonderbox-screen-1.png Add sky and refs 2026-03-30 21:54:55 +02:00
Wonderbox-screen-2.png Add sky and refs 2026-03-30 21:54:55 +02:00
Wonderbox-screen-5.png Add sky and refs 2026-03-30 21:54:55 +02:00
Wonderbox-screen-6.png Add sky and refs 2026-03-30 21:54:55 +02:00

BVLE Voxels

Prototype de moteur voxel hybride basé sur Wicked Engine (MIT, C++17, DX12/Vulkan).

Cible : 60+ fps en 1440p, monde de 512×512×256 voxels visibles.

Prérequis

Outil Version Installation
Windows 10/11 (x64)
CMake 3.19+ winget install Kitware.CMake
Visual Studio 2022 Build Tools 17.x winget install Microsoft.VisualStudio.2022.BuildTools
Windows SDK 10.0.26100+ winget install Microsoft.WindowsSDK.10.0.26100
GPU DX12 feature level 12.0+ AMD RDNA 2+ / Nvidia RTX 3060+ recommandé

Le SDK 10.0.26100 est requis car les headers DX12 fournis par Wicked Engine ne sont pas compatibles avec le SDK 22621.

Installation

# 1. Cloner le dépôt
git clone <url> bvle-voxels
cd bvle-voxels

# 2. Cloner Wicked Engine dans engine/
git clone --depth 1 https://github.com/turanszkij/WickedEngine.git engine

# 3. Configurer CMake
cmake -B build -G "Visual Studio 17 2022" -A x64 -DCMAKE_SYSTEM_VERSION=10.0.26100.0

# 4. Compiler
cmake --build build --config Release --target BVLEVoxels --parallel

# 5. Lancer
./build/Release/BVLEVoxels.exe

Commandes de lancement

Commande Description
BVLEVoxels.exe Mode normal (monde procédural, rayon 4 chunks)
BVLEVoxels.exe debug Mode debug face-color (+X=Rouge, -X=Rouge sombre, etc.)
BVLEVoxels.exe debugdevice Active la couche de debug D3D12
BVLEVoxels.exe vulkan Force le backend Vulkan

Contrôles

Touche Action
WASD Déplacement caméra
Espace / Ctrl Monter / Descendre
Shift Vitesse ×3
Clic droit Capturer/libérer la souris
~ (tilde) Console Wicked Engine

Architecture

bvle-voxels/
├── CMakeLists.txt              # Build CMake
├── engine/                     # Wicked Engine (git clone --depth 1)
├── src/
│   ├── voxel/                  # Bibliothèque VoxelEngine (static lib)
│   │   ├── VoxelTypes.h        # Types (VoxelData, PackedQuad, ChunkPos)
│   │   ├── VoxelWorld.h/.cpp   # Monde voxel (hashmap, génération Perlin)
│   │   ├── VoxelMesher.h/.cpp  # Binary Greedy Mesher CPU
│   │   └── VoxelRenderer.h/.cpp# Renderer GPU-driven + VoxelRenderPath
│   └── app/
│       └── main.cpp            # Point d'entrée Win32
├── shaders/                    # Sources HLSL
│   ├── voxelCommon.hlsli       # Root signature, CB, structs partagés
│   ├── voxelVS.hlsl            # Vertex shader (vertex pulling)
│   ├── voxelPS.hlsl            # Pixel shader (triplanar + lighting)
│   ├── voxelCullCS.hlsl        # Compute: frustum + backface culling
│   └── voxelMeshCS.hlsl        # Compute: GPU mesher (binary, baseline)
└── voxel_engine_spec.md        # Document de spécification complet (Markdown)

Pipeline de rendu (Phase 2 — GPU-driven)

CPU: mesh dirty chunks (greedy merge) → pack quads + chunkInfo dans mega-buffers → upload GPU
GPU: frustum cull compute → indirect args → DrawInstancedIndirectCount (1 appel = N draws)

Buffers GPU :

Buffer Type Slot Rôle
megaQuadBuffer_ StructuredBuffer<PackedQuad> SRV t0 2M quads max (16 MB)
chunkInfoBuffer_ StructuredBuffer<GPUChunkInfo> SRV t2 2048 chunks max
indirectArgsBuffer_ RWStructuredBuffer UAV u0 Indirect draw args
drawCountBuffer_ RWByteAddressBuffer UAV u1 Compteur atomique de draws

Caractéristiques Phase 2 :

  • Mega-buffer unique pour tous les quads de tous les chunks
  • Vertex pulling via SV_VertexID + push constants (b999)
  • Frustum culling CPU (wi::primitive::Frustum)
  • Backface culling par face group (6 directions × chunk)
  • GPU frustum cull compute shader (prêt, activation via flag)
  • GPU mesher compute shader baseline (binary, sans greedy merge)
  • Tri des quads par direction de face dans le mesher CPU
  • GPU timestamp queries pour benchmark

Phases de développement

  • Phase 1 — Setup, meshing CPU, rendu basique
  • Phase 2 — GPU-driven pipeline, mega-buffer, culling, compute shaders
  • Phase 3 — Texture blending (triplanar, height-based)
  • Phase 4 — Toping (rebords, bordures procédurales)
  • Phase 5 — Rendu smooth (Surface Nets / Marching Cubes)
  • Phase 6 — Ray tracing hybride (RT shadows + AO)

Licence

Wicked Engine est sous licence MIT. Le code spécifique BVLE est propriétaire.