Skip to content

docs: Add @typegpu/geometry docs with interactive previews - #2998

Open
reczkok wants to merge 6 commits into
feat/geometry-patchesfrom
docs/geometry
Open

reczkok wants to merge 6 commits into
feat/geometry-patchesfrom
docs/geometry

Conversation

@reczkok

@reczkok reczkok commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

Adds a guide for @typegpu/geometry, covering mesh creation, composition and the different ways to evaluate and update geometry

  • primitives, parametric surfaces + custom geometry
  • transform, concat and custom vertex attributes
  • bake into buffers, evaluate in vertex shaders or update through compute
  • interactive previews for subdivisions, surface parameters, vertex colors and deformation
  • smooth, flat and wireframe shading to inspect the results

Stacks on #3014

@github-actions

github-actions Bot commented Sep 8, 2026 •

Copy link
Copy Markdown

pkg.pr.new

packages
Ready to be installed by your favorite package manager ⬇️

https://pkg.pr.new/software-mansion/TypeGPU/typegpu@9b0a57ecddfe50fd3c148608bceddc69c7d32926
https://pkg.pr.new/software-mansion/TypeGPU/@typegpu/react@9b0a57ecddfe50fd3c148608bceddc69c7d32926

benchmark
view benchmark

commit
view commit

@github-actions

github-actions Bot commented Sep 8, 2026 •

Copy link
Copy Markdown

Bundle size comparison (import * as ... in PR vs import * as ... in target):

🟢 Decreased ➖ Unchanged 🔴 Increased ❔ Unknown
0 355 0 0

No notable changes.

If you wish to run a comparison for other, slower bundlers, run the 'Tree-shake test' from the GitHub Actions menu.

@github-actions

github-actions Bot commented Sep 8, 2026 •

Copy link
Copy Markdown

Resolution Time Benchmark

---
config:
  themeVariables:
    xyChart:
      plotColorPalette: "#E63946, #3B82F6, #059669"
---
xychart
  title "Random Branching (🔴 PR | 🔵 main | 🟢 release)"
  x-axis "max depth" [1, 2, 3, 4, 5, 6, 7, 8]
  y-axis "time (ms)"
  line [1.04, 2.17, 4.80, 6.97, 8.57, 14.25, 28.79, 29.57]
  line [1.07, 2.00, 4.41, 7.61, 8.73, 13.58, 29.47, 26.25]
  line [1.05, 2.01, 4.70, 7.28, 9.31, 15.02, 25.90, 25.90]
Loading
---
config:
  themeVariables:
    xyChart:
      plotColorPalette: "#E63946, #3B82F6, #059669"
---
xychart
  title "Linear Recursion (🔴 PR | 🔵 main | 🟢 release)"
  x-axis "max depth" [1, 2, 3, 4, 5, 6, 7, 8]
  y-axis "time (ms)"
  line [0.32, 0.53, 0.69, 0.84, 1.22, 1.24, 1.46, 1.65]
  line [0.33, 0.57, 0.77, 0.96, 1.20, 1.31, 1.68, 1.76]
  line [0.37, 0.59, 0.73, 0.94, 1.24, 1.28, 1.55, 1.66]
Loading
---
config:
  themeVariables:
    xyChart:
      plotColorPalette: "#E63946, #3B82F6, #059669"
---
xychart
  title "Full Tree (🔴 PR | 🔵 main | 🟢 release)"
  x-axis "max depth" [1, 2, 3, 4, 5, 6, 7, 8]
  y-axis "time (ms)"
  line [0.94, 2.28, 3.97, 8.14, 13.98, 29.53, 61.31, 124.95]
  line [0.93, 2.29, 3.81, 7.90, 13.65, 28.76, 62.30, 125.61]
  line [1.01, 2.29, 4.04, 8.02, 13.78, 28.82, 61.63, 121.93]
Loading

@reczkok
reczkok removed this pull request from stack #2999 September 9, 2026 14:49
@reczkok
reczkok changed the base branch from feat/geometry-meshes to feat/geometry-patches September 9, 2026 14:50
@reczkok
reczkok added this pull request to stack #3015 September 9, 2026 14:50
@reczkok
reczkok force-pushed the docs/geometry branch 2 times, most recently from 211795a to 86df052 Compare October 22, 2026 11:58
@reczkok
reczkok marked this pull request as ready for review October 22, 2026 13:00
Copilot AI balanced review requested due to automatic review settings October 22, 2026 13:00

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes

This run reviewed the full @typegpu/geometry docs PR against its stacked base feat/geometry-patches, including the interactive preview runtime and its regression test.

  • Docs guide (typegpu-geometry.mdx) — 558-line guide covering primitives, parametric surfaces, triangular patches, custom geometry, combinators, baking/updating and lines/joins/caps; prose claims spot-checked against packages/typegpu-geometry/src.
  • Preview viewer (viewer.ts, renderer.ts, shaders.ts, demos.ts) — shared-root WebGPU viewer with visibility/pause gating, per-schema pipeline caching, deferred resource cleanup and five demo scenes.
  • React shell (MeshPreview.tsx) — param/shading/pause controls plus loading and error states.
  • Docs nav (astro.config.mjs) — DEV-gated @typegpu/geometry sidebar entry with a dev badge.
  • Regression test (mesh-preview.test.ts) — pins that a bake in flight at disposal submits before its uniforms are destroyed.

Pullfrog  | View workflow run | Using deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The line-rendering example leaves its control points uninitialized, so it renders no visible line.

1 open issue
What changed in this PR

Adds an @typegpu/geometry guide with interactive mesh previews, extending the documentation to cover the triangular patches introduced in #3014.

Changes:

  • Documents primitives, composition, custom attributes, mesh evaluation and updates, and line rendering.
  • Adds configurable previews with smooth, flat, and wireframe shading.
  • Adds a disposal regression test and development-only sidebar navigation.
File Description
apps/​typegpu-docs/​tests/​individual-example-tests/​mesh-preview.test.ts Tests disposal while asynchronous baking is pending.
apps/​typegpu-docs/​src/​content/​docs/​ecosystem/​typegpu-geometry.mdx Adds the geometry guide and embedded previews.
apps/​typegpu-docs/​src/​components/​geometry/​viewer.ts Manages preview state, animation, baking, and cleanup.
apps/​typegpu-docs/​src/​components/​geometry/​shaders.ts Defines lighting and shading modes.
apps/​typegpu-docs/​src/​components/​geometry/​renderer.ts Handles render pipelines, camera updates, and depth textures.
apps/​typegpu-docs/​src/​components/​geometry/​MeshPreview.tsx Adds preview controls and visibility handling.
apps/​typegpu-docs/​src/​components/​geometry/​demos.ts Defines configurable geometry demonstrations.
apps/​typegpu-docs/​astro.config.mjs Adds the development-only geometry sidebar entry.

Review effort: Balanced

Comment thread apps/typegpu-docs/src/content/docs/ecosystem/typegpu-geometry.mdx

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants