diff --git a/.changeset/mighty-lies-hear.md b/.changeset/mighty-lies-hear.md deleted file mode 100644 index 8315b013e..000000000 --- a/.changeset/mighty-lies-hear.md +++ /dev/null @@ -1,47 +0,0 @@ ---- -"vfx-composer": minor -"vfx-composer-r3f": minor ---- - -**Major Breaking Change:** Everything around particles has received a significant refactor to reduce coupling between the different libraries and prepare for the addition of new particle and VFX types. There is only one user-facing change to the API resulting from this, but it is significant: **the way that per-particle attributes (including lifetimes!) are set has changed significantly.** - -Instanced particles may make use of instanced attribute buffers. When assembling particle materials with Material Composer and Shader Composer, these can be wrapped using a `ParticleAttribute` unit. In the past, `InstancedParticles` would search the material's shader graph for these units and take care of the buffer writing automatically. - -The new API makes the attribute writing more explicit, with the added benefit of decoupling `InstancedParticles` entirely from Material and Shader Composer. - -When working with `ParticleAttribute`, you now need to call a `write` function and pass in a reference to the mesh that you are creating the particle in. In order to make this easier, particle setup callbacks now receive the active mesh as an additional `mesh` prop in its first argument that you can use. - -#### Examples - -Setting particle lifetimes within a particle setup callback: - -```tsx -const lifetime = createParticleLifetime() - -/* Before: */ -lifetime.setLifetime(duration, offset) - -/* Now: */ -lifetime.write(mesh, duration, offset) -``` - -Writing a `ParticleAttribute` value: - -```tsx -const speed = new ParticleAttribute(() => 0) -const velocity = new ParticleAttribute(() => new THREE.Vector3()) - -/* Before: */ -speed.value = 5 -velocity.value.set(x, y, z) - -/* Now: */ -speed.write(mesh, 5) -velocity.write(mesh, (v) => v.set(x, y, z)) -``` - -The `write` method on `ParticleAttribute` accepts as its second argument either a value, or a function returning a value, and doesn't much care which one you use; the function form is mostly a convenience mechanism to help you save on the number of objects created every frame/emitted particle. The object passed into the function is the same one that is passed into the `ParticleAttribute`'s constructor; in the example above, we're instantiating the `velocity` attribute with a `new THREE.Vector3()`; in the `write` invocation, that very `Vector3` instance is passed into the function for you to mutate. This is significantly cheaper than creating a new `Vector3` instance for every emitted particle. - -This new API is a little more verbose than the previous version, but it is also more explicit and less error-prone, and decouples the particles engine entirely from Material and Shader Composer, allowing for more flexibility in the future, such as writing to multiple meshes at once, or using non-Shader Composer mechanisms to write into the buffers. - -If you have feedback on this new API, please [let me know](https://github.com/hmans/composer-suite/discussions). diff --git a/.changeset/red-months-attend.md b/.changeset/red-months-attend.md deleted file mode 100644 index 400564e46..000000000 --- a/.changeset/red-months-attend.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"render-composer": patch ---- - -**New:** `` now offers three new props, `clearColor`, `clearDepth` and `clearStencil`, that allow the user to configure which information the built-in clear pass should actually clear when enabled. diff --git a/apps/bucketeer-examples/package.json b/apps/bucketeer-examples/package.json index b3db21576..2807cf163 100644 --- a/apps/bucketeer-examples/package.json +++ b/apps/bucketeer-examples/package.json @@ -16,7 +16,7 @@ "randomish": "^0.1.4", "react": "^18.2.0", "react-dom": "^18.2.0", - "render-composer": "workspace:^0.2.5", + "render-composer": "workspace:^0.2.6", "three": "^0.145.0" }, "devDependencies": { diff --git a/apps/render-composer-examples/package.json b/apps/render-composer-examples/package.json index 0a18b439c..4f5478bf4 100644 --- a/apps/render-composer-examples/package.json +++ b/apps/render-composer-examples/package.json @@ -15,7 +15,7 @@ "postprocessing": "^6.28.7", "react": "^18.2.0", "react-dom": "^18.2.0", - "render-composer": "^0.2.5", + "render-composer": "^0.2.6", "shader-composer": "workspace:^0.4.6", "three": "^0.145.0" }, diff --git a/apps/spacerage/package.json b/apps/spacerage/package.json index 13a4ee1ce..1b950bed9 100644 --- a/apps/spacerage/package.json +++ b/apps/spacerage/package.json @@ -43,7 +43,7 @@ "react": "^18.2.0", "react-dom": "^18.2.0", "react-merge-refs": "^1.1.0", - "render-composer": "^0.2.5", + "render-composer": "^0.2.6", "shader-composer": "workspace:^0.4.6", "shader-composer-r3f": "^0.4.5", "shader-composer-toybox": "^0.1.3", @@ -56,8 +56,8 @@ "troika-three-text": "^0.46.4", "tunnel-rat": "^0.1.0", "ui-composer": "workspace:^0.0.1", - "vfx-composer": "^0.3.2", - "vfx-composer-r3f": "^0.3.0" + "vfx-composer": "^0.4.0", + "vfx-composer-r3f": "^0.4.0" }, "devDependencies": { "@types/react": "^18.0.21", diff --git a/apps/ui-composer-examples/package.json b/apps/ui-composer-examples/package.json index 96db0e26f..c21c05287 100644 --- a/apps/ui-composer-examples/package.json +++ b/apps/ui-composer-examples/package.json @@ -15,7 +15,7 @@ "@stitches/react": "^1.2.8", "react": "^18.2.0", "react-dom": "^18.2.0", - "render-composer": "workspace:^0.2.5", + "render-composer": "workspace:^0.2.6", "three": "^0.145.0", "ui-composer": "workspace:^0.0.1" }, diff --git a/apps/vfx-composer-examples/package.json b/apps/vfx-composer-examples/package.json index c170168ab..db6c77e01 100644 --- a/apps/vfx-composer-examples/package.json +++ b/apps/vfx-composer-examples/package.json @@ -31,8 +31,8 @@ "three": "^0.145.0", "three-stdlib": "^2.17.2", "timeline-composer": "^0.1.7", - "vfx-composer": "^0.3.2", - "vfx-composer-r3f": "^0.3.0", + "vfx-composer": "^0.4.0", + "vfx-composer-r3f": "^0.4.0", "wouter": "^2.8.0-alpha.2" }, "devDependencies": { diff --git a/packages/render-composer/CHANGELOG.md b/packages/render-composer/CHANGELOG.md index 1fcaff7d8..ce7502c42 100644 --- a/packages/render-composer/CHANGELOG.md +++ b/packages/render-composer/CHANGELOG.md @@ -1,5 +1,11 @@ # render-composer +## 0.2.6 + +### Patch Changes + +- 1d74dfc: **New:** `` now offers three new props, `clearColor`, `clearDepth` and `clearStencil`, that allow the user to configure which information the built-in clear pass should actually clear when enabled. + ## 0.2.5 ### Patch Changes diff --git a/packages/render-composer/package.json b/packages/render-composer/package.json index b2c00b55e..06e577822 100644 --- a/packages/render-composer/package.json +++ b/packages/render-composer/package.json @@ -6,7 +6,7 @@ "url": "https://hmans.co" }, "description": "Declarative graph-based render pipelines.", - "version": "0.2.5", + "version": "0.2.6", "main": "dist/render-composer.cjs.js", "module": "dist/render-composer.esm.js", "files": [ diff --git a/packages/vfx-composer-r3f/CHANGELOG.md b/packages/vfx-composer-r3f/CHANGELOG.md index 481fc621d..ad1ea14eb 100644 --- a/packages/vfx-composer-r3f/CHANGELOG.md +++ b/packages/vfx-composer-r3f/CHANGELOG.md @@ -1,5 +1,57 @@ # vfx-composer-r3f +## 0.4.0 + +### Minor Changes + +- 1ae718d: **Major Breaking Change:** Everything around particles has received a significant refactor to reduce coupling between the different libraries and prepare for the addition of new particle and VFX types. There is only one user-facing change to the API resulting from this, but it is significant: **the way that per-particle attributes (including lifetimes!) are set has changed significantly.** + + Instanced particles may make use of instanced attribute buffers. When assembling particle materials with Material Composer and Shader Composer, these can be wrapped using a `ParticleAttribute` unit. In the past, `InstancedParticles` would search the material's shader graph for these units and take care of the buffer writing automatically. + + The new API makes the attribute writing more explicit, with the added benefit of decoupling `InstancedParticles` entirely from Material and Shader Composer. + + When working with `ParticleAttribute`, you now need to call a `write` function and pass in a reference to the mesh that you are creating the particle in. In order to make this easier, particle setup callbacks now receive the active mesh as an additional `mesh` prop in its first argument that you can use. + + #### Examples + + Setting particle lifetimes within a particle setup callback: + + ```tsx + const lifetime = createParticleLifetime() + + /* Before: */ + lifetime.setLifetime(duration, offset) + + /* Now: */ + lifetime.write(mesh, duration, offset) + ``` + + Writing a `ParticleAttribute` value: + + ```tsx + const speed = new ParticleAttribute(() => 0) + const velocity = new ParticleAttribute(() => new THREE.Vector3()) + + /* Before: */ + speed.value = 5 + velocity.value.set(x, y, z) + + /* Now: */ + speed.write(mesh, 5) + velocity.write(mesh, (v) => v.set(x, y, z)) + ``` + + The `write` method on `ParticleAttribute` accepts as its second argument either a value, or a function returning a value, and doesn't much care which one you use; the function form is mostly a convenience mechanism to help you save on the number of objects created every frame/emitted particle. The object passed into the function is the same one that is passed into the `ParticleAttribute`'s constructor; in the example above, we're instantiating the `velocity` attribute with a `new THREE.Vector3()`; in the `write` invocation, that very `Vector3` instance is passed into the function for you to mutate. This is significantly cheaper than creating a new `Vector3` instance for every emitted particle. + + This new API is a little more verbose than the previous version, but it is also more explicit and less error-prone, and decouples the particles engine entirely from Material and Shader Composer, allowing for more flexibility in the future, such as writing to multiple meshes at once, or using non-Shader Composer mechanisms to write into the buffers. + + If you have feedback on this new API, please [let me know](https://github.com/hmans/composer-suite/discussions). + +### Patch Changes + +- Updated dependencies [1ae718d] + - vfx-composer@0.4.0 + ## 0.3.0 ### Minor Changes diff --git a/packages/vfx-composer-r3f/package.json b/packages/vfx-composer-r3f/package.json index 2499df04d..4def3d25c 100644 --- a/packages/vfx-composer-r3f/package.json +++ b/packages/vfx-composer-r3f/package.json @@ -6,7 +6,7 @@ "url": "https://hendrik.mans.de" }, "description": "React-Three-Fiber bindings for VFX Composer.", - "version": "0.3.0", + "version": "0.4.0", "main": "dist/vfx-composer-r3f.cjs.js", "module": "dist/vfx-composer-r3f.esm.js", "files": [ @@ -40,7 +40,7 @@ "miniplex": "1.0.0", "shader-composer": "^0.4.5", "shader-composer-r3f": "^0.4.5", - "vfx-composer": "^0.3.0" + "vfx-composer": "^0.4.0" }, "peerDependencies": { "@react-three/fiber": ">=8.0.27", diff --git a/packages/vfx-composer/CHANGELOG.md b/packages/vfx-composer/CHANGELOG.md index cbd4b788c..d74d64d9f 100644 --- a/packages/vfx-composer/CHANGELOG.md +++ b/packages/vfx-composer/CHANGELOG.md @@ -1,5 +1,52 @@ # vfx-composer +## 0.4.0 + +### Minor Changes + +- 1ae718d: **Major Breaking Change:** Everything around particles has received a significant refactor to reduce coupling between the different libraries and prepare for the addition of new particle and VFX types. There is only one user-facing change to the API resulting from this, but it is significant: **the way that per-particle attributes (including lifetimes!) are set has changed significantly.** + + Instanced particles may make use of instanced attribute buffers. When assembling particle materials with Material Composer and Shader Composer, these can be wrapped using a `ParticleAttribute` unit. In the past, `InstancedParticles` would search the material's shader graph for these units and take care of the buffer writing automatically. + + The new API makes the attribute writing more explicit, with the added benefit of decoupling `InstancedParticles` entirely from Material and Shader Composer. + + When working with `ParticleAttribute`, you now need to call a `write` function and pass in a reference to the mesh that you are creating the particle in. In order to make this easier, particle setup callbacks now receive the active mesh as an additional `mesh` prop in its first argument that you can use. + + #### Examples + + Setting particle lifetimes within a particle setup callback: + + ```tsx + const lifetime = createParticleLifetime() + + /* Before: */ + lifetime.setLifetime(duration, offset) + + /* Now: */ + lifetime.write(mesh, duration, offset) + ``` + + Writing a `ParticleAttribute` value: + + ```tsx + const speed = new ParticleAttribute(() => 0) + const velocity = new ParticleAttribute(() => new THREE.Vector3()) + + /* Before: */ + speed.value = 5 + velocity.value.set(x, y, z) + + /* Now: */ + speed.write(mesh, 5) + velocity.write(mesh, (v) => v.set(x, y, z)) + ``` + + The `write` method on `ParticleAttribute` accepts as its second argument either a value, or a function returning a value, and doesn't much care which one you use; the function form is mostly a convenience mechanism to help you save on the number of objects created every frame/emitted particle. The object passed into the function is the same one that is passed into the `ParticleAttribute`'s constructor; in the example above, we're instantiating the `velocity` attribute with a `new THREE.Vector3()`; in the `write` invocation, that very `Vector3` instance is passed into the function for you to mutate. This is significantly cheaper than creating a new `Vector3` instance for every emitted particle. + + This new API is a little more verbose than the previous version, but it is also more explicit and less error-prone, and decouples the particles engine entirely from Material and Shader Composer, allowing for more flexibility in the future, such as writing to multiple meshes at once, or using non-Shader Composer mechanisms to write into the buffers. + + If you have feedback on this new API, please [let me know](https://github.com/hmans/composer-suite/discussions). + ## 0.3.2 ### Patch Changes diff --git a/packages/vfx-composer/package.json b/packages/vfx-composer/package.json index fc5a3edc7..6e8145672 100644 --- a/packages/vfx-composer/package.json +++ b/packages/vfx-composer/package.json @@ -6,7 +6,7 @@ "url": "https://hendrik.mans.de" }, "description": "Composable, GPU-driven Visual Effects for Three.js and React-Three-Fiber.", - "version": "0.3.2", + "version": "0.4.0", "main": "dist/vfx-composer.cjs.js", "module": "dist/vfx-composer.esm.js", "files": [ diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 31b735d30..cec65da22 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -73,7 +73,7 @@ importers: randomish: ^0.1.4 react: ^18.2.0 react-dom: ^18.2.0 - render-composer: workspace:^0.2.5 + render-composer: workspace:^0.2.6 three: ^0.145.0 typescript: ^4.6.4 vite: ^3.1.0 @@ -194,7 +194,7 @@ importers: postprocessing: ^6.28.7 react: ^18.2.0 react-dom: ^18.2.0 - render-composer: ^0.2.5 + render-composer: ^0.2.6 shader-composer: workspace:^0.4.6 three: ^0.145.0 typescript: ^4.8.4 @@ -290,7 +290,7 @@ importers: react: ^18.2.0 react-dom: ^18.2.0 react-merge-refs: ^1.1.0 - render-composer: ^0.2.5 + render-composer: ^0.2.6 shader-composer: workspace:^0.4.6 shader-composer-r3f: ^0.4.5 shader-composer-toybox: ^0.1.3 @@ -304,8 +304,8 @@ importers: tunnel-rat: ^0.1.0 typescript: ^4.8.4 ui-composer: workspace:^0.0.1 - vfx-composer: ^0.3.2 - vfx-composer-r3f: ^0.3.0 + vfx-composer: ^0.4.0 + vfx-composer-r3f: ^0.4.0 vite: ^3.1.6 dependencies: '@dimforge/rapier3d-compat': 0.9.0 @@ -390,7 +390,7 @@ importers: '@vitejs/plugin-react': ^2.1.0 react: ^18.2.0 react-dom: ^18.2.0 - render-composer: workspace:^0.2.5 + render-composer: workspace:^0.2.6 three: ^0.145.0 typescript: ^4.8.4 ui-composer: workspace:^0.0.1 @@ -444,8 +444,8 @@ importers: three-stdlib: ^2.17.2 timeline-composer: ^0.1.7 typescript: ^4.8.4 - vfx-composer: ^0.3.2 - vfx-composer-r3f: ^0.3.0 + vfx-composer: ^0.4.0 + vfx-composer-r3f: ^0.4.0 vite: ^3.1.6 wouter: ^2.8.0-alpha.2 dependencies: @@ -708,7 +708,7 @@ importers: miniplex: 1.0.0 shader-composer: ^0.4.5 shader-composer-r3f: ^0.4.5 - vfx-composer: ^0.3.0 + vfx-composer: ^0.4.0 dependencies: '@hmans/use-const': 0.0.1 '@hmans/use-rerender': 0.0.2