Skip to content

feat: Add 3D mesh endpoint to @typegpu/geometry - #2997

Draft
reczkok wants to merge 3 commits into
mainfrom
feat/geometry-meshes
Draft

reczkok wants to merge 3 commits into
mainfrom
feat/geometry-meshes

Conversation

@reczkok

@reczkok reczkok commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Adds meshes to @typegpu/geometry. Geometry is a vertex schema + vertexAt (and optionally indexAt), so primitives and transformations compose before anything needs a buffer

  • plane, box, sphere, cylinder, torus + custom parametric surfaces
  • transform, map, attach extra attributes and concat geometries
  • evaluate directly in shaders, bake into buffers or bake just the indices while keeping vertices procedural
  • baked meshes can be updated through compute and used as geometry inputs again
  • includes an animated primitives example with shadows

Interactive cloth example and docs will follow in separate PRs

@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@434811e108842f6add656b1494983a3288bdb0d6
https://pkg.pr.new/software-mansion/TypeGPU/@typegpu/cli@434811e108842f6add656b1494983a3288bdb0d6
https://pkg.pr.new/software-mansion/TypeGPU/@typegpu/gl@434811e108842f6add656b1494983a3288bdb0d6

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 325 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.02, 2.04, 4.36, 6.91, 7.61, 11.42, 24.54, 25.60]
  line [1.01, 2.11, 4.60, 6.44, 7.75, 11.12, 25.93, 25.43]
  line [1.03, 1.99, 4.40, 6.63, 7.61, 12.45, 24.18, 27.64]
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.33, 0.49, 0.69, 0.84, 1.10, 1.26, 1.48, 1.64]
  line [0.31, 0.55, 0.69, 0.82, 1.15, 1.20, 1.43, 1.58]
  line [0.28, 0.54, 0.76, 0.84, 1.15, 1.25, 1.43, 1.58]
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.97, 2.37, 3.89, 7.54, 12.65, 26.39, 57.77, 115.96]
  line [0.83, 2.19, 3.66, 6.96, 12.67, 26.70, 57.06, 116.80]
  line [0.86, 2.37, 3.72, 7.49, 12.72, 26.79, 56.28, 114.82]
Loading

@deluksic

deluksic commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Please take a look at my (almost finished) branch, if you would like to incorporate any of it, or steal techniques

https://github.com/deluksic/TypeGPU/tree/de/geometry-spheres (it is more than spheres)

@reczkok
reczkok force-pushed the feat/geometry-meshes branch from b452155 to 434811e Compare September 9, 2026 14:48
@reczkok
reczkok removed this pull request from stack #2999 September 9, 2026 14:49
@reczkok
reczkok added this pull request to stack #3015 September 9, 2026 14:50
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