Beautliful voxel engine like enshrouded
Find a file
Samuel Bouchet 36b8de9285 Phase 4.2: match grass blade colors to voxel faces + stronger translucency
Use same ambient (0.15, 0.18, 0.25) as voxel PS instead of greener
tint. Increase translucency (0.6) to reduce contrast when orbiting
around grass. Wrap at 0.85 for balanced lit-side brightness.
2026-03-26 19:07:04 +01:00
shaders Phase 4.2: match grass blade colors to voxel faces + stronger translucency 2026-03-26 19:07:04 +01:00
src Add wind to grass toping 2026-03-26 18:58:19 +01: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 Phase 4.2: grass blade tufts, stone corner fills/caps, vegetation shading 2026-03-26 18:48:35 +01:00
CMakeLists.txt cleanup 2026-03-25 19:38:50 +01:00
plan_phase4.md Phase 4.1: TopingSystem infrastructure + procedural mesh generation 2026-03-26 15:27:15 +01:00
README.md Phase 3: per-material bleed flags + patch-based terrain for blend testing 2026-03-26 12:47:10 +01:00
research_connected_meshes.md Phase 4.1: TopingSystem infrastructure + procedural mesh generation 2026-03-26 15:27:15 +01:00
voxel_engine_spec.docx Phase 2: GPU-driven voxel rendering pipeline 2026-03-25 14:24:05 +01:00
voxel_engine_spec.md Phase 2.2: MDI rendering with CPU-filled indirect args 2026-03-25 22:07:22 +01: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.