@threepipe/webgi-plugins 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * @threepipe/webgi-plugins v0.2.0
3
+ * @threepipe/webgi-plugins v0.2.1
4
4
  * Copyright 2022-2025 repalash <palash@shaders.app>
5
5
  * GPL-3.0-only License
6
6
  */
@@ -252,22 +252,24 @@ let VelocityBufferPlugin = class extends PipelinePassPlugin {
252
252
  this.material = new SSVelocityMaterial();
253
253
  this.unpackExtension = {
254
254
  shaderExtender: (shader) => {
255
+ if (this.isDisabled()) return;
255
256
  shader.fragmentShader = shaderReplaceString(
256
257
  shader.fragmentShader,
257
258
  "#pragma <velocity_unpack>",
258
259
  "\n" + VelocityBufferUnpack + "\n"
259
260
  );
260
261
  },
262
+ computeCacheKey: () => this.isDisabled() ? "" : "vb",
261
263
  extraUniforms: {
262
264
  tVelocity: () => {
263
265
  var _a2;
264
- return { value: (_a2 = this.target) == null ? void 0 : _a2.texture };
266
+ return { value: !this.isDisabled() ? (_a2 = this.target) == null ? void 0 : _a2.texture : null };
265
267
  }
266
268
  },
267
269
  extraDefines: {
268
270
  ["HAS_VELOCITY_BUFFER"]: () => {
269
271
  var _a2;
270
- return ((_a2 = this.target) == null ? void 0 : _a2.texture) ? 1 : void 0;
272
+ return !this.isDisabled() && ((_a2 = this.target) == null ? void 0 : _a2.texture) ? 1 : void 0;
271
273
  }
272
274
  },
273
275
  priority: 100,
@@ -353,6 +355,11 @@ let VelocityBufferPlugin = class extends PipelinePassPlugin {
353
355
  if (this._attachToTaa) (_b = (_a2 = viewer.getPlugin(TemporalAAPlugin)) == null ? void 0 : _a2.pass) == null ? void 0 : _b.material.unregisterMaterialExtensions([this.unpackExtension]);
354
356
  return super.onRemove(viewer);
355
357
  }
358
+ setDirty() {
359
+ var _a2, _b;
360
+ super.setDirty();
361
+ (_b = (_a2 = this.unpackExtension).setDirty) == null ? void 0 : _b.call(_a2);
362
+ }
356
363
  _beforeRender(scene, camera, renderManager) {
357
364
  if (!super._beforeRender(scene, camera, renderManager)) return false;
358
365
  const pass = this.pass;