83 releases
Uses new Rust 2024
| 0.6.70 | Feb 1, 2026 |
|---|---|
| 0.6.40 | Dec 29, 2025 |
| 0.6.14 | Nov 30, 2025 |
#1167 in Game dev
117 downloads per month
Used in 2 crates
3.5MB
87K
SLoC
Nightshade
A cross-platform data-oriented game engine built with wgpu.
Getting Started
Use the nightshade-template to create a new project, or add nightshade to your Cargo.toml:
[dependencies]
nightshade = "0.6.70"
Basic Example
use nightshade::prelude::*;
fn main() -> Result<(), Box<dyn std::error::Error>> {
launch(MyGame)?;
Ok(())
}
struct MyGame;
impl State for MyGame {
fn title(&self) -> &str {
"My Game"
}
fn initialize(&mut self, world: &mut World) {
world.resources.user_interface.enabled = true;
let camera_position = Vec3::new(0.0, 2.0, 10.0);
let main_camera = spawn_camera(world, camera_position, "Main Camera".to_string());
world.resources.active_camera = Some(main_camera);
}
fn ui(&mut self, _world: &mut World, ui_context: &egui::Context) {
egui::Window::new("My Game").show(ui_context, |ui| {
ui.heading("Hello, world!");
});
}
fn run_systems(&mut self, world: &mut World) {
fly_camera_system(world);
}
}
Browser Support
WebGPU is supported in:
- All chromium-based browsers (Chrome, Edge, Brave, Vivaldi, etc.)
- Firefox 141+
License
Nightshade is free, open source and permissively licensed! All code in this repository is dual-licensed under either:
- MIT License (LICENSE-MIT or http://opensource.org/licenses/MIT)
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in nightshade by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
Dependencies
~4–74MB
~1M SLoC