You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Added support for object-level interactive priority in the event system. Objects with `userData.interactivePriority` take precedence over standard distance-based hit testing, enabling UI controls that render on top via depth tricks to receive events correctly.
55
+
56
+
```tsx
57
+
// This mesh receives events even if behind other objects in world space
58
+
<meshuserData={{ interactivePriority: 1 }}>
59
+
<boxGeometry />
60
+
<meshBasicMaterial />
61
+
</mesh>
62
+
63
+
// Higher values take precedence
64
+
<meshuserData={{ interactivePriority: 10 }}>
65
+
{/* Receives events before interactivePriority: 1 */}
66
+
</mesh>
67
+
```
68
+
69
+
**Sort order:**
70
+
71
+
1. Objects with `interactivePriority` come before objects without
72
+
2. Higher `interactivePriority` values win among prioritized objects
73
+
3. Then standard `events.priority` (portal/layer priority)
74
+
4. Then distance (closer first)
75
+
76
+
**Use cases:** Transform controls (PivotControls), UI overlays, debug helpers that use depth tricks to render on top.
77
+
78
+
**Files changed:**
79
+
80
+
-`packages/fiber/src/core/events.ts` - Added interactivePriority check in hit sorting
81
+
82
+
#### useBuffers & useGPUStorage Hooks
83
+
84
+
Added two new hooks for managing GPU storage in compute-intensive WebGPU applications:
85
+
86
+
**useBuffers** - Manages buffer data for GPU compute:
Added `forceEven` prop to Canvas for Safari compatibility. Safari has issues with odd or fractional HTML canvas dimensions. When enabled, canvas dimensions are rounded up to the nearest even number.
@@ -323,6 +409,7 @@ Added automatic Hot Module Replacement (HMR) support for WebGPU TSL hooks. When
323
409
324
410
### Bug Fixes
325
411
412
+
- Fixed memory leak in `createPortal` where subscriptions to parent store were never cleaned up. When portals were created/destroyed frequently (e.g., with rapidly changing data), each portal subscribed to `previousRoot` but never unsubscribed, keeping the portal's zustand store and all its state in memory indefinitely.
326
413
- Fixed portal `size` state being overwritten by parent resize events. Portals now correctly preserve their own size override when the root canvas resizes, matching the existing behavior for `events`. This also fixes nested portals ignoring their size configuration.
327
414
- Fixed `setSize` not triggering a frame in demand mode. Now calls `scheduler.invalidate()` directly so `useFrame` callbacks can respond to size changes.
328
415
- Fixed `useNodes()` and `useUniforms()` reader modes not updating when store changes
0 commit comments