Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 26 additions & 57 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,91 +1,60 @@
<p align="center">
<img src="documents/images/Zenith.NET.svg" alt="Zenith.NET icon" width="128" height="128">
<img src="https://raw.githubusercontent.com/qian-o/Zenith.NET/master/documents/images/Zenith.NET.png" alt="Zenith.NET icon" width="128" height="128">
</p>

<h1 align="center">Zenith.NET</h1>

<p align="center">
A modern rendering hardware interface for .NET.
Cross-platform graphics for .NET
</p>

<p align="center">
<a href="https://qian-o.github.io/Zenith.NET/learn/">Learn</a> ·
<a href="https://qian-o.github.io/Zenith.NET/">Documentation</a> ·
<a href="https://qian-o.github.io/Zenith.NET/learn/samples.html">Samples</a> ·
<a href="https://qian-o.github.io/Zenith.NET/api/">API Reference</a> ·
<a href="https://www.nuget.org/packages?q=Zenith.NET">NuGet</a>
<a href="https://www.nuget.org/packages/Zenith.NET">NuGet</a>
</p>

## 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)
2 changes: 1 addition & 1 deletion documents/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ _disableAffix: true
<resource key="home.actions.reference"></resource>
</a>
</div>
<p class="backend-note">DirectX · Metal · Vulkan</p>
<p class="backend-note">DirectX 12 · Metal 4 · Vulkan 1.4</p>
</div>
<div class="geometry-stage" data-home-scene="">
<canvas aria-label="@home.scene.description" data-resource-label="home.scene.description" id="home-geometry" role="img" tabindex="0"></canvas>
Expand Down
11 changes: 0 additions & 11 deletions documents/learn/concepts/platform-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,6 @@ view.RenderRequested += (_, args) =>
<slot name="undefined"><a class="xref" href="xref:Zenith.NET.TextureLayout.Undefined"><code>Undefined</code></a></slot>
</resource>
</p>
<p>
<resource key="concepts.platforms.frame.reference">
<slot name="zenithViewHelperDrawableFormat"><a class="xref" href="xref:Zenith.NET.Views.ZenithViewHelper.DrawableFormat"><code>ZenithViewHelper.DrawableFormat</code></a></slot>
</resource>
</p>
<p>
<resource key="concepts.platforms.lifecycle.context">
<slot name="descWidth"><code><a class="code-reference" href="xref:Zenith.NET.Texture.Desc">Desc</a>.<a class="code-reference" href="xref:Zenith.NET.TextureDesc.Width">Width</a></code></slot>
Expand Down Expand Up @@ -285,12 +280,6 @@ view.RenderRequested += (_, args) =>
<slot name="renderRequested"><a class="xref" href="xref:Zenith.NET.Views.IZenithView.RenderRequested"><code>RenderRequested</code></a></slot>
</resource>
</p>
<p>
<resource key="concepts.platforms.integration.guidance">
<slot name="avaloniaPackage"><code>Zenith.NET.Views.Avalonia</code></slot>
</resource>
</p>

<p>
<resource key="concepts.platforms.integration.context">
<slot name="useZenithView"><code>UseZenithView</code></slot>
Expand Down
8 changes: 6 additions & 2 deletions documents/learn/concepts/resource-management.md
Original file line number Diff line number Diff line change
Expand Up @@ -381,10 +381,14 @@ title: '@concepts.resources.title'
</li>
</ul>
<p>
<resource key="concepts.resources.transfers.notes">
<slot name="link"><a href="~/learn/concepts/synchronization.md#cpu-and-gpu"><resource key="concepts.resources.transfers.notes.link"></resource></a></slot>
<resource key="concepts.resources.transfers.layouts">
<slot name="copyDst"><a class="xref" href="xref:Zenith.NET.TextureLayout.CopyDst"><code>CopyDst</code></a></slot>
<slot name="copySrc"><a class="xref" href="xref:Zenith.NET.TextureLayout.CopySrc"><code>CopySrc</code></a></slot>
</resource>
</p>
<p>
<resource key="concepts.resources.transfers.notes"></resource>
</p>
<h2 id="place-resources-in-a-heap-when-allocation-control-is-needed">
<resource key="concepts.resources.allocation.title"></resource>
</h2>
Expand Down
6 changes: 3 additions & 3 deletions documents/learn/concepts/shader-data-and-binding.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ title: '@concepts.shaders.title'
<slot name="zenithCompiler"><a class="xref" href="xref:Zenith.NET.ZenithCompiler"><code>ZenithCompiler</code></a></slot>
<slot name="shaderDesc"><a class="xref" href="xref:Zenith.NET.ShaderDesc"><code>ShaderDesc</code></a></slot>
<slot name="graphicsApi"><a class="xref" href="xref:Zenith.NET.GraphicsContext.GraphicsApi"><code>GraphicsApi</code></a></slot>
<slot name="dxil"><code>DXIL</code></slot>
<slot name="metallib"><code>metallib</code></slot>
<slot name="spirv"><code>SPIR-V</code></slot>
</resource>
</p>
<p>
Expand Down Expand Up @@ -146,9 +149,6 @@ commandBuffer.Dispatch(groupCountX, groupCountY, 1);

<p>
<resource key="concepts.shaders.binding.guidance">
<slot name="commandBuffer"><code>commandBuffer</code></slot>
<slot name="computePipeline"><code>computePipeline</code></slot>
<slot name="constantBuffer"><code>constantBuffer</code></slot>
<slot name="bufferUsagesConstant"><a class="xref" href="xref:Zenith.NET.BufferUsages.Constant"><code>BufferUsages.Constant</code></a></slot>
</resource>
</p>
Expand Down
Loading