Nightshade Editor
An interactive editor and scene inspector for the Nightshade game engine.
Installation
From crates.io
cargo install nightshade-editor
From source
git clone https://github.com/matthewjberger/nightshade.git
cd nightshade
cargo build --release -p nightshade-editor
Usage
Run the editor:
nightshade-editor
Or use the justfile:
just run
Features
Scene Management
- Scene tree - Hierarchical view of entities with parent-child relationships
- Component inspector - View and edit entity components
- Entity selection - Click entities to inspect their properties
Rendering
- 3D viewport - WGPU-based renderer with WebGPU support
- Fly camera controls - WASD movement with mouse look
- Grid and skybox - Scene navigation helpers
- Alpha blending - Support for opaque, mask, and blend (OIT) transparency modes
- Material editing - Edit base color, alpha mode, and alpha cutoff in real-time
- SDF text rendering - Signed distance field text with outline support
- HUD overlays - Screen-space UI elements
Tools
- Mesh spawning - Create cubes, spheres, planes, and cylinders
- Line rendering - GPU-accelerated line primitives with frustum culling
- 3D text - Spawn text objects with customizable properties
- Stress testing - Tools for performance profiling (5K text lattice, 10K meshes, 20K lines)
Post-Processing
- Render graph system - Modular pass-based rendering pipeline
- Grayscale effect - Example compute shader post-process
Performance
- FPS counter - Frame rate display
- Entity count - Total entities in scene
- Line count - Line primitive usage
Controls
| Input |
Action |
| WASD |
Move camera (forward/left/backward/right) |
| Space/Shift |
Move camera up/down |
| Mouse |
Look around (click viewport to capture cursor) |
| Q |
Exit editor |
| ESC |
Release cursor |
Architecture
The editor is built on top of the Nightshade engine and demonstrates:
- ECS pattern using freecs
- Data-oriented design with component-based architecture
- WGPU rendering with custom render graph
- egui integration for immediate-mode UI
- Cross-platform support (native and WASM)
Development
Building for WASM
trunk serve --open --config apps/editor/Trunk.toml
Running tests
cargo test --all
Linting
cargo clippy --all --tests -- -D warnings
License
Licensed under the MIT License.
Links