@cueframe/kernel 0.2.15 → 0.2.17
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/_members/animate/index.d.ts +1 -1
- package/dist/_members/animate/three/FrameDepthOfField.d.ts +8 -0
- package/dist/_members/animate/three/depthOfFieldPipeline.d.ts +29 -0
- package/dist/_members/animate/three/index.d.ts +1 -0
- package/dist/_members/component-runtime/allowedImports.d.ts +1 -1
- package/dist/_members/component-runtime/allowedImports.d.ts.map +1 -1
- package/dist/_members/component-runtime/bake.d.ts.map +1 -1
- package/dist/_members/component-runtime/index.d.ts +1 -0
- package/dist/_members/component-runtime/index.d.ts.map +1 -1
- package/dist/_members/component-runtime/localRoot.d.ts +10 -0
- package/dist/_members/component-runtime/localRoot.d.ts.map +1 -1
- package/dist/_members/component-runtime/sourceAdmission.d.ts +12 -0
- package/dist/_members/component-runtime/sourceAdmission.d.ts.map +1 -0
- package/dist/_members/composition/fonts/bundledFaces.d.ts +15 -0
- package/dist/animate.js +4 -2
- package/dist/authoring/build-tools.js +6 -6
- package/dist/authoring/context.js +5 -5
- package/dist/authoring/tools.js +5 -5
- package/dist/authoring.js +9 -9
- package/dist/{chunk-RKDXNYLE.js → chunk-26MBA3WH.js} +1 -1
- package/dist/{chunk-IUIG5N6M.js → chunk-2R35PKNK.js} +5 -1
- package/dist/{chunk-MDFKDTPF.js → chunk-3BCGHUJS.js} +1 -1
- package/dist/{chunk-S3PZFAF5.js → chunk-3IUVVVFE.js} +1 -1
- package/dist/{chunk-X6U6XVU4.js → chunk-4GSIXJ3I.js} +4 -4
- package/dist/{chunk-A74FZCPY.js → chunk-5NGYBI5Z.js} +2 -1
- package/dist/{chunk-TARKDVP6.js → chunk-BAC7DKQZ.js} +5 -0
- package/dist/{chunk-QLHATEZI.js → chunk-CG2E43AN.js} +1 -1
- package/dist/{chunk-KBMKQGFR.js → chunk-D3GMN4WL.js} +35 -9
- package/dist/{chunk-5DSHDRPQ.js → chunk-DEOP3TWR.js} +9 -9
- package/dist/{chunk-C4P4NC66.js → chunk-ENMY25I3.js} +1 -1
- package/dist/{chunk-IGP2CA7C.js → chunk-KSGREMGC.js} +1 -1
- package/dist/{chunk-O7G2NXUJ.js → chunk-MAD6MSXA.js} +1 -1
- package/dist/{chunk-TAXZ4KBF.js → chunk-MQO5T32S.js} +2 -2
- package/dist/{chunk-5CNS7IXO.js → chunk-OXHF3O5T.js} +1 -1
- package/dist/{chunk-QZR4JCFY.js → chunk-URUOXC3Z.js} +1 -1
- package/dist/chunk-WXHD6OUT.js +82 -0
- package/dist/{chunk-6BZZWF5B.js → chunk-ZYGUHMX6.js} +213 -81
- package/dist/component-runtime/importPolicy.js +1 -1
- package/dist/component-runtime/render.js +3 -3
- package/dist/component-runtime/sourceAdmission.d.ts +1 -0
- package/dist/component-runtime/sourceAdmission.js +12 -0
- package/dist/component-runtime.js +12 -4
- package/dist/compose.js +12 -12
- package/dist/composition/fonts.js +3 -1
- package/dist/composition/graphics-plan.js +3 -3
- package/dist/composition/ops.js +4 -4
- package/dist/composition/projection.js +3 -3
- package/dist/composition/validators.js +3 -3
- package/dist/composition-ops.js +6 -6
- package/dist/composition.js +5 -5
- package/dist/{context-VHBMKP65.js → context-UE255PMJ.js} +5 -5
- package/dist/core/render.js +3 -3
- package/dist/core.js +3 -3
- package/dist/mcp/adapter.js +3 -3
- package/dist/mcp/server.js +2 -2
- package/dist/mcp.js +2 -2
- package/dist/primitives/captions.js +1 -1
- package/dist/primitives/effects.js +3 -3
- package/dist/primitives/layouts.js +3 -3
- package/dist/primitives/lib/index.js +11 -11
- package/dist/primitives/lib.js +11 -11
- package/dist/primitives/scenes.js +3 -3
- package/dist/primitives/ui-blocks.js +4 -4
- package/dist/primitives.js +10 -10
- package/dist/render-harness.js +10 -9
- package/package.json +25 -17
- package/dist/{chunk-XMAA2HYI.js → chunk-2P4NHHKR.js} +3 -3
- package/dist/{chunk-B3GSTQLR.js → chunk-A76GTLSA.js} +3 -3
|
@@ -34,7 +34,7 @@ import {
|
|
|
34
34
|
} from "./chunk-KKV5U5EA.js";
|
|
35
35
|
import {
|
|
36
36
|
resolveCaptionFaces
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-BAC7DKQZ.js";
|
|
38
38
|
|
|
39
39
|
// ../execution/animate/src/easing/smooth.ts
|
|
40
40
|
var sigmoid = (x) => 1 / (1 + Math.exp(-x));
|
|
@@ -1060,8 +1060,138 @@ var ThreeCanvas = ({
|
|
|
1060
1060
|
);
|
|
1061
1061
|
};
|
|
1062
1062
|
|
|
1063
|
+
// ../execution/animate/src/three/FrameDepthOfField.tsx
|
|
1064
|
+
import { useLayoutEffect as useLayoutEffect3, useRef } from "react";
|
|
1065
|
+
import { useFrame, useThree as useThree3 } from "@react-three/fiber";
|
|
1066
|
+
|
|
1067
|
+
// ../execution/animate/src/three/depthOfFieldPipeline.ts
|
|
1068
|
+
import {
|
|
1069
|
+
DepthOfFieldEffect,
|
|
1070
|
+
EffectComposer,
|
|
1071
|
+
EffectPass,
|
|
1072
|
+
RenderPass,
|
|
1073
|
+
ToneMappingEffect,
|
|
1074
|
+
ToneMappingMode
|
|
1075
|
+
} from "postprocessing";
|
|
1076
|
+
import {
|
|
1077
|
+
ACESFilmicToneMapping,
|
|
1078
|
+
HalfFloatType,
|
|
1079
|
+
NoToneMapping,
|
|
1080
|
+
Vector4
|
|
1081
|
+
} from "three";
|
|
1082
|
+
var canvasOwners = /* @__PURE__ */ new WeakSet();
|
|
1083
|
+
function validateFrameFocus(props) {
|
|
1084
|
+
const { focusDistance, focusRange, bokehScale = 2, resolutionScale = 0.5 } = props;
|
|
1085
|
+
if (!Number.isFinite(focusDistance) || focusDistance <= 0 || !Number.isFinite(focusRange) || focusRange <= 0 || !Number.isFinite(bokehScale) || bokehScale < 0 || !Number.isFinite(resolutionScale) || resolutionScale <= 0 || resolutionScale > 1) {
|
|
1086
|
+
throw new Error("FrameDepthOfField: expected positive focusDistance/focusRange, nonnegative bokehScale and resolutionScale in (0, 1].");
|
|
1087
|
+
}
|
|
1088
|
+
}
|
|
1089
|
+
var FrameFocusPipeline = class {
|
|
1090
|
+
constructor(gl, scene, camera, resolutionScale) {
|
|
1091
|
+
this.gl = gl;
|
|
1092
|
+
this.camera = camera;
|
|
1093
|
+
if (!gl.isWebGLRenderer || !camera.isPerspectiveCamera) {
|
|
1094
|
+
throw new Error("FrameDepthOfField requires a WebGLRenderer and a perspective camera.");
|
|
1095
|
+
}
|
|
1096
|
+
if (gl.toneMapping !== NoToneMapping && gl.toneMapping !== ACESFilmicToneMapping) {
|
|
1097
|
+
throw new Error("FrameDepthOfField supports NoToneMapping or ACESFilmicToneMapping.");
|
|
1098
|
+
}
|
|
1099
|
+
if (canvasOwners.has(gl)) throw new Error("Only one FrameDepthOfField may own a canvas.");
|
|
1100
|
+
this.toneMapping = gl.toneMapping;
|
|
1101
|
+
const autoClear = gl.autoClear;
|
|
1102
|
+
this.composer = new EffectComposer(gl, { frameBufferType: HalfFloatType, multisampling: 0 });
|
|
1103
|
+
gl.autoClear = autoClear;
|
|
1104
|
+
this.focus = new DepthOfFieldEffect(camera, { resolutionScale, bokehScale: 2 });
|
|
1105
|
+
const tone = gl.toneMapping === ACESFilmicToneMapping ? [new ToneMappingEffect({ mode: ToneMappingMode.ACES_FILMIC })] : [];
|
|
1106
|
+
this.effectPass = new EffectPass(camera, this.focus, ...tone);
|
|
1107
|
+
this.composer.addPass(new RenderPass(scene, camera));
|
|
1108
|
+
this.composer.addPass(this.effectPass);
|
|
1109
|
+
canvasOwners.add(gl);
|
|
1110
|
+
}
|
|
1111
|
+
gl;
|
|
1112
|
+
camera;
|
|
1113
|
+
composer;
|
|
1114
|
+
focus;
|
|
1115
|
+
effectPass;
|
|
1116
|
+
viewport = new Vector4();
|
|
1117
|
+
scissor = new Vector4();
|
|
1118
|
+
disposed = false;
|
|
1119
|
+
toneMapping;
|
|
1120
|
+
resize(width, height) {
|
|
1121
|
+
this.composer.setSize(width, height, false);
|
|
1122
|
+
}
|
|
1123
|
+
draw(props) {
|
|
1124
|
+
validateFrameFocus(props);
|
|
1125
|
+
if (this.disposed) throw new Error("FrameDepthOfField pipeline was disposed.");
|
|
1126
|
+
const { gl, focus, camera } = this;
|
|
1127
|
+
if (gl.toneMapping !== this.toneMapping) {
|
|
1128
|
+
throw new Error("FrameDepthOfField: renderer tone mapping changed; remount the helper.");
|
|
1129
|
+
}
|
|
1130
|
+
this.effectPass.mainCamera = camera;
|
|
1131
|
+
focus.cocMaterial.focusDistance = props.focusDistance;
|
|
1132
|
+
focus.cocMaterial.focusRange = props.focusRange;
|
|
1133
|
+
focus.bokehScale = props.bokehScale ?? 2;
|
|
1134
|
+
const target = gl.getRenderTarget();
|
|
1135
|
+
if (target !== null) throw new Error("FrameDepthOfField must own the canvas output, not a nested render target.");
|
|
1136
|
+
const autoClear = gl.autoClear;
|
|
1137
|
+
const toneMapping = gl.toneMapping;
|
|
1138
|
+
const scissorTest = gl.getScissorTest();
|
|
1139
|
+
gl.getViewport(this.viewport);
|
|
1140
|
+
gl.getScissor(this.scissor);
|
|
1141
|
+
try {
|
|
1142
|
+
gl.autoClear = false;
|
|
1143
|
+
gl.toneMapping = NoToneMapping;
|
|
1144
|
+
gl.setScissorTest(false);
|
|
1145
|
+
this.composer.render(0);
|
|
1146
|
+
} finally {
|
|
1147
|
+
gl.setRenderTarget(target);
|
|
1148
|
+
gl.setViewport(this.viewport);
|
|
1149
|
+
gl.setScissor(this.scissor);
|
|
1150
|
+
gl.setScissorTest(scissorTest);
|
|
1151
|
+
gl.autoClear = autoClear;
|
|
1152
|
+
gl.toneMapping = toneMapping;
|
|
1153
|
+
}
|
|
1154
|
+
}
|
|
1155
|
+
dispose() {
|
|
1156
|
+
if (this.disposed) return;
|
|
1157
|
+
this.disposed = true;
|
|
1158
|
+
try {
|
|
1159
|
+
this.composer.dispose();
|
|
1160
|
+
} finally {
|
|
1161
|
+
canvasOwners.delete(this.gl);
|
|
1162
|
+
}
|
|
1163
|
+
}
|
|
1164
|
+
};
|
|
1165
|
+
|
|
1166
|
+
// ../execution/animate/src/three/FrameDepthOfField.tsx
|
|
1167
|
+
function FrameDepthOfField(props) {
|
|
1168
|
+
validateFrameFocus(props);
|
|
1169
|
+
const gl = useThree3((state) => state.gl);
|
|
1170
|
+
const scene = useThree3((state) => state.scene);
|
|
1171
|
+
const camera = useThree3((state) => state.camera);
|
|
1172
|
+
const size = useThree3((state) => state.size);
|
|
1173
|
+
const dpr = useThree3((state) => state.viewport.dpr);
|
|
1174
|
+
const pipeline = useRef(null);
|
|
1175
|
+
const resolutionScale = props.resolutionScale ?? 0.5;
|
|
1176
|
+
useLayoutEffect3(() => {
|
|
1177
|
+
const owned = new FrameFocusPipeline(gl, scene, camera, resolutionScale);
|
|
1178
|
+
pipeline.current = owned;
|
|
1179
|
+
return () => {
|
|
1180
|
+
pipeline.current = null;
|
|
1181
|
+
owned.dispose();
|
|
1182
|
+
};
|
|
1183
|
+
}, [gl, scene, camera, resolutionScale]);
|
|
1184
|
+
useLayoutEffect3(() => {
|
|
1185
|
+
pipeline.current?.resize(size.width, size.height);
|
|
1186
|
+
}, [gl, scene, camera, resolutionScale, size.width, size.height, dpr]);
|
|
1187
|
+
useFrame(() => {
|
|
1188
|
+
pipeline.current?.draw(props);
|
|
1189
|
+
}, 1);
|
|
1190
|
+
return null;
|
|
1191
|
+
}
|
|
1192
|
+
|
|
1063
1193
|
// ../execution/animate/src/three/useImageTexture.ts
|
|
1064
|
-
import { useLayoutEffect as
|
|
1194
|
+
import { useLayoutEffect as useLayoutEffect4, useRef as useRef2, useState } from "react";
|
|
1065
1195
|
import { cancelRender, continueRender, delayRender } from "remotion";
|
|
1066
1196
|
import { SRGBColorSpace, TextureLoader } from "three";
|
|
1067
1197
|
|
|
@@ -1082,10 +1212,10 @@ function discardStaleTexture(texture) {
|
|
|
1082
1212
|
// ../execution/animate/src/three/useImageTexture.ts
|
|
1083
1213
|
function useImageTexture(src) {
|
|
1084
1214
|
const [texture, setTexture] = useState(null);
|
|
1085
|
-
const held =
|
|
1215
|
+
const held = useRef2(NO_TEXTURE);
|
|
1086
1216
|
const [firstHandle] = useState(() => src ? delayRender(`three: load texture ${src}`) : null);
|
|
1087
|
-
const firstHandleSpent =
|
|
1088
|
-
|
|
1217
|
+
const firstHandleSpent = useRef2(false);
|
|
1218
|
+
useLayoutEffect4(() => {
|
|
1089
1219
|
const takeHandle = () => {
|
|
1090
1220
|
if (firstHandle !== null && !firstHandleSpent.current) {
|
|
1091
1221
|
firstHandleSpent.current = true;
|
|
@@ -1128,10 +1258,10 @@ function useImageTexture(src) {
|
|
|
1128
1258
|
continueRender(handle);
|
|
1129
1259
|
};
|
|
1130
1260
|
}, [src, firstHandle]);
|
|
1131
|
-
|
|
1261
|
+
useLayoutEffect4(() => {
|
|
1132
1262
|
held.current = commitImageTexture(held.current, texture);
|
|
1133
1263
|
}, [texture]);
|
|
1134
|
-
|
|
1264
|
+
useLayoutEffect4(() => () => {
|
|
1135
1265
|
held.current = releaseImageTexture(held.current);
|
|
1136
1266
|
}, []);
|
|
1137
1267
|
return texture;
|
|
@@ -1619,8 +1749,8 @@ var ContactShadow = ({ y, width, depth, opacity = 0.45, z = 0 }) => {
|
|
|
1619
1749
|
};
|
|
1620
1750
|
|
|
1621
1751
|
// ../execution/animate/src/media/MediaTileScene.tsx
|
|
1622
|
-
import React21, { useCallback, useLayoutEffect as
|
|
1623
|
-
import { useThree as
|
|
1752
|
+
import React21, { useCallback, useLayoutEffect as useLayoutEffect5, useMemo as useMemo4, useRef as useRef3, useState as useState2 } from "react";
|
|
1753
|
+
import { useThree as useThree4 } from "@react-three/fiber";
|
|
1624
1754
|
import { Video } from "@remotion/media";
|
|
1625
1755
|
import { ThreeCanvas as ThreeCanvas2 } from "@remotion/three";
|
|
1626
1756
|
import { BufferAttribute, BufferGeometry, Color, SRGBColorSpace as SRGBColorSpace3, Texture as Texture2, WebGLRenderer } from "three";
|
|
@@ -1737,9 +1867,9 @@ function ImageProducer({ id, stream: stream2, accept, report }) {
|
|
|
1737
1867
|
);
|
|
1738
1868
|
}
|
|
1739
1869
|
function VideoProducer({ id, stream: stream2, accept, report }) {
|
|
1740
|
-
const container =
|
|
1741
|
-
const version =
|
|
1742
|
-
const acceptedFrame =
|
|
1870
|
+
const container = useRef3(null);
|
|
1871
|
+
const version = useRef3(0);
|
|
1872
|
+
const acceptedFrame = useRef3(null);
|
|
1743
1873
|
const frame = useCurrentFrame15();
|
|
1744
1874
|
const handleVideoError = useCallback((error) => {
|
|
1745
1875
|
report(error);
|
|
@@ -1796,7 +1926,7 @@ function geometryForCrop(crop) {
|
|
|
1796
1926
|
return geometry;
|
|
1797
1927
|
}
|
|
1798
1928
|
function StreamTiles({ entry, tiles }) {
|
|
1799
|
-
const invalidate =
|
|
1929
|
+
const invalidate = useThree4((state) => state.invalidate);
|
|
1800
1930
|
const texture = useMemo4(() => {
|
|
1801
1931
|
const value = new Texture2(entry.source);
|
|
1802
1932
|
value.colorSpace = SRGBColorSpace3;
|
|
@@ -1812,11 +1942,11 @@ function StreamTiles({ entry, tiles }) {
|
|
|
1812
1942
|
}
|
|
1813
1943
|
return values;
|
|
1814
1944
|
}, [tiles]);
|
|
1815
|
-
|
|
1945
|
+
useLayoutEffect5(() => {
|
|
1816
1946
|
texture.needsUpdate = true;
|
|
1817
1947
|
invalidate();
|
|
1818
1948
|
}, [entry.version, invalidate, texture]);
|
|
1819
|
-
|
|
1949
|
+
useLayoutEffect5(() => () => {
|
|
1820
1950
|
texture.dispose();
|
|
1821
1951
|
for (const geometry of geometries.values()) geometry.dispose();
|
|
1822
1952
|
}, [geometries, texture]);
|
|
@@ -1838,12 +1968,12 @@ function StreamTiles({ entry, tiles }) {
|
|
|
1838
1968
|
}));
|
|
1839
1969
|
}
|
|
1840
1970
|
function SceneContents({ streamIds, tiles, sources, camera, fog, background, announce, presentationReady, playing }) {
|
|
1841
|
-
const { advance, camera: threeCamera, gl, invalidate } =
|
|
1971
|
+
const { advance, camera: threeCamera, gl, invalidate } = useThree4();
|
|
1842
1972
|
const frame = useCurrentFrame15();
|
|
1843
1973
|
const isRendering = getRemotionEnvironment().isRendering;
|
|
1844
1974
|
const perspective = camera?.perspective ?? 1400;
|
|
1845
1975
|
const { height } = useVideoConfig4();
|
|
1846
|
-
|
|
1976
|
+
useLayoutEffect5(() => {
|
|
1847
1977
|
threeCamera.position.set(camera?.x ?? 0, -(camera?.y ?? 0), perspective - (camera?.z ?? 0));
|
|
1848
1978
|
threeCamera.zoom = camera?.zoom ?? 1;
|
|
1849
1979
|
if ("fov" in threeCamera) threeCamera.fov = 2 * Math.atan(height / (2 * perspective)) * 180 / Math.PI;
|
|
@@ -1857,7 +1987,7 @@ function SceneContents({ streamIds, tiles, sources, camera, fog, background, ann
|
|
|
1857
1987
|
invalidate();
|
|
1858
1988
|
}, [background, camera, frame, gl, height, invalidate, perspective, threeCamera]);
|
|
1859
1989
|
const sourceVersions = streamIds.map((id) => sources[id].version).join(":");
|
|
1860
|
-
|
|
1990
|
+
useLayoutEffect5(() => {
|
|
1861
1991
|
if (isRendering || !playing) advance(performance.now());
|
|
1862
1992
|
else invalidate();
|
|
1863
1993
|
if (presentationReady) announce();
|
|
@@ -1878,7 +2008,7 @@ function createWebGl2Renderer(defaults) {
|
|
|
1878
2008
|
}
|
|
1879
2009
|
function MediaTileScene({ streams, tiles, camera, fog, background, style }) {
|
|
1880
2010
|
const frame = useCurrentFrame15();
|
|
1881
|
-
const playing = Internals2.Timeline.
|
|
2011
|
+
const [playing] = Internals2.Timeline.usePlayingState();
|
|
1882
2012
|
const { width, height } = useVideoConfig4();
|
|
1883
2013
|
const isRendering = getRemotionEnvironment().isRendering;
|
|
1884
2014
|
const { delayRender: scopedDelayRender, continueRender: scopedContinueRender } = useDelayRender();
|
|
@@ -1886,9 +2016,9 @@ function MediaTileScene({ streams, tiles, camera, fog, background, style }) {
|
|
|
1886
2016
|
const [sources, setSources] = useState2({});
|
|
1887
2017
|
const [failure, setFailure] = useState2(null);
|
|
1888
2018
|
const [sceneId] = useState2(() => `cueframe-media-tile-${++nextMediaTileSceneId}`);
|
|
1889
|
-
const announcedFrame =
|
|
1890
|
-
const frameGate =
|
|
1891
|
-
|
|
2019
|
+
const announcedFrame = useRef3(null);
|
|
2020
|
+
const frameGate = useRef3(null);
|
|
2021
|
+
useLayoutEffect5(() => {
|
|
1892
2022
|
if (!isRendering) return;
|
|
1893
2023
|
const gate = {
|
|
1894
2024
|
frame,
|
|
@@ -2008,7 +2138,7 @@ function scaleSceneTransform(t, scale) {
|
|
|
2008
2138
|
}
|
|
2009
2139
|
|
|
2010
2140
|
// ../execution/animate/src/scene/v2/builders.tsx
|
|
2011
|
-
import React22, { useLayoutEffect as
|
|
2141
|
+
import React22, { useLayoutEffect as useLayoutEffect9, useMemo as useMemo5, useRef as useRef6 } from "react";
|
|
2012
2142
|
import { DoubleSide as DoubleSide2, FrontSide as FrontSide2 } from "three";
|
|
2013
2143
|
|
|
2014
2144
|
// ../execution/animate/src/scene/deviceOpacity.ts
|
|
@@ -2064,13 +2194,13 @@ function textureImageSize(texture, slot, layerIndex) {
|
|
|
2064
2194
|
}
|
|
2065
2195
|
|
|
2066
2196
|
// ../execution/animate/src/scene/UnlitPlane.tsx
|
|
2067
|
-
import { useLayoutEffect as
|
|
2197
|
+
import { useLayoutEffect as useLayoutEffect6 } from "react";
|
|
2068
2198
|
import { DoubleSide, FrontSide } from "three";
|
|
2069
2199
|
var UNLIT_PLANE_ALPHA_TEST = 0.01;
|
|
2070
2200
|
function UnlitPlane({ texture, fit, color = "#ffffff", transparent = true, depthWrite = true, backface = "hidden", resourceOwner, resourceName }) {
|
|
2071
2201
|
const [rx, ry] = fit.repeat;
|
|
2072
2202
|
const [ox, oy] = fit.offset;
|
|
2073
|
-
|
|
2203
|
+
useLayoutEffect6(() => {
|
|
2074
2204
|
if (texture.repeat.x !== rx || texture.repeat.y !== ry) texture.repeat.set(rx, ry);
|
|
2075
2205
|
if (texture.offset.x !== ox || texture.offset.y !== oy) texture.offset.set(ox, oy);
|
|
2076
2206
|
}, [texture, rx, ry, ox, oy]);
|
|
@@ -2089,8 +2219,8 @@ function UnlitPlane({ texture, fit, color = "#ffffff", transparent = true, depth
|
|
|
2089
2219
|
}
|
|
2090
2220
|
|
|
2091
2221
|
// ../execution/animate/src/scene/useSceneImageTexture.ts
|
|
2092
|
-
import { useLayoutEffect as
|
|
2093
|
-
import { useThree as
|
|
2222
|
+
import { useLayoutEffect as useLayoutEffect7, useRef as useRef4, useState as useState3 } from "react";
|
|
2223
|
+
import { useThree as useThree5 } from "@react-three/fiber";
|
|
2094
2224
|
import { cancelRender as cancelRender3, continueRender as continueRender3, delayRender as delayRender3 } from "remotion";
|
|
2095
2225
|
import { SRGBColorSpace as SRGBColorSpace4, TextureLoader as TextureLoader2 } from "three";
|
|
2096
2226
|
|
|
@@ -2148,13 +2278,13 @@ function advanceRendererOnce(advance) {
|
|
|
2148
2278
|
// ../execution/animate/src/scene/useSceneImageTexture.ts
|
|
2149
2279
|
function useSceneImageTexture(src, slot, what, resourceOwner = `surface:${slot}`) {
|
|
2150
2280
|
const registerActual = useSceneActualResourceRegistrarV1();
|
|
2151
|
-
const advance =
|
|
2281
|
+
const advance = useThree5((s) => s.advance);
|
|
2152
2282
|
const [generations] = useState3(() => new LoadGenerations());
|
|
2153
2283
|
const [firstHandle] = useState3(() => delayRender3(`scene: ${what} "${slot}"`));
|
|
2154
|
-
const firstHandleSpent =
|
|
2284
|
+
const firstHandleSpent = useRef4(false);
|
|
2155
2285
|
const [committed, setCommitted] = useState3(null);
|
|
2156
|
-
const state =
|
|
2157
|
-
|
|
2286
|
+
const state = useRef4(EMPTY_TEXTURE_STATE);
|
|
2287
|
+
useLayoutEffect7(() => {
|
|
2158
2288
|
const token = generations.begin();
|
|
2159
2289
|
let handle;
|
|
2160
2290
|
if (!firstHandleSpent.current) {
|
|
@@ -2197,19 +2327,19 @@ function useSceneImageTexture(src, slot, what, resourceOwner = `surface:${slot}`
|
|
|
2197
2327
|
continueRender3(handle);
|
|
2198
2328
|
};
|
|
2199
2329
|
}, [src, slot, what, resourceOwner, generations, firstHandle, registerActual]);
|
|
2200
|
-
|
|
2330
|
+
useLayoutEffect7(() => {
|
|
2201
2331
|
if (!committed) return;
|
|
2202
2332
|
state.current = onTextureCommitted(state.current, committed, { continueRender: continueRender3, redraw: () => advanceRendererOnce(advance) });
|
|
2203
2333
|
}, [committed, advance]);
|
|
2204
|
-
|
|
2334
|
+
useLayoutEffect7(() => () => {
|
|
2205
2335
|
state.current = onTextureOwnerUnmounted(generations, state.current);
|
|
2206
2336
|
}, [generations]);
|
|
2207
2337
|
return committed?.texture ?? null;
|
|
2208
2338
|
}
|
|
2209
2339
|
|
|
2210
2340
|
// ../execution/animate/src/scene/useWorldTextTexture.ts
|
|
2211
|
-
import { useLayoutEffect as
|
|
2212
|
-
import { useThree as
|
|
2341
|
+
import { useLayoutEffect as useLayoutEffect8, useRef as useRef5, useState as useState4 } from "react";
|
|
2342
|
+
import { useThree as useThree6 } from "@react-three/fiber";
|
|
2213
2343
|
import { cancelRender as cancelRender4, continueRender as continueRender4, delayRender as delayRender4 } from "remotion";
|
|
2214
2344
|
|
|
2215
2345
|
// ../execution/animate/src/scene/fontReadiness.ts
|
|
@@ -2464,18 +2594,18 @@ function createWorldTextTexture(request, registerActual = registerActualSceneRes
|
|
|
2464
2594
|
function useWorldTextTexture(prepared) {
|
|
2465
2595
|
const registerActual = useSceneActualResourceRegistrarV1();
|
|
2466
2596
|
const { layer, index, layout, size, key } = prepared;
|
|
2467
|
-
const advance =
|
|
2468
|
-
const gl =
|
|
2597
|
+
const advance = useThree6((s) => s.advance);
|
|
2598
|
+
const gl = useThree6((s) => s.gl);
|
|
2469
2599
|
const [generations] = useState4(() => new LoadGenerations());
|
|
2470
2600
|
const [firstHandle] = useState4(() => delayRender4(`scene: world text "${layer.id}"`));
|
|
2471
|
-
const firstHandleSpent =
|
|
2601
|
+
const firstHandleSpent = useRef5(false);
|
|
2472
2602
|
const [committed, setCommitted] = useState4(null);
|
|
2473
|
-
const held =
|
|
2474
|
-
const request =
|
|
2475
|
-
|
|
2603
|
+
const held = useRef5(null);
|
|
2604
|
+
const request = useRef5({ layer, layout, size, index });
|
|
2605
|
+
useLayoutEffect8(() => {
|
|
2476
2606
|
request.current = { layer, layout, size, index };
|
|
2477
2607
|
});
|
|
2478
|
-
|
|
2608
|
+
useLayoutEffect8(() => {
|
|
2479
2609
|
const token = generations.begin();
|
|
2480
2610
|
let handle;
|
|
2481
2611
|
if (!firstHandleSpent.current) {
|
|
@@ -2506,11 +2636,11 @@ function useWorldTextTexture(prepared) {
|
|
|
2506
2636
|
continueRender4(handle);
|
|
2507
2637
|
};
|
|
2508
2638
|
}, [key, gl, generations, firstHandle, registerActual]);
|
|
2509
|
-
|
|
2639
|
+
useLayoutEffect8(() => {
|
|
2510
2640
|
if (!committed) return;
|
|
2511
2641
|
held.current = onRasterCommitted(worldTextRasterCache, held.current, committed, { continueRender: continueRender4, redraw: () => advanceRendererOnce(advance) });
|
|
2512
2642
|
}, [committed, advance]);
|
|
2513
|
-
|
|
2643
|
+
useLayoutEffect8(() => () => {
|
|
2514
2644
|
held.current = onRasterOwnerUnmounted(generations, worldTextRasterCache, held.current);
|
|
2515
2645
|
}, [generations]);
|
|
2516
2646
|
return committed?.raster ?? null;
|
|
@@ -2528,7 +2658,7 @@ function LoadedSceneSurface({ src, slot, what, resourceOwner, children }) {
|
|
|
2528
2658
|
var sceneDeviceResourceOwnerV1 = (node) => `${node.kind}:${node.id}`;
|
|
2529
2659
|
var slabContentFit = (width, height, image) => planeFit("contain", { width, height }, image);
|
|
2530
2660
|
function PosedObject({ transform, scale, opacity, children }) {
|
|
2531
|
-
const group =
|
|
2661
|
+
const group = useRef6(null);
|
|
2532
2662
|
const pose = useMemo5(() => sceneLayerPose(scaleSceneTransform(transform, scale)), [
|
|
2533
2663
|
transform.position[0],
|
|
2534
2664
|
transform.position[1],
|
|
@@ -2539,7 +2669,7 @@ function PosedObject({ transform, scale, opacity, children }) {
|
|
|
2539
2669
|
transform.scale,
|
|
2540
2670
|
scale
|
|
2541
2671
|
]);
|
|
2542
|
-
|
|
2672
|
+
useLayoutEffect9(() => {
|
|
2543
2673
|
if (group.current) applyLayerOpacity(group.current, opacity);
|
|
2544
2674
|
}, [opacity]);
|
|
2545
2675
|
return /* @__PURE__ */ React22.createElement("group", { ref: group, visible: opacity > 0, position: pose.position, quaternion: pose.quaternion, scale: pose.scale }, children);
|
|
@@ -2664,11 +2794,11 @@ function useOwnedSlabResources(width, height, thickness, cornerRadius, edgeRadiu
|
|
|
2664
2794
|
{ owner, name: "body-geometry", domain: "gl", bytes: geometryBytes },
|
|
2665
2795
|
{ owner, name: "body-geometry-arrays", domain: "cpu", bytes: geometryBytes }
|
|
2666
2796
|
]), [geometry, geometryBytes, owner, registerActual]);
|
|
2667
|
-
|
|
2797
|
+
useLayoutEffect9(() => () => {
|
|
2668
2798
|
geometry.dispose();
|
|
2669
2799
|
geometryMeasurement();
|
|
2670
2800
|
}, [geometry, geometryMeasurement]);
|
|
2671
|
-
|
|
2801
|
+
useLayoutEffect9(() => () => finish.dispose(), [finish]);
|
|
2672
2802
|
return { geometry, finish };
|
|
2673
2803
|
}
|
|
2674
2804
|
function PageObject({ node, src, contentColor, preparedSurface, scale, surfaceResourceOwner, mountEarly = false }) {
|
|
@@ -2802,9 +2932,9 @@ function assertSceneSurfaceResolution(spec2, output) {
|
|
|
2802
2932
|
}
|
|
2803
2933
|
|
|
2804
2934
|
// ../execution/animate/src/scene/v2/videoBinding.tsx
|
|
2805
|
-
import React23, { useCallback as useCallback2, useLayoutEffect as
|
|
2935
|
+
import React23, { useCallback as useCallback2, useLayoutEffect as useLayoutEffect10, useRef as useRef7, useState as useState5 } from "react";
|
|
2806
2936
|
import { flushSync } from "react-dom";
|
|
2807
|
-
import { useThree as
|
|
2937
|
+
import { useThree as useThree7 } from "@react-three/fiber";
|
|
2808
2938
|
import { Video as Video2 } from "@remotion/media";
|
|
2809
2939
|
import { Sequence, cancelRender as cancelRender5, continueRender as continueRender5, delayRender as delayRender5, useCurrentFrame as useCurrentFrame16 } from "remotion";
|
|
2810
2940
|
import { CanvasTexture as CanvasTexture3, LinearFilter as LinearFilter2, LinearMipmapLinearFilter as LinearMipmapLinearFilter2, SRGBColorSpace as SRGBColorSpace6 } from "three";
|
|
@@ -2829,19 +2959,19 @@ function SceneVideoBindingV1({ src, schedule, contentFrame, width, height, resou
|
|
|
2829
2959
|
const registerActual = useSceneActualResourceRegistrarV1();
|
|
2830
2960
|
const compositionFrame = useCurrentFrame16();
|
|
2831
2961
|
const address = sceneVideoMidpointAddressV1(contentFrame, schedule);
|
|
2832
|
-
const expected =
|
|
2833
|
-
const alive =
|
|
2834
|
-
const canvas =
|
|
2835
|
-
const texture =
|
|
2836
|
-
const releaseTextureMeasurement =
|
|
2837
|
-
const accepted =
|
|
2838
|
-
const revision =
|
|
2839
|
-
const drawReceipt =
|
|
2840
|
-
const readinessHandle =
|
|
2962
|
+
const expected = useRef7("");
|
|
2963
|
+
const alive = useRef7(true);
|
|
2964
|
+
const canvas = useRef7(null);
|
|
2965
|
+
const texture = useRef7(null);
|
|
2966
|
+
const releaseTextureMeasurement = useRef7(null);
|
|
2967
|
+
const accepted = useRef7(null);
|
|
2968
|
+
const revision = useRef7(0);
|
|
2969
|
+
const drawReceipt = useRef7({ request: null, revision: null });
|
|
2970
|
+
const readinessHandle = useRef7(null);
|
|
2841
2971
|
const [binding, setBinding] = useState5(null);
|
|
2842
2972
|
const request = `${contentFrame}:${address.sourceIndex}:${address.mediaFrame}`;
|
|
2843
2973
|
expected.current = request;
|
|
2844
|
-
|
|
2974
|
+
useLayoutEffect10(() => {
|
|
2845
2975
|
alive.current = true;
|
|
2846
2976
|
return () => {
|
|
2847
2977
|
alive.current = false;
|
|
@@ -2916,8 +3046,8 @@ function SceneVideoBindingV1({ src, schedule, contentFrame, width, height, resou
|
|
|
2916
3046
|
)));
|
|
2917
3047
|
}
|
|
2918
3048
|
function SceneVideoTextureCommitV1({ binding }) {
|
|
2919
|
-
const { advance, scene } =
|
|
2920
|
-
|
|
3049
|
+
const { advance, scene } = useThree7((state) => ({ advance: state.advance, scene: state.scene }));
|
|
3050
|
+
useLayoutEffect10(() => {
|
|
2921
3051
|
if (!sceneHasVideoTextureV1(scene, binding.texture)) throw new Error(`${VIDEO_ERROR} matching texture was not attached to a material before readiness.`);
|
|
2922
3052
|
binding.texture.needsUpdate = true;
|
|
2923
3053
|
advance(performance.now());
|
|
@@ -2929,8 +3059,8 @@ function SceneVideoTextureCommitV1({ binding }) {
|
|
|
2929
3059
|
}
|
|
2930
3060
|
|
|
2931
3061
|
// ../execution/animate/src/scene/v2/SceneShotV2.tsx
|
|
2932
|
-
import React26, { useLayoutEffect as
|
|
2933
|
-
import { useThree as
|
|
3062
|
+
import React26, { useLayoutEffect as useLayoutEffect12 } from "react";
|
|
3063
|
+
import { useThree as useThree9 } from "@react-three/fiber";
|
|
2934
3064
|
import { getRemotionEnvironment as getRemotionEnvironment2, Internals as Internals3 } from "remotion";
|
|
2935
3065
|
|
|
2936
3066
|
// ../execution/animate/src/scene/assets.ts
|
|
@@ -3138,8 +3268,8 @@ function sceneFinishingUniforms(post, seed, frame, size, scale) {
|
|
|
3138
3268
|
}
|
|
3139
3269
|
|
|
3140
3270
|
// ../execution/animate/src/scene/FocusPass.tsx
|
|
3141
|
-
import { useLayoutEffect as
|
|
3142
|
-
import { useFrame, useThree as
|
|
3271
|
+
import { useLayoutEffect as useLayoutEffect11, useState as useState6 } from "react";
|
|
3272
|
+
import { useFrame as useFrame2, useThree as useThree8 } from "@react-three/fiber";
|
|
3143
3273
|
|
|
3144
3274
|
// ../execution/animate/src/scene/focusBlur.ts
|
|
3145
3275
|
var FOCUS_TAPS = 8;
|
|
@@ -3163,7 +3293,7 @@ import {
|
|
|
3163
3293
|
DepthFormat,
|
|
3164
3294
|
DepthTexture,
|
|
3165
3295
|
FloatType,
|
|
3166
|
-
HalfFloatType,
|
|
3296
|
+
HalfFloatType as HalfFloatType2,
|
|
3167
3297
|
LinearFilter as LinearFilter3,
|
|
3168
3298
|
NearestFilter,
|
|
3169
3299
|
NoBlending,
|
|
@@ -3175,7 +3305,7 @@ import {
|
|
|
3175
3305
|
UnsignedIntType,
|
|
3176
3306
|
Mesh,
|
|
3177
3307
|
Vector2,
|
|
3178
|
-
Vector4,
|
|
3308
|
+
Vector4 as Vector42,
|
|
3179
3309
|
WebGLRenderTarget
|
|
3180
3310
|
} from "three";
|
|
3181
3311
|
|
|
@@ -3414,8 +3544,8 @@ function finishingUniformValues(lattice) {
|
|
|
3414
3544
|
uVignette: { value: 0 },
|
|
3415
3545
|
uFrameSize: { value: new Vector2(1, 1) },
|
|
3416
3546
|
uGrainBase: { value: new Vector2(0, 0) },
|
|
3417
|
-
uGrainStitch: { value: new
|
|
3418
|
-
uVignetteCore: { value: new
|
|
3547
|
+
uGrainStitch: { value: new Vector42(1, 1, 1, 1) },
|
|
3548
|
+
uVignetteCore: { value: new Vector42(0, 0, 1, 1) },
|
|
3419
3549
|
uVignetteSigma: { value: new Vector2(1, 1) },
|
|
3420
3550
|
tGrainLattice: { value: lattice }
|
|
3421
3551
|
};
|
|
@@ -3462,7 +3592,7 @@ var FocusResources = class {
|
|
|
3462
3592
|
depthTexture.magFilter = NearestFilter;
|
|
3463
3593
|
this.world = new WebGLRenderTarget(width, height, {
|
|
3464
3594
|
format: RGBAFormat,
|
|
3465
|
-
type:
|
|
3595
|
+
type: HalfFloatType2,
|
|
3466
3596
|
minFilter: LinearFilter3,
|
|
3467
3597
|
magFilter: LinearFilter3,
|
|
3468
3598
|
wrapS: ClampToEdgeWrapping,
|
|
@@ -3474,7 +3604,7 @@ var FocusResources = class {
|
|
|
3474
3604
|
});
|
|
3475
3605
|
this.gathered = new WebGLRenderTarget(width, height, {
|
|
3476
3606
|
format: RGBAFormat,
|
|
3477
|
-
type:
|
|
3607
|
+
type: HalfFloatType2,
|
|
3478
3608
|
minFilter: LinearFilter3,
|
|
3479
3609
|
magFilter: LinearFilter3,
|
|
3480
3610
|
wrapS: ClampToEdgeWrapping,
|
|
@@ -3685,17 +3815,17 @@ function assertPassRenderer(resources, gl) {
|
|
|
3685
3815
|
}
|
|
3686
3816
|
function FocusPass({ focus, finishing, scale, frame }) {
|
|
3687
3817
|
const registerActual = useSceneActualResourceRegistrarV1();
|
|
3688
|
-
const gl =
|
|
3689
|
-
const scene =
|
|
3690
|
-
const camera =
|
|
3818
|
+
const gl = useThree8((s) => s.gl);
|
|
3819
|
+
const scene = useThree8((s) => s.scene);
|
|
3820
|
+
const camera = useThree8((s) => s.camera);
|
|
3691
3821
|
const [resources] = useState6(() => new FocusResources(gl, frame.width, frame.height, registerActual));
|
|
3692
|
-
|
|
3822
|
+
useLayoutEffect11(() => {
|
|
3693
3823
|
resources.resize(frame.width, frame.height);
|
|
3694
3824
|
}, [resources, frame.width, frame.height]);
|
|
3695
|
-
|
|
3825
|
+
useLayoutEffect11(() => () => resources.dispose(), [resources]);
|
|
3696
3826
|
assertPassRenderer(resources, gl);
|
|
3697
3827
|
const planes = focusCameraPlanes(camera);
|
|
3698
|
-
|
|
3828
|
+
useFrame2(() => {
|
|
3699
3829
|
renderFocusPass(gl, scene, camera, resources, focusUniforms(focus, scale, planes, frame), finishing);
|
|
3700
3830
|
}, FOCUS_PASS_PRIORITY);
|
|
3701
3831
|
return null;
|
|
@@ -3767,10 +3897,10 @@ function drawSceneFrameV2({ advance, invalidate, isRendering, playing, now }) {
|
|
|
3767
3897
|
else invalidate();
|
|
3768
3898
|
}
|
|
3769
3899
|
function SceneFrameCommitV2({ frame, children }) {
|
|
3770
|
-
const { advance, invalidate } =
|
|
3771
|
-
const playing = Internals3.Timeline.
|
|
3900
|
+
const { advance, invalidate } = useThree9((state) => ({ advance: state.advance, invalidate: state.invalidate }));
|
|
3901
|
+
const [playing] = Internals3.Timeline.usePlayingState();
|
|
3772
3902
|
const isRendering = getRemotionEnvironment2().isRendering;
|
|
3773
|
-
|
|
3903
|
+
useLayoutEffect12(() => {
|
|
3774
3904
|
drawSceneFrameV2({ advance, invalidate, isRendering, playing, now: performance.now() });
|
|
3775
3905
|
}, [advance, frame, invalidate, isRendering, playing]);
|
|
3776
3906
|
return /* @__PURE__ */ React26.createElement(React26.Fragment, null, children);
|
|
@@ -4280,6 +4410,7 @@ var sandboxScope = {
|
|
|
4280
4410
|
Graph,
|
|
4281
4411
|
DiGraph,
|
|
4282
4412
|
ThreeCanvas,
|
|
4413
|
+
FrameDepthOfField,
|
|
4283
4414
|
StageCameraRig,
|
|
4284
4415
|
useImageTexture,
|
|
4285
4416
|
StudioRig,
|
|
@@ -4362,6 +4493,7 @@ export {
|
|
|
4362
4493
|
sceneCameraPoseFromV1,
|
|
4363
4494
|
StageCameraRig,
|
|
4364
4495
|
ThreeCanvas,
|
|
4496
|
+
FrameDepthOfField,
|
|
4365
4497
|
useImageTexture,
|
|
4366
4498
|
defaultScreenLayout,
|
|
4367
4499
|
makeDefaultScreenTexture,
|
|
@@ -26,16 +26,16 @@ import {
|
|
|
26
26
|
stagedBrowserLocator,
|
|
27
27
|
verifyLocalStagedBrowser,
|
|
28
28
|
vp9AlphaFfmpegOverride
|
|
29
|
-
} from "../chunk-
|
|
29
|
+
} from "../chunk-D3GMN4WL.js";
|
|
30
30
|
import "../chunk-WB2VFDQZ.js";
|
|
31
31
|
import "../chunk-EXY4JJPH.js";
|
|
32
32
|
import "../chunk-DAARYRNT.js";
|
|
33
|
-
import "../chunk-
|
|
33
|
+
import "../chunk-5NGYBI5Z.js";
|
|
34
34
|
import "../chunk-C5MPFJCD.js";
|
|
35
35
|
import "../chunk-ZVG446DJ.js";
|
|
36
36
|
import "../chunk-KKV5U5EA.js";
|
|
37
37
|
import "../chunk-2L7PYYJK.js";
|
|
38
|
-
import "../chunk-
|
|
38
|
+
import "../chunk-BAC7DKQZ.js";
|
|
39
39
|
import "../chunk-2ESYSVXG.js";
|
|
40
40
|
export {
|
|
41
41
|
COMPONENT_BROWSER_CLEANUP_TIMEOUT_MS,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "../_members/component-runtime/sourceAdmission.js";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import {
|
|
2
|
+
assertSourceReadsDeclaredAssets,
|
|
3
|
+
missingDeclaredAssetHandleReads,
|
|
4
|
+
sourceAssetHandleReads
|
|
5
|
+
} from "../chunk-WXHD6OUT.js";
|
|
6
|
+
import "../chunk-ZVG446DJ.js";
|
|
7
|
+
import "../chunk-2ESYSVXG.js";
|
|
8
|
+
export {
|
|
9
|
+
assertSourceReadsDeclaredAssets,
|
|
10
|
+
missingDeclaredAssetHandleReads,
|
|
11
|
+
sourceAssetHandleReads
|
|
12
|
+
};
|