The native runtime for three.js: three.js, down to the metal. 45× smaller than Electron, on a Sony PS3, and path-traced at 60 fps on ray-tracing GPUs.
Rust electron-alternativegame-engineglobal-illuminationgraphicsjavascript-runtimemetalpath-tracingray-tracingreal-time-renderingrenderingrustthreejstypescriptvoxelvulkanwebgpuwgpu
[package]
name = "threert-render"
version = "0.1.0"
edition = "2021"
description = "Native renderer for ThreeRT games: embedded scene runtime, GPU path tracer + UE5-matched post chain"
license = "MIT"
[dependencies]
voxel-core = { path = "voxel-core" }
physics-core = { path = "physics-core" }
wgpu = "30"
# The kernel's variants (gpu.rs `kernel_wgsl`): WESL's conditional translation, by wesl-rs (WESL's compiler in Rust).
wesl = { version = "0.6", features = ["naga-ext"] }
bytemuck = { version = "1", features = ["derive"] }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
gltf = { version = "1.4", features = ["KHR_materials_emissive_strength", "KHR_texture_transform", "KHR_materials_ior", "KHR_materials_transmission", "extensions"] }
image = { version = "0.25", default-features = false, features = ["png", "jpeg", "exr"] }
glam = { version = "0.30", features = ["bytemuck"] }
rayon = "1.10"
anyhow = "1"
half = { version = "2", features = ["bytemuck"] }
# Procedural geometry data: content hashes (asset files and inline data alike; src/procasset.rs).
sha2 = "0.10"
# The clock of a frame: std's natively (a re-export, nothing changes), the page's `performance.now()` in a browser,
# where std's `Instant` panics.
web-time = "1.1"
bevy_mikktspace = "1.0.0"
# The native shell only: the window, the embedded script runtime, blocking on the GPU's futures, the denoiser. The
# engine's library builds without them for wasm32 (docs/RUNTIME.md "The engine's library in a browser"): there the
# page owns the window and the event loop, and scripts run in the browser's own engine.
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
# Natively the physics world is stepped by Rapier's parallel solver (ROADMAP § 6 step 8; decided 2026-11-11), in a
# pool of its own (src/physics.rs: 4 threads or the performance cores when fewer; THREERT_PHYSICS_THREADS changes it,
# 1 is sequential). It steps to the sequential build's bits, which are wasm32's (tools/physics-determinism.ts holds
# the three to the recorded hashes). wasm32 has no threads here and stays sequential: the dependency above.
physics-core = { path = "physics-core", features = ["parallel"] }
pollster = "0.4"
winit = "0.30"
oidn = { version = "2.5", optional = true }
# Scene runtime of the render node (game bundles run in the renderer process, src/script.rs).
rquickjs = "0.12"
# Files on the host channel are base64 (docs/RUNTIME.md "Files"): the script runtime's codec (src/script.rs) and the
# app side of `files.*` / `store.*` (src/userfiles.rs).
base64 = "0.23"
# The `threert-render` binary's sockets and HTTP, for the games its window runs (src/net.rs: the `net.*` messages of
# the host channel, docs/RUNTIME.md), with the `net` feature; ureq and rustls also with `assets` (src/assets.rs, the
# library's one piece with network). A program that embeds the library without them sets `default-features = false`
# (the browser module does). TLS is rustls with the ring provider and the webpki roots: no system TLS library.
tungstenite = { version = "0.30", optional = true, default-features = false, features = ["handshake", "rustls-tls-webpki-roots"] }
ureq = { version = "3", optional = true, default-features = false, features = ["rustls", "gzip"] }
rustls = { version = "0.23", optional = true, default-features = false, features = ["ring", "std"] }
# Sound (the `audio` feature): the decoders, pure Rust (WAV, Ogg Vorbis, MP3, FLAC).
symphonia = { version = "0.5", optional = true, default-features = false, features = ["wav", "pcm", "ogg", "vorbis", "mp3", "flac"] }
# The sound device (the `audio` feature, src/audio/out.rs): Core Audio and WASAPI through cpal; ALSA and AAudio are
# loaded at run time (no sound library to link on Linux or Android).
[target.'cfg(any(target_os = "macos", target_os = "ios", target_os = "windows"))'.dependencies]
cpal = { version = "0.17", optional = true }
[target.'cfg(any(target_os = "linux", target_os = "android"))'.dependencies]
libloading = { version = "0.8", optional = true }
# DLSS Super Resolution (Vulkan). This wgpu 30 release is not published on crates.io.
[target.'cfg(all(target_arch = "x86_64", any(target_os = "linux", target_os = "windows")))'.dependencies]
dlss_wgpu = { git = "https://github.com/bevyengine/dlss_wgpu.git", rev = "b35069de8640bfae383e65a46b7d16058b2994d2", optional = true }
uuid = { version = "1", optional = true }
# The performance cores' count (src/physics.rs: the physics' threads).
[target.'cfg(target_os = "macos")'.dependencies]
libc = "0.2"
# build.rs reads shaders/live.wgsl's bindings with the compiler wgpu uses (its version: 30), when the crate is built.
[build-dependencies]
cc = "1"
naga = { version = "30", features = ["wgsl-in"] }
# src/merged.rs's tests read the generated shaders with the compiler wgpu uses: they are valid, and no stage binds more
# storage buffers than a browser allows.
[dev-dependencies]
naga = { version = "30", features = ["wgsl-in"] }
# tools/physics-determinism.ts: the physics' recorded hashes in this crate's wasm32 graph.
[[example]]
name = "physics_bits"
crate-type = ["cdylib"]
# tools/three/physics.ts: the engine's world and physics as a wasm32 module, for the three.js view.
[[example]]
name = "physics_scene"
crate-type = ["cdylib"]
[features]
default = ["net", "audio"]
# Sound for games (src/audio: the `audio.*` messages of the host channel, docs/RUNTIME.md "Sound"): decoding, placing
# and mixing in Rust on every platform; the device by cpal (macOS, iOS, Windows), ALSA (Linux) or AAudio (Android),
# the last two loaded at run time. The clients turn it on with the library (`features = ["audio"]`).
audio = ["dep:symphonia", "dep:cpal", "dep:libloading"]
# WebSockets and HTTP in `threert-render play` (above). Without it the window answers every `net.*` request with a
# failure that says so.
net = ["dep:tungstenite", "assets"]
# `assets.*` on the host channel as a library piece (src/assets.rs: `AssetFetcher`, downloads into the asset root's
# cache/ for any app that holds a GameSession; docs/RUNTIME.md "Assets"): ureq on rustls. On with `net`.
assets = ["dep:ureq", "dep:rustls"]
# Intel Open Image Denoise (needs OIDN_DIR at build time and the shared libs at runtime).
oidn = ["dep:oidn"]
# NVIDIA DLSS Super Resolution (needs DLSS_SDK and VULKAN_SDK at build time).
dlss = ["dep:dlss_wgpu", "dep:uuid"]
[profile.release]
opt-level = 3
debug = false
lto = "thin"
[profile.dev]
opt-level = 2
# glamx with its eigen decomposition's acos / cos called through simba (libm on every platform): the physics' bits must
# not depend on the platform's math functions (third_party/glamx/PATCH.md). physics-core's own manifest has the same
# table, but cargo only reads the one of the crate it builds: this one is what the renderer gets
# (src/physics.rs `the_renderers_physics_steps_to_the_recorded_bits` fails without it).
[patch.crates-io]
glamx = { path = "third_party/glamx" }
parry3d = { path = "third_party/parry3d" }
# The TLAS built from the instances that changed (third_party/wgpu-core/PATCH.md).
wgpu = { path = "third_party/wgpu" }
wgpu-core = { path = "third_party/wgpu-core" }