feat(webgpu-rt): any-hit + AABB (procedural) geometry support #14
No reviewers
Labels
No labels
claude:done
claude:in-progress
claude:ready
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Catcrafts/Crafter.Graphics!14
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "claude/issue-13"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Adds the two missing WebGPU ray-tracing capabilities from #13: any-hit shaders and an equivalent to
VK_GEOMETRY_TYPE_AABBS_KHR(procedural / AABB geometry with intersection shaders).What changed
Type surface (cross-backend)
RTShaderGroupType::ProceduralHitGroup+RTShaderGroup::intersectionShader(mirrorVK_RAY_TRACING_SHADER_GROUP_TYPE_PROCEDURAL_HIT_GROUP_KHR).WebGPURTStage::Intersectionfor AABB intersection shaders.Mesh::BuildProcedural(span<RTAabb>, opaque)— the WebGPU analog of an AABB geometry BLAS.Codegen (
PipelineRTWebGPU)runIntersectionmega-switch alongside the existingrunAnyHitswitch, plusRT_HAS_ANYHIT/RT_HAS_INTERSECTIONconsts and the@CRAFTER_RT_TRACE_USERmarker.WGSL library (
dom-webgpu.js)MeshRecordgrows to 64 bytes (geomType+opaque).@group(3+)resources. Opaque triangle-only scenes are unchanged — the user-callback branches const-fold away and TRACE keeps its zero-user-code footprint.Mesh build — SAH BVH2 over AABB primitives, uploaded in primitive order so the intersection shader fetches the right box.
Testing
crafter-build test— clean (the library defines no automated tests; this RT path is browser-verified, as with #8 / #11).examples/RTVolume: 27 procedural spheres via an analytic ray-sphere intersection shader, perforated by an any-hit spherical-checkerboard cut-out — verified rendering in Firefox/WebGPU (screenshot below).RTStress(opaque triangle path) in Firefox — renders identically, no console errors.Screenshots
Resolves #13