enginerenderer 0.0.1

A zero-dependency offline rendering engine in pure Rust โ€” CPU path tracing, BVH acceleration, 16-band spectral rendering, PBR materials, animation & video export.
Documentation
  • Coverage
  • 80.81%
    876 out of 1084 items documented0 out of 264 items with examples
  • Size
  • Source code size: 1.96 MB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 15.11 MB This is the summed size of all files generated by rustdoc for all configured targets
  • ร˜ build duration
  • this release: 9s Average build duration of successful builds.
  • all releases: 9s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • rayanmorel381-beep/EngineRenderer
    2 1 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • rayanmorel381-beep

๐ŸŽฅ EngineRenderer ๐ŸŽฅ

A zero-dependency offline rendering engine in pure Rust

CPU Path Tracing ยท BVH Acceleration ยท 16-Band Spectral Rendering ยท PBR Materials ยท Animation & Video

Rust Platforms Build Matrix Crates License

478 source files ยท ~49,060 lines ยท 17 material presets ยท 18 interpolation curves ยท 9+ targets

๐ŸŽจ Features

Rendering Pipeline

๐Ÿ”ฆ Path Tracing Configurable SPP (1โ€“64+), multi-bounce, BVH-accelerated
๐ŸŒˆ Spectral 16-band wavelength dispatch, CIE 1931 XYZ conversion
๐Ÿชฉ PBR Materials Albedo ยท roughness ยท metallic ยท emission ยท IOR ยท subsurface ยท anisotropy ยท iridescence ยท clearcoat ยท transmission
๐ŸŽญ 17 Presets Stellar ยท planetary ยท manufactured ยท celestial ยท natural
๐Ÿ’ก Lighting Area lights ยท soft shadows ยท cascaded shadow maps (PCF + contact)
๐ŸŒซ๏ธ Volumetrics God rays ยท participating media ยท atmospheric scattering ยท clouds
โœจ Post-Processing Bloom ยท blur ยท depth-of-field (physical lens) ยท tone mapping
๐ŸŽ๏ธ Motion Blur Time-sampled primitives
๐ŸŽฏ Optimization Adaptive sampling ยท firefly rejection ยท denoising ยท frustum culling ยท LOD

Render Presets

AnimationFast ยทยทยทยทยทยทยทยทยท  1 SPP ยท 1 bounce ยท denoised previews
PreviewCpu ยทยทยทยทยทยทยทยทยทยทยทยท  4 SPP ยท 1 bounce ยท adaptive sampling
UltraHdCpu ยทยทยทยทยทยทยทยทยทยทยทยท 16 SPP ยท 3 bounces ยท high-quality stills
ProductionReference ยทยทยท 64 SPP ยท max bounces ยท reference quality

Realtime 120 FPS Profile

EngineRenderer includes a unified ultra-constrained realtime profile for --fps 120.

  • Scene-side budget: proxy showcase geometry, reduced light budget, optional panorama removal
  • Runtime-side budget: cached showcase meshes, static realtime scene reuse, BVH reuse
  • Loop-side budget: deadline-based frame pacing with drift compensation
  • Runtime adaptation: smoothed quality bias, sample pressure, scheduler granularity, and hysteresis-based internal resolution scaling

Validated runtime benchmarks (release, 3 seconds, --fps 120 --width 1280 --height 720):

  • Linux x86_64: stable high-frequency cadence with adaptive runtime controls
  • Android ARM64: constrained-device adaptation validated with dynamic internal resolution and scheduler tuning

๐ŸŽฌ Animation

โฑ๏ธ Timeline keyframes Camera ยท sun ยท sky ยท exposure
๐Ÿ“ 18 interpolations Linear ยท Step ยท SmoothStep ยท Hermite ยท EaseIn/Out/InOut (Quad, Cubic, Sine, Expo) ยท Back ยท Bounce
๐ŸŽž๏ธ Frame sequencer Batch rendering with caching
๐Ÿ“น Video export MP4 via system FFmpeg

๐Ÿ—๏ธ Scene Building

๐Ÿ”— Fluent API SceneBuilder ยท MaterialBuilder ยท CameraController
๐Ÿ“„ Scene format Text-based .scene files with serialization & parsing
๐Ÿ“ฆ Mesh import OBJ ยท glTF/GLB
๐Ÿ”ง Procedural Geometry generators ยท mesh operations ยท composite objects

โš›๏ธ Physics & Simulation

๐Ÿ’ฅ Rigid bodies Constraint solving ยท collision detection ยท raycasting
๐Ÿช N-body Gravitational simulation for celestial mechanics

๐Ÿค– AI Integration

๐Ÿ” Introspection Capabilities::discover() โ†’ JSON feature description
๐Ÿ’ฌ Prompt-to-scene Natural language โ†’ renderable scene
๐Ÿ“ท Camera presets Front ยท top-down ยท dramatic ยท cinematic ยท closeup

๐Ÿงฉ Runtime Subsystems

