hadronized / luminance-rs

Type-safe, type-level and stateless Rust graphics framework
https://phaazon.github.io/learn-luminance/
Other
1.09k stars 59 forks source link
gpu graphics opengl rust shaders vulkan webgl

luminance logo

luminance, the safe, type-driven, multi-backend and simple graphics crate

Build Status] docs.rs crates.io License Matrix room

History

luminance is an effort to make graphics rendering simple and elegant. It was originally imagined, designed and implemented by @phaazon in Haskell (here) and eventually ported to Rust in 2016. The core concepts remained the same and the crate has been slowly evolving ever since. At first, used only by @phaazon for his Rust demoscene productions (example here and here, using spectra) and a bunch of curious peeps, it now has more visibility among the graphics ecosystem of Rust.

Currently, that ecosystem is spread into several crates, ideas and people. It is highly recommended to read the great article about the ecosystem by @Icefoxen, here.

However, luminance is a bit different from what it was initially imagined for. People are looking for an easy-to-use crate, with good abstractions and safe-guards against all the bad and dangerous graphics API caveats. luminance has always been about providing a safe, type-safe and elegant API (being Haskell-based makes it heavily use the type system, for instance) but it now has a more unique niche in the ecosystem. Where gfx-hal provides an experience focused on down-to-metal performance and an API very similar to Vulkan’s, luminance provides an API that is, for sure, a bit higher-level, and not Vulkan-based — and hence, yes, it likely won't give you the same performances as with gfx-hal (though no benchmarks have been done so far) — but easier to start with, especially if you don’t already have a background experience with OpenGL or Vulkan.

The strengths of luminance are:

The luminance ecosystem

It is currently composed of several different crates:

Core crates

Backend crates

Platform crates

Other crates

Learning

luminance has two main and official resources to learn:

You should try both ways and see which one fits the best for you!

Contributing

Please read the CONTRIBUTING document.

Dependent projects

Those projects use luminance:

Licenses

luminance is licensed under BSD-3-Clause and the logo is under CC BY-ND.