Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
7684a1d
Add upscaling support and related backend updates
qian-o Sep 2, 2026
908250a
Update Slangc.NET and Uno.WinUI package versions
qian-o Sep 2, 2026
a20c049
Add spatial and temporal upscaling implementations
qian-o Sep 4, 2026
fcaafef
Refactor upscaling passes to streamline operations and remove unused …
qian-o Sep 4, 2026
d46a58e
Refactor upscaling parameters to use InputWidth and InputHeight inste…
qian-o Sep 4, 2026
e66549c
Refactor upscaling structures to unify InputWidth and InputHeight in …
qian-o Sep 4, 2026
edc5d84
Refactor struct init; update Record methods; add BOM
qian-o Sep 4, 2026
94ad99c
Add new shaders for SGSR2 upscaling and update project configuration
qian-o Sep 4, 2026
38c3f6b
Refactor code style, project structure, and shaders
qian-o Sep 4, 2026
af02974
Remove unsafe modifier from generated class declarations
qian-o Sep 4, 2026
8a787a4
Refactor shader pass classes and compilation logic
qian-o Sep 4, 2026
804b370
Update shader passes with DX12 bytecode, refactor Compile.cs
qian-o Sep 4, 2026
b324fd6
Remove Shaders directory from None items in project
qian-o Sep 4, 2026
b44f11f
Add shader compilation and ImGui shader source files
qian-o Sep 4, 2026
6bfc7e3
Refactor ImGuiRenderer shader creation logic
qian-o Sep 4, 2026
4af8a05
Refactor boolean expressions to idiomatic C# style
qian-o Sep 4, 2026
a2e0cde
Refactor shader compilation logic and clean up unused code
qian-o Sep 4, 2026
f1c98bb
Embed compiled shader bytecode in ImGuiRenderer.g.cs
qian-o Sep 4, 2026
d1141e4
Refactor shader definitions and compilation logic for consistency acr…
qian-o Sep 4, 2026
4d90f66
chore: remove generated shader files
qian-o Sep 4, 2026
b642be9
chore: regenerate embedded shader files
qian-o Sep 4, 2026
f0bf22b
chore: regenerate embedded shader files
qian-o Sep 4, 2026
e0bbda4
Refactor shader generators to group descriptors by graphics API and r…
qian-o Sep 4, 2026
8b08db3
Generate DirectX 12 and Vulkan shader binaries
qian-o Sep 4, 2026
54afd96
Refactor shader generators to group descriptors by graphics API and r…
qian-o Sep 4, 2026
bdaf1c7
Generate DirectX 12 and Vulkan shader binaries
qian-o Sep 4, 2026
d70bb4d
Refactor shader compilation logic to improve readability and maintain…
qian-o Sep 5, 2026
09cb2b2
Refactor shader compilation and codegen for clarity
qian-o Sep 5, 2026
b1f7a8a
Generate Metal shader binaries
qian-o Sep 5, 2026
4827bd7
Refactor shader compilation error handling and logging for consistency
qian-o Sep 5, 2026
da3761d
Refactor and fix methods in Compile.cs for clarity
qian-o Sep 5, 2026
637bd1a
Generate DirectX 12 shader binaries
qian-o Sep 5, 2026
8eed46a
Add Sponza project with app logic and utility classes
qian-o Sep 5, 2026
a46fb9f
Refactor: unify rendering logic in new Renderer class
qian-o Sep 5, 2026
d52da9c
Add SharpGLTF.Core, Silk.NET.Input, and Windowing refs
qian-o Sep 5, 2026
8450481
Add UI controls for render scale, upscaling, and time of day
qian-o Sep 5, 2026
9f9d0a7
Update DEVELOPMENT.md with detailed renderer plan
qian-o Sep 5, 2026
423d95d
Update Avalonia, SkiaSharp, and Uno.WinUI versions
qian-o Sep 5, 2026
b575da2
Add RenderSettings struct for managing rendering configurations
qian-o Sep 5, 2026
ba29227
Refactor: rename mode to upscalingMode in foreach loop
qian-o Sep 5, 2026
f63fcda
Update DEVELOPMENT.md with asset integration details and rendering sp…
qian-o Sep 5, 2026
bf50ddd
Update Sponza
qian-o Sep 5, 2026
30dd49a
Implement code changes to enhance functionality and improve performance
qian-o Sep 5, 2026
6d18930
Update DEVELOPMENT.md with detailed project scope, constraints, and r…
qian-o Sep 6, 2026
a3e413f
Update DEVELOPMENT.md to reflect v1.1 baseline, clarifying project sc…
qian-o Sep 6, 2026
373090a
Update DEVELOPMENT.md to reflect v1.2 baseline, clarifying project sc…
qian-o Sep 7, 2026
8322ae9
Refactor code structure for improved readability and maintainability
qian-o Sep 7, 2026
7e5058e
Implement feature X to enhance user experience and optimize performance
qian-o Sep 7, 2026
a2a58b7
Add Sponza rendering pipeline structures and passes
qian-o Sep 8, 2026
1317ce5
Ensure minimum viewport/scissor count and update Math.Max usage
qian-o Sep 8, 2026
4b265d8
Update Vulkan to use dynamic state extensions
qian-o Sep 8, 2026
c8b3a1d
Clarify viewport/scissor handling in render passes
qian-o Sep 8, 2026
3530a00
Refactor scene and shadow shaders to use SceneFrameConstants directly…
qian-o Sep 8, 2026
e829e8f
Use shadow texture directly in shadow data
qian-o Sep 9, 2026
792e71e
Always set CreateMutableFormatBit for image creation
qian-o Sep 9, 2026
c10b77b
Map PixelFormat enums to DXGI formats in SRV desc
qian-o Sep 9, 2026
dab72c3
Bump MAUI and SkiaSharp package versions
qian-o Sep 9, 2026
a5a3309
Refactor scene and shadow rendering logic to improve performance and …
qian-o Sep 9, 2026
d5dc3cf
Refactor code for improved readability and consistency in SceneResour…
qian-o Sep 9, 2026
f7ec45d
Fix texture view configurations for DirectX and Vulkan
qian-o Sep 9, 2026
a6d4d76
Add sRGB support for texture loading in ImageSharp extensions
qian-o Sep 9, 2026
9eb1e18
Refactor LoadTextureFromStream and LoadTextureFromFile methods to inc…
qian-o Sep 9, 2026
23fa4f2
Update Sponza DEVELOPMENT.md for v3.0 specifications and implementati…
qian-o Sep 9, 2026
7eb0b26
Remove renderer, shaders, textures; update docs/spec
qian-o Sep 11, 2026
67d65b6
Add BOM to beginning of Sponza.gltf file
qian-o Sep 11, 2026
88ac9d4
Add Sponza ray tracing design doc to DEVELOPMENT.md
qian-o Sep 11, 2026
0d5e405
Fix BOM in Sponza.gltf to proper JSON opening brace
qian-o Sep 11, 2026
e1ac4a7
Clarify Sponza renderer contract
qian-o Sep 11, 2026
25e3e3d
Clarify Sponza PT and denoising spec
qian-o Sep 11, 2026
843ddad
Implement feature X to enhance user experience and optimize performance
qian-o Sep 11, 2026
2adc413
Refine Sponza path tracing documentation for clarity and accuracy
qian-o Sep 11, 2026
13608e5
Refactor Sponza rendering design documentation to clarify real-time P…
qian-o Sep 11, 2026
2100e95
Add rendering passes for fluid simulation including Output, Scene, Su…
qian-o Sep 12, 2026
6369898
Rewrite DEVELOPMENT.md for unified RT pipeline
qian-o Sep 13, 2026
7f55c0f
Refactor: centralize params, remove unsafe, modernize buffers
qian-o Sep 13, 2026
8f3d928
Refactor simulation and rendering settings management
qian-o Sep 13, 2026
eb59c79
Make Simulation constants public for external access
qian-o Sep 13, 2026
3b2b017
Refactor rendering API: remove wrapper structs, expose fields
qian-o Sep 13, 2026
0ff0115
Refactor resource fields to auto-properties for encapsulation
qian-o Sep 13, 2026
2c23382
Rewrite and formalize Sponza RT pipeline spec
qian-o Sep 13, 2026
63f40f8
Update SharpGLTF.Core and fix DEVELOPMENT.md formatting
qian-o Sep 13, 2026
1c3cb0e
Remove Sponza sample project and all assets
qian-o Sep 13, 2026
748c3da
Rename texture params; improve mipmap and view logic
qian-o Sep 13, 2026
24e2d9a
Move SceneResources to FluidTank.Models namespace
qian-o Sep 13, 2026
acd91ce
Refactor upscaler debug names and init logic
qian-o Sep 13, 2026
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ Continue with the [RHI Guide](https://qian-o.github.io/Zenith.NET/docs/) or buil
[![ImageSharp](https://img.shields.io/nuget/v/Zenith.NET.Extensions.ImageSharp.svg?label=ImageSharp&style=flat-square)](https://www.nuget.org/packages/Zenith.NET.Extensions.ImageSharp)
[![ImGui](https://img.shields.io/nuget/v/Zenith.NET.Extensions.ImGui.svg?label=ImGui&style=flat-square)](https://www.nuget.org/packages/Zenith.NET.Extensions.ImGui)
[![Skia](https://img.shields.io/nuget/v/Zenith.NET.Extensions.Skia.svg?label=Skia&style=flat-square)](https://www.nuget.org/packages/Zenith.NET.Extensions.Skia)
[![Upscaling](https://img.shields.io/nuget/v/Zenith.NET.Extensions.Upscaling.svg?label=Upscaling&style=flat-square)](https://www.nuget.org/packages/Zenith.NET.Extensions.Upscaling)

### Views

Expand Down
1 change: 1 addition & 0 deletions Zenith.NET.slnx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<Project Path="sources/Extensions/Zenith.NET.Extensions.ImageSharp/Zenith.NET.Extensions.ImageSharp.csproj" />
<Project Path="sources/Extensions/Zenith.NET.Extensions.ImGui/Zenith.NET.Extensions.ImGui.csproj" />
<Project Path="sources/Extensions/Zenith.NET.Extensions.Skia/Zenith.NET.Extensions.Skia.csproj" />
<Project Path="sources/Extensions/Zenith.NET.Extensions.Upscaling/Zenith.NET.Extensions.Upscaling.csproj" />
</Folder>
<Folder Name="/Solution Items/">
<File Path="sources/Directory.Build.props" />
Expand Down
6 changes: 5 additions & 1 deletion documents/docs/fundamentals/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ commandBuffer.Draw(vertexCount, 1, 0, 0);
commandBuffer.EndRenderPass();
```

`BeginRenderPass` initializes viewports and scissors from the attachment size. Set them afterward when rendering to a smaller region.
`BeginRenderPass` resets the viewport and scissor state to one pair, regardless of the number of color attachments. The pair covers the selected mip level of the first color attachment. When there are no color attachments, its dimensions come from the depth/stencil attachment's selected mip level instead.

`SetViewports` and `SetScissors` replace the corresponding active arrays, including their counts. Call them after `BeginRenderPass` to change the rendering region or configure multiple viewports. Both arrays must be nonempty and within the device's supported limits, and their counts must match before drawing. Using more than one pair requires device support for multiple viewports.

The array indices identify viewport/scissor slots, not color attachments. See [MRT and Viewports](../workloads/rasterization.md#mrt-and-viewports) for the distinction.

## Transfer Data

Expand Down
10 changes: 8 additions & 2 deletions documents/docs/workloads/rasterization.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,16 @@ commandBuffer.Draw(vertexCount, 1, 0, 0);
commandBuffer.EndRenderPass();
```

Choose `Load`, `Clear`, or `DontCare` for each attachment according to whether previous contents are needed. `BeginRenderPass` initializes the viewport and scissor from the attachment size.
Choose `Load`, `Clear`, or `DontCare` for each attachment according to whether previous contents are needed. `BeginRenderPass` initializes one viewport/scissor pair, independent of the color attachment count. Its dimensions come from the first color attachment's selected mip level, or the depth/stencil attachment's selected mip level when there are no color attachments.

Set a smaller viewport and scissor after beginning the pass when rendering to only part of an attachment.
Set a smaller viewport and scissor after beginning the pass when rendering to only part of an attachment. To change the number of active viewports, set both arrays with matching counts before drawing. See [Commands](../fundamentals/commands.md#record-a-render-pass) for the count and device requirements.

Use `Draw` for non-indexed geometry and `DrawIndexed` for indexed geometry. `DrawIndirect` and `DrawIndexedIndirect` read commands from a buffer created with `BufferUsages.Indirect`.

## MRT and Viewports

Multiple render targets (MRT) use fragment shader outputs `SV_Target0`, `SV_Target1`, and so on to write to color attachments at the corresponding indices. Keep the output indices aligned with both `AttachmentFormats.ColorFormats` and the `colorAttachments` array passed to `BeginRenderPass`. These outputs share the viewport transform and scissor selected for the primitive. Multiple color attachments do not require multiple viewports or scissors.

Multiple viewports instead let different primitives select different viewport transforms and scissor rectangles. The pre-rasterization shader output `SV_ViewportArrayIndex` selects the viewport/scissor pair for a primitive, not a color attachment. Without this output, primitives use pair zero. Setting multiple viewports does not duplicate geometry or create additional render targets.

See [Bindless Resources](../fundamentals/bindless-resources.md) for shader-visible resources and [Synchronization](../fundamentals/synchronization.md) when GPU work produces indirect arguments.
16 changes: 8 additions & 8 deletions sources/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,23 @@
</PropertyGroup>

<ItemGroup>
<PackageVersion Include="Avalonia" Version="12.1.1" />
<PackageVersion Include="Avalonia" Version="12.1.2" />
<PackageVersion Include="Hexa.NET.ImGui" Version="2.2.9" />
<PackageVersion Include="Metal.NET" Version="2.4.0" />
<PackageVersion Include="Microsoft.Maui.Controls" Version="10.0.90" />
<PackageVersion Include="Microsoft.WindowsAppSDK" Version="2.3.1" />
<PackageVersion Include="Roslynator.Analyzers" Version="4.15.0" />
<PackageVersion Include="Microsoft.Maui.Controls" Version="10.0.101" />
<PackageVersion Include="Microsoft.WindowsAppSDK" Version="2.4.0" />
<PackageVersion Include="Roslynator.Analyzers" Version="5.0.0" />
<PackageVersion Include="Silk.NET.Direct3D11" Version="2.23.0" />
<PackageVersion Include="Silk.NET.Direct3D12" Version="2.23.0" />
<PackageVersion Include="Silk.NET.Direct3D9" Version="2.23.0" />
<PackageVersion Include="Silk.NET.Vulkan" Version="2.23.0" />
<PackageVersion Include="Silk.NET.Vulkan.Extensions.ANDROID" Version="2.23.0" />
<PackageVersion Include="Silk.NET.Vulkan.Extensions.EXT" Version="2.23.0" />
<PackageVersion Include="Silk.NET.Vulkan.Extensions.KHR" Version="2.23.0" />
<PackageVersion Include="SixLabors.ImageSharp" Version="4.0.0" />
<PackageVersion Include="SkiaSharp" Version="4.151.0" />
<PackageVersion Include="Slangc.NET" Version="2026.14.1" />
<PackageVersion Include="Uno.WinUI" Version="6.6.184" />
<PackageVersion Include="SixLabors.ImageSharp" Version="4.1.1" />
<PackageVersion Include="SkiaSharp" Version="4.152.0" />
<PackageVersion Include="Slangc.NET" Version="2026.16.1" />
<PackageVersion Include="Uno.WinUI" Version="6.7.103" />
</ItemGroup>

</Project>
14 changes: 6 additions & 8 deletions sources/Experiments/CornellBox/App.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ static App()

public static void Run()
{
window.Update += delta =>
window.Update += static delta =>
{
if (Width is 0 || Height is 0)
{
Expand All @@ -129,14 +129,14 @@ public static void Run()

ImGui.GetBackgroundDrawList().AddImage(imGui.Binding(activeRenderer.Color), new(0, 0), new(Width / DpiScale.X, Height / DpiScale.Y));

ImGuiHelper.Overlay(() =>
ImGuiHelper.Overlay(static () =>
{
ImGui.Text(Context.Capabilities.DeviceName);
ImGui.Text($"GraphicsApi: {Context.GraphicsApi}");
ImGui.Text($"FPS: {ImGui.GetIO().Framerate:F1}");
});

ImGuiHelper.Settings(() =>
ImGuiHelper.Settings(static () =>
{
ImGui.Text("Render Mode:");

Expand Down Expand Up @@ -168,7 +168,7 @@ public static void Run()
});
};

window.Render += _ =>
window.Render += static _ =>
{
if (Width is 0 || Height is 0)
{
Expand All @@ -181,17 +181,15 @@ public static void Run()
activeRenderer.Render(commandBuffer);

commandBuffer.Transition(swapChain.Drawable, default, TextureLayout.Undefined, TextureLayout.ColorAttachment);

imGui.Render(commandBuffer, ColorAttachment.DontCare(swapChain.Drawable));

imGui.Render(commandBuffer, ColorAttachment.Clear(swapChain.Drawable, default));
commandBuffer.Transition(swapChain.Drawable, default, TextureLayout.ColorAttachment, TextureLayout.Present);

commandBuffer.Submit().Wait();

swapChain.Present();
};

window.Resize += _ =>
window.Resize += static _ =>
{
if (Width is 0 || Height is 0)
{
Expand Down
46 changes: 0 additions & 46 deletions sources/Experiments/CornellBox/Assets/Shaders/.clang-format

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,8 @@ float3 TracePath(float3 origin, float3 direction, inout uint rng)

if (query.CommittedStatus() == COMMITTED_NOTHING)
{
float3 skyColor = lerp(float3(0.15, 0.12, 0.10), float3(0.30, 0.35, 0.45), saturate(direction.y * 0.5 + 0.5));
float3 skyColor =
lerp(float3(0.15, 0.12, 0.10), float3(0.30, 0.35, 0.45), saturate(direction.y * 0.5 + 0.5));
radiance += throughput * skyColor;

break;
Expand Down Expand Up @@ -472,7 +473,8 @@ void CSMain(uint3 dispatchThreadID: SV_DispatchThreadID)
return;
}

uint rng = PCGHash(pixel.x + pixel.y * pathTracing.Width + pathTracing.FrameCount * pathTracing.Width * pathTracing.Height);
uint rng = PCGHash(pixel.x + pixel.y * pathTracing.Width +
pathTracing.FrameCount * pathTracing.Width * pathTracing.Height);

uint sampleIndex = pathTracing.FrameCount + 1;
float hx = Halton(sampleIndex, 2);
Expand Down
Loading