Releases: oframe/ogpu
Releases · oframe/ogpu
Release list
0.2.0 — core hardening + PerDrawBuffer restructure
Port of the dgpu core audit outcome (parity-reviewed against dgpu as reference).
Breaking
- Per-mesh uniform buffers replaced by one renderer-owned
PerDrawBuffer
(dynamic offsets). EveryMesh.drawallocates an aligned slice of a shared
uniform buffer and binds group(0) with a dynamic offset — a mesh can now repeat
across passes inside one chained-encodersubmit (shadow + main in one command
buffer) without uniforms stomping each other.Meshno longer owns
uniformBuffer; it exposesuniformResource({buffer, offset, size}), and
thebindGroupsfactory receives that descriptor instead of aGPUBuffer:
bind it verbatim —{ binding: 0, resource: uniformResource }. All examples
andGLTFLoaderare migrated. The buffer'spointerresets each frame; size
via the newRendereroptionperDrawSize(default 1 MiB), overflow logs
loudly.group(0)/binding(0)is markedhasDynamicOffseton every
RenderPipeline— non-Mesh direct draws must passpass.setBindGroup(0, bg, [0]); shaders that declare but never readuniformsare handled via
RenderPipeline.hasDynamicUniform. Rendererstencilconstructor option removed — it was stored and never
read.Geometrywithoutdatanow throws with a clear message instead of
warning and then crashing inside webgpu-utils.
Fixed
- Canvas transparency never worked — the context was configured with a
misspelledalphamodekey (silently ignored). NowalphaMode: 'premultiplied'|'opaque'. ComputeShadercrashed on devices withouttimestamp-query— timestamp
query-set creation throws per spec; all timestamp resources are now
feature-gated andtiming: truedegrades to a no-op (also skipped for
external passes, which never receive timestamp writes).RenderTargetsilently flattened 3D/array/cube targets — the
constructor's ownonResizewipeddepth/dimension; both are now
preserved through every resize.Geometry.destroy()leaked index buffers (webgpu-utils returns
indexBufferseparately frombuffers).- Orthographic cameras swallowed
0extents (left: 0became-1via
||); presence-based type detection and??defaults. - Wrong-sized swapchain depth texture was never recreated — the resize
mismatch branch was dead code. - Tab-switch delta spike — resuming after the page was hidden delivered the
entire hidden duration as onedeltaTime;pause()now actually stops the
clock and callbacks, and resume starts with a zero-delta frame. RenderPipelinemutated caller-ownedtargetsdescriptors when applying
blend state (shared arrays leaked blending into opaque pipelines); partial
blendingwithoutalphanow gets the engine default instead of failing
pipeline creation.Skinreplaced boneposition/quaternion/scaleinstances, orphaning
theTransformrotation-sync hooks; bind poses are applied in place.- 2D-array texture mip uploads shrank the layer count per mip (only 3D
depth shrinks); upper mips of higher layers were never written. cameraQuaternionuniform was the camera's local rotation — now
world-space via the newCamera.worldQuaternion.resolutionuniform was always canvas-sized — draws into a
RenderTargetnow receive the target's dimensions.Camera.getFrustumSizereturned half extents (missing ×2).- A superseded device's late
lostevent could re-init over a healthy
replacement; device-loss recovery failures now log an honest
recovery-specific error instead of the boot-time message. - Instanced attribute shader locations could collide when vertex data spans
multiple buffer layouts — locations now derive from all layouts.
Changed
Mesh.drawalways callssetPipeline— the redundant-bind skip cache
desynced when external code set a pipeline on a shared pass.gui.uniform(target, key)requires only.uniforms+.gpu;
.uniformBufferis optional (passes with private buffers keep immediate
writes; meshes upload on next draw).- Texture and depth views are cached per texture generation instead of being
recreated every frame (invalidated through destroy/resize/device-restore).
v0.1.3
webgpu-spec-lookup: cached local W3C spec + grep
W3C spec lookups now run against a preprocessed local copy refreshed at most once per day, instead of a WebFetch of the 4.5 MB spec page per question.
- New
update_spec.pydownloads https://www.w3.org/TR/webgpu/ only when the cached copy's date differs from today, strips it to ~628 KB of greppable text, and prefixes every heading with its[#anchor]so a grep hit traces back to a spec section. - Benefit: spec answers go from slow, lossy whole-page fetches to near-instant local
grep— exact identifiers and limit values (GPUFeatureName,GPUSupportedLimits, defaults) come back verbatim, and repeat lookups reuse the same-day cache. - Chrome "What's New" lookups still use
WebFetch. The downloaded cache is gitignored.
v0.1.2 — skinning + glTF PBR
Focused on the skinning and glTF paths.
Highlights
Skinning + glTF
GLTFLoader.getSkinnedMesh({ code, ibl })— new turnkey getter that returns a fully-wired skinned, PBR-lit mesh: it builds theSkin(compute buffers) and itsAnimation, decodes the glTF material maps (with factor-only fallbacks for the maps a file lacks), and binds everything — skin buffers, IBL, material factors — against the skinned-PBR shader layout. Returns{ mesh, skin, animation }; driveanimation.elapsed+skin.update()per frame.- Skinning examples split into JSON + glTF (PBR) — the hand-built JSON rig and the glTF/Mixamo path are now separate examples. The new
skinninggltfexample deliberately keeps the manual wiring (geometry, material maps, IBL bindings) to show how to unfold a glTF mesh yourself; PBR shading was folded in via the pbr-shading skill.getSkinnedMeshis the one-liner alternative. - Real-time shadow mapping in
skinninggltf— the glTF example now renders a depth-pass shadow map: a vertex-only caster pulls skinned positions from theSkincompute buffer (so the cast shadow tracks the animation) into an orthographic light's depth target, and the character + a floor sample it back with 3×3 PCF for a soft contact shadow and self-shadowing. - glTF inverse-bind matrices are read straight from the file (authoritative bind-inverse), with FK-from-bind-pose only as the fallback for hand-built rigs.
- Skeleton-ancestor nodes (Blender armature / Mixamo
Neo_Reference) are rebuilt as animatable transforms so baked root motion plays back correctly.
PBR / IBL
createBrdfLUTutil — the split-sum BRDF LUT is now a shared helper, deduped across the PBR/skinning examples instead of being rebuilt per example.- glTF textures go through the engine
Textureclass instead of raw WebGPU calls (sRGB-correct, mipmapped).
Skills (agent tooling)
shadow-mappingskill — folds real-time shadow mapping (depth-pass caster + comparison-sampled PCF receiver) into any existingRenderPipeline/shader, covering the static, skinned/compute-positioned, and IBL-only cases. Companion to thepbr-shadingskill; it's the skill theskinninggltfshadow pass above was built with.
Performance
- Skinning animation sampling sped up; added a high-mesh-count example to exercise it.
- glTF primitives share
RenderPipelines keyed by cull/blend state (typically 1–2 pipelines per file). - Meshes skip redundant
setPipelinevia per-pass bookkeeping.
Full diff: v0.1.1...v0.1.2
v0.1.1 — repomap tooling normalization
Tooling
- Repomap path separators normalized to POSIX.
build-module-graph.mjsandbuild-api-digest.mjsemitted OS-native separators, so a repomap regenerated on Windows differed from one on mac/Linux on every path — churning the drift gate and blocking cross-platform commits. Both generators now route every repo-relative id through arel()helper that forces/. Output is unchanged on mac/Linux; the fix is preventive for Windows contributors. (eda299e)
Full changelog: v0.1.0...v0.1.1
v0.1.0
First tagged release.
Highlights:
- New High Mesh Count performance example (one pipeline + shared box geometry, N meshes each with own bind group; mesh count live-tunable via GUI).
- New Performance gallery section.
- Faster skinning example animation.
- glTF (fix): previously created one pipeline per node — now shared across nodes by cull/blend state, cutting redundant pipeline objects per model. Pull to pick up.
- Shadowmapping refactor; shared vertex-buffer layout when a pipeline draws multiple geometries.