A cross-platform 3D/2D rendering engine written in Rust using OpenGL / OpenGL ES through glow.
The goal of this project is to build a lightweight, modular, and flexible rendering library crate (rendering_engine) that runs seamlessly across desktop and mobile while utilizing modern rendering techniques (Multi-Draw Indirect, persistent mapped buffers, multi-threaded rendering, texture management, FBOs, compute shaders, and skybox passes).
-
Modular Architecture (
core,resources,render)- Clean separation between low-level memory/buffers, graphics resources, and rendering pipelines.
-
Multi-Draw Indirect (MDI) & GPU Batching
- Groups draw calls together to reduce CPU overhead.
- Uses GPU-side instance data handling to avoid unnecessary CPU-to-GPU synchronization.
-
Textures, Atlases & Texture Arrays
- 2D textures, 2D texture arrays (
GL_TEXTURE_2D_ARRAY), and UV atlas helpers (TextureAtlas).
- 2D textures, 2D texture arrays (
-
Offscreen Framebuffers & Render Targets
- FBO abstractions (
Framebuffer) with color attachments, depth textures, and depth renderbuffers.
- FBO abstractions (
-
Compute Shader Pipelines
ComputeShadersupport for OpenGL ES 3.1+ / OpenGL 4.3+.
-
Fullscreen Skybox Pass
- Pre-pass skybox pipeline with
LEQUALdepth testing and inverse view-projection uniform upload.
- Pre-pass skybox pipeline with
-
Persistent Mapped Buffers
- Uses persistent mapped SSBOs with multiple fenced regions (
TRANSFORM_REGIONS) to safely update GPU data while avoiding CPU/GPU conflicts.
- Uses persistent mapped SSBOs with multiple fenced regions (
-
Dedicated Render Thread & Lock-Free Triple Buffering
- Game logic and rendering are separated into different threads via a lock-free
TripleBuffer.
- Game logic and rendering are separated into different threads via a lock-free
-
Desktop and Android Support
- Desktop support through
winit/glutin. - Android support through
android-native-activityand OpenGL ES.
- Desktop support through
rendering-engine/
├── engine/ # Core rendering engine crate (`rendering_engine`)
│ └── src/
│ ├── lib.rs
│ ├── core/ # Memory allocators, persistent buffers, math & triple buffer
│ ├── resources/ # Meshes, geometry pool, shaders, textures, materials, compute
│ └── render/ # Renderer facade, passes, MDI, framebuffers, skybox, scene graph
│
├── demo/ # Example voxel 3D application
│ └── src/
│
├── docs/ # Library documentation & guides
│ └── USAGE.md # Simple, comprehensive library usage guide
│
└── shaders_gles/ # OpenGL / OpenGL ES shader sources
For code examples on using rendering_engine as a library crate in your own projects, see Library Usage Guide.
To launch the desktop demo application:
cargo run --bin desktop- W / A / S / D: Move camera forward / left / backward / right.
- Mouse / Drag: Look around (yaw & pitch).
- Space / Left Ctrl: Fly up / down.
This project is open-source and available under the BSD-3-Clause License.