roxlap-render 0.13.0

Unified CPU/GPU renderer facade for the roxlap scene-graph engine — one SceneRenderer over roxlap-core opticast (softbuffer) and roxlap-gpu (wgpu), with automatic CPU fallback.
Documentation
[package]
name = "roxlap-render"
version.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true
authors.workspace = true
rust-version.workspace = true
description = "Unified CPU/GPU renderer facade for the roxlap scene-graph engine — one SceneRenderer over roxlap-core opticast (softbuffer) and roxlap-gpu (wgpu), with automatic CPU fallback."
documentation = "https://docs.rs/roxlap-render"
keywords = ["voxlap", "voxel", "renderer", "wgpu", "fallback"]
categories = ["game-development", "graphics", "rendering"]
readme.workspace = true

[dependencies]
# Both backends + the scene/world types they consume.
roxlap-core = { path = "../roxlap-core", version = "0.13" }
roxlap-formats = { path = "../roxlap-formats", version = "0.13" }
roxlap-scene = { path = "../roxlap-scene", version = "0.13" }
roxlap-gpu = { path = "../roxlap-gpu", version = "0.13" }
glam = { workspace = true }
# CPU strip-parallel render thread count (caps the ScratchPool slots).
# Runs on wasm too via wasm-bindgen-rayon (the host inits the pool).
rayon = { workspace = true }
# The facade is decoupled from any specific windowing library: it
# binds the surface to whatever `HasWindowHandle`/`HasDisplayHandle`
# provider the host passes (winit, SDL, GLFW, …). Re-exported from the
# crate root so hosts can name the bounds without their own dep.
raw-window-handle = "0.6"
# Optional `hud` feature: egui overlay support. CPU backend needs only
# egui's tessellation types (software-rasterised here); the GPU backend
# delegates to egui-wgpu inside roxlap-gpu (enabled via roxlap-gpu/hud).
egui = { version = "0.34", optional = true }

# CPU-backend presentation on native: a windowed software framebuffer
# (softbuffer). The GPU backend presents via roxlap-gpu's own wgpu
# surface, and the wasm CPU fallback presents via WebGL2 (see below),
# so softbuffer is native-only.
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
softbuffer = "0.4"

# wasm/WebGPU: the GPU backend binds the wgpu surface to the canvas;
# the CPU fallback presents the composited framebuffer through a
# WebGL2 blit (`cpu_blit.rs`). `wasm-bindgen` is pinned to the same
# exact version the web crates use so the workspace lock unifies.
[target.'cfg(target_arch = "wasm32")'.dependencies]
wasm-bindgen = "=0.2.117"
# Unsafe-free `u32`-framebuffer / `f32`-quad → byte reinterpretation
# for the WebGL2 uploads (the facade is `#![forbid(unsafe_code)]`).
bytemuck = "1"
web-sys = { version = "0.3", features = [
    "HtmlCanvasElement",
    "WebGl2RenderingContext",
    "WebGlBuffer",
    "WebGlProgram",
    "WebGlShader",
    "WebGlTexture",
    "WebGlUniformLocation",
    "WebGlVertexArrayObject",
    "console",
] }

[features]
# Overlay an egui UI on top of the rendered frame (`SceneRenderer::
# paint_egui`). Pulls egui's tessellation types for the CPU
# software-rasteriser and turns on roxlap-gpu's egui-wgpu paint path.
hud = ["dep:egui", "roxlap-gpu/hud"]

[dev-dependencies]
# Doctests/examples construct a winit window to drive the facade; the
# library itself no longer depends on winit.
winit = "0.30"

[lints]
workspace = true