diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml index 1ac4d77c..abc19fb9 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yaml +++ b/.github/ISSUE_TEMPLATE/bug_report.yaml @@ -13,34 +13,23 @@ body: required: true attributes: label: Describe the bug - description: A clear and concise description of what the bug is. - placeholder: E.g. When initializing a DirectX12 context, an exception is thrown on integrated graphics. - - - type: textarea - validations: - required: true - attributes: - label: Steps to reproduce - description: Steps to reproduce the behavior. Include a minimal code example if possible. + description: A clear and concise description of what the bug is, including steps to reproduce and expected behavior. placeholder: | + What happened: + E.g. When initializing a DirectX12 context, an exception is thrown on integrated graphics. + + Steps to reproduce: 1. Create a GraphicsContext with DirectX12 2. Call CreateSwapChain() 3. See exception - - type: textarea - validations: - required: true - attributes: - label: Expected behavior - description: What you expected to happen. - placeholder: DirectX12 context should initialize successfully. + Expected behavior: + DirectX12 context should initialize successfully. - type: textarea - validations: - required: true attributes: label: Environment - description: Please provide your environment details. + description: Please provide your environment details (if applicable). placeholder: | - OS: Windows 11 / macOS 15 / Ubuntu 24.04 / etc. - Graphics API: DirectX12 / Metal / Vulkan diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index e44e9ffc..8f99e94d 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -5,7 +5,4 @@ contact_links: about: I have a question about how to use Zenith.NET or need help with graphics programming. - name: Documentation url: https://qian-o.github.io/Zenith.NET/ - about: Check out the documentation and tutorials for Zenith.NET. - - name: Feature Discussions - url: https://github.com/qian-o/Zenith.NET/discussions/categories/ideas - about: Discuss new ideas and features for Zenith.NET with the community. \ No newline at end of file + about: Check out the documentation and tutorials for Zenith.NET. \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/custom.yaml b/.github/ISSUE_TEMPLATE/custom.yaml deleted file mode 100644 index 40d48e05..00000000 --- a/.github/ISSUE_TEMPLATE/custom.yaml +++ /dev/null @@ -1,24 +0,0 @@ -ο»Ώname: General Issue -description: For issues that do not fit other templates -title: "Issue: " -labels: ["needs-triage"] -body: - - type: markdown - attributes: - value: | - This template is for issues that don't fit into Bug Report or Feature Request. - For questions or discussions, please use the [Discussions](https://github.com/qian-o/Zenith.NET/discussions) section. - - - type: textarea - validations: - required: true - attributes: - label: Description - description: Describe your issue or question in detail. - placeholder: Please provide a clear description... - - - type: textarea - attributes: - label: Additional context - description: Add any relevant information, environment details, code snippets, or screenshots. - placeholder: Any additional information that might help. \ No newline at end of file diff --git a/README.md b/README.md index c66724d6..bd640b50 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@

A modern, cross-platform graphics and compute library for .NET.
- One API for DirectX 12, Metal, and Vulkan. + One API for DirectX 12, Metal 4, and Vulkan 1.4.

@@ -14,21 +14,17 @@ License

-

- Status: Work in Progress -

