1# llimphi-3d
2
3Llimphi's base 3D pass (M0 of the 3D engine).
4
5The minimum needed for **real 3D inside a Llimphi `View`**: a `Camera3d`
6(view/projection matrices with `glam`), a depth buffer of its own, and a
7`Renderer3d` that draws indexed geometry with depth testing over the frame's
8intermediate texture.
9
10## How it fits the Elm loop + vello + wgpu
11
12Llimphi already rasterizes the UI with vello onto an intermediate texture and
13exposes `View::gpu_paint_with` to inject a direct GPU pass *after* vello (with
14`LoadOp::Load`, preserving the UI). `Renderer3d::render` has **exactly** the
15signature that closure needs (`device, queue, encoder, target_view, (w, h),
16&camera`), so a 3D node is:
17
18```ignore
19let r3d = Arc::new(Mutex::new(Renderer3d::new(&device, fmt)));
20View::empty().gpu_paint_with(move |dev, q, enc, view, rect, vp| {
21 r3d.lock().unwrap().render(dev, q, enc, view, vp, &camera);
22})
23```
24
25It is not a second engine: it runs on the **same wgpu** Llimphi already uses,
26which in turn translates to Vulkan/Metal/DX12/GL/WebGPU. See
27`01_yachay/dominium/MOTOR-VOXEL.md` §11 for the full route (M0..M4).
28
29---
30
31Part of **llimphi** — see [llimphi](../README.md).
README.md
llimphi-3d
Llimphi's base 3D pass (M0 of the 3D engine).
The minimum needed for real 3D inside a Llimphi View: a Camera3d
(view/projection matrices with glam), a depth buffer of its own, and a
Renderer3d that draws indexed geometry with depth testing over the frame's
intermediate texture.
How it fits the Elm loop + vello + wgpu
Llimphi already rasterizes the UI with vello onto an intermediate texture and
exposes View::gpu_paint_with to inject a direct GPU pass after vello (with
LoadOp::Load, preserving the UI). Renderer3d::render has exactly the
signature that closure needs (device, queue, encoder, target_view, (w, h), &camera), so a 3D node is:
let r3d = Arc::new(Mutex::new(Renderer3d::new(&device, fmt)));
View::empty().gpu_paint_with(move |dev, q, enc, view, rect, vp| {
r3d.lock().unwrap().render(dev, q, enc, view, vp, &camera);
})
It is not a second engine: it runs on the same wgpu Llimphi already uses,
which in turn translates to Vulkan/Metal/DX12/GL/WebGPU. See
01_yachay/dominium/MOTOR-VOXEL.md §11 for the full route (M0..M4).
Part of llimphi — see llimphi.