๐Ÿง  Scripting VM Stack-based bytecode VM with Push ยท Add/Sub/Mul/Div ยท Jmp/JmpIf ยท Eq/Ne/Lt/Gt/Le/Ge ยท Call/Ret ยท Load/Store ยท Neg/Not ยท CallNative
๐Ÿ“œ Script runner ScriptRunner compiles expressions and dispatches to the VM with native function registration
๐Ÿ” Hot reload HotReloader watches script files and triggers ScriptRunner::load_from_file on change
๐Ÿงฌ ECS Sparse-set TypedStorage<T> ยท ComponentRegistry ยท entity spawn/remove with type-erased component storage

๐Ÿ›๏ธ Architecture

โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—
โ•‘                          API Layer                              โ•‘
โ•‘   SceneBuilder ยท MaterialCatalog ยท CameraController             โ•‘
โ•‘   AnimationClip ยท Timeline ยท FrameSequencer                     โ•‘
โ•‘   AiRenderer ยท Capabilities ยท SceneDescriptor                   โ•‘
โ• โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•ฃ
โ•‘                         Core Engine                             โ•‘
โ•‘   Path Tracer ยท BVH ยท Spectral Shading ยท Shadow Maps            โ•‘
โ•‘   Volumetrics ยท Post-Processing ยท Scene Graph ยท Physics         โ•‘
โ•‘   Animation Sequencer ยท Video Exporter ยท Scheduler              โ•‘
โ•‘   ECS (TypedStorage) ยท Scripting VM ยท Hot Reload                โ•‘
โ• โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•ฃ
โ•‘                  Hardware Abstraction Layer                      โ•‘
โ•‘   CPU (topology, SIMD) ยท GPU (DRM/D3D12) ยท Display ยท DMA       โ•‘
โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

๐Ÿ“‹ Full module breakdown: arborescence.md

๐ŸŒ Cross-Platform Support

Targets

Target Arch OS
x86_64-unknown-linux-gnu x86_64 Linux
i686-unknown-linux-gnu x86 Linux
aarch64-unknown-linux-gnu ARM64 Linux
armv7-unknown-linux-gnueabihf ARMv7 Linux
x86_64-apple-darwin x86_64 macOS Intel
aarch64-apple-darwin ARM64 macOS Silicon
x86_64-pc-windows-gnu x86_64 Windows
i686-pc-windows-gnu x86 Windows
aarch64-linux-android ARM64 Android
  • musl variants for static linking

โœ… All listed targets compile successfully.

โœ… cargo clippy --target x86_64-pc-windows-gnu passes cleanly.

SIMD Detection

ISA Extensions
x86 / x86_64 SSE4.2 ยท AVX ยท AVX-512
ARM / AArch64 NEON ยท SVE
Fallback Scalar paths

GPU Drivers

OS Drivers
Linux amdgpu radeon i915 xe nouveau mali msm
Windows D3D12 / DXGI
macOS AppleGPU ยท Intel iGPU

Automatic CPU fallback if no GPU available

๐Ÿ”จ Building

Dependency Required Notes
Rust โœ… Edition 2024
FFmpeg โŒ Only for MP4 export
cargo build --release

Quick start: quickstart.md

cargo build --release --target aarch64-apple-darwin         # Apple Silicon
cargo build --release --target aarch64-unknown-linux-gnu    # ARM64 Linux
cargo build --release --target x86_64-pc-windows-gnu        # Windows (MinGW)
cargo build --release --target aarch64-linux-android         # Android
cargo build --release --target x86_64-unknown-linux-musl    # Static Linux

๐Ÿš€ Usage

CLI Mode

cargo run --release -- render    # Standard render โ†’ output file
cargo run --release -- gallery   # Full gallery showcase
cargo run --release -- test      # Quick smoke test
cargo run --release -- detect    # Hardware/compute diagnostics
cargo run --release -- gpu-render # GPU pipeline render
cargo run --release -- video     # Render animation โ†’ MP4
cargo run --release -- run       # Realtime preview mode
cargo run --release -- help      # Show commands

Detect / Debug options

cargo run --release -- detect --verbose
cargo run --release -- detect --json --component gpu
cargo run --release -- detect --bench --component cpu
cargo run --release -- detect --override arch=arm,os=windows,vendor=amd

Supported values:

  • --component: cpu, gpu, ram, display, all
  • --override: arch=x86|arm, os=linux|windows|macos, vendor=amd|intel|apple|unknown

Interactive Terminal

Launch with no arguments for a full REPL with module navigation and built-in docs:

