ReadonlytextureReadonlyviewReadonlysamplerReadonlyresolutionReadonlyworldReadonlyworldWorld-space extent along each axis (worldMax - worldMin).
StaticbakeBakes a signed distance field from a triangle mesh using a single compute dispatch. Returns immediately after submitting the command buffer; the texture is usable once the device has consumed the submission (typical WebGPU resource semantics).
StaticfromBakes an SDF from a Mesh created with keepData: true. Extracts
positions from the retained interleaved vertex data (stride = VERTEX_STRIDE)
and forwards to bakeFromMesh.
worldOffset translates the mesh positions before baking so the SDF's AABB
aligns with where the mesh is rendered in world space (the particle pass
samples the SDF in world coordinates). For a mesh drawn at Mat4.translation(x,y,z),
pass worldOffset: [x, y, z]. Defaults to [0,0,0] — mesh local == world.
Throws if the Mesh wasn't built with keepData: true.
Optionalopts: {
A baked signed-distance field stored as a 3D r32float texture plus an AABB transform. Sampled by particle modifiers (sdf_attractor, sdf_collision) and the sdf_surface spawn shape.
Owns its GPU texture; call destroy when done.