- --- ## πŸ“– Overview -Zenith.NET is a GPU abstraction layer that unifies DirectX 12, Metal, and Vulkan under a single .NET API. It enables developers to build high-performance rendering and compute applications without writing backend-specific code. The library supports modern GPU features including ray tracing and mesh shading, and integrates seamlessly with popular .NET UI frameworks. +Zenith.NET is a GPU abstraction layer that unifies DirectX 12, Metal 4, and Vulkan 1.4 under a single .NET API. It enables developers to build high-performance rendering and compute applications without writing backend-specific code. The library supports modern GPU features including ray tracing and mesh shading, and integrates seamlessly with popular .NET UI frameworks. Visit the [documentation site](https://qian-o.github.io/Zenith.NET/) for tutorials and API reference. ## ✨ Features -- 🎯 **Unified API** β€” Write once, run on DirectX 12, Metal, and Vulkan +- 🎯 **Unified API** β€” Write once, run on DirectX 12, Metal 4, and Vulkan 1.4 - 🎨 **Graphics** β€” Vertex and pixel shaders - ⚑ **Compute** β€” General-purpose GPU computing - πŸ’‘ **Ray Tracing** β€” Hardware-accelerated BLAS/TLAS with RayQuery in any shader stage @@ -42,11 +38,9 @@ Visit the [documentation site](https://qian-o.github.io/Zenith.NET/) for tutoria | | DirectX 12 | Metal 4 | Vulkan 1.4 | | :-------: | :--------: | :-----: | :--------: | | Windows | βœ… | | βœ… | -| Linux | | | βœ… | -| Apple | | 🚧 | βœ… | +| Apple | | βœ… | βœ… | | Android | | | βœ… | - -> 🚧 Metal backend is under development. +| Linux | | | βœ… | --- diff --git a/documents/api/index.md b/documents/api/index.md index 1eaf01ce..2e464262 100644 --- a/documents/api/index.md +++ b/documents/api/index.md @@ -8,8 +8,8 @@ Welcome to the Zenith.NET API Reference. This documentation is automatically gen |-----------|-------------| | Zenith.NET | Core graphics abstractions and resource types | | Zenith.NET.DirectX12 | DirectX 12 backend implementation for Windows | -| Zenith.NET.Metal | Metal backend implementation for Apple platforms | -| Zenith.NET.Vulkan | Vulkan backend implementation for cross-platform support | +| Zenith.NET.Metal | Metal 4 backend implementation for Apple platforms | +| Zenith.NET.Vulkan | Vulkan 1.4 backend implementation for cross-platform support | ## Key Types diff --git a/documents/docfx.json b/documents/docfx.json index c4efb083..dc96a069 100644 --- a/documents/docfx.json +++ b/documents/docfx.json @@ -13,7 +13,8 @@ ] } ], - "output": "api" + "output": "api", + "enumSortOrder": "declaringOrder" } ], "build": { @@ -35,7 +36,6 @@ ] } ], - "output": "_site", "template": [ "default", "modern", @@ -45,10 +45,15 @@ "_appTitle": "Zenith.NET", "_appLogoPath": "images/Zenith.NET-Logo.svg", "_appFaviconPath": "images/Zenith.NET.png", + "_enableSearch": true, "_gitContribute": { "repo": "https://github.com/qian-o/Zenith.NET", "branch": "master" } + }, + "output": "_site", + "sitemap": { + "baseUrl": "https://qian-o.github.io/Zenith.NET/" } } } \ No newline at end of file diff --git a/documents/docs/concepts/graphics-context.md b/documents/docs/concepts/graphics-context.md index 005d502f..d68b3b89 100644 --- a/documents/docs/concepts/graphics-context.md +++ b/documents/docs/concepts/graphics-context.md @@ -6,6 +6,6 @@ This topic covers: - GraphicsContext creation methods for each backend -- Three backend options: DirectX12, Metal, Vulkan +- Three backend options: DirectX 12, Metal 4, Vulkan 1.4 - Querying device capabilities via `Capabilities` - Handling validation messages via `ValidationMessage` event diff --git a/documents/docs/index.md b/documents/docs/index.md index a2bdc8f4..bb3c67bc 100644 --- a/documents/docs/index.md +++ b/documents/docs/index.md @@ -5,6 +5,20 @@ This section provides conceptual documentation to help you understand Zenith.NET > [!NOTE] > Looking for step-by-step coding guides? Check out the [Tutorials](../tutorials/index.md) section. +## Design Philosophy + +Zenith.NET abstracts DirectX 12, Metal 4, and Vulkan 1.4 under a unified API. The design follows a clear principle: **adopt the latest API versions and expose only the capabilities shared across all three backends**. This means platform-specific features are intentionally excluded to maintain a consistent cross-platform experience. + +Each backend targets real-world device coverage: + +| Backend | Strategy | +|---------|----------| +| **DirectX 12** | Targets mainstream Windows 10 and above, covering the vast majority of Windows devices | +| **Metal 4** | Supports Apple Silicon (M-series) Macs and compatible iPhone/iPad models. Intel-based Macs are not supported | +| **Vulkan 1.4** | Serves as the cross-platform fallback. While Vulkan has evolved rapidly with many extensions, mobile and Linux driver support remains uneven β€” so adaptation is driven by actual device capabilities rather than spec version alone | + +For detailed backend selection guidance, see [Backend Selection](platform/backend-selection.md). + ## Core Concepts ### Graphics Context @@ -51,12 +65,12 @@ Pipelines reference a single `ResourceLayout`, and you bind a corresponding `Res ## Platform Support -| Platform | DirectX 12 | Metal | Vulkan | +| Platform | DirectX 12 | Metal 4 | Vulkan 1.4 | |----------|:----------:|:-----:|:------:| | Windows | Yes | No | Yes | -| Linux | No | No | Yes | | Apple | No | Yes | Yes | | Android | No | No | Yes | +| Linux | No | No | Yes | ## Best Practices diff --git a/documents/index.md b/documents/index.md index f9cbd8ee..1ee6696f 100644 --- a/documents/index.md +++ b/documents/index.md @@ -8,7 +8,7 @@ _layout: landing

Zenith.NET

Unified Cross-Platform GPU Programming for .NET

-

A modern graphics and compute library that provides a single API for DirectX 12, Metal, and Vulkan. Build high-performance rendering and GPU compute applications with ease.

+

A modern graphics and compute library that provides a single API for DirectX 12, Metal 4, and Vulkan 1.4. Build high-performance rendering and GPU compute applications with ease.

Get Started API Reference @@ -26,12 +26,12 @@ _layout: landing
Graphics APIs - DirectX 12 Β· Metal Β· Vulkan + DirectX 12 Β· Metal 4 Β· Vulkan 1.4
Platforms - Windows Β· Linux Β· Apple Β· Android + Windows Β· Apple Β· Android Β· Linux
@@ -43,7 +43,7 @@ _layout: landing
🎯
- Unified API β€” Write once, run everywhere. A single API abstracts DirectX 12, Metal, and Vulkan. + Unified API β€” Write once, run everywhere. A single API abstracts DirectX 12, Metal 4, and Vulkan 1.4.
@@ -98,7 +98,7 @@ _layout: landing
1

Initialize

-

Create a graphics context with your preferred backend (DirectX 12, Metal, or Vulkan).

+

Create a graphics context with your preferred backend (DirectX 12, Metal 4, or Vulkan 1.4).

diff --git a/documents/templates/public/main.css b/documents/templates/public/main.css index e992ff7f..7fdbe873 100644 --- a/documents/templates/public/main.css +++ b/documents/templates/public/main.css @@ -106,6 +106,14 @@ body { color: var(--text-primary); } +/* Full-width layout */ +main.container-xxl, +header .container-xxl { + max-width: 100% !important; + padding-left: 2rem !important; + padding-right: 2rem !important; +} + /* ========================================================================== 3. Navbar ========================================================================== */ @@ -217,6 +225,24 @@ header.bg-body, font-size: 1.05rem; } + /* Theme switcher dropdown β€” match icon button size */ + .navbar .icons .dropdown > a.btn { + width: auto !important; + height: 34px !important; + padding: 6px 10px !important; + } + +/* Search box β€” smaller width and spacing from theme switcher */ +.navbar #navbar form.search { + margin-left: 8px !important; +} + + .navbar #navbar form.search > input { + max-width: 180px !important; + height: 34px !important; + font-size: 0.85rem !important; + } + #logo { height: 50px; } @@ -1109,6 +1135,8 @@ article th { color: var(--text-tertiary) !important; background: transparent !important; border: none !important; + white-space: nowrap !important; + vertical-align: middle !important; } article thead tr th:first-child { @@ -1134,6 +1162,7 @@ article td { background: transparent !important; border: none !important; border-top: 1px solid var(--border) !important; + vertical-align: middle !important; } article tbody tr:first-child td { @@ -1783,19 +1812,87 @@ article td a { 20. Hide UI Elements ========================================================================== */ -article h1 > a, -article h2 > a, -article h3 > a, -article h4 > a, -article h5 > a, -article h6 > a, +article h1 > a:not(.header-action), +article h2 > a:not(.header-action), +article h3 > a:not(.header-action), +article h4 > a:not(.header-action), +article h5 > a:not(.header-action), +article h6 > a:not(.header-action), a[href^="http"]::after, a[href^="https"]::after { display: none !important; } /* ========================================================================== - 21. Responsive Design + 21. Search Results + ========================================================================== */ + +body[data-search] > .search-results { + max-width: 820px; + margin: 0 auto; + padding: 2rem 1.5rem 3rem; +} + +#search-results { + line-height: 1.7; +} + + #search-results > .search-list { + font-size: 0.9rem; + color: var(--text-secondary); + margin-bottom: 1.5rem; + padding-bottom: 1rem; + border-bottom: 1px solid var(--border); + } + + #search-results > .sr-items { + display: flex; + flex-direction: column; + gap: 0.75rem; + } + + #search-results > .sr-items > .sr-item { + background: var(--surface); + border: 1px solid var(--border); + border-radius: var(--radius-md); + padding: 1.25rem 1.5rem; + margin-bottom: 0; + transition: border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease); + } + + #search-results > .sr-items > .sr-item:hover { + border-color: var(--accent); + box-shadow: var(--shadow-sm); + } + + #search-results > .sr-items > .sr-item > .item-title { + font-size: 1.125rem; + font-weight: 600; + color: var(--accent); + text-decoration: none; + display: block; + margin-bottom: 0.35rem; + } + + #search-results > .sr-items > .sr-item > .item-title:hover { + color: var(--accent-hover); + } + + #search-results > .sr-items > .sr-item > .item-href { + font-size: 0.8rem; + color: var(--text-tertiary); + margin-bottom: 0.5rem; + word-break: break-all; + } + + #search-results > .sr-items > .sr-item > .item-brief { + font-size: 0.875rem; + color: var(--text-secondary); + line-height: 1.6; + } + +/* ========================================================================== + 22. Responsive Design ========================================================================== */ @media (max-width: 768px) { diff --git a/documents/templates/public/main.js b/documents/templates/public/main.js index c080a739..fbf12aad 100644 --- a/documents/templates/public/main.js +++ b/documents/templates/public/main.js @@ -7,6 +7,13 @@ } ], start: () => { + // Prevent short table cells from wrapping (e.g. "DirectX 12", "Vulkan 1.4") + for (const td of document.querySelectorAll('article td')) { + if (td.textContent.trim().length <= 20) { + td.style.whiteSpace = 'nowrap'; + } + } + // Hide inherited type info sections (inheritance, implements, inheritedMembers, derivedClasses) for (const dl of document.querySelectorAll('dl.typelist.inheritance, dl.typelist.implements, dl.typelist.inheritedMembers, dl.typelist.derivedClasses')) { dl.style.display = 'none'; @@ -27,7 +34,6 @@ while (el) { toHide.push(el); if (el.tagName === 'H3') { - // Also grab the preceding overload anchor const prev = el.previousElementSibling; if (prev && prev.tagName === 'A' && prev.dataset.uid) { toHide.push(prev); @@ -63,5 +69,26 @@ h2.style.display = 'none'; } } + + // Search results: navigate in same tab with back button support + document.addEventListener('click', (e) => { + const link = e.target.closest('#search-results .sr-item a'); + if (!link) return; + + e.preventDefault(); + const query = document.getElementById('search-query')?.value || ''; + history.replaceState({ search: true, query }, ''); + window.location.href = link.href; + }); + + window.addEventListener('popstate', (e) => { + if (e.state?.search) { + const input = document.getElementById('search-query'); + if (input) { + input.value = e.state.query; + input.dispatchEvent(new Event('input', { bubbles: true })); + } + } + }); } } \ No newline at end of file diff --git a/documents/tutorials/advanced/ray-tracing.md b/documents/tutorials/advanced/ray-tracing.md index cb0ca2f8..3095dcb6 100644 --- a/documents/tutorials/advanced/ray-tracing.md +++ b/documents/tutorials/advanced/ray-tracing.md @@ -684,10 +684,15 @@ while (query.Proceed()) uint sphereIndex = query.CandidatePrimitiveIndex(); Sphere sphere = spheres[sphereIndex]; + float3 ro = query.CandidateObjectRayOrigin(); + float3 rd = query.CandidateObjectRayDirection(); + float t = IntersectSphere(ro, rd, sphere); if (t >= query.RayTMin() && t <= query.CommittedRayT()) { + float3 hitPoint = ro + rd * t; + sphereHitNormal = normalize(hitPoint - sphere.Center); sphereHitColor = sphere.Color; @@ -742,6 +747,9 @@ bool TraceShadowRay(float3 origin, float3 direction) uint sphereIndex = shadowQuery.CandidatePrimitiveIndex(); Sphere sphere = spheres[sphereIndex]; + float3 ro = shadowQuery.CandidateObjectRayOrigin(); + float3 rd = shadowQuery.CandidateObjectRayDirection(); + float t = IntersectSphere(ro, rd, sphere); if (t >= shadowQuery.RayTMin() && t <= shadowQuery.CommittedRayT()) diff --git a/documents/tutorials/getting-started/prerequisites.md b/documents/tutorials/getting-started/prerequisites.md index de49e106..bc61952b 100644 --- a/documents/tutorials/getting-started/prerequisites.md +++ b/documents/tutorials/getting-started/prerequisites.md @@ -11,12 +11,12 @@ Zenith.NET supports multiple graphics backends across platforms: | Platform | DirectX 12 | Metal 4 | Vulkan 1.4 | |----------|:----------:|:-------:|:----------:| | Windows | Yes | No | Yes | -| Linux | No | No | Yes | | Apple | No | Yes | Yes | | Android | No | No | Yes | +| Linux | No | No | Yes | > [!NOTE] -> These tutorials are designed for desktop platforms (Windows, Linux, and macOS). +> These tutorials are designed for desktop platforms (Windows, macOS, and Linux). ### Software @@ -136,12 +136,9 @@ Different graphics backends use different indexing schemes for resource bindings | Backend | Index Scheme | |---------|--------------| -| DirectX 12 | Per-type: CBV, SRV, UAV, Sampler each start at 0 | -| Vulkan | Global: All resources share index space (0, 1, 2, ...) | +| DirectX12 | Per-type: CBV, SRV, UAV, Sampler each start at 0 | | Metal | Per-category: Buffer, Texture, Sampler each start at 0 | - -Create `BindingHelper.cs` to handle these differences automatically: - +| Vulkan | Global: All resources share index space (0, 1, 2, ...) | ```csharp namespace ZenithTutorials; @@ -184,17 +181,6 @@ internal static class BindingHelper } break; - case Backend.Vulkan: - { - for (int i = 0; i < bindings.Length; i++) - { - ref ResourceBinding binding = ref bindings[i]; - - binding = binding with { Index = (uint)i }; - } - } - break; - case Backend.Metal: { uint bufferIndex = 0; @@ -224,6 +210,17 @@ internal static class BindingHelper } } break; + + case Backend.Vulkan: + { + for (int i = 0; i < bindings.Length; i++) + { + ref ResourceBinding binding = ref bindings[i]; + + binding = binding with { Index = (uint)i }; + } + } + break; } return bindings; @@ -319,9 +316,9 @@ internal static class App static App() { // Ensure platform is supported - if (!OperatingSystem.IsWindows() && !OperatingSystem.IsLinux() && !OperatingSystem.IsMacOS()) + if (!OperatingSystem.IsWindows() && !OperatingSystem.IsMacOS() && !OperatingSystem.IsLinux()) { - throw new PlatformNotSupportedException("This tutorial only supports Windows, Linux, and macOS."); + throw new PlatformNotSupportedException("This tutorial only supports Windows, macOS, and Linux."); } // Create window with no graphics API (we manage rendering ourselves) @@ -342,17 +339,17 @@ internal static class App surface = Surface.Win32(window.Native!.Win32!.Value.Hwnd, Width, Height); } - else if (OperatingSystem.IsLinux()) + else if (OperatingSystem.IsMacOS()) { - Context = GraphicsContext.CreateVulkan(useValidationLayer: true); + Context = GraphicsContext.CreateMetal(useValidationLayer: true); - surface = Surface.Xlib(window.Native!.X11!.Value.Display, (nint)window.Native.X11.Value.Window, Width, Height); + surface = Surface.Apple(CocoaHelper.CreateLayer(window.Native!.Cocoa!.Value), Width, Height); } else { - Context = GraphicsContext.CreateMetal(useValidationLayer: true); + Context = GraphicsContext.CreateVulkan(useValidationLayer: true); - surface = Surface.Apple(CocoaHelper.CreateLayer(window.Native!.Cocoa!.Value), Width, Height); + surface = Surface.Xlib(window.Native!.X11!.Value.Display, (nint)window.Native.X11.Value.Window, Width, Height); } // Log validation messages for debugging @@ -438,9 +435,9 @@ App.Cleanup(); This framework provides: -- **Platform validation** - Ensures only supported platforms (Windows, Linux, macOS) are used +- **Platform validation** - Ensures only supported platforms (Windows, macOS, Linux) are used - **Window creation** with Silk.NET (1280Γ—720 default size) -- **Cross-platform backend selection** (DirectX 12 on Windows, Vulkan on Linux, Metal on macOS) +- **Cross-platform backend selection** (DirectX12 on Windows, Metal on macOS, Vulkan on Linux) - **SwapChain management** for presenting frames - **Resize handling** for responsive rendering - **Generic renderer pattern** using `App.Run()` for easy tutorial switching diff --git a/documents/tutorials/index.md b/documents/tutorials/index.md index f8d26ee2..74d10369 100644 --- a/documents/tutorials/index.md +++ b/documents/tutorials/index.md @@ -66,7 +66,7 @@ Before starting, ensure you have: - Visual Studio 2026, VS Code, or JetBrains Rider > [!NOTE] -> These tutorials are designed for desktop platforms (Windows, Linux, and macOS). +> These tutorials are designed for desktop platforms (Windows, macOS, and Linux). > See [Prerequisites](getting-started/prerequisites.md) for detailed platform support and setup instructions. ## Source Code diff --git a/sources/Directory.Packages.props b/sources/Directory.Packages.props index 5929646b..8a77753e 100644 --- a/sources/Directory.Packages.props +++ b/sources/Directory.Packages.props @@ -14,6 +14,7 @@ + diff --git a/sources/Experiments/CornellBox/App.cs b/sources/Experiments/CornellBox/App.cs index d0c30ef2..c6c1ddf1 100644 --- a/sources/Experiments/CornellBox/App.cs +++ b/sources/Experiments/CornellBox/App.cs @@ -31,13 +31,13 @@ static App() { Context = GraphicsContext.CreateDirectX12(useValidationLayer: true); } - else if (OperatingSystem.IsLinux()) + else if (OperatingSystem.IsMacOS()) { - Context = GraphicsContext.CreateVulkan(useValidationLayer: true); + Context = GraphicsContext.CreateMetal(useValidationLayer: true); } else { - Context = GraphicsContext.CreateMetal(useValidationLayer: true); + Context = GraphicsContext.CreateVulkan(useValidationLayer: true); } Context.ValidationMessage += static (sender, args) => Console.WriteLine($"[{args.Source} - {args.Severity}] {args.Message}"); @@ -54,13 +54,13 @@ static App() { surface = Surface.Win32(window.Native!.Win32!.Value.Hwnd, Width, Height); } - else if (OperatingSystem.IsLinux()) + else if (OperatingSystem.IsMacOS()) { - surface = Surface.Xlib(window.Native!.X11!.Value.Display, (nint)window.Native.X11.Value.Window, Width, Height); + surface = Surface.Apple(CocoaHelper.CreateLayer(window.Native!.Cocoa!.Value), Width, Height); } else { - surface = Surface.Apple(CocoaHelper.CreateLayer(window.Native!.Cocoa!.Value), Width, Height); + surface = Surface.Xlib(window.Native!.X11!.Value.Display, (nint)window.Native.X11.Value.Window, Width, Height); } swapChain = Context.CreateSwapChain(new() { Surface = surface, ColorTargetFormat = PixelFormat.B8G8R8A8UNorm, DepthStencilTargetFormat = PixelFormat.D32FloatS8UInt }); diff --git a/sources/Experiments/CornellBox/CONVENTIONS.md b/sources/Experiments/CornellBox/CONVENTIONS.md index 455deeea..95ecf1ee 100644 --- a/sources/Experiments/CornellBox/CONVENTIONS.md +++ b/sources/Experiments/CornellBox/CONVENTIONS.md @@ -2,7 +2,7 @@ ## Overview -A dual-mode Cornell Box renderer built on the Zenith.NET multi-backend GPU framework (DirectX12 / Vulkan / Metal). +A dual-mode Cornell Box renderer built on the Zenith.NET multi-backend GPU framework (DirectX12 / Metal / Vulkan). Two rendering modes switchable via ImGui radio buttons at runtime: - **Path Tracing** (mode 0): `ComputePipeline` + inline `RayQuery<>`, progressive accumulation with NEE (Next Event Estimation), Cook-Torrance PBR BRDF (GGX + Schlick Fresnel + Smith G), GGX importance sampling for specular, cosine-weighted hemisphere for diffuse, Russian roulette, environment sky light on ray miss. Only available when `Context.Capabilities.RayTracingSupported` is true. @@ -11,7 +11,7 @@ Two rendering modes switchable via ImGui radio buttons at runtime: ## Current State (2026-03-30) - All files implemented and compiling successfully -- DX12 validation layer clean +- DirectX12 validation layer clean - Camera initial position: (278, 273, -800), Speed=240, FarPlane=2000, looks into the box - Swap chain format: B8G8R8A8UNorm color + D32FloatS8UInt depth/stencil - `Renderer` abstract base class unifies both renderers (`Update` / `Render` / `Resize` + `IDisposable`) @@ -775,10 +775,10 @@ base (FrameBuffer + DepthStencil + Color) β†’ constantBuffer β†’ materialBuffer β†’ indexBuffer β†’ vertexBuffer ``` -## DX12 Specific Notes +## DirectX12 Specific Notes -- `BindingHelper` assigns DX12 register indices by type: CBV(b), SRV(t), UAV(u), Sampler(s) independently numbered -- Vulkan numbers all bindings sequentially; Metal uses argument buffer index +- `BindingHelper` assigns DirectX12 register indices by type: CBV(b), SRV(t), UAV(u), Sampler(s) independently numbered +- Metal uses argument buffer index; Vulkan numbers all bindings sequentially ## C# Code Style diff --git a/sources/NuGet.Packaging.props b/sources/NuGet.Packaging.props index 4b517e21..cf795345 100644 --- a/sources/NuGet.Packaging.props +++ b/sources/NuGet.Packaging.props @@ -7,7 +7,7 @@ $(MSBuildThisFileDirectory)..\.nuget - 0.0.6 + 0.0.7 qian-o Copyright (c) 2026 qian-o Zenith.NET is a modern, cross-platform graphics and compute library for .NET. It provides a unified GPU programming interface supporting DirectX12, Metal, and Vulkan backends. diff --git a/sources/Zenith.NET.Vulkan/Zenith.NET.Vulkan.csproj b/sources/Zenith.NET.Vulkan/Zenith.NET.Vulkan.csproj index 56ad22a6..39132514 100644 --- a/sources/Zenith.NET.Vulkan/Zenith.NET.Vulkan.csproj +++ b/sources/Zenith.NET.Vulkan/Zenith.NET.Vulkan.csproj @@ -9,6 +9,7 @@ +