22 Commits

Author SHA1 Message Date
xfy
5fa2621e6a fix(shaders): use #define_import_path + namespaced imports
The whole-file #import "file.wgsl" form (without ::) does not reliably
bring functions into scope in naga_oil/Bevy 0.19 — the renderer was
failing at runtime with 'no definition in scope for identifier:
ray_direction' (and rot_x, deriv, etc.), producing a blank screen despite
'cargo build' passing (shaders aren't compile-checked at build time).

Fix: add #define_import_path to each module file and import symbols
explicitly via namespace::name (the canonical Bevy pattern from the
shader_material_2d example). Verified the full shader pipeline compiles
and runs at runtime with zero WGSL errors.

This was a pre-existing bug masked by incomplete runtime verification in
earlier tasks; it is NOT specific to Task 15's grid work. All earlier
visual features (shadow, Doppler disk, Einstein halo, stars, planets,
grid) now actually render.
2026-07-13 09:51:08 +08:00
xfy
661d28a6a1 feat: lensed Flamm paraboloid curvature grid 2026-07-13 09:37:25 +08:00
xfy
8931904495 feat: lensed planet ray-sphere intersection in geodesic tracer
Add planets as ray-traced spheres inside the RK4 geodesic loop. A new
planets.wgsl shader tests each integrator segment against a storage
buffer of SphereData (center/radius/color/emissive) and composites hits
front-to-back alongside the accretion disk. Lambert shading with a fixed
light direction; emissive flag bypasses shading.

- assets/shaders/planets.wgsl: segment-sphere intersection + shading
- src/scene/: Planet component, upload_planets system, default planet
- black_hole.wgsl: wire planet_hit into the compositing loop
- geodesic_schwarzschild.wgsl: replace tuple return with Deriv struct
2026-07-10 17:06:19 +08:00
xfy
983413e9af feat: egui UI wired with live disk brightness + steps 2026-07-10 10:54:22 +08:00
xfy
1b1eda0772 feat: accretion disk with Doppler beaming + lensed Einstein halo 2026-07-10 10:48:31 +08:00
xfy
fbe1685a38 feat: procedural lensed starfield background 2026-07-10 10:45:24 +08:00
xfy
d5e3008343 test: CPU-mirrored geodesic physics + bcrit/capture unit tests 2026-07-10 10:43:11 +08:00
xfy
9d81df1c14 feat: Schwarzschild RK4 geodesic integrator + black shadow 2026-07-10 10:39:46 +08:00
xfy
9665d12348 feat: per-pixel camera ray generation 2026-07-10 10:36:18 +08:00
xfy
265ec9925d feat: BlackHoleUniforms + camera/params mirror system 2026-07-10 10:33:10 +08:00
xfy
1a2b157ef3 feat: BlackHoleParams tunable resource 2026-07-10 10:27:10 +08:00
xfy
d039064efa feat: orbit camera controller (yaw/pitch/zoom) 2026-07-10 10:25:16 +08:00
xfy
a45d42c07a feat: full-screen quad + BlackHoleMaterial pipeline 2026-07-10 10:20:38 +08:00
xfy
9c8f384d0e feat: web build via trunk with WebGPU detection + fallback 2026-07-10 10:12:57 +08:00
xfy
25e2207e0d feat: minimal bevy window opens 2026-07-10 09:48:38 +08:00
xfy
ea6b15524d build: add bevy 0.19 and bevy_egui 0.41 dependencies 2026-07-10 09:45:59 +08:00
xfy
02368a0a74 docs(plan): Phase 1 Schwarzschild implementation plan
20 tasks covering: deps, minimal window, web/Trunk/WebGPU, full-screen
Material2d pipeline, orbit camera, params resource, uniforms+mirror, ray
gen, RK4 Schwarzschild integrator, CPU physics tests, lensed starfield,
Doppler accretion disk w/ Einstein halo, egui panel, storage-buffer
planets, Flamm grid, cubemap skybox, render scale, web verification,
README. Verified against Bevy 0.19 API (group-2 material bind group,
component spawning, WgpuSettings defaults).
2026-07-09 18:57:42 +08:00
xfy
041e8f3b21 docs(spec): correct Bevy 0.19 API details (verified)
- Material2d bind group is group 2 (#{MATERIAL_BIND_GROUP}), not group 1
- RenderPlugin has no wgpu_backends field; enable bevy 'webgpu' feature instead
- WgpuSettings::default() auto-selects BROWSER_WEBGPU on wasm32
- Imports from bevy::sprite_render (Material2d, AlphaMode2d)
- Component-based spawning (Camera2d, Mesh2d/MeshMaterial2d), no bundles
- getrandom 0.4/wasm_js handled transitively by Bevy
2026-07-09 18:47:44 +08:00
xfy
c1bfe2b25e docs(spec): add desktop + web (WebGPU) platform support
- WebGPU-only web target (Bevy forces WebGPU/WebGL2 at build time; WebGL2
  lacks storage buffers our planets feature needs)
- Add §13 Platform support: build toolchain (trunk/wasm32), backend gating,
  fallback message, web defaults (render_scale 0.75, steps 200)
- Add src/web.rs, web/index.html, Trunk.toml to file structure
- Add web-sys dep; add web build + perf verification milestones
- Update storage-buffer risk note: valid on native + WebGPU
2026-07-09 18:30:56 +08:00
xfy
60bfdb9ca6 docs(spec): add egui parameter UI (bevy_egui 0.41) + dependencies section
- Switch interaction from keyboard to a collapsible egui 'Controls' panel
  with grouped sections (Camera/Disk/Doppler/Renderer/Background/Grid/Planets)
- Pin bevy_egui 0.41.0 (verified against crates.io: bevy ^0.19 + egui ^0.35)
- Add Dependencies section §0; add src/ui.rs to file structure
- Clarify mouse-input routing between egui panel and orbit controller
2026-07-09 18:26:24 +08:00
xfy
c2d4bf779a docs: add Interstellar black hole renderer design spec
Analyzes reference video (BH + tilted Doppler disk + lensed halo + stars),
specifies full 8-feature scope (adds cubemap skybox, lensed planets, Flamm
grid), Schwarzschild Phase 1 with Kerr Phase 2 follow-up, Bevy 0.19
full-screen Material2d architecture.
2026-07-09 18:20:38 +08:00
xfy
3d34c0920d Initial commit: scaffold Rust project with Cargo 2026-07-09 17:55:14 +08:00