diff --git a/README.md b/README.md index 59b05e5e..e25cdddf 100644 --- a/README.md +++ b/README.md @@ -1,91 +1,60 @@ 

- Zenith.NET icon + Zenith.NET icon

Zenith.NET

- A modern rendering hardware interface for .NET. + Cross-platform graphics for .NET

- Learn · + Documentation · Samples · API Reference · - NuGet + NuGet

-## Overview +Zenith.NET is a rendering hardware interface (RHI) for .NET, with a shared C# API for graphics and compute across **DirectX 12, Metal 4, and Vulkan 1.4**. -Zenith.NET is a rendering hardware interface (RHI) that provides one C# API for graphics and compute across DirectX 12, Metal 4, and Vulkan 1.4. It gives applications explicit control over GPU resources, pipelines, command recording, synchronization, and presentation. +It gives applications explicit control over GPU resources, command recording, and synchronization. -Build rasterization and compute workloads, access shader resources through bindless handles, and coordinate GPU work through queues, barriers, and timelines. Inline ray tracing and mesh shading are available through the same API when the device exposes the corresponding capabilities. +## Getting started -## Getting Started - -In a .NET 10 project, install the core package and a backend supported by your platform and graphics driver. For Vulkan: - -```console -dotnet add package Zenith.NET -dotnet add package Zenith.NET.Vulkan -``` - -Create a graphics context: - -```csharp -using Zenith.NET; -using Zenith.NET.Vulkan; - -using GraphicsContext context = GraphicsContext.CreateVulkan(useValidationLayer: true); - -context.ValidationMessage += static (_, args) => Console.WriteLine($"[{args.Severity}] {args.Message}"); -``` - -Follow [First Triangle](https://qian-o.github.io/Zenith.NET/learn/first-triangle.html) to build a .NET console application with NuGet packages, from an empty window to the first rendered frame. +Follow [First Triangle](https://qian-o.github.io/Zenith.NET/learn/first-triangle.html) to create a .NET 10 console application and draw your first triangle. ## Packages -Choose packages by their role in your application. Add a graphics backend, then the compiler, extensions, or UI integration you need. - -### Core and Backends +### Graphics packages | Package | Purpose | | --- | --- | -| `Zenith.NET` | Shared graphics and compute API, resource types, and command interfaces. | -| `Zenith.NET.Compiler` | Compile Slang shaders for the selected graphics API. | -| `Zenith.NET.DirectX12` | DirectX 12 backend. | -| `Zenith.NET.Metal` | Metal 4 backend. | -| `Zenith.NET.Vulkan` | Vulkan 1.4 backend. | +| [Zenith.NET](https://www.nuget.org/packages/Zenith.NET) | Shared graphics and compute API. | +| [Zenith.NET.Compiler](https://www.nuget.org/packages/Zenith.NET.Compiler) | Compiles Slang shaders for the selected graphics API. | +| [Zenith.NET.DirectX12](https://www.nuget.org/packages/Zenith.NET.DirectX12) | DirectX 12 implementation of the shared API. | +| [Zenith.NET.Metal](https://www.nuget.org/packages/Zenith.NET.Metal) | Metal 4 implementation of the shared API. | +| [Zenith.NET.Vulkan](https://www.nuget.org/packages/Zenith.NET.Vulkan) | Vulkan 1.4 implementation of the shared API. | ### Extensions | Package | Purpose | | --- | --- | -| `Zenith.NET.Extensions.ImageSharp` | Load images into GPU textures with ImageSharp. | -| `Zenith.NET.Extensions.ImGui` | Dear ImGui rendering and input integration. | -| `Zenith.NET.Extensions.Skia` | SkiaSharp rendering with Zenith.NET textures. | -| `Zenith.NET.Extensions.Upscaling` | Spatial and temporal image upscaling. | +| [Zenith.NET.Extensions.ImageSharp](https://www.nuget.org/packages/Zenith.NET.Extensions.ImageSharp) | Loads images into GPU textures using ImageSharp. | +| [Zenith.NET.Extensions.ImGui](https://www.nuget.org/packages/Zenith.NET.Extensions.ImGui) | Dear ImGui rendering and input integration. | +| [Zenith.NET.Extensions.Skia](https://www.nuget.org/packages/Zenith.NET.Extensions.Skia) | SkiaSharp drawing on GPU textures. | +| [Zenith.NET.Extensions.Upscaling](https://www.nuget.org/packages/Zenith.NET.Extensions.Upscaling) | Spatial and temporal image upscaling. | -### UI Integrations +### UI integrations | Package | Purpose | | --- | --- | -| `Zenith.NET.Views` | Shared rendering-view interfaces and frame events. | -| `Zenith.NET.Views.Avalonia` | Avalonia rendering control. | -| `Zenith.NET.Views.Maui` | .NET MAUI rendering control. | -| `Zenith.NET.Views.WinForms` | Windows Forms rendering control. | -| `Zenith.NET.Views.WinUI` | WinUI 3 and Uno rendering control. | -| `Zenith.NET.Views.WPF` | WPF rendering control. | - -See [Platform Integration](https://qian-o.github.io/Zenith.NET/learn/concepts/platform-integration.html) for native surfaces, frame ownership and UI integration choices. - -## Documentation and Examples - -- [Learn](https://qian-o.github.io/Zenith.NET/learn/) — a complete triangle tutorial and guides to the programming model. -- [Samples](https://qian-o.github.io/Zenith.NET/learn/samples.html) — focused examples with C# and Slang source links. -- [API Reference](https://qian-o.github.io/Zenith.NET/api/) — types and members. -- [Experiments](sources/Experiments/) — sample applications and utilities in this repository. +| [Zenith.NET.Views](https://www.nuget.org/packages/Zenith.NET.Views) | Shared interfaces and frame events for rendering controls. | +| [Zenith.NET.Views.Avalonia](https://www.nuget.org/packages/Zenith.NET.Views.Avalonia) | Avalonia rendering control. | +| [Zenith.NET.Views.Maui](https://www.nuget.org/packages/Zenith.NET.Views.Maui) | .NET MAUI rendering control. | +| [Zenith.NET.Views.WinForms](https://www.nuget.org/packages/Zenith.NET.Views.WinForms) | Windows Forms rendering control. | +| [Zenith.NET.Views.WinUI](https://www.nuget.org/packages/Zenith.NET.Views.WinUI) | WinUI and Uno Platform rendering control. | +| [Zenith.NET.Views.WPF](https://www.nuget.org/packages/Zenith.NET.Views.WPF) | WPF rendering control. | ## License -Zenith.NET is licensed under the [MIT License](LICENSE). +[MIT](https://github.com/qian-o/Zenith.NET/blob/master/LICENSE) diff --git a/documents/index.md b/documents/index.md index 824760d0..4e9115c8 100644 --- a/documents/index.md +++ b/documents/index.md @@ -26,7 +26,7 @@ _disableAffix: true -

