Simple Example • Usage • Features • Documentation
A Rust crate for creating graphic experiences, with a focus on ease of use and beginner friendliness. Also helpful for visualizing algorithms when learning Rust.
This creative coding library draws a lot of inspiration from p5.js.
Simple Example
This example draws a cube in the center of the window, rotating and coloring it based on the time that has passed.
use Camera;
use Duku;
use Hsb;
use Light;
use Result;
use Instant;
Usage
To use this crate, add this dependency to your Cargo.toml
file.
[]
= "0.2.1"
Features
- Supports - Windows and Linux X11
- Vulkan - uses the Vulkan SDK
- 3D - mesh rendering with materials and shaders
- 2D - shape, texture and text rendering with batching
- PBR - uses a PBR material/shader system
- Shadows - uses PCF shadow maps
- Text - uses Fira Mono or other OTF/TTF fonts
- Shaders - uses custom glsl shaders
This crate supports additional features that you can add
to your dependency in your Cargo.toml
file.
[]
= { .. , features = ["feature-name"] }
The features include:
Name | Default | Uses | Description |
---|---|---|---|
window |
yes | winit | adds OS window creation support |
png |
no | png | adds png file loading support |
jpeg |
no | jpeg-decoder | adds jpeg file loading support |
gltf |
no | gltf | adds gltf file loading support |
glsl |
no | shaderc | adds custom glsl file loading support |
otf |
no | ab_glyph | adds otf/ttf file loading support |
log |
no | n/a | adds informational logs |
Documentation
The crate documentation can be found here and for shader compilation here. Commented examples on how to use this crate can be found here.