cargo run --release
โ•ญโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€ Root Namespace โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ ๐Ÿš€Welcome in Helper๐Ÿš€           โ”‚
โ”‚                                  โ”‚
โ”‚ ๐Ÿ“ฆ Modules:                     โ”‚
โ”‚   ๐Ÿง  ai         ๐ŸŽฌ animation   โ”‚
โ”‚   ๐Ÿ“ท camera     โš™ engine       โ”‚
โ”‚   ๐ŸŽจ materials  ๐Ÿ“ฆ objects     โ”‚
โ”‚   ๐ŸŒŒ scenes     ๐Ÿงฉ types       โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
Command Description
open <module> Enter a module namespace
call <fn> Execute a function
inspect <item> Show details
docs [target] [section] Browse source documentation
animate [topic] Show execution flow
back Return to root
clear Clear screen
exit Quit

engine โ†’ call render ยท call gallery ยท call test ยท call run

animation โ†’ call spheres ยท call cubes ยท call house ยท call city ยท call car ยท call world ยท call blackhole

The REPL reads source code directly:

engine> docs                        # List all topics
engine> docs readme                 # README
engine> docs tree                   # Project structure
engine> docs changelog              # Changelog
engine> docs rendering              # Rendering pipeline
engine> docs ai.renderer            # Sub-module docs
engine> docs ai.prompt constraints  # Section filter

Sections: overview ยท constraints ยท implementation ยท tips

Render Examples

Standalone GPU example binaries live in examples/:

cargo run --release --example gpu_render_demo   # GPU pipeline showcase
cargo run --release --example gpu_render_heavy  # Heavy GPU workload stress
cargo run --release --example gpu_window        # Windowed GPU preview

CPU gallery scenes (spheres, cubes, house, city, car, world, blackhole) are exposed via the gallery command and the REPL:

cargo run --release -- gallery              # Render the full CPU gallery
engine> open animation
animation> call spheres        # or cubes ยท house ยท city ยท car ยท world ยท blackhole

๐ŸŒ€ Rendu vidรฉo / Animation

Le mode video gรฉnรจre une animation MP4 ร  partir d'une scรจne :

cargo run --release -- video --duration=10 --fps=30 --width=1920 --height=1080 --output-mp4=output/animation.mp4

Chargement d'une scรจne existante :

cargo run --release -- video --scene-file=my_scene.scene --output-mp4=output/animation.mp4
Option Dรฉfaut Description
--duration=N 5 Durรฉe en secondes
--fps=N 30 Images par seconde
--width=N 1280 Largeur en pixels
--height=N 720 Hauteur en pixels
--quality=preview|hd|production preview Qualitรฉ de rendu
--scene-file=PATH (dรฉfaut) Scรจne .scene ร  charger
--output-dir=PATH output/video Dossier frames temporaires
--output-mp4=PATH output/video/animation.mp4 Fichier MP4 final
--prefix=NAME frame Prรฉfixe des frames

โœ… Validation Suite

The workspace includes rendering validation tests under tests/workspace_render_validation.rs:

  • Visual determinism regression for preview outputs
  • Parallel stress rendering over multiple workers
  • Long-run pacing campaign (ignored by default)
  • Diagnostics benchmark matrix campaign (ignored by default)

Run the standard suite:

cargo test

Run the dedicated workspace validation file:

cargo test --test workspace_render_validation

Run ignored long campaigns explicitly:

cargo test --test workspace_render_validation -- --ignored

Core quality gates used in this workspace:

cargo check --all-targets
cargo clippy --all-targets

Latest status (see ChangeLog.md 0.0.1):

  • cargo clippy clean on x86_64-unknown-linux-gnu (0 warnings)
  • Scripting VM dispatch covers CallNative end-to-end (encode โ†’ decode โ†’ execute โ†’ native dispatch โ†’ VmError::UnknownNative reporting via Display)
  • ECS TypedStorage::component_count exposed via both inherent and trait surfaces
  • Hot-reload runtime log reports watched_paths() and per-script is_loaded(...)

๐Ÿ“ฆ Library API

use enginerenderer::api::engine::Engine;
use enginerenderer::api::scenes::builder::SceneBuilder;
use enginerenderer::api::materials::catalog::MaterialCatalog;
use enginerenderer::api::objects::primitives::RenderPreset;
use enginerenderer::api::animation::{AnimationClip, Timeline, Interpolation, FrameSequencer};

Default render:

let report = Engine::default().run()?;
println!("Rendered {}x{} in {} ms", report.width, report.height, report.duration_ms);

Production gallery:

let reports = Engine::production_reference().render_gallery()?;
for report in reports {
    println!("{}", report.output_path.display());
}

Smoke test:

let report = Engine::test_minimal().run()?;

AI capabilities:

let caps = enginerenderer::api::ai::capabilities::Capabilities::discover();

Hardware diagnostics:

enginerenderer::api::diagnose_compute_environment();

๐Ÿ“ Output Formats

Format Extension Notes
PPM .ppm Default still image
EXR .exr HDR framebuffer
PNG .png Compressed stills
MP4 .mp4 Video (FFmpeg)

๐Ÿ“Š Stats

Source files Lines of Rust External crates Material presets Interpolation curves Render presets Targets Edition
478 ~49,060 0 17 18 4 9+ 2024

License

MIT