Home

Awesome

LiteFX

An extensible, descriptive, modern computer graphics and rendering engine, written in C++23.

<p align="center"> <img src="https://raw.githubusercontent.com/crud89/LiteFX/main/docs/img/litefx_rm_banner.png"> </p> <div align="center">

GitHub GitHub Workflow Status Latest release Released at Issues Pull Requests Documentation

</div>

About

LiteFX is a computer graphics engine, that can be used to quick-start developing applications using Vulkan 🌋 and/or DirectX 12 ❎ rendering APIs. It provides a flexible abstraction layer over modern graphics pipelines. Furthermore, it can easily be build and integrated using CMake. It naturally extents build scripts with functions that can be used to handle assets and compile shaders † and model dependencies to both.

The engine design follows an descriptive approach, which means that an application focuses on configuring what it needs and the engine then takes care of handling those requirements. To support this, the API also provides a fluent builder interface. Here is an example of how to easily setup a render pass graphics pipeline with a few lines of code:

SharedPtr<RenderPass> renderPass = device->buildRenderPass("Geometry")
    .renderTarget(RenderTargetType::Present, Format::B8G8R8A8_UNORM, MultiSamplingLevel::x1, RenderTargetFlags::Clear, { 0.f, 0.f, 0.f, 1.f })
    .renderTarget(RenderTargetType::DepthStencil, Format::D32_SFLOAT, MultiSamplingLevel::x1, RenderTargetFlags::Clear, { 1.f, 0.f, 0.f, 0.f });

UniquePtr<RenderPipeline> renderPipeline = device->buildRenderPipeline(*renderPass, "Geometry")
    .inputAssembler(inputAssembler)
    .rasterizer(device->buildRasterizer()
        .polygonMode(PolygonMode::Solid)
        .cullMode(CullMode::BackFaces)
        .cullOrder(CullOrder::ClockWise)
        .lineWidth(1.f))
    .layout(device->buildPipelineLayout()
        .descriptorSet(DescriptorSets::Constant, ShaderStage::Vertex | ShaderStage::Fragment)
            .withUniform(0, sizeof(CameraBuffer))
            .add()
        .descriptorSet(DescriptorSets::PerFrame, ShaderStage::Vertex)
            .withUniform(0, sizeof(TransformBuffer))
            .add())
    .shaderProgram(device->buildShaderProgram()
        .withVertexShaderModule("shaders/basic_vs." + FileExtensions<TRenderBackend>::SHADER)
        .withFragmentShaderModule("shaders/basic_fs." + FileExtensions<TRenderBackend>::SHADER));

LiteFX is written in modern C++23, following established design patterns to make it easy to learn and adapt. Its focus is make the performance of modern graphics APIs easily accessible, whilst retaining full flexibility.

† Shaders can be built using glslc or DXC. glslc can be used to compile HLSL and GLSL shaders into SPIR-V for the Vulkan backend. DXC can only compile HLSL, but can target SPIR-V and DXIL, that's why it is preferred over glslc.

Key Features

Getting Started

If you just want to start using LiteFX, you can acquire binaries of the latest version from the releases page and follow the project setup and quick start guides. If you want to perform a custom build, check out the building guide. For a collection of tutorials and more in-depth information on how to use the engine and work with the code base, take a look at the documentation and the project wiki.

Dependencies

All dependencies are automatically installed using vcpkg, when performing a manual build. The engine core by itself only has one hard dependency:

Depending on which rendering backends are build, the following dependencies are additionally linked against:

The math module can optionally be built with converters for the following math and linear algebra libraries:

Furthermore, the samples also use some libraries for convenience. Those dependencies are not exported and are not required by your application. You can use whatever replacement suits you best instead.

Contribute

If you are having trouble using the engine, found a bug or have suggestions, just drop an issue. Keep in mind that this project is developed in my free time and I might not be able to provide any advanced support. If you want to, feel free to provide improvements by creating a pull request.

Projects using LiteFX

<!-- Currently none, lol -->

Want to add yours? Feel free to contact me!

License

LiteFX is licensed under the permissive MIT license. The documentation (i.e. the contents of the docs folder of this repository, especially the LiteFX logo, banner and icon) is licensed under CC-BY 4.0. Parts of this software are from third parties and are licensed under different terms. By using or redistributing this software, you agree to the terms of the third-party licenses mentioned in the NOTICE file, depending on the parts you use or re-distribute. Please refer to the above list to see which license terms you have to agree to.

If you want to use LiteFX in your projects, linking to project website and/or putting the logo in your project description is much appreciated.