Crates.io | renderling |
lib.rs | renderling |
version | 0.4.9 |
source | src |
created_at | 2022-02-17 01:11:29.165955 |
updated_at | 2024-09-20 21:11:00.643047 |
description | User-friendly real-time rendering. 🍖 |
homepage | |
repository | https://github.com/schell/renderling |
max_upload_size | |
id | 533701 |
size | 802,535 |
Renderling is an innovative, GPU-driven renderer designed for efficient scene rendering with a focus on leveraging GPU capabilities for nearly all rendering operations. Utilizing Rust for shader development, it ensures memory safety and cross-platform compatibility, including web platforms. The project, currently in the alpha stage, aims for rapid loading of GLTF files, handling large scenes, and supporting numerous lights. Development emphasizes performance, ergonomics, observability and the use of modern rendering techniques like forward+ rendering and physically based shading.
This project is funded through NGI Zero Core, a fund established by NLnet with financial support from the European Commission's Next Generation Internet program. Learn more at the NLnet project page.
renderling
holds entire scenes of geometry, textures, materials, lighting, even the scene graph itself - in GPU buffers.
All but a few of the rendering operations happen on the GPU.
The CPU is used to interact with the filesystem to marshall data to the GPU and to update transforms.
Shaders are written in Rust, via rust-gpu
.
renderling
Data is easily staged on the GPU using an automatically reference counted slab allocator that provides access from the CPU.
Your scene geometry, materials, animations - all of it - live on the GPU, while the CPU has easy access to read and modify that data, without borrowing - allowing you to send your data through threads to anything that needs it.
Having everything on the GPU makes renderling
very effective at rendering certain types of scenes.
Specifically renderling
aims to be good at rendering scenes with a moderate level of unique geometry,
(possibly a large amount of repeated geometry), with a small number of large textures (or large number of small textures),
and lots of lighting effects.
Tight integration with GLTF:
Image based lighting + analytical lighting
Good documentation
image
cratetext
- on by default)gltf
(cargo feature gltf
- on by default)Shaders are written in Rust via rust-gpu
where possible, falling back to wgsl
where needed.
Renderling takes a forward+ approach to rendering.
By default it uses a single uber-shader for rendering.
renderling noun
A small beast that looks cute up close, ready to do your graphics bidding.
Ghost in the machine, lighting your scene with magic. Cute technology.
crates/renderling-shader
Contains Rust shader code that can be shared on CPU and GPU (using rust-gpu
to compile to SPIR-V).
Most of the shader code is here!
Certain tasks require atomics which doesn't work from rust-gpu
to wgpu
yet. See NOTES.md.
This crate is a member of the workspace so you get nice editor tooling while writing shaders in Rust.
You can also write sanity tests that run with cargo test
.
Things just work like BAU.
shaders
Contains a thin crate wrapper around renderling-shader
.
Provides the spirv annotations for shaders.
Contains a program that compiles Rust into SPIR-V and copies .spv files into the main renderling
crate.
crates/renderling
The main crate. Contains CPU Rust code for creating pipelines and managing resources, making render passes, etc. Contains tests, some using image comparison of actual frame renders for consistency and backwards compatibility.
img
Image assets for tests (textures, etc.)
test_img
Reference images to use for testing.
crates/example
Contains an example of using the renderling
crate to make an application.
Tests use renderling
in headless mode and generate images that are compared to expected output.
cargo test
The shaders/
folder is a crate that is excluded from the cargo workspace.
It compiles into a program that can be run to generate the shaders:
cd shaders/ && cargo run --release
RUSTFLAGS=--cfg=web_sys_unstable_apis trunk build crates/example-wasm/index.html && basic-http-server -a 127.0.0.1:8080 crates/example-wasm/dist
This work will always be free and open source. If you use it (outright or for inspiration), please consider donating.
Many projects were born from first solving a need within renderling
.
Some of these solutions were then spun off into their own projects.
crabslab
A slab allocator for working across CPU/GPU boundaries.loading-bytes
A cross-platform (including the web) and comedically tiny way of loading files to bytes.moongraph
A DAG and resource graph runner.naga
gltf
Sponsoring this project contributes to the ecosystem.
Renderling is free and open source. All code in this repository is dual-licensed under either:
MIT License (LICENSE-MIT or http://opensource.org/licenses/MIT)
Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
at your option. This means you can select the license you prefer! This dual-licensing approach is the de-facto standard in the Rust ecosystem and there are very good reasons to include both.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
I keep a list of (un)organized notes about this project here. I keep a devlog here.