Skip to content

fix: @typegpu/three toTSL should have a per-stage namespace#1994

Merged
iwoplaza merged 1 commit intofeat/tgpu-threefrom
fix/tgpu-three-per-stage-namespace
Dec 22, 2025
Merged

fix: @typegpu/three toTSL should have a per-stage namespace#1994
iwoplaza merged 1 commit intofeat/tgpu-threefrom
fix/tgpu-three-per-stage-namespace

Conversation

@iwoplaza
Copy link
Collaborator

No description provided.

@github-actions
Copy link

pkg.pr.new

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

https://pkg.pr.new/software-mansion/TypeGPU/typegpu@8de091c3b86e835839d25bc79c1993cf380ceb34
https://pkg.pr.new/software-mansion/TypeGPU/@typegpu/noise@8de091c3b86e835839d25bc79c1993cf380ceb34
https://pkg.pr.new/software-mansion/TypeGPU/unplugin-typegpu@8de091c3b86e835839d25bc79c1993cf380ceb34

benchmark
view benchmark

commit
view commit

Copy link
Collaborator

@cieplypolar cieplypolar left a comment

Choose a reason for hiding this comment

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

Good work! 🚀

@cieplypolar
Copy link
Collaborator

After these changes and minor waterMaterial tweaks, example with pool and ducks seems to work

waterMaterial.normalNode = TSL.transformNormalToView(t3.toTSL(() => {
  'use gpu';
  const normals = getCurrentNormals(d.u32(t3.vertexIndex.$));
  return d.vec3f(normals.normalX, std.neg(normals.normalY), 1.0);
})).toVertexStage();

proof of working :))

Screen.Recording.2025-12-22.at.13.43.31.mov

@iwoplaza iwoplaza merged commit 10e82d9 into feat/tgpu-three Dec 22, 2025
3 checks passed
@iwoplaza iwoplaza deleted the fix/tgpu-three-per-stage-namespace branch December 22, 2025 12:57
iwoplaza added a commit that referenced this pull request Dec 22, 2025
)

* feat: tgpu.comptime, tgpu.rawCodeSnippet and `this` allowed in TypeGPU
shader functions

* Fix tests

* Better docs for rawCodeSnippet

* Docs for comptime

* - Namable comptime - Turned `extensionEnabled` into a comptime function

* Fixes

* Add @typegpu/three package and Three.js integration example (very WIP)

* Update tgpuThree.ts

* Three.js types for example code view

* More tweaks and experiments

* More work

* A bit more work

* More work

* Using @typegpu/noise in Three.js

* Add a new example

* Testing compute in Three.js

* Update examples

* Update typegpu-material.ts

* Update index.ts

* Some more work

* Works again

* TypeGPU compute shaders in TSL!

* A bit of a refactor of the cloth example

* Cleanup 🧹

* Comparing Three and TypeGPU output

* triNoise3D in TypeGPU

* comptime

* Support for 'this' in TypeGPU shader functions

* Update verlet.ts

* feat: Attractors example (#1949)

* Tweaks

* feat: Tweaks to feat/tgpu-three (#1954)

* Some review fixes

* Thumbnails and tags

* Comptime fromTSL

* Update shellless.test.ts

* fix: Calling `toTSL` multiple times (#1974)

* feat: Inform user about type mismatches (#1988)

* Fix renderer resizing when browser zoom

* docs: Cloth example controls (#1986)

* feat: ThreeJS 'Compute Particles' with tgpu (#1947)

* feat: ThreeJS 'Compute Geometry' with tgpu (#1948)

* feat: ThreeJS 'Compute Snow Particles' example in tgpu (#1972)

* fix: @typegpu/three toTSL should have a per-stage namespace (#1994)

---------

Co-authored-by: Iwo Plaza <iwoplaza@gmail.com>
Co-authored-by: Aleksander Katan <56294622+aleksanderkatan@users.noreply.github.com>
Co-authored-by: Rafal Lukosz <93160829+lursz@users.noreply.github.com>
Co-authored-by: Szymon Szulc <103948576+cieplypolar@users.noreply.github.com>
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