Gohla's game/graphics/gadget garage/garden/gadgetry
Developed in Rust using wgpu for rendering.
A recent version of Rust is required. See Rust's installation instructions.
Main graphics demos:
- Voxel planetoid renderer:
cargo run --bin voxel_planets
- Note: surface nets mesher disabled due to bug in LoD stitching.
- Note: transvoxel mesher doesn't correctly extract border regions.
- Marching cubes visualization:
cargo run --bin marching_cubes
- Rendering many cubes demo:
cargo run --bin cubes
Small examples:
- Triangle:
cargo run --bin triangle
- Quads:
cargo run --bin quads
Currently broken graphics demos:
- Ray tracing in one weekend, in a GLSL fragment shader:
cargo run --bin ray_tracing
- Renders only the "sky". Probably broken due to
naga
(wpgu's shader compiler) not compiling the shader properly, or at least not the wayshaderc
was compiling it.
- Renders only the "sky". Probably broken due to
- Surface nets visualization:
cargo run --bin surface_nets
- Crashes due to a LoD stitching bug
By default, Rust runs with a debug/development profile. To run with full optimization and use optimized CPU instructions for you CPU, run like this:
RUSTFLAGS=-Ctarget-cpu=native cargo run --bin voxel_planets --release
- core: core libraries
common
: common data structures and helpersos
: operating system interface, providing logging, input handling, etc.gfx
: wgpu utilities, GPU buffer utilities, and common graphics code such as camera projection.gfxc
: shader compileregui_integration
: integrateegui
withos
andgfx
, providing an immediate mode GUI.gui
: common gui code and widgetsapp
: application framework taking care of setting upos
,gfx
andegui_integration
, and taking care of running the game loop.- All demos in this repository implement the
App
trait so the demos can focus on the actual functionality.
- All demos in this repository implement the
job_queue
: parallel job queue with support for dependencies and referencing/caching computed datavoxel
: voxels, level of detail (Lod), voxel meshing, and procedural generation via noise.- Voxel meshing implementations: marching cubes, transvoxel (incomplete), and naive surface nets.
- Level of detail stitching between different LoD levels is still incomplete/buggy.
- graphics/src/bin: graphics demos
triangle
: render a single triangle, every renderer needs this :)quads
: render some quads with a texturecubes
: render many cubes efficientlymarching_cubes
: marching cubes visualizationsurface_nets
: surface nets visualizationvoxel_planets
: voxel planetoid renderer
- gadgets/src/bin: gadgets
job_queue
: example on using the job queue
When using the Vulkan backend of wgpu, and you want Vulkan's validation layers to run, you need to install the Vulkan SDK. Install the Vulkan SDK using their own installer, or use a package manager:
Install the Vulkan SDK. This can be done via scoop:
scoop install main/vulkan
Then follow the instructions ("Allow vulkan applications to find VK layers provided by Khronos, run ...") after installing to make Vulkan validation layers work.
Install the Vulkan SDK with homebrew:
brew tap apenngrace/homebrew-vulkan
brew install vulkan-sdk