Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

7 Commits

Folders and files

Repository files navigation

Modern Renderer (DirectX 12)

A future-targeted DirectX 12 renderer built from scratch for modern and next-generation hardware (RTX 3060+ / PS5+ / PS6). No legacy barriers, no Input Assembler bottlenecks, and no per-draw descriptor-table slot juggling—modern and forward-looking DX12 only.

Currently renders a Shader Model 6.9 GPU-driven meshlet pipeline with instanced glTF/glb scenes (auto-loading niagara_bistro/bistro.gltf when present, or a procedural icosphere fallback), bindless PBR materials & BC5/BC7 textures, an async COPY upload queue, Infinite Reverse-Z depth, an offscreen HDR + ACES compute tonemapping pass, and a free-fly camera.

Architecture & Tech Stack

  • Core DX12 & Memory: Agility SDK 1.620.1 (ID3D12Device16, ID3D12GraphicsCommandList10), Shader Model 6.9 (as_6_9, ms_6_9, ps_6_9, cs_6_9 via DXC 1.9.2609.5, -WX -HV 2021), 100% Enhanced Barriers, PSO subobject streams (D3D12_PIPELINE_STATE_STREAM_DESC), and AMD D3D12MA v3.3.0 (CreateResource3, Tight Alignment & GPU_UPLOAD heap aware).
  • Universal Bindless Root Signature (1.1): 16x 32-bit root constants at b0 with CBV_SRV_UAV_HEAP_DIRECTLY_INDEXED (16,384-slot ResourceDescriptorHeap) and SAMPLER_HEAP_DIRECTLY_INDEXED (2,048-slot SamplerDescriptorHeap via SamplerManager with deduplicated glTF & 16x anisotropic samplers).
  • GPU-Driven Meshlet Pipeline (MeshletScene, shaders/meshlet.hlsl):
    • fastgltf v1.0.1 + meshoptimizer v1.3 import (RH -> LH conversion), vertex/index optimization, meshlet partitioning (max 64 vertices / 124 triangles), and decoupled InstanceData / MeshletInstance batches split across Opaque, Alpha-Mask, and Alpha-Blend PSOs.
    • 24-byte Packed Vertices: UNORM16 local-AABB positions, octahedral SNORM16x2 normals, 15-bit octahedral tangents + handedness bit, and float16_t2 UV0/UV1.
    • AS + MS + PS: Amplification Shader frustum & backface cone culling with wave-adaptive compaction (WaveActiveCountBits / InterlockedOr) into DispatchMesh, Mesh Shader transform + SV_CullPrimitive NDC backface culling, and Pixel Shader with wave-scalarized material/texture reads (WaveReadLaneFirst, IsHelperLane(), explicit SampleGrad).
  • PBR Materials & Texture Pipeline (TextureManager):
    • Multi-scattering GGX BRDF (EnvBRDFApprox) with KHR_materials_emissive_strength, KHR_materials_ior, KHR_materials_specular, KHR_materials_transmission, KHR_materials_unlit, MSFT_texture_dds, and parallel CPU pre-conversion of KHR_materials_pbrSpecularGlossiness.
    • DirectXTex (may2026) DDS/WIC decoding, mipmap generation, BC7 (BC7_UNORM_SRGB / BC7_UNORM) and BC5 (BC5_UNORM / SNORM) compression, plus 1x1 fallback textures.
  • HDR & Post-Processing (HdrPipeline, shaders/tonemap.hlsl): Offscreen R16G16B16A16_FLOAT HDR render target, cs_6_9 compute pass (8x8 groups) with Stephen Hill ACES RRT+ODT tonemapping + linear-to-sRGB conversion into an R8G8B8A8_UNORM UAV, then copy to the backbuffer.
  • Async Streaming & Depth (GpuUploader, DepthBuffer, Camera, SceneConstants): Dedicated COPY queue with a 64 MB staging ring, temporary oversized upload fallback, and cross-queue Enhanced Barrier sync (SyncToQueue); D32_FLOAT Infinite Reverse-Z depth (0.0f clear, GREATER_EQUAL); triple-buffered bindless SceneConstants CBV.
  • Swapchain & Validation: Triple-buffered FLIP_DISCARD, 2 frames in flight, waitable latency pacing, ALLOW_TEARING, /W4 /WX, D3D12 Debug Layer + ID3D12InfoQueue1, and D3D12MA / live-object leak checks (--frames / RendererUnitTests).

Build, Test & Run

Requires Windows 10/11 (x64), Visual Studio 2026 (C++20), CMake 3.25+, and a GPU/driver supporting Enhanced Barriers, Mesh Shaders (Tier 1), and SM 6.9. Dependencies are fetched automatically.

cmake --preset vs2026-x64
cmake --build --preset vs2026-debug
cmake --build --preset vs2026-release
ctest --test-dir build/vs2026 -C Debug --output-on-failure

Ninja presets (ninja-debug, ninja-release) are also in CMakePresets.json. Built binaries live under build/vs2026/<Config>/ (ModernRenderer.exe and RendererUnitTests.exe).

CLI Flags: --scene <path> / --scene=<path> (load .gltf/.glb; auto-loads niagara_bistro/bistro.gltf if present), --procedural (force procedural icosphere), --meshlet-colors (start in meshlet visualization), --frames <N> / --frames=<N> (automated run, suppresses startup MessageBoxW), --debug-layer (enable D3D12 Debug Layer in Release), --no-vsync (disable VSync / allow tearing).

Controls: WASD / Q / E to fly (Shift to boost), right-click drag to look around, M to toggle PBR shading / meshlet colors, C to toggle AS frustum & cone culling, Esc to exit.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages