• Stars
    star
    224
  • Rank 177,792 (Top 4 %)
  • Language
    Rust
  • License
    Other
  • Created over 5 years ago
  • Updated almost 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

PBR rendering example/experiment with rendy

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 direction
  • Y: Add a row of models in the Y direction
  • Z: 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.

More Repositories

1

ultraviolet

A wide linear algebra crate for games and graphics.
Rust
738
star
2

rayn

A small path tracing renderer written in Rust.
Rust
529
star
3

sdfu

Signed Distance Field Utilities
Rust
116
star
4

i3-vim-nav

Seamlessly navigate i3 windows and vim splits
Go
99
star
5

colstodian

An opinionated, practical color management library for games and graphics.
Rust
34
star
6

nano-rs

An implementation of Nano in Rust using Tokio
Rust
28
star
7

ggez_snake

Rust
25
star
8

cint

A lean, minimal, and stable set of types for color interoperation between crates in Rust.
Rust
19
star
9

CCBullet3D

An easy-to-use wrapper in the Cocos/Objective-C style to integrate the robust, C++ physics library "Bullet" with Cocos3D.
C++
16
star
10

gfx-hal-tutorial

Rust
15
star
11

hot

A mid-level Vulkan abstraction library for the experts and the masses.
Rust
10
star
12

rgba

Reasonably Good Bluetooth Audio - A tiny, inline Bluetooth audio receiver for IEMs.
8
star
13

rmpt2d

A 2d ray-marching path-tracer in Processing
Processing
7
star
14

luluu

A cute and smart arm warmer sleeve ^_^
Rust
6
star
15

CCBullet3D-Sample

Sample use of the CCBullet3D wrapper.
C++
5
star
16

giftrogue

Small roguelike in rust/tcod as part of a gift to someone.
Rust
4
star
17

rayn2d

Rust
4
star
18

dotfiles

My dotfiles managed by yadm
Lua
4
star
19

nanopow-rs-node

A JavaScript wrapper for nanopow-rs to provide fast, safe, fully multithreaded Nano proof-of-work generation in Node.js.
Rust
4
star
20

egui-color-picker-oklab

Rust
3
star
21

simple-rayn

A simple raytracing renderer written in Rust.
Rust
3
star
22

thunderclap

A ray marching experiment in Zig
C
3
star
23

nano-base32

A small, quick, self-contained implementation of the Base32 encoding/decoding scheme used by the cryptocurrency Nano.
JavaScript
3
star
24

linmath.zig

Small, computer-graphics focused linear algebra library for Zig
Zig
3
star
25

fu5ha

2
star
26

vsps

Casing & power supply design for VSPS (Very Simple Phono Stage) by RJM Audio
2
star
27

nanowarpwallet

A Nano brain wallet generator that uses scrypt.
JavaScript
2
star
28

p5.Asteroids

Asteroids implementation in p5.js
JavaScript
1
star
29

TicTacToe-Ruby

A simple, two-player, command-line Tic Tac Toe game.
Ruby
1
star
30

grayolson.me

JavaScript
1
star
31

graphics-experiments

C#
1
star
32

rust-toh

A simple, terminal-interface Towers of Hanoi simulator in Rust
Rust
1
star
33

CheckpointTitler

An OpenPlanet plugin to automatically update your Twitch stream title with your current checkpoint status when playing RPG or trial maps.
AngelScript
1
star