shaders 2.0.0-alpha.11 → 2.0.0-alpha.12

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.
@@ -6,6 +6,7 @@ export { default as Grayscale } from './components/Grayscale';
6
6
  export { default as HueShift } from './components/HueShift';
7
7
  export { default as Invert } from './components/Invert';
8
8
  export { default as LinearGradient } from './components/LinearGradient';
9
+ export { default as MouseDistortion } from './components/MouseDistortion';
9
10
  export { default as Posterize } from './components/Posterize';
10
11
  export { default as Saturation } from './components/Saturation';
11
12
  export { default as SolidColor } from './components/SolidColor';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,O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AM,iBAAiB,CAAC"}
@@ -35480,14 +35480,14 @@ const Tnt = (r) => {
35480
35480
  }
35481
35481
  return /* @__PURE__ */ pr(Ot.Provider, { value: h, children: r.children });
35482
35482
  }, Il = { name: "MouseDistortion", props: { distortionRadius: { type: Number, default: 0.2, description: "Radius of the distortion effect (0-1)" }, distortionStrength: { type: Number, default: 0.1, description: "Strength of the distortion (0-1)" }, smoothing: { type: Number, default: 0.85, description: "Smoothing factor for mouse movement (0-1, higher = smoother)" } }, fragmentNode: ({ uniforms: r, onBeforeRender: t, childNode: e }) => {
35483
- let { vec2: s, vec4: i, float: n, uniform: a, length: o, smoothstep: l, screenUV: h, convertToTexture: u } = Ur;
35483
+ let { vec2: s, vec4: i, float: n, uniform: a, length: o, smoothstep: l, uv: h, convertToTexture: u } = Ur;
35484
35484
  if (!e) return console.warn("MouseDistortion: No child node provided"), i(0, 0, 0, 0);
35485
35485
  let c = u(e), d = a(0.5), p = a(0.5), m = a(0), f = a(0), x = 0.5, b = 0.5, w = 0.5, S = 0.5, _ = 0, E = 0;
35486
35486
  t(({ pointer: ht, deltaTime: _t }) => {
35487
35487
  let hr = (ht.x - x) / _t, jr = (ht.y - b) / _t, ni = r.smoothing.uniform.value, Wr = w + (ht.x - w) * (1 - ni), zx = S + (ht.y - S) * (1 - ni), Cx = _ + (hr - _) * (1 - ni), Ex = E + (jr - E) * (1 - ni);
35488
35488
  d.value = Wr, p.value = zx, m.value = Cx, f.value = Ex, x = ht.x, b = ht.y, w = Wr, S = zx, _ = Cx, E = Ex;
35489
35489
  });
35490
- let z = h, A = s(d, p), L = z.sub(A), K = o(L), it = r.distortionRadius.uniform, st = l(it, n(0), K), wt = s(m, f), ut = r.distortionStrength.uniform, It = st.mul(ut).mul(n(0.5)), Ct = L.mul(It), Dt = n(2), te = wt.mul(Dt).mul(st).mul(ut), Qt = Ct.add(te), gt = z.sub(Qt);
35490
+ let z = h(), A = s(d, p), L = z.sub(A), K = o(L), it = r.distortionRadius.uniform, st = l(it, n(0), K), wt = s(m, f), ut = r.distortionStrength.uniform, It = st.mul(ut).mul(n(0.5)), Ct = L.mul(It), Dt = n(2), te = wt.mul(Dt).mul(st).mul(ut), Qt = Ct.add(te), gt = z.sub(Qt);
35491
35491
  return c.sample(gt);
35492
35492
  } };
35493
35493
  function Oit(r, t) {