Myth is a high-performance 3D rendering engine built in Rust, designed for developers seeking simplicity and efficiency. It combines the power of wgpu with a user-friendly approach, offering a cross-platform solution that runs seamlessly across native platforms and the web. This engine reduces boilerplate while maintaining performance, making graphics development accessible.
Myth is a high-performance 3D rendering engine developed in Rust, designed to provide a developer-friendly experience. Leveraging the capabilities of wgpu, Myth is engineered to simplify the complexities often associated with rendering while maintaining outstanding performance.
Key Features
- Cross-Platform Support: Operates seamlessly across native platforms (Windows, macOS, Linux, iOS, Android) and provides WebGPU/WASM support along with Python bindings, ensuring that a single codebase functions everywhere.
- Modern Backend: Built on wgpu, it fully supports advanced graphics APIs including Vulkan, Metal, DirectX 12, and WebGPU.
- SSA-based Render Graph: Utilizes a declarative and compiler-driven architecture that streamlines rendering processes, allowing for automatic synchronization and memory aliasing, dead-pass elimination, and zero-allocation per-frame rebuilds.
- Advanced Rendering Techniques: Incorporates features like physically based materials (PBR) with support for Clearcoat, Iridescence, Transmission, and Anisotropy. Additionally, it supports advanced lighting techniques, including Image-Based Lighting (IBL) and dynamic shadows.
- Post-Processing Effects: Engage with stunning visual effects including HDR, Bloom, Color Grading, and Anti-Aliasing techniques (TAA, FXAA, MSAA).
- Robust Asset Support: Full integration for glTF 2.0, enabling the use of PBR materials, animations, and morph targets, along with an asynchronous asset system to improve load times.
Innovative Graph Compiler
The core architecture of Myth leverages a strict SSA-based Render Graph that enhances its performance through:
- Automatic scheduling of rendering passes.
- Elimination of dead passes to avoid unnecessary workloads.
- Aggressive reuse of memory, ensuring efficient resource management without the need for manual barriers.
For those interested in visualizing the underlying processes of Myth, a detailed RenderGraph topology illustrates how the engine manages complex rendering tasks while optimizing performance.
Online Demos
Experience the capabilities of Myth through browser-based applications:
- Showcase (Home) demonstrates high-performance rendering.
- glTF Viewer & Inspector allows users to import and inspect their own .glb files.
- glTF Sample Models showcases various official glTF assets seamlessly rendered with Myth.
Quick Start Example
Integrating Myth into a Rust project is straightforward. Below is a simple Rust example demonstrating how to create a basic application with a spinning cube:
use myth::prelude::*;
struct MyApp;
impl AppHandler for MyApp {
fn init(engine: &mut Engine, _: &dyn Window) -> Self {
let scene = engine.scene_manager.create_active();
let tex_handle = engine.assets.checkerboard(512, 64);
let mesh_handle = scene.spawn_box(
1.0, 1.0, 1.0,
PhongMaterial::new(Vec4::new(1.0, 0.76, 0.33, 1.0)).with_map(tex_handle),
&engine.assets,
);
let cam_node_id = scene.add_camera(Camera::new_perspective(45.0, 1280.0 / 720.0, 0.1));
scene.node(&cam_node_id).set_position(0.0, 0.0, 5.0).look_at(Vec3::ZERO);
scene.active_camera = Some(cam_node_id);
scene.add_light(Light::new_directional(Vec3::ONE, 5.0));
scene.on_update(move |scene, _input, _dt| {
if let Some(node) = scene.get_node_mut(mesh_handle) {
let rot_y = Quat::from_rotation_y(0.02);
let rot_x = Quat::from_rotation_x(0.01);
node.transform.rotation = node.transform.rotation * rot_y * rot_x;
}
});
Self {}
}
}
fn main() -> myth::Result<()> {
App::new().with_title("Myth-Engine Demo").run::<MyApp>()
}
With its emphasis on performance and usability, Myth is an innovative solution for developers seeking an efficient rendering engine that bridges the gap between low-level graphics programming and high-level game development.
No comments yet.
Sign in to be the first to comment.