@react-three/postprocessing 2.10.0 → 2.11.0

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.
@@ -17,5 +17,5 @@ export declare const GodRays: React.ForwardRefExoticComponent<{
17
17
  kernelSize?: import("postprocessing").KernelSize | undefined;
18
18
  blur?: boolean | undefined;
19
19
  } & {
20
- sun: Mesh | Points;
20
+ sun: Mesh | Points | React.MutableRefObject<Mesh | Points>;
21
21
  } & React.RefAttributes<GodRaysEffect>>;
package/dist/index.cjs CHANGED
@@ -197,7 +197,9 @@ const Glitch = React.forwardRef(function Glitch({ active = true, ...props }, ref
197
197
 
198
198
  const GodRays = React.forwardRef(function GodRays(props, ref) {
199
199
  const { camera } = React.useContext(EffectComposerContext);
200
- const effect = React.useMemo(() => new postprocessing.GodRaysEffect(camera, props.sun, props), [camera, props]);
200
+ const effect = React.useMemo(() => new postprocessing.GodRaysEffect(camera, resolveRef(props.sun), props), [camera, props]);
201
+ // @ts-ignore v6.30.2 https://github.com/pmndrs/postprocessing/pull/470/commits/091ef6f9516ca02efa7576305afbecf1ce8323ae
202
+ React.useLayoutEffect(() => void (effect.lightSource = resolveRef(props.sun)), [effect, props.sun]);
201
203
  return jsxRuntime.jsx("primitive", { ref: ref, object: effect, dispose: null });
202
204
  });
203
205
 
package/dist/index.js CHANGED
@@ -177,7 +177,9 @@ const Glitch = forwardRef(function Glitch({ active = true, ...props }, ref) {
177
177
 
178
178
  const GodRays = forwardRef(function GodRays(props, ref) {
179
179
  const { camera } = useContext(EffectComposerContext);
180
- const effect = useMemo(() => new GodRaysEffect(camera, props.sun, props), [camera, props]);
180
+ const effect = useMemo(() => new GodRaysEffect(camera, resolveRef(props.sun), props), [camera, props]);
181
+ // @ts-ignore v6.30.2 https://github.com/pmndrs/postprocessing/pull/470/commits/091ef6f9516ca02efa7576305afbecf1ce8323ae
182
+ useLayoutEffect(() => void (effect.lightSource = resolveRef(props.sun)), [effect, props.sun]);
181
183
  return jsx("primitive", { ref: ref, object: effect, dispose: null });
182
184
  });
183
185
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-three/postprocessing",
3
- "version": "2.10.0",
3
+ "version": "2.11.0",
4
4
  "description": "postprocessing wrapper for React and @react-three/fiber",
5
5
  "keywords": [
6
6
  "postprocessing",