rendy-pbr
This is a small, realtime physically-based renderer written with rendy
, a 'make-your-own-renderer' toolkit
which builds on gfx-hal
by providing a render graph, compile- and run-time safety checks, and
other helpers. It is a testbed for rendy
and Amethyst; much or all of what is implemented here will eventually be added to the Amethyst renderer in some form.
Planned features/next steps:
- Physically based shading model
- Point lights
- Basic
glTF
import - HDR rendering with a tone mapping pass
- More robust
glTF
import - Scene format for loading models from multiple glTF files
- Diffuse and specular image based lighting using split-sum approximation
- Emissive materials
- Bloom
- Time-Sampled Anti-aliasing
- Postprocess color correction
- Directional lights
- Shadow mapping
- (Maybe) Vertex skinning/animation
Building
Building should straightforward, however there is a bit of extra complication compared to a standard Cargo project. First, this repo uses Git LFS to store demo asset files. This means that you need to install git-lfs before cloning the repo, or if you already have cloned it then install git lfs and do another pull, upon which you should download the necessary files.
Note: If you receive an error like rendy_pbr: Exit with Unnamed Error: The Decoder does not support the image format 'Unsupported image format'
upon running, do an explicit git lfs pull
. Because I have it configured to pull from this repo's GitLab mirror's LFS storage, it seems that the repo needs to be cloned first before those settings are updated. Once they are, it will then properly download the LFS files. Also note that downloading the files stored in LFS is not explicitly required if you are providing your own glTF and environment map assets.
Second, one of the dependencies, shaderc, is a little more complex to set up. See the Setup section of the shaderc-rs
repo for more information.
With that done, you should just be able to run
cargo run --features <vulkan | metal> [--release]
RenderDoc
If you want to inspect a frame in RenderDoc, there is support for RenderDoc built into the application under the rd
feature flag. It only works with the Vulkan backend currently, so you'll need to be on either Windows or Linux. To use it, you must have renderdoc.dll
/renderdoc.so
on your PATH
. On Windows, this just means adding the RenderDoc folder in Program Files to your path. Then build with:
cargo run --features="vulkan rd" [--release]
Scene Description
See scene.rs
for a description of the scene format, and assets/scene.ron
for an example. Should be able to load
data from any PBR metallic-roughness based glTF assets. If you encounter issues, please open a ticket in the issue
tracker!
Controls
Navigation
- Left click: Rotate camera
- Middle click: Pan camera
- Right click/Scroll wheel: Dolly camera
* Note: for now model controls are disabled
Model controls
X: Add a row of models in the X directionY: Add a row of models in the Y directionZ: Add a row of models in the Z direction
* Hold shift to subtract a row
Tonemapping/Exposure controls
- A: Use ACES Tonemapping curve
- U: Use Uncharted 2 Tonemapping curve
- C: Display Uncharted 2 and ACES in split-screen configuration
- Hold CTRL + left click: Adjust split screen split
- E: Increase exposure f-stop (hold shift to decrease)
Environment Mapping/Processed IBL Mapping Display Controls
- M: View HDR environment map
- I: View convoluted irradiance map
- S: View convoluted specular radiance map
- S: View rougher convolution of specular map
- Shift+S: View smoother convolution of specular map
More Screenshots
Assets
FlightHelmet, SciFiHelmet, and Corset models are from the glTF Samples repository. FlightHelmet and Corset were originally created by Microsoft and are licensed under the public domain. SciFiHelmet was created by Michael Pavlovich for Quixel and is licensed under the CC-Attrib 4.0 license.
ElementalSword was created by X-ray on Sketchfab and is under the CC-Attrib-NonCommercial license.