Licht 0.1.0-beta.2

This is a prerelease version of Licht.
dotnet add package Licht --version 0.1.0-beta.2                
NuGet\Install-Package Licht -Version 0.1.0-beta.2                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Licht" Version="0.1.0-beta.2" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Licht --version 0.1.0-beta.2                
#r "nuget: Licht, 0.1.0-beta.2"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Licht as a Cake Addin
#addin nuget:?package=Licht&version=0.1.0-beta.2&prerelease

// Install Licht as a Cake Tool
#tool nuget:?package=Licht&version=0.1.0-beta.2&prerelease                

Licht

NuGet Badge NuGet Badge

A thin but opinionated abstraction layer to write Vulkan Code in C# (using Silk.NET) with fewer boilerplate code. (work in progress, see Examples folder for some examples)

Get to the Triangle in less than 50 lines of code:

using Licht.Applications;
using Licht.Core;
using Licht.Vulkan;
using Licht.Vulkan.Memory;
using Licht.Vulkan.Pipelines;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Silk.NET.Windowing;

var opts = ApplicationSpecification.Default with {ApplicationName = "Triangle"};
var builder = new ApplicationBuilder(opts);

builder.Services.AddSingleton<ILogger, Logger>();
builder.Services.AddWindow(opts);
builder.Services.AddVulkanRenderer<PassthroughAllocator>();

{
    using var app = builder.Build<TriangleApplication>();
    app.Run();
}

sealed class TriangleApplication : WindowedApplication
{
    private readonly VkGraphicsDevice _device;
    private readonly VkGraphicsPipeline _pipeline;
    private readonly PipelineEffect _effect;
    public TriangleApplication(ILogger logger, VkGraphicsDevice device, IWindow window, VkRenderer renderer) : base(logger, renderer, window)
    {
        _device = device;
        var passDescription = GraphicsPipelineDescription.Default();
        _effect = PipelineEffect.BuildEffect(_device, "./assets/shaders/triangle.vert.spv", "./assets/shaders/triangle.frag.spv", null);
        _pipeline = new VkGraphicsPipeline(_device, _effect, passDescription, default, Renderer.RenderPass!.Value);
    }

    public override void DrawFrame(CommandBuffer cmd, float deltaTime)
    {
        cmd.BindGraphicsPipeline(_pipeline);
        cmd.Draw(3, 1, 0, 0);
    }

    public override void Release()
    {
        _device.WaitIdle();
        _pipeline.Dispose();        
        _effect.Dispose();
        base.Release();
    }
}

There are currently examples for:

  • Triangle Example
  • ImGui Example
  • Compute Shader (small raytraced sphere) Example
Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.1.0-beta.2 236 10/15/2023
0.1.0-alpha.5 77 10/15/2023