DirectX · Metal · Vulkan

+

DirectX 12 · Metal 4 · Vulkan 1.4

diff --git a/documents/learn/concepts/platform-integration.md b/documents/learn/concepts/platform-integration.md index 8aed9607..39c00270 100644 --- a/documents/learn/concepts/platform-integration.md +++ b/documents/learn/concepts/platform-integration.md @@ -181,11 +181,6 @@ view.RenderRequested += (_, args) => Undefined

-

- - ZenithViewHelper.DrawableFormat - -

Desc.Width @@ -285,12 +280,6 @@ view.RenderRequested += (_, args) => RenderRequested

-

- - Zenith.NET.Views.Avalonia - -

-

UseZenithView diff --git a/documents/learn/concepts/resource-management.md b/documents/learn/concepts/resource-management.md index f1a2726d..8c46cf79 100644 --- a/documents/learn/concepts/resource-management.md +++ b/documents/learn/concepts/resource-management.md @@ -381,10 +381,14 @@ title: '@concepts.resources.title'

- - + + CopyDst + CopySrc

+

+ +

diff --git a/documents/learn/concepts/shader-data-and-binding.md b/documents/learn/concepts/shader-data-and-binding.md index e13d29f0..a7f6054d 100644 --- a/documents/learn/concepts/shader-data-and-binding.md +++ b/documents/learn/concepts/shader-data-and-binding.md @@ -16,6 +16,9 @@ title: '@concepts.shaders.title' ZenithCompiler ShaderDesc GraphicsApi + DXIL + metallib + SPIR-V

@@ -146,9 +149,6 @@ commandBuffer.Dispatch(groupCountX, groupCountY, 1);

- commandBuffer - computePipeline - constantBuffer BufferUsages.Constant

diff --git a/documents/learn/first-triangle.md b/documents/learn/first-triangle.md index 7ea83be7..65c9f230 100644 --- a/documents/learn/first-triangle.md +++ b/documents/learn/first-triangle.md @@ -20,7 +20,6 @@ title: '@tutorial.title'

- net10.0

@@ -62,15 +61,7 @@ title: '@tutorial.title'

- - CAMetalLayer.cs - -

-

- - - - +

@@ -124,15 +115,9 @@ title: '@tutorial.title'

3.

-

- - CocoaHelper.cs - -

Program.cs - Main

@@ -194,10 +179,7 @@ using Zenith.NET.Vulkan;

- IWindow window - - - + IWindow window

@@ -227,13 +209,15 @@ context.ValidationMessage += static (_, args) => Console.WriteLine($"[{args.Seve

+

+ + CocoaHelper.cs + +

window.Center() - window.Run() - - - + window.Run()

@@ -292,7 +276,6 @@ SwapChain swapChain = context.CreateSwapChain(new() B8G8R8A8UNorm UNorm - swapChain.Desc.Format

@@ -320,11 +303,7 @@ context.Dispose();

- _ - window.Run(); - - - + window.Run()

@@ -405,7 +384,7 @@ window.Render += _ =>

FramebufferResize - window.Run(); + window.Run()

@@ -463,10 +442,7 @@ using System.Runtime.InteropServices;

- Program.cs - - - + Program.cs

@@ -482,8 +458,6 @@ file struct Vertex(Vector3 position, Vector4 color)

- file - Program.cs LayoutKind.Sequential Position Color @@ -494,10 +468,7 @@ file struct Vertex(Vector3 position, Vector4 color)

- window.Render += _ => - - - + window.Render += _ =>

@@ -511,13 +482,7 @@ Vertex[] vertices = ```

- - Vertex - new - Vector3 - Vector4 - w = 1 - +

@@ -585,7 +550,6 @@ unsafe vertexBuffer.Dispose(); swapChain.Dispose(); Program.cs -

@@ -816,9 +780,6 @@ inputLayout.Add(new() { Format = ElementFormat.Float4, Semantic = ElementSemanti GraphicsPipeline

-

- -