@ntalmagor/3drize-viewer 0.1.22 → 0.1.23
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/components/EnvironmentManager.d.ts.map +1 -1
- package/dist/components/EnvironmentManager.js +18 -22
- package/dist/components/HdrPlaylistRenderer.d.ts +10 -0
- package/dist/components/HdrPlaylistRenderer.d.ts.map +1 -0
- package/dist/components/HdrPlaylistRenderer.js +364 -0
- package/dist/hooks/useCubeCamera.js +4 -4
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnvironmentManager.d.ts","sourceRoot":"","sources":["../../src/components/EnvironmentManager.tsx"],"names":[],"mappings":"AAIA,OAAkB,EAAE,KAAK,YAAY,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"EnvironmentManager.d.ts","sourceRoot":"","sources":["../../src/components/EnvironmentManager.tsx"],"names":[],"mappings":"AAIA,OAAkB,EAAE,KAAK,YAAY,EAAE,KAAK,cAAc,EAAE,MAAM,aAAa,CAAC;AAIhF,OAAO,KAAK,EAAE,iBAAiB,EAAe,MAAM,wBAAwB,CAAC;AAG7E,MAAM,WAAW,uBAAwB,SAAQ,cAAc;IAC7D,WAAW,CAAC,EAAE,iBAAiB,CAAC;IAChC,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,QAAA,MAAM,kBAAkB,kHAkHtB,CAAC;AAIH,eAAe,kBAAkB,CAAC"}
|
|
@@ -5,24 +5,9 @@ import { useThree } from '@react-three/fiber';
|
|
|
5
5
|
import { Vector3 } from 'three';
|
|
6
6
|
import SkySystem from './SkySystem.js';
|
|
7
7
|
import { useCubeCamera } from '../hooks/useCubeCamera.js';
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
timeSettings,
|
|
11
|
-
// sunSystemVisible = false,
|
|
12
|
-
// sunSize,
|
|
13
|
-
// moonSize,
|
|
14
|
-
// skyboxScale,
|
|
15
|
-
// sunIntensity,
|
|
16
|
-
// castShadow,
|
|
17
|
-
// shadowMapSize,
|
|
18
|
-
// playerPosition,
|
|
19
|
-
// starsSettings,
|
|
20
|
-
// cloudsSettings,
|
|
21
|
-
// cloudsMaterialSettings,
|
|
22
|
-
// skyControllerSettings,
|
|
23
|
-
// rainSettings,
|
|
24
|
-
// fogSettings,
|
|
25
|
-
onTimeOfDayChange, onTimeUpdate, }, ref) => {
|
|
8
|
+
import HdrPlaylistRenderer from './HdrPlaylistRenderer.js';
|
|
9
|
+
import { getTransitionSettings } from '@ntalmagor/3drize-core';
|
|
10
|
+
const EnvironmentManager = forwardRef(({ environment, cubeCameraResolution = 512, timeSettings, onTimeOfDayChange, onTimeUpdate, }, ref) => {
|
|
26
11
|
const { scene } = useThree();
|
|
27
12
|
const defaultHdr = {
|
|
28
13
|
visible: false,
|
|
@@ -41,6 +26,10 @@ onTimeOfDayChange, onTimeUpdate, }, ref) => {
|
|
|
41
26
|
};
|
|
42
27
|
const hdr = environment?.hdr ?? defaultHdr;
|
|
43
28
|
const backgroundName = hdr.visible ? hdr.name : null;
|
|
29
|
+
const urls = hdr.urls;
|
|
30
|
+
const playlistActive = !!urls && urls.length > 1;
|
|
31
|
+
const singleUrl = urls && urls.length === 1 ? urls[0] : undefined;
|
|
32
|
+
const hdrActive = !!(backgroundName || singleUrl || playlistActive);
|
|
44
33
|
const sky = environment?.sky;
|
|
45
34
|
const sunSystemVisible = sky?.sunSystem?.visible;
|
|
46
35
|
const sunSize = sky?.sunSystem?.sunSize;
|
|
@@ -63,16 +52,23 @@ onTimeOfDayChange, onTimeUpdate, }, ref) => {
|
|
|
63
52
|
timeSettings,
|
|
64
53
|
resolution: cubeCameraResolution,
|
|
65
54
|
});
|
|
55
|
+
// While the playlist is active, drei <Environment> unmounts; HdrPlaylistRenderer
|
|
56
|
+
// owns scene.environment + scene.background for the duration of the transitions.
|
|
66
57
|
const environmentComponent = useMemo(() => {
|
|
67
|
-
if (
|
|
58
|
+
if (playlistActive)
|
|
68
59
|
return null;
|
|
69
|
-
|
|
60
|
+
if (!singleUrl && !backgroundName)
|
|
61
|
+
return null;
|
|
62
|
+
const sourceProps = singleUrl
|
|
63
|
+
? { files: singleUrl }
|
|
64
|
+
: { preset: backgroundName };
|
|
65
|
+
return (_jsx(Environment, { ...sourceProps, background: true, scene: scene, backgroundBlurriness: hdr.settings.backgroundBlurriness ?? 0, backgroundIntensity: hdr.settings.backgroundIntensity ?? 1, backgroundRotation: [0, hdr.settings.backgroundRotation ?? Math.PI / 2, 0], environmentIntensity: hdr.settings.environmentIntensity ?? 1, environmentRotation: [0, hdr.settings.environmentRotation ?? Math.PI / 2, 0], blur: hdr.settings.blur ?? 0, ground: {
|
|
70
66
|
radius: hdr.settings.groundRadius,
|
|
71
67
|
height: hdr.settings.groundHeight,
|
|
72
68
|
scale: hdr.settings.groundScale,
|
|
73
69
|
} }));
|
|
74
|
-
}, [backgroundName, hdr.settings, scene]);
|
|
75
|
-
return (_jsxs(_Fragment, { children: [environmentComponent, _jsx(SkySystem, { ref: ref, timeSettings: timeSettings, visible: true, sunSystemVisible: sunSystemVisible, sunSize: sunSize, moonSize: moonSize, skyboxScale: skyboxScale, sunIntensity: sunIntensity, castShadow: castShadow, shadowMapSize: shadowMapSize, playerPosition: playerPosition, starsSettings: starsSettings, cloudsSettings: cloudsSettings, cloudsMaterialSettings: cloudsMaterialSettings, skyControllerSettings: skyControllerSettings, rainSettings: rainSettings, fogSettings: fogSettings, onTimeOfDayChange: onTimeOfDayChange, onTimeUpdate: onTimeUpdate })] }));
|
|
70
|
+
}, [playlistActive, singleUrl, backgroundName, hdr.settings, scene]);
|
|
71
|
+
return (_jsxs(_Fragment, { children: [environmentComponent, playlistActive && urls && (_jsx(HdrPlaylistRenderer, { urls: urls, transition: getTransitionSettings(hdr) })), _jsx(SkySystem, { ref: ref, timeSettings: timeSettings, visible: true, sunSystemVisible: sunSystemVisible, sunSize: sunSize, moonSize: moonSize, skyboxScale: skyboxScale, sunIntensity: sunIntensity, castShadow: castShadow, shadowMapSize: shadowMapSize, playerPosition: playerPosition, starsSettings: starsSettings, cloudsSettings: cloudsSettings, cloudsMaterialSettings: cloudsMaterialSettings, skyControllerSettings: skyControllerSettings, rainSettings: rainSettings, fogSettings: fogSettings, onTimeOfDayChange: onTimeOfDayChange, onTimeUpdate: onTimeUpdate })] }));
|
|
76
72
|
});
|
|
77
73
|
EnvironmentManager.displayName = 'EnvironmentManager';
|
|
78
74
|
export default EnvironmentManager;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { HdrTransitionSettings } from '@ntalmagor/3drize-core';
|
|
2
|
+
export interface HdrPlaylistRendererProps {
|
|
3
|
+
/** Two or more equirect HDR URLs to cycle through. Caller ensures length >= 2. */
|
|
4
|
+
urls: string[];
|
|
5
|
+
/** Fully resolved transition settings (defaults already merged). */
|
|
6
|
+
transition: HdrTransitionSettings;
|
|
7
|
+
}
|
|
8
|
+
declare const HdrPlaylistRenderer: React.FC<HdrPlaylistRendererProps>;
|
|
9
|
+
export default HdrPlaylistRenderer;
|
|
10
|
+
//# sourceMappingURL=HdrPlaylistRenderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HdrPlaylistRenderer.d.ts","sourceRoot":"","sources":["../../src/components/HdrPlaylistRenderer.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,qBAAqB,EAAqB,MAAM,wBAAwB,CAAC;AAEvF,MAAM,WAAW,wBAAwB;IACvC,kFAAkF;IAClF,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,oEAAoE;IACpE,UAAU,EAAE,qBAAqB,CAAC;CACnC;AA8KD,QAAA,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,wBAAwB,CAgP3D,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,364 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useMemo, useRef, useState } from 'react';
|
|
3
|
+
import { useFrame, useThree } from '@react-three/fiber';
|
|
4
|
+
import * as THREE from 'three';
|
|
5
|
+
import { gsap } from 'gsap';
|
|
6
|
+
import { RGBELoader } from 'three/addons/loaders/RGBELoader.js';
|
|
7
|
+
const CUBE_SIZE = 256;
|
|
8
|
+
const MODE_INDEX = {
|
|
9
|
+
crossfade: 0,
|
|
10
|
+
wipe: 1,
|
|
11
|
+
iris: 2,
|
|
12
|
+
dissolve: 3,
|
|
13
|
+
'vertical-divider': 4,
|
|
14
|
+
'horizontal-divider': 5,
|
|
15
|
+
};
|
|
16
|
+
const isDividerMode = (m) => m === 4 || m === 5;
|
|
17
|
+
// ── Shaders ─────────────────────────────────────────────────────────────────
|
|
18
|
+
const cubeVertexShader = /* glsl */ `
|
|
19
|
+
varying vec3 vDir;
|
|
20
|
+
void main() {
|
|
21
|
+
vDir = position;
|
|
22
|
+
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
23
|
+
}
|
|
24
|
+
`;
|
|
25
|
+
const cubeFragmentShader = /* glsl */ `
|
|
26
|
+
precision highp float;
|
|
27
|
+
uniform samplerCube tA;
|
|
28
|
+
uniform samplerCube tB;
|
|
29
|
+
uniform float uMix;
|
|
30
|
+
uniform int uMode;
|
|
31
|
+
uniform vec3 uWipeAxis;
|
|
32
|
+
uniform vec3 uIrisCenter;
|
|
33
|
+
uniform float uNoiseScale;
|
|
34
|
+
uniform float uFeather;
|
|
35
|
+
varying vec3 vDir;
|
|
36
|
+
|
|
37
|
+
float hash3(vec3 p) {
|
|
38
|
+
p = fract(p * vec3(0.1031, 0.1030, 0.0973));
|
|
39
|
+
p += dot(p, p.yzx + 33.33);
|
|
40
|
+
return fract((p.x + p.y) * p.z);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
float noise3(vec3 p) {
|
|
44
|
+
vec3 i = floor(p);
|
|
45
|
+
vec3 f = fract(p);
|
|
46
|
+
f = f * f * (3.0 - 2.0 * f);
|
|
47
|
+
float n000 = hash3(i);
|
|
48
|
+
float n100 = hash3(i + vec3(1.0, 0.0, 0.0));
|
|
49
|
+
float n010 = hash3(i + vec3(0.0, 1.0, 0.0));
|
|
50
|
+
float n110 = hash3(i + vec3(1.0, 1.0, 0.0));
|
|
51
|
+
float n001 = hash3(i + vec3(0.0, 0.0, 1.0));
|
|
52
|
+
float n101 = hash3(i + vec3(1.0, 0.0, 1.0));
|
|
53
|
+
float n011 = hash3(i + vec3(0.0, 1.0, 1.0));
|
|
54
|
+
float n111 = hash3(i + vec3(1.0, 1.0, 1.0));
|
|
55
|
+
float nx00 = mix(n000, n100, f.x);
|
|
56
|
+
float nx10 = mix(n010, n110, f.x);
|
|
57
|
+
float nx01 = mix(n001, n101, f.x);
|
|
58
|
+
float nx11 = mix(n011, n111, f.x);
|
|
59
|
+
float nxy0 = mix(nx00, nx10, f.y);
|
|
60
|
+
float nxy1 = mix(nx01, nx11, f.y);
|
|
61
|
+
return mix(nxy0, nxy1, f.z);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
void main() {
|
|
65
|
+
vec3 dir = normalize(vDir);
|
|
66
|
+
vec4 a = textureCube(tA, dir);
|
|
67
|
+
vec4 b = textureCube(tB, dir);
|
|
68
|
+
float blend;
|
|
69
|
+
|
|
70
|
+
if (uMode == 0) {
|
|
71
|
+
blend = uMix;
|
|
72
|
+
} else if (uMode == 1) {
|
|
73
|
+
float s = dot(dir, normalize(uWipeAxis)) * 0.5 + 0.5;
|
|
74
|
+
float adj = uMix * (1.0 + 2.0 * uFeather) - uFeather;
|
|
75
|
+
blend = 1.0 - smoothstep(adj - uFeather, adj + uFeather, s);
|
|
76
|
+
} else if (uMode == 2) {
|
|
77
|
+
float ang = acos(clamp(dot(dir, normalize(uIrisCenter)), -1.0, 1.0));
|
|
78
|
+
float radius = uMix * (3.14159265 + 2.0 * uFeather) - uFeather;
|
|
79
|
+
blend = 1.0 - smoothstep(radius - uFeather, radius + uFeather, ang);
|
|
80
|
+
} else {
|
|
81
|
+
float n = noise3(dir * uNoiseScale);
|
|
82
|
+
float adj = uMix * (1.0 + 2.0 * uFeather) - uFeather;
|
|
83
|
+
blend = 1.0 - smoothstep(adj - uFeather, adj + uFeather, n);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
gl_FragColor = mix(a, b, blend);
|
|
87
|
+
}
|
|
88
|
+
`;
|
|
89
|
+
const bgVertexShader = /* glsl */ `
|
|
90
|
+
uniform mat4 uCamWorldMatrix;
|
|
91
|
+
uniform mat4 uProjMatrixInv;
|
|
92
|
+
varying vec3 vWorldDir;
|
|
93
|
+
varying vec2 vScreenUV;
|
|
94
|
+
void main() {
|
|
95
|
+
vScreenUV = position.xy * 0.5 + 0.5;
|
|
96
|
+
vec4 viewPos = uProjMatrixInv * vec4(position.xy, 1.0, 1.0);
|
|
97
|
+
viewPos /= viewPos.w;
|
|
98
|
+
vWorldDir = (uCamWorldMatrix * vec4(viewPos.xyz, 0.0)).xyz;
|
|
99
|
+
gl_Position = vec4(position.xy, 1.0, 1.0);
|
|
100
|
+
}
|
|
101
|
+
`;
|
|
102
|
+
const bgFragmentShader = /* glsl */ `
|
|
103
|
+
precision highp float;
|
|
104
|
+
uniform samplerCube tA;
|
|
105
|
+
uniform samplerCube tB;
|
|
106
|
+
uniform int uMode;
|
|
107
|
+
uniform float uDividerX;
|
|
108
|
+
uniform float uDividerY;
|
|
109
|
+
uniform float uFeather;
|
|
110
|
+
varying vec3 vWorldDir;
|
|
111
|
+
varying vec2 vScreenUV;
|
|
112
|
+
void main() {
|
|
113
|
+
vec3 dir = normalize(vWorldDir);
|
|
114
|
+
vec4 a = textureCube(tA, dir);
|
|
115
|
+
vec4 b = textureCube(tB, dir);
|
|
116
|
+
float blend;
|
|
117
|
+
if (uMode == 4) {
|
|
118
|
+
blend = smoothstep(uDividerX - uFeather, uDividerX + uFeather, vScreenUV.x);
|
|
119
|
+
} else {
|
|
120
|
+
blend = smoothstep(uDividerY - uFeather, uDividerY + uFeather, vScreenUV.y);
|
|
121
|
+
}
|
|
122
|
+
gl_FragColor = mix(a, b, blend);
|
|
123
|
+
}
|
|
124
|
+
`;
|
|
125
|
+
// ── Loader ──────────────────────────────────────────────────────────────────
|
|
126
|
+
const loadEquirectHdr = (url) => new Promise((resolve, reject) => {
|
|
127
|
+
const loader = new RGBELoader();
|
|
128
|
+
loader.setDataType(THREE.HalfFloatType);
|
|
129
|
+
loader.load(url, (tex) => resolve(tex), undefined, reject);
|
|
130
|
+
});
|
|
131
|
+
// ── Order policy ────────────────────────────────────────────────────────────
|
|
132
|
+
const pickNext = (order, current, length, directionRef) => {
|
|
133
|
+
if (length <= 1)
|
|
134
|
+
return current;
|
|
135
|
+
if (order === 'sequential')
|
|
136
|
+
return (current + 1) % length;
|
|
137
|
+
if (order === 'random') {
|
|
138
|
+
let pick = current;
|
|
139
|
+
while (pick === current)
|
|
140
|
+
pick = Math.floor(Math.random() * length);
|
|
141
|
+
return pick;
|
|
142
|
+
}
|
|
143
|
+
// yoyo
|
|
144
|
+
let next = current + directionRef.current;
|
|
145
|
+
if (next >= length) {
|
|
146
|
+
directionRef.current = -1;
|
|
147
|
+
next = current - 1;
|
|
148
|
+
}
|
|
149
|
+
else if (next < 0) {
|
|
150
|
+
directionRef.current = 1;
|
|
151
|
+
next = current + 1;
|
|
152
|
+
}
|
|
153
|
+
return next;
|
|
154
|
+
};
|
|
155
|
+
// ── Component ───────────────────────────────────────────────────────────────
|
|
156
|
+
const HdrPlaylistRenderer = ({ urls, transition }) => {
|
|
157
|
+
const { scene, gl: renderer, camera } = useThree();
|
|
158
|
+
const mixRef = useRef(0);
|
|
159
|
+
const tlRef = useRef(null);
|
|
160
|
+
const stateRef = useRef(null);
|
|
161
|
+
const modeRef = useRef(MODE_INDEX[transition.types[0] ?? 'crossfade']);
|
|
162
|
+
const currentIdxRef = useRef(0);
|
|
163
|
+
const yoyoDirRef = useRef(1);
|
|
164
|
+
const typeIdxRef = useRef(0);
|
|
165
|
+
// Live transition snapshot — read each frame so slider changes apply instantly
|
|
166
|
+
// without rebuilding GPU resources or the timeline.
|
|
167
|
+
const transitionRef = useRef(transition);
|
|
168
|
+
useEffect(() => {
|
|
169
|
+
transitionRef.current = transition;
|
|
170
|
+
}, [transition]);
|
|
171
|
+
const bgMeshRef = useRef(null);
|
|
172
|
+
// Gates the timeline-build effect on the cube-RT pipeline being ready.
|
|
173
|
+
// Replaces a previous rAF poll — flips false → true once HDRs load and
|
|
174
|
+
// stateRef.current is populated, and back to false on URL/teardown changes.
|
|
175
|
+
const [pipelineReady, setPipelineReady] = useState(false);
|
|
176
|
+
// Stable uniforms object for the bg shader. Must NOT be inline JSX literal —
|
|
177
|
+
// R3F reassigns material.uniforms on parent re-render and would wipe tA/tB.
|
|
178
|
+
const bgUniforms = useMemo(() => ({
|
|
179
|
+
tA: { value: null },
|
|
180
|
+
tB: { value: null },
|
|
181
|
+
uMode: { value: 4 },
|
|
182
|
+
uDividerX: { value: 0.5 },
|
|
183
|
+
uDividerY: { value: 0.5 },
|
|
184
|
+
uFeather: { value: transition.dividerFeather ?? 0.003 },
|
|
185
|
+
uCamWorldMatrix: { value: new THREE.Matrix4() },
|
|
186
|
+
uProjMatrixInv: { value: new THREE.Matrix4() },
|
|
187
|
+
}),
|
|
188
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
189
|
+
[]);
|
|
190
|
+
// ── Build cube RTs + blend pipeline (rebuilds only when urls change) ──────
|
|
191
|
+
const urlsKey = urls.join('|');
|
|
192
|
+
useEffect(() => {
|
|
193
|
+
let disposed = false;
|
|
194
|
+
(async () => {
|
|
195
|
+
let equirects = [];
|
|
196
|
+
try {
|
|
197
|
+
equirects = await Promise.all(urls.map(loadEquirectHdr));
|
|
198
|
+
}
|
|
199
|
+
catch (err) {
|
|
200
|
+
console.error('[HdrPlaylistRenderer] HDR load failed', err);
|
|
201
|
+
return;
|
|
202
|
+
}
|
|
203
|
+
if (disposed) {
|
|
204
|
+
equirects.forEach((t) => t.dispose());
|
|
205
|
+
return;
|
|
206
|
+
}
|
|
207
|
+
const cubeRTOpts = {
|
|
208
|
+
type: THREE.HalfFloatType,
|
|
209
|
+
format: THREE.RGBAFormat,
|
|
210
|
+
generateMipmaps: true,
|
|
211
|
+
minFilter: THREE.LinearMipmapLinearFilter,
|
|
212
|
+
};
|
|
213
|
+
const cubeRTs = equirects.map((eq) => {
|
|
214
|
+
const rt = new THREE.WebGLCubeRenderTarget(CUBE_SIZE, cubeRTOpts);
|
|
215
|
+
rt.fromEquirectangularTexture(renderer, eq);
|
|
216
|
+
eq.dispose();
|
|
217
|
+
return rt;
|
|
218
|
+
});
|
|
219
|
+
const outRT = new THREE.WebGLCubeRenderTarget(CUBE_SIZE, cubeRTOpts);
|
|
220
|
+
const cubeCamera = new THREE.CubeCamera(0.1, 10, outRT);
|
|
221
|
+
const material = new THREE.ShaderMaterial({
|
|
222
|
+
uniforms: {
|
|
223
|
+
tA: { value: cubeRTs[0].texture },
|
|
224
|
+
tB: { value: cubeRTs[1 % cubeRTs.length].texture },
|
|
225
|
+
uMix: { value: 0 },
|
|
226
|
+
uMode: { value: 0 },
|
|
227
|
+
uWipeAxis: { value: new THREE.Vector3(0, 1, 0) },
|
|
228
|
+
uIrisCenter: { value: new THREE.Vector3(0, 1, 0) },
|
|
229
|
+
uNoiseScale: { value: 4.0 },
|
|
230
|
+
uFeather: { value: 0.07 },
|
|
231
|
+
},
|
|
232
|
+
vertexShader: cubeVertexShader,
|
|
233
|
+
fragmentShader: cubeFragmentShader,
|
|
234
|
+
side: THREE.BackSide,
|
|
235
|
+
});
|
|
236
|
+
const geo = new THREE.BoxGeometry(1, 1, 1);
|
|
237
|
+
const mesh = new THREE.Mesh(geo, material);
|
|
238
|
+
const blendScene = new THREE.Scene();
|
|
239
|
+
blendScene.add(mesh);
|
|
240
|
+
blendScene.add(cubeCamera);
|
|
241
|
+
stateRef.current = {
|
|
242
|
+
blendScene,
|
|
243
|
+
cubeCamera,
|
|
244
|
+
outRT,
|
|
245
|
+
material,
|
|
246
|
+
cubeRTs,
|
|
247
|
+
mesh,
|
|
248
|
+
};
|
|
249
|
+
bgUniforms.tA.value = cubeRTs[0].texture;
|
|
250
|
+
bgUniforms.tB.value = cubeRTs[1 % cubeRTs.length].texture;
|
|
251
|
+
currentIdxRef.current = 0;
|
|
252
|
+
yoyoDirRef.current = 1;
|
|
253
|
+
// Signal readiness AFTER stateRef is populated. The timeline-build effect
|
|
254
|
+
// listens for this and runs without polling.
|
|
255
|
+
setPipelineReady(true);
|
|
256
|
+
})();
|
|
257
|
+
return () => {
|
|
258
|
+
disposed = true;
|
|
259
|
+
setPipelineReady(false);
|
|
260
|
+
const s = stateRef.current;
|
|
261
|
+
if (s) {
|
|
262
|
+
s.outRT.dispose();
|
|
263
|
+
s.cubeRTs.forEach((rt) => rt.dispose());
|
|
264
|
+
s.material.dispose();
|
|
265
|
+
s.mesh.geometry.dispose();
|
|
266
|
+
}
|
|
267
|
+
stateRef.current = null;
|
|
268
|
+
};
|
|
269
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
270
|
+
}, [urlsKey, renderer, bgUniforms]);
|
|
271
|
+
// ── Build/rebuild GSAP timeline when timing-or-order props change ──────────
|
|
272
|
+
// Gated on `pipelineReady` so we never run before stateRef.current is
|
|
273
|
+
// populated — no rAF polling needed; React schedules us once the pipeline
|
|
274
|
+
// effect calls setPipelineReady(true).
|
|
275
|
+
useEffect(() => {
|
|
276
|
+
if (!pipelineReady)
|
|
277
|
+
return;
|
|
278
|
+
const s = stateRef.current;
|
|
279
|
+
if (!s)
|
|
280
|
+
return;
|
|
281
|
+
let cancelled = false;
|
|
282
|
+
tlRef.current?.kill();
|
|
283
|
+
const fadeSec = Math.max(0.05, transition.durationMs / 1000);
|
|
284
|
+
const holdSec = Math.max(0, transition.holdMs / 1000);
|
|
285
|
+
const stepTo = (target) => {
|
|
286
|
+
const tl = gsap.timeline();
|
|
287
|
+
tl.to({}, { duration: holdSec });
|
|
288
|
+
tl.to(mixRef, { current: target, duration: fadeSec, ease: 'sine.inOut' });
|
|
289
|
+
return tl;
|
|
290
|
+
};
|
|
291
|
+
const advance = () => {
|
|
292
|
+
if (cancelled || !stateRef.current)
|
|
293
|
+
return;
|
|
294
|
+
const st = stateRef.current;
|
|
295
|
+
const length = st.cubeRTs.length;
|
|
296
|
+
const cur = currentIdxRef.current;
|
|
297
|
+
const next = pickNext(transitionRef.current.order, cur, length, yoyoDirRef);
|
|
298
|
+
const types = transitionRef.current.types?.length
|
|
299
|
+
? transitionRef.current.types
|
|
300
|
+
: ['crossfade'];
|
|
301
|
+
const legType = types[typeIdxRef.current % types.length];
|
|
302
|
+
const legMode = MODE_INDEX[legType];
|
|
303
|
+
st.material.uniforms.uMode.value = isDividerMode(legMode) ? 0 : legMode;
|
|
304
|
+
st.material.uniforms.tA.value = st.cubeRTs[cur].texture;
|
|
305
|
+
st.material.uniforms.tB.value = st.cubeRTs[next].texture;
|
|
306
|
+
bgUniforms.tA.value = st.cubeRTs[cur].texture;
|
|
307
|
+
bgUniforms.tB.value = st.cubeRTs[next].texture;
|
|
308
|
+
modeRef.current = legMode;
|
|
309
|
+
mixRef.current = 0;
|
|
310
|
+
const tl = stepTo(1);
|
|
311
|
+
tl.eventCallback('onComplete', () => {
|
|
312
|
+
currentIdxRef.current = next;
|
|
313
|
+
typeIdxRef.current += 1;
|
|
314
|
+
if (!cancelled)
|
|
315
|
+
advance();
|
|
316
|
+
});
|
|
317
|
+
tlRef.current = tl;
|
|
318
|
+
};
|
|
319
|
+
advance();
|
|
320
|
+
return () => {
|
|
321
|
+
cancelled = true;
|
|
322
|
+
tlRef.current?.kill();
|
|
323
|
+
tlRef.current = null;
|
|
324
|
+
};
|
|
325
|
+
}, [pipelineReady, transition.durationMs, transition.holdMs, transition.order, urlsKey, bgUniforms]);
|
|
326
|
+
// ── Per-frame: render the blend and assign to scene ─────────────────────────
|
|
327
|
+
useFrame(() => {
|
|
328
|
+
const s = stateRef.current;
|
|
329
|
+
if (!s)
|
|
330
|
+
return;
|
|
331
|
+
const t = transitionRef.current;
|
|
332
|
+
s.material.uniforms.uMix.value = mixRef.current;
|
|
333
|
+
s.material.uniforms.uFeather.value = t.feather ?? 0.07;
|
|
334
|
+
s.material.uniforms.uNoiseScale.value = t.noiseScale ?? 4.0;
|
|
335
|
+
if (t.wipeAxis)
|
|
336
|
+
s.material.uniforms.uWipeAxis.value.set(...t.wipeAxis);
|
|
337
|
+
if (t.irisCenter)
|
|
338
|
+
s.material.uniforms.uIrisCenter.value.set(...t.irisCenter);
|
|
339
|
+
s.cubeCamera.update(renderer, s.blendScene);
|
|
340
|
+
scene.environment = s.outRT.texture;
|
|
341
|
+
const mode = modeRef.current;
|
|
342
|
+
const divider = isDividerMode(mode);
|
|
343
|
+
if (divider) {
|
|
344
|
+
scene.background = null;
|
|
345
|
+
if (bgMeshRef.current)
|
|
346
|
+
bgMeshRef.current.visible = true;
|
|
347
|
+
const feather = t.dividerFeather ?? 0.003;
|
|
348
|
+
const dividerPos = 1.0 - (mixRef.current * (1.0 + 2.0 * feather) - feather);
|
|
349
|
+
bgUniforms.uMode.value = mode;
|
|
350
|
+
bgUniforms.uDividerX.value = mode === 4 ? dividerPos : 0.5;
|
|
351
|
+
bgUniforms.uDividerY.value = mode === 5 ? dividerPos : 0.5;
|
|
352
|
+
bgUniforms.uFeather.value = feather;
|
|
353
|
+
bgUniforms.uCamWorldMatrix.value.copy(camera.matrixWorld);
|
|
354
|
+
bgUniforms.uProjMatrixInv.value.copy(camera.projectionMatrixInverse);
|
|
355
|
+
}
|
|
356
|
+
else {
|
|
357
|
+
scene.background = s.outRT.texture;
|
|
358
|
+
if (bgMeshRef.current)
|
|
359
|
+
bgMeshRef.current.visible = false;
|
|
360
|
+
}
|
|
361
|
+
});
|
|
362
|
+
return (_jsxs("mesh", { ref: bgMeshRef, frustumCulled: false, renderOrder: -1000, visible: false, children: [_jsx("planeGeometry", { args: [2, 2] }), _jsx("shaderMaterial", { depthTest: false, depthWrite: false, uniforms: bgUniforms, vertexShader: bgVertexShader, fragmentShader: bgFragmentShader })] }));
|
|
363
|
+
};
|
|
364
|
+
export default HdrPlaylistRenderer;
|
|
@@ -7,7 +7,7 @@ export const useCubeCamera = (options) => {
|
|
|
7
7
|
const { scene, gl: renderer } = useThree();
|
|
8
8
|
const cubeCameraRef = useRef(null);
|
|
9
9
|
const isUpdatingRef = useRef(false);
|
|
10
|
-
const
|
|
10
|
+
const hdrActive = hdrSettings.visible && (hdrSettings.name || (hdrSettings.urls && hdrSettings.urls.length > 0)) ? true : false;
|
|
11
11
|
const initializeCubeCamera = useCallback(() => {
|
|
12
12
|
if (!renderer || !scene)
|
|
13
13
|
return null;
|
|
@@ -43,7 +43,7 @@ export const useCubeCamera = (options) => {
|
|
|
43
43
|
}, [scene]);
|
|
44
44
|
// Create or dispose cube camera based on active sky / HDR state
|
|
45
45
|
useEffect(() => {
|
|
46
|
-
if (
|
|
46
|
+
if (hdrActive) {
|
|
47
47
|
dispose();
|
|
48
48
|
return;
|
|
49
49
|
}
|
|
@@ -55,11 +55,11 @@ export const useCubeCamera = (options) => {
|
|
|
55
55
|
dispose();
|
|
56
56
|
clearSceneEnvironment(scene);
|
|
57
57
|
}
|
|
58
|
-
}, [
|
|
58
|
+
}, [hdrActive, skyVisible, sunSystemVisible]);
|
|
59
59
|
// Live update when auto-animating (sky moves, environment changes)
|
|
60
60
|
const UPDATE_INTERVAL_MS = 300;
|
|
61
61
|
useFrame((state) => {
|
|
62
|
-
if (
|
|
62
|
+
if (hdrActive || !(skyVisible || sunSystemVisible))
|
|
63
63
|
return;
|
|
64
64
|
if (!timeSettings.autoAnimate)
|
|
65
65
|
return;
|
package/dist/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export { CameraController, default as CameraControllerDefault } from './componen
|
|
|
6
6
|
export { default as CreatedObject } from './components/CreatedObject';
|
|
7
7
|
export { default as CustomPrimitive } from './components/CustomPrimitive';
|
|
8
8
|
export { default as EffectsGenerator } from './components/EffectsGenerator';
|
|
9
|
+
export { default as HdrPlaylistRenderer } from './components/HdrPlaylistRenderer';
|
|
9
10
|
export type { EffectsGeneratorProps } from './components/EffectsGenerator';
|
|
10
11
|
export { default as EffectsGroup } from './components/EffectsGroup';
|
|
11
12
|
export { default as Frame } from './components/Frame';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,IAAI,iBAAiB,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC7F,YAAY,EAAE,cAAc,EAAE,kBAAkB,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAG3F,OAAO,EAAE,cAAc,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAC/F,YAAY,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,OAAO,IAAI,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AACrG,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAC5E,YAAY,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACrE,OAAO,EAAE,aA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AAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,cAAc,qBAAqB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -6,6 +6,7 @@ export { CameraController, default as CameraControllerDefault } from './componen
|
|
|
6
6
|
export { default as CreatedObject } from './components/CreatedObject.js';
|
|
7
7
|
export { default as CustomPrimitive } from './components/CustomPrimitive.js';
|
|
8
8
|
export { default as EffectsGenerator } from './components/EffectsGenerator.js';
|
|
9
|
+
export { default as HdrPlaylistRenderer } from './components/HdrPlaylistRenderer.js';
|
|
9
10
|
export { default as EffectsGroup } from './components/EffectsGroup.js';
|
|
10
11
|
export { default as Frame } from './components/Frame.js';
|
|
11
12
|
export { FrameGeometry } from './components/FrameGeometry.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ntalmagor/3drize-viewer",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.23",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"@react-three/fiber": "^9",
|
|
27
27
|
"@react-three/rapier": "^2",
|
|
28
28
|
"react": "^18 || ^19",
|
|
29
|
-
"@ntalmagor/3drize-core": "^0.1.
|
|
29
|
+
"@ntalmagor/3drize-core": "^0.1.14",
|
|
30
30
|
"three": "^0.170"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|