Realism
A high-performance, production-ready scene management crate for Rust game engines.
realism provides a robust, data-oriented foundation for managing large game worlds. It is designed to sit between your game logic and your renderer, handling the complexity of entity transforms, visibility culling, and scene organization with minimal overhead.
✨ Key Features
- 🚀 High Performance: Built on a generational index system and sparse set storage. Handles 100k+ entities with sub-millisecond overhead for transform propagation.
- 🌳 Spatial Partitioning: Integrated Dynamic Octree for incredibly fast spatial queries and frustum culling.
- 🔄 Hierarchy System: complete parent-child transform propagation with dirty flag optimization.
- 📦 Asset & Prefab Support:
- JSON-based scene serialization/deserialization.
- Additive scene loading (Prefabs) with root offsets.
- Seamless integration with Archetype Asset via
xxhashcompatibility.
- 🎨 Renderer Agnostic: Does not enforce a specific rendering backend. Extracts a linear buffer of
RenderCommands that you can consume in WGPU, Vulkan, or any other API.
📦 Installation
Add this to your Cargo.toml:
[]
= "0.1.0"
= "0.29"
🚀 Quick Start
use Scene;
use Transform;
use ;
📖 Architecture
Realism is built on three core pillars:
- Entity-Component System (ECS-lite): Uses opaque
EntityIdhandles and component pools for cache efficiency. - Spatial Index: A loose/dynamic Octree that automatically tracks entities with
WorldBounds. - Render Extraction: A explicit synchronization phase that produces a safe, read-only snapshot for the renderer.
See ARCHITECTURE.md for a deep dive.
🤝 Integration
Using with Archetype Asset
realism is fully compatible with the archetype_asset crate. Both use xxh3 for asset path hashing.
- Register asset path in Realism:
scene.add_renderable(...) - Extract frame:
let cmds = scene.extract(...) - In Renderer:
asset_cache.get(cmd.mesh_id)
📄 License
Licensed under Apache License, Version 2.0.