babylonjs-editor-tools-lite 5.5.3-alpha.1 → 5.5.4-alpha.1

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.
Files changed (151) hide show
  1. package/MISSING_FEATURES.md +29 -15
  2. package/build/src/cinematic/generate.js +3 -1
  3. package/build/src/cinematic/generate.js.map +1 -1
  4. package/build/src/cinematic/parse.js +65 -59
  5. package/build/src/cinematic/parse.js.map +1 -1
  6. package/build/src/cinematic/sequences.js +226 -0
  7. package/build/src/cinematic/sequences.js.map +1 -0
  8. package/build/src/index.js +1 -0
  9. package/build/src/index.js.map +1 -1
  10. package/build/src/loading/material.js +25 -0
  11. package/build/src/loading/material.js.map +1 -1
  12. package/build/src/loading/materials/image-processing.js +260 -160
  13. package/build/src/loading/materials/image-processing.js.map +1 -1
  14. package/build/src/loading/materials/pbr.js +4 -6
  15. package/build/src/loading/materials/pbr.js.map +1 -1
  16. package/build/src/loading/materials/sky.js +14 -80
  17. package/build/src/loading/materials/sky.js.map +1 -1
  18. package/build/src/loading/materials/standard.js +4 -0
  19. package/build/src/loading/materials/standard.js.map +1 -1
  20. package/build/src/rendering/default/bloom.js +106 -0
  21. package/build/src/rendering/default/bloom.js.map +1 -0
  22. package/build/src/rendering/default/blur.js +186 -0
  23. package/build/src/rendering/default/blur.js.map +1 -0
  24. package/build/src/rendering/default/chromatic-aberration.js +75 -0
  25. package/build/src/rendering/default/chromatic-aberration.js.map +1 -0
  26. package/build/src/rendering/default/depth-of-field.js +170 -0
  27. package/build/src/rendering/default/depth-of-field.js.map +1 -0
  28. package/build/src/rendering/default/fxaa.js +36 -0
  29. package/build/src/rendering/default/fxaa.js.map +1 -0
  30. package/build/src/rendering/default/glow-layer.js +550 -0
  31. package/build/src/rendering/default/glow-layer.js.map +1 -0
  32. package/build/src/rendering/default/grain.js +45 -0
  33. package/build/src/rendering/default/grain.js.map +1 -0
  34. package/build/src/rendering/default/image-processing.js +860 -0
  35. package/build/src/rendering/default/image-processing.js.map +1 -0
  36. package/build/src/rendering/default/pipeline.js +536 -0
  37. package/build/src/rendering/default/pipeline.js.map +1 -0
  38. package/build/src/rendering/default/shaders.js +619 -0
  39. package/build/src/rendering/default/shaders.js.map +1 -0
  40. package/build/src/rendering/default/sharpen.js +46 -0
  41. package/build/src/rendering/default/sharpen.js.map +1 -0
  42. package/build/src/rendering/default-pipeline.js +93 -260
  43. package/build/src/rendering/default-pipeline.js.map +1 -1
  44. package/build/src/rendering/motion-blur/post-process.js +223 -0
  45. package/build/src/rendering/motion-blur/post-process.js.map +1 -0
  46. package/build/src/rendering/motion-blur/shaders.js +83 -0
  47. package/build/src/rendering/motion-blur/shaders.js.map +1 -0
  48. package/build/src/rendering/motion-blur.js +34 -11
  49. package/build/src/rendering/motion-blur.js.map +1 -1
  50. package/build/src/rendering/pipeline.js +328 -713
  51. package/build/src/rendering/pipeline.js.map +1 -1
  52. package/build/src/rendering/post-process/context.js +8 -0
  53. package/build/src/rendering/post-process/context.js.map +1 -0
  54. package/build/src/rendering/post-process/depth-renderer.js +150 -0
  55. package/build/src/rendering/post-process/depth-renderer.js.map +1 -0
  56. package/build/src/rendering/post-process/geometry.js +303 -0
  57. package/build/src/rendering/post-process/geometry.js.map +1 -0
  58. package/build/src/rendering/post-process/includes.js +455 -0
  59. package/build/src/rendering/post-process/includes.js.map +1 -0
  60. package/build/src/rendering/post-process/jitter.js +23 -0
  61. package/build/src/rendering/post-process/jitter.js.map +1 -0
  62. package/build/src/rendering/post-process/matrix.js +110 -0
  63. package/build/src/rendering/post-process/matrix.js.map +1 -0
  64. package/build/src/rendering/post-process/mesh-materials.js +212 -0
  65. package/build/src/rendering/post-process/mesh-materials.js.map +1 -0
  66. package/build/src/rendering/post-process/mesh-pass.js +780 -0
  67. package/build/src/rendering/post-process/mesh-pass.js.map +1 -0
  68. package/build/src/rendering/post-process/pass.js +426 -0
  69. package/build/src/rendering/post-process/pass.js.map +1 -0
  70. package/build/src/rendering/post-process/pre-pass.js +189 -0
  71. package/build/src/rendering/post-process/pre-pass.js.map +1 -0
  72. package/build/src/rendering/post-process/shader.js +611 -0
  73. package/build/src/rendering/post-process/shader.js.map +1 -0
  74. package/build/src/rendering/post-process/targets.js +79 -0
  75. package/build/src/rendering/post-process/targets.js.map +1 -0
  76. package/build/src/rendering/shaders.js +13 -377
  77. package/build/src/rendering/shaders.js.map +1 -1
  78. package/build/src/rendering/ssao/pipeline.js +440 -0
  79. package/build/src/rendering/ssao/pipeline.js.map +1 -0
  80. package/build/src/rendering/ssao/shaders.js +210 -0
  81. package/build/src/rendering/ssao/shaders.js.map +1 -0
  82. package/build/src/rendering/ssao.js +51 -10
  83. package/build/src/rendering/ssao.js.map +1 -1
  84. package/build/src/rendering/ssr/pipeline.js +464 -0
  85. package/build/src/rendering/ssr/pipeline.js.map +1 -0
  86. package/build/src/rendering/ssr/shaders.js +978 -0
  87. package/build/src/rendering/ssr/shaders.js.map +1 -0
  88. package/build/src/rendering/ssr.js +69 -13
  89. package/build/src/rendering/ssr.js.map +1 -1
  90. package/build/src/rendering/taa/halton.js +84 -0
  91. package/build/src/rendering/taa/halton.js.map +1 -0
  92. package/build/src/rendering/taa/pipeline.js +478 -0
  93. package/build/src/rendering/taa/pipeline.js.map +1 -0
  94. package/build/src/rendering/taa/shaders.js +42 -0
  95. package/build/src/rendering/taa/shaders.js.map +1 -0
  96. package/build/src/rendering/taa.js +7 -92
  97. package/build/src/rendering/taa.js.map +1 -1
  98. package/build/src/rendering/volumetric/pipeline.js +12 -28
  99. package/build/src/rendering/volumetric/pipeline.js.map +1 -1
  100. package/build/src/rendering/volumetric-lighting.js +133 -9
  101. package/build/src/rendering/volumetric-lighting.js.map +1 -1
  102. package/build/src/rendering/wgsl.js +27 -6
  103. package/build/src/rendering/wgsl.js.map +1 -1
  104. package/declaration/src/cinematic/parse.d.ts +1 -0
  105. package/declaration/src/cinematic/sequences.d.ts +40 -0
  106. package/declaration/src/cinematic/typings.d.ts +24 -1
  107. package/declaration/src/index.d.ts +1 -0
  108. package/declaration/src/loading/material.d.ts +13 -0
  109. package/declaration/src/loading/materials/image-processing.d.ts +10 -11
  110. package/declaration/src/rendering/default/bloom.d.ts +57 -0
  111. package/declaration/src/rendering/default/blur.d.ts +71 -0
  112. package/declaration/src/rendering/default/chromatic-aberration.d.ts +61 -0
  113. package/declaration/src/rendering/default/depth-of-field.d.ts +74 -0
  114. package/declaration/src/rendering/default/fxaa.d.ts +24 -0
  115. package/declaration/src/rendering/default/glow-layer.d.ts +285 -0
  116. package/declaration/src/rendering/default/grain.d.ts +33 -0
  117. package/declaration/src/rendering/default/image-processing.d.ts +351 -0
  118. package/declaration/src/rendering/default/pipeline.d.ts +249 -0
  119. package/declaration/src/rendering/default/shaders.d.ts +56 -0
  120. package/declaration/src/rendering/default/sharpen.d.ts +33 -0
  121. package/declaration/src/rendering/default-pipeline.d.ts +10 -124
  122. package/declaration/src/rendering/motion-blur/post-process.d.ts +112 -0
  123. package/declaration/src/rendering/motion-blur/shaders.d.ts +4 -0
  124. package/declaration/src/rendering/motion-blur.d.ts +4 -7
  125. package/declaration/src/rendering/pipeline.d.ts +37 -138
  126. package/declaration/src/rendering/post-process/context.d.ts +214 -0
  127. package/declaration/src/rendering/post-process/depth-renderer.d.ts +79 -0
  128. package/declaration/src/rendering/post-process/geometry.d.ts +70 -0
  129. package/declaration/src/rendering/post-process/includes.d.ts +32 -0
  130. package/declaration/src/rendering/post-process/jitter.d.ts +18 -0
  131. package/declaration/src/rendering/post-process/matrix.d.ts +40 -0
  132. package/declaration/src/rendering/post-process/mesh-materials.d.ts +86 -0
  133. package/declaration/src/rendering/post-process/mesh-pass.d.ts +187 -0
  134. package/declaration/src/rendering/post-process/pass.d.ts +167 -0
  135. package/declaration/src/rendering/post-process/pre-pass.d.ts +87 -0
  136. package/declaration/src/rendering/post-process/shader.d.ts +132 -0
  137. package/declaration/src/rendering/post-process/targets.d.ts +43 -0
  138. package/declaration/src/rendering/shaders.d.ts +3 -27
  139. package/declaration/src/rendering/ssao/pipeline.d.ts +211 -0
  140. package/declaration/src/rendering/ssao/shaders.d.ts +8 -0
  141. package/declaration/src/rendering/ssao.d.ts +4 -7
  142. package/declaration/src/rendering/ssr/pipeline.d.ts +274 -0
  143. package/declaration/src/rendering/ssr/shaders.d.ts +20 -0
  144. package/declaration/src/rendering/ssr.d.ts +6 -9
  145. package/declaration/src/rendering/taa/halton.d.ts +47 -0
  146. package/declaration/src/rendering/taa/pipeline.d.ts +199 -0
  147. package/declaration/src/rendering/taa/shaders.d.ts +4 -0
  148. package/declaration/src/rendering/taa.d.ts +3 -61
  149. package/declaration/src/rendering/volumetric/pipeline.d.ts +8 -4
  150. package/declaration/src/rendering/wgsl.d.ts +7 -0
  151. package/package.json +1 -1
@@ -12,14 +12,14 @@ Legend:
12
12
 
13
13
  - **Intentional**: WebGPU only. There is no WebGL support, in compatibility mode or otherwise.
14
14
  - **Intentional**: only the KTX2 compressed textures (`.ktx2`) are supported. The KTX1 textures generated with a format suffix (`-astc.ktx`, `-dxt.ktx`, `-pvrtc.ktx`, `-etc1.ktx`, `-etc2.ktx`) are not loaded, `configureEngineToUseCompressedTextures` and `addExcludedCompressedTexture` are removed and the offline preload ignores the `.ktx` files. KTX2 textures are enabled using `setUseKtx2CompressedTextures`.
15
- - **Partial**: the MSAA is configured once for the engine (`createEngine`): the `msaaSamples` options of the rendering pipelines are ignored.
15
+ - **Partial**: the MSAA of the scenes rendered without post-process is the MSAA of the engine (`createEngine`). When rendering pipelines render the camera, the scene is rendered with the samples of the first pipeline, as Babylon.js does (`samples` of the default rendering pipeline and of the SSR, `textureSamples` of the SSAO2, `msaaSamples` of the TAA and of the volumetric lighting), with 1 or 4 samples (the sample counts supported by WebGPU).
16
16
 
17
17
  ## Scene loading
18
18
 
19
19
  - **Partial**: Babylon Lite renders only the registered scenes. `loadScene` registers the scene (with the support of the shadows when the scene contains shadow generators) or rebuilds its renderables when it is already registered (several editor scenes loaded in the same scene). Use `doNotRegisterScene` to register the scene yourself.
20
20
  - **Partial**: the physics world must be created by the application (`createHavokWorld`) and given to `loadScene` (`physicsWorld` option): Babylon Lite scenes have no physics engine.
21
21
  - **Partial**: the BRDF lookup texture required by Babylon Lite for the image based lighting is embedded in the tools (same texture as Babylon.js). It can be replaced using the `brdfUrl` option.
22
- - **Missing**: the entities of the scene file that Babylon Lite doesn't support are not loaded: classic particle systems (`ParticleSystem`, `GPUParticleSystem`), reflection probes, lens flare systems, effect layers (glow and highlight layers) and legacy sounds.
22
+ - **Missing**: the entities of the scene file that Babylon Lite doesn't support are not loaded: classic particle systems (`ParticleSystem`, `GPUParticleSystem`), reflection probes, lens flare systems, the effect layers saved in the scene file (glow and highlight layers: the glow layer of the default rendering pipeline is supported, see below) and legacy sounds.
23
23
  - **Missing**: Babylon Lite has no collision system: the collisions of the scene, the meshes and the cameras (`collisionsEnabled`, `checkCollisions`, `ellipsoid`, collision meshes of the editor) are not applied. The physics (character controller of Babylon Lite) can be used instead.
24
24
 
25
25
  ## Meshes and geometry
@@ -110,20 +110,26 @@ Node materials are compiled by the node material parser of Babylon Lite.
110
110
 
111
111
  ## Rendering pipelines and post-processes
112
112
 
113
- The post-processes are rendered by the frame graph tasks of the tools: the scene must be created using `createEditorSceneContext`. The scenes created with the default render task of Babylon Lite are rendered without post-processes: only the exposure, the contrast and the tone mapping apply (to the materials, not to the clear color).
114
-
115
- - **Partial**: default rendering pipeline: depth of field, bloom, chromatic aberration, image processing (exposure, contrast, tone mapping, vignette, color grading, color curves, dithering), sharpen, grain and FXAA.
116
- - **Partial**: the exposure, contrast and tone mapping are applied by the Babylon Lite materials (PBR, sky) and to the clear color by the tools: the other post-processes run on the tone mapped colors, while Babylon.js runs them on the HDR colors before the image processing (the bloom threshold behaves differently). The vignette, which Babylon.js applies before the tone mapping, is applied by inverting the image processing of the materials and applying it again: the colors the tone mapping crushes to black can't be recovered.
117
- - **Emulated**: color grading: the `.3dl` lookup tables (`ColorGradingTexture`) and the 2D lookup textures are sampled as 3D textures. The 2D lookup textures are converted when loaded: changing `colorGradingWithGreenDepth` afterwards has no effect.
118
- - **Partial**: TAA rendering pipeline: `clampHistory` and `reprojectHistory` are ignored, `samples` is read when the frame graph is built.
119
- - **Partial**: the frame graph of a Babylon Lite scene can't change once built: it contains the post-processes enabled for any of the cameras when the scene is loaded. Enabling another effect later logs a warning; disabling an effect bypasses its tasks.
113
+ The rendering pipelines are rendered by the frame graph tasks of the tools: the scene must be created using `createEditorSceneContext`. The scenes created with the default render task of Babylon Lite are rendered without post-processes: only the exposure, the contrast and the tone mapping apply (to the materials, not to the clear color).
114
+
115
+ - **Emulated**: the default rendering pipeline (`rendering/default`), the SSAO2 (`rendering/ssao`), SSR (`rendering/ssr`) and TAA (`rendering/taa`) rendering pipelines and the motion blur post-process (`rendering/motion-blur`) are custom implementations of the pipelines of Babylon.js 9.27 with WebGPU: same passes, same sizes, formats and samplers of the textures, same order (`renderingPipelinesOrder`) and the WGSL shaders of Babylon.js, run through an adapter reproducing the conventions of Babylon.js (render targets stored upside down, texture and fragment coordinates with their origin at the bottom-left corner). They have the properties and the options of the Babylon.js pipelines and were compared pixel by pixel with Babylon.js (WebGPU, or WebGL2 where Babylon.js fails with WebGPU): the remaining differences are a few 1/255 on a fraction of the pixels, as for the scenes rendered without post-process.
116
+ - default rendering pipeline: image processing (exposure, contrast, tone mapping, vignette, color curves, color grading, white balance, dithering), bloom, depth of field, chromatic aberration, sharpen, grain, FXAA and glow layer. As with Babylon.js, the materials output linear colors when the image processing is applied by the post-process.
117
+ - SSAO2: same random texture and sample sphere, generated using `Math.random` as Babylon.js does (the noise differs from one run to the other, as with Babylon.js), expensive and legacy blurs.
118
+ - SSR: all the options, including the thickness computed from the depth of the back faces, the blur, the attenuations, the environment texture (`ISSREnvironmentTexture`, a cube texture of Babylon Lite), the screen space depth (`useScreenspaceDepth`) and the debug output.
119
+ - TAA: same Halton sequence, history (ping-pong textures), `clampHistory` and `reprojectHistory`. The projection is jittered by offsetting the view projection matrix of the scene, the same way Babylon.js jitters the projection matrix of the camera, including its behaviors: no new jitter while the camera moves, and no jitter at all when the TAA isn't the first post-process of the camera (see "Babylon.js issues found while porting").
120
+ - motion blur: object based (velocity of the meshes, `motionBlurSamples`, `motionStrength`) and screen based (depth of the scene and previous view projection of the camera), scaled by the time elapsed since the previous frame as Babylon.js does (`scene.getAnimationRatio()`).
121
+ - glow layer (`glowLayerEnabled`, `GlowLayer`): the meshes are drawn into the glow map with the color of their glow (emissive color and texture, alpha, alpha test and blending of the PBR and standard materials, as Babylon.js computes them), the glow map is blurred twice and added to the color of the scene before the post-processes. The meshes using another material (node materials, sky materials) are drawn with the neutral color, as Babylon.js does.
122
+ - **Partial**: the geometry textures of the pre-pass renderer read by the SSAO2 and the SSR (depth, normals, reflectivity) are rendered by geometry renderer tasks of Babylon Lite. As with Babylon.js, the transparent meshes are drawn after the opaque meshes, sorted from back to front, and write the geometry where their alpha is greater than their alpha cutoff (PBR materials) or 0.4 (standard materials). The differences: the alpha of the PBR materials doesn't include the luminance of the specular and radiance (`useSpecularOverAlpha`, `useRadianceOverAlpha`) and the alpha channel of the reflectivity (roughness) is blended as the color while Babylon.js adds the alphas.
123
+ - **Emulated**: the velocity of the pre-pass renderer (object based motion blur, reprojection of the TAA) is rendered by the tools, the same way Babylon.js computes it (world matrices and view projection of the previous frame, encoded or linear velocity, alpha of the transparent meshes): the geometry renderer tasks of Babylon Lite compute the motion of the camera only (see "Babylon Lite issues found while porting"). The screen space depth of the pre-pass (SSR `useScreenspaceDepth`) and the depth renderers of Babylon.js (depth of field, back faces of the SSR with `backfaceForceDepthWriteTransparentMeshes`) are rendered the same way: the geometry renderer tasks of Babylon Lite run the whole shaders of the materials to render a depth. These meshes are drawn from their GPU buffers (positions, texture coordinates, vertex colors, thin instances): the morph targets, the skeletons and the baked vertex animations are not applied (`excludeSkinnedMesh` has no effect), and the thin instances keep the velocity of their mesh (the previous matrices of the instances are not tracked). As with the TAA material manager of Babylon.js, the jitter of the reprojection offsets the vertices of the pre-pass once the velocity is computed.
124
+ - **Partial**: motion blur: rendered at the size of the rendering (the `options` ratio of the constructor is not supported).
125
+ - **Partial**: glow layer: the glow map is drawn from the GPU buffers of the meshes (positions, texture coordinates, vertex colors, thin instances): the morph targets, the skeletons and the baked vertex animations are not applied. `referenceMeshToUseItsOwnMaterial`, the rendering groups other than the default one, the MSAA of the glow map (`mainTextureSamples`) and the blend modes of the merge other than "add" and "combine" are not supported. The emissive textures of the PBR materials are loaded a second time for the glow: Babylon Lite decodes them as sRGB textures, whose mipmaps are computed in linear space.
126
+ - **Emulated**: color grading: the `.3dl` lookup tables (`ColorGradingTexture`) and the 2D lookup textures are sampled as 3D textures. The 2D lookup textures are converted when loaded: changing `colorGradingWithGreenDepth` afterwards has no effect. The 2D lookup textures were compared with Babylon.js using WebGL2 (they fail with WebGPU, see below).
120
127
  - **Partial**: volumetric lighting rendering pipeline (`rendering/volumetric`), ported from the Babylon.js version of the tools with the same configuration, the same configuration per light (`light.metadata.volumetricLighting`, clustered lights included), the same selection of the lights and the same shaders (raymarching, temporal accumulation, bilateral blur, composition and debug outputs). The differences:
121
128
  - Babylon Lite has no shadows for the point lights: the point lights casting volumetric shadows are occluded using the depth buffer, as the Babylon.js version does for the lights without shadow map.
122
- - the depth of the scene is rendered in half floats by a geometry renderer task (shared with the depth of field): the surfaces further than 65504 units are considered as the sky.
123
- - when the image processing of the default rendering pipeline is enabled, Babylon.js composes the light shafts before its image processing post-process while the materials of Babylon Lite already applied it: the composition inverts the image processing of the materials (exposure, tone mapping and contrast), adds the light shafts and applies it again. The colors saturated by the tone mapping can't be recovered, and the 8 bits colors of the scene limit the precision in the highlights.
124
- - `msaaSamples` is ignored (the MSAA of Babylon Lite is set on the engine) and `depthSource` is always `GeometryBuffer`.
125
- - **Missing**: SSAO2 rendering pipeline, SSR rendering pipeline, motion blur post-process, volumetric light scattering post-process, glow layer. Their configuration functions are kept and return `null`.
126
- - **Missing**: `sortCameraPostProcesses` / `keepRenderingPipelinesOrdered` do nothing: the order of the post-processes is fixed.
129
+ - the depth of the scene is stored in half floats: the surfaces further than 65504 units are considered as the sky.
130
+ - `depthSource`: as with the Babylon.js version, the depth is read from the pre-pass when another pipeline renders it (SSAO2, SSR, motion blur, reprojection of the TAA). Otherwise the depth of all the surfaces is rendered by a geometry renderer task (`GeometryBuffer`), while the Babylon.js version then renders the opaque and alpha tested surfaces with a depth renderer (when the scene has no geometry buffer renderer).
131
+ - **Missing**: volumetric light scattering post-process. Its configuration functions are kept and return `null`.
132
+ - **Missing**: `sortCameraPostProcesses` / `keepRenderingPipelinesOrdered` do nothing: the order of the post-processes is fixed (`renderingPipelinesOrder`).
127
133
 
128
134
  ## Sounds
129
135
 
@@ -178,14 +184,22 @@ These behaviors of the Babylon.js version of the tools are not reproduced on pur
178
184
  - the node material compiler generates invalid WGSL identifiers for the block names starting with a digit.
179
185
  - `loadBabylon` applies the Euler rotations in XYZ order while Babylon.js uses the yaw-pitch-roll (YXZ) order.
180
186
  - `addClusteredLightContainer` throws when the scene has no camera yet.
181
- - the chromatic aberration post-process uses a V axis pointing down (`direction` and `centerPosition` are converted by the tools).
187
+ - the chromatic aberration post-process uses a V axis pointing down (Babylon.js uses a V axis pointing up for `direction` and `centerPosition`).
182
188
  - the standard materials with `disableLighting` output `emissive * diffuse` while Babylon.js outputs `diffuse + emissive + ambient`, and they don't use the alpha of the diffuse texture for the alpha blending (both emulated by the tools).
183
189
  - a scene with a cascaded shadow generator (directional light) and a PCF shadow generator (spot light) renders nothing: every frame fails with an invalid bind group ("binding index 3 not present in the bind group layout"), also without the tools.
184
190
  - the PBR materials have no legacy specular energy conservation (`useLegacySpecularEnergyConservation` of Babylon.js, enabled by default): the F90 of the metallic reflectance is always `mix(specularWeight, 1, metallic)`.
191
+ - the geometry shaders of the standard materials (geometry renderer task) replace the first `return color;` of the fragment shader by the geometry outputs: when the code of a material plugin contains `return color;` (in a helper function), the shader fails to compile (the plugins of the tools avoid it).
192
+ - the velocity rendered by the geometry renderer (`LINEAR_VELOCITY`) is not exactly 0 for the static meshes when the camera doesn't move: the current and previous clip positions are computed with identical matrices but differ by up to 1e-5 (in normalized device coordinates) near the camera on large triangles.
193
+ - the velocity rendered by the geometry renderer for the PBR materials only includes the motion of the camera (`previousViewProjection * worldPosition`): the motion of the meshes is ignored (the standard materials use the previous world matrix of the mesh).
194
+ - the geometry renderer tasks run the whole shaders of the materials (lights, shadows, image based lighting) even when only a depth is requested: rendering a depth costs about as much as rendering the scene (the tools render the depths with their own shaders).
185
195
  - the material plugins can't change the color of the PBR materials before the fog and the image processing: `CUSTOM_FRAGMENT_BEFORE_FINALCOLORCOMPOSITION` is injected in the middle of the fragments sorted by name (before the unlit, sheen, sub-surface and refraction fragments), and `CUSTOM_FRAGMENT_BEFORE_FRAGCOLOR` runs after the image processing.
186
196
 
187
197
  ## Babylon.js issues found while porting
188
198
 
189
199
  - with WebGPU, the image processing fails to compile when the color grading uses a 2D lookup texture: the WGSL version of the "imageProcessingFunctions" shader calls `textureSample(txColorTransform, sampler, vec3, vec2)` instead of the `sampleTexture3D` function of the GLSL version.
190
200
  - the `.babylon` loader doesn't import the module registering `TransformNode.Parse`: the scenes with transform nodes stop loading after the multi-materials, unless the application imports `@babylonjs/core/Meshes/transformNode` (or the whole `@babylonjs/core`). The error is not reported: `SceneLoader` ignores the error the plugin reports when it returns `true`.
201
+ - with WebGPU, the SSR fails to compile with `attenuateBackfaceReflection`: the WGSL version of `computeAttenuationForIntersection` calls `texelFetch(normalSampler, hitPixel, 0)` (GLSL function, undefined variable) instead of `textureLoad(normalSampler, vec2<i32>(ihitPixel), 0)`.
202
+ - the TAA only jitters the camera when it is the first post-process of the camera: when another post-process renders before it (default rendering pipeline, SSAO2, SSR, volumetric lighting), the TAA jitters the projection matrix after the scene is drawn, and each render target rendered before the next frame is drawn (shadow maps, depth renderers, and the tile mask of the clustered light container that the Babylon.js version of the tools creates for each scene) computes the projection matrix again (`getProjectionMatrix(true)` in `ObjectRenderer.initRender`), removing the jitter: the TAA then blends frames without anti-aliasing them. The tools reproduce this behavior.
203
+ - with WebGPU, the reprojection of the TAA (`reprojectHistory`) makes the PBR materials using a normal map without tangents or receiving cascaded shadows exceed the 16 inter-stage variables allowed by default (`maxInterStageShaderVariables`): their render pipelines are invalid and the meshes are not drawn.
191
204
  - with WebGPU, the prepass renderer of a scene using SSAO2, the motion blur and the TAA together exceeds `maxColorAttachmentBytesPerSample` (34 bytes for 32): Babylon.js doesn't request the higher limit the adapter supports.
205
+ - with WebGPU, the object based motion blur makes the PBR materials receiving cascaded shadows exceed the 16 inter-stage variables allowed by default (velocity of the pre-pass, same as the reprojection of the TAA): the meshes are not drawn.
@@ -9,6 +9,7 @@ import { handleApplyEvent } from "./events/event";
9
9
  import { handleSetEnabledEvent } from "./events/set-enabled";
10
10
  import { handleApplyImpulseEvent } from "./events/apply-impulse";
11
11
  import { Cinematic } from "./cinematic";
12
+ import { mergeCinematicSequences } from "./sequences";
12
13
  import { isCinematicKey, isCinematicKeyCut } from "./guards";
13
14
  import { getPropertyValue, registerAfterAnimationCallback } from "./tools";
14
15
  /**
@@ -19,7 +20,8 @@ import { getPropertyValue, registerAfterAnimationCallback } from "./tools";
19
20
  */
20
21
  export function generateCinematicAnimationGroup(cinematic, scene, options) {
21
22
  const result = new Cinematic(cinematic.name, scene);
22
- cinematic.tracks.forEach((track) => {
23
+ // Sequences are played one after the other: their tracks are merged into the tracks of a single timeline.
24
+ mergeCinematicSequences(cinematic).forEach((track) => {
23
25
  // Animation groups
24
26
  const animationGroup = track.animationGroup;
25
27
  if (animationGroup && track.animationGroups?.length) {
@@ -1 +1 @@
1
- {"version":3,"file":"generate.js","sourceRoot":"","sources":["../../../src/cinematic/generate.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;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AC,IAAI,KAAK,CAAC,YAAY,KAAK,UAAU,EAAE,CAAC;oBACzD,SAAS,CAAC,QAAQ,CACjB,IAAI,oBAAoB,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,EAAE;wBAClD,MAAM,UAAU,GAAQ,wBAAwB,EAAE,CAAC;wBACnD,IAAI,CAAC,UAAU,EAAE,CAAC;4BACjB,OAAO;wBACR,CAAC;wBAED,MAAM,cAAc,GAAG,UAAU,CAAC,cAAc,CAAC;wBACjD,UAAU,CAAC,cAAc,GAAG,CAAC,CAAC;wBAE9B,qBAAqB,CAAC,GAAG,EAAE;4BAC1B,UAAU,CAAC,cAAc,GAAG,cAAc,CAAC;wBAC5C,CAAC,CAAC,CAAC;oBACJ,CAAC,CAAC,CACF,CAAC;gBACH,CAAC;YACF,CAAC;QACF,CAAC,CAAC,CAAC;QAEH,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAExB,MAAM,CAAC,oBAAoB,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;IAC9C,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,SAAS,EAAE,CAAC;IAEnB,OAAO,MAAM,CAAC;AACf,CAAC"}
@@ -4,11 +4,13 @@ import { getAnimationTypeForObject } from "../tools/animation";
4
4
  import { getAnimationGroupByName, getMeshById, getNodeById, getSceneData } from "../tools/scene";
5
5
  import { EditorAnimation } from "../animation/animation";
6
6
  import { getPropertyValue } from "./tools";
7
+ import { getCinematicSequences } from "./sequences";
7
8
  function toVec3(value) {
8
9
  return { x: value?.[0] ?? 0, y: value?.[1] ?? 0, z: value?.[2] ?? 0 };
9
10
  }
10
11
  /**
11
12
  * Parses the given JSON data and returns a new cinematic object.
13
+ * The tracks of the cinematics saved before sequences existed are moved to a single sequence.
12
14
  * @param data defines the JSON data of the cinematic to parse.
13
15
  * @param scene defines the reference to the scene used to retrieve cinematic's data.
14
16
  */
@@ -17,67 +19,71 @@ export function parseCinematic(data, scene) {
17
19
  name: data.name,
18
20
  framesPerSecond: data.framesPerSecond,
19
21
  outputFramesPerSecond: data.outputFramesPerSecond,
20
- tracks: data.tracks.map((track) => {
21
- let node = null;
22
- let animationType = null;
23
- if (track.node) {
24
- node = getNodeById(track.node, scene);
25
- if (!node) {
26
- node = getSceneData(scene).particleSystems.find((ps) => ps.id === track.node) ?? null;
27
- }
28
- }
29
- else if (track.defaultRenderingPipeline) {
30
- node = getDefaultRenderingPipeline();
31
- }
32
- else if (track.volumetricLightScattering) {
33
- node = getVLSPostProcess();
34
- }
35
- if (track.propertyPath) {
36
- const value = getPropertyValue(node, track.propertyPath);
37
- animationType = getAnimationTypeForObject(value);
38
- }
39
- let sound = null;
40
- if (track.sound) {
41
- sound = getNodeById(track.sound, scene);
42
- }
43
- return {
44
- node,
45
- sound,
46
- propertyPath: track.propertyPath,
47
- defaultRenderingPipeline: track.defaultRenderingPipeline,
48
- volumetricLightScattering: track.volumetricLightScattering,
49
- animationGroupWeight: track.animationGroupWeight,
50
- animationGroup: track.animationGroup ? getAnimationGroupByName(track.animationGroup, scene) : null,
51
- animationGroups: track.animationGroups,
52
- sounds: track.sounds,
53
- soundVolume: parseKeyFrameAnimations(track.soundVolume ?? [], EditorAnimation.ANIMATIONTYPE_FLOAT),
54
- keyFrameEvents: track.keyFrameEvents?.map((event) => {
55
- const result = {
56
- ...event,
57
- };
58
- switch (event.data?.type) {
59
- case "set-enabled":
60
- result.data = {
61
- type: "set-enabled",
62
- value: event.data.value,
63
- node: getNodeById(event.data.node, scene),
64
- };
65
- break;
66
- case "apply-impulse":
67
- result.data = {
68
- type: "apply-impulse",
69
- radius: event.data.radius,
70
- mesh: getMeshById(event.data.mesh, scene),
71
- force: toVec3(event.data.force),
72
- contactPoint: toVec3(event.data.contactPoint),
73
- };
74
- break;
75
- }
76
- return result;
77
- }),
78
- keyFrameAnimations: node && animationType !== null && parseKeyFrameAnimations(track.keyFrameAnimations ?? [], animationType),
22
+ sequences: getCinematicSequences(data).map((sequence) => ({
23
+ name: sequence.name,
24
+ tracks: sequence.tracks.map((track) => parseCinematicTrack(track, scene)),
25
+ })),
26
+ };
27
+ }
28
+ function parseCinematicTrack(track, scene) {
29
+ let node = null;
30
+ let animationType = null;
31
+ if (track.node) {
32
+ node = getNodeById(track.node, scene);
33
+ if (!node) {
34
+ node = getSceneData(scene).particleSystems.find((ps) => ps.id === track.node) ?? null;
35
+ }
36
+ }
37
+ else if (track.defaultRenderingPipeline) {
38
+ node = getDefaultRenderingPipeline();
39
+ }
40
+ else if (track.volumetricLightScattering) {
41
+ node = getVLSPostProcess();
42
+ }
43
+ if (track.propertyPath) {
44
+ const value = getPropertyValue(node, track.propertyPath);
45
+ animationType = getAnimationTypeForObject(value);
46
+ }
47
+ let sound = null;
48
+ if (track.sound) {
49
+ sound = getNodeById(track.sound, scene);
50
+ }
51
+ return {
52
+ node,
53
+ sound,
54
+ propertyPath: track.propertyPath,
55
+ defaultRenderingPipeline: track.defaultRenderingPipeline,
56
+ volumetricLightScattering: track.volumetricLightScattering,
57
+ animationGroupWeight: track.animationGroupWeight,
58
+ animationGroup: track.animationGroup ? getAnimationGroupByName(track.animationGroup, scene) : null,
59
+ animationGroups: track.animationGroups,
60
+ sounds: track.sounds,
61
+ soundVolume: parseKeyFrameAnimations(track.soundVolume ?? [], EditorAnimation.ANIMATIONTYPE_FLOAT),
62
+ keyFrameEvents: track.keyFrameEvents?.map((event) => {
63
+ const result = {
64
+ ...event,
79
65
  };
66
+ switch (event.data?.type) {
67
+ case "set-enabled":
68
+ result.data = {
69
+ type: "set-enabled",
70
+ value: event.data.value,
71
+ node: getNodeById(event.data.node, scene),
72
+ };
73
+ break;
74
+ case "apply-impulse":
75
+ result.data = {
76
+ type: "apply-impulse",
77
+ radius: event.data.radius,
78
+ mesh: getMeshById(event.data.mesh, scene),
79
+ force: toVec3(event.data.force),
80
+ contactPoint: toVec3(event.data.contactPoint),
81
+ };
82
+ break;
83
+ }
84
+ return result;
80
85
  }),
86
+ keyFrameAnimations: node && animationType !== null && parseKeyFrameAnimations(track.keyFrameAnimations ?? [], animationType),
81
87
  };
82
88
  }
83
89
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"parse.js","sourceRoot":"","sources":["../../../src/cinematic/parse.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAG5E,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAE,uBAAuB,EAAE,WAAW,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEjG,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAG3C,SAAS,MAAM,CAAC,KAAU;IACzB,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;AACvE,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,IAAgB,EAAE,KAAmB;IACnE,OAAO;QACN,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,eAAe,EAAE,IAAI,CAAC,eAAe;QACrC,qBAAqB,EAAE,IAAI,CAAC,qBAAqB;QACjD,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;YACjC,IAAI,IAAI,GAAQ,IAAI,CAAC;YACrB,IAAI,aAAa,GAAkB,IAAI,CAAC;YAExC,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC;gBAChB,IAAI,GAAG,WAAW,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;gBACtC,IAAI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,CAAC,KAAK,EAAE,aAAa,CAAC;oBACxE,SAAS,EAAE,sBAAsB,CAAC,eAAe,CAAC,IAAI,CAAC,SAAS,EAAE,aAAa,CAAC;oBAChF,UAAU,EAAE,sBAAsB,CAAC,eAAe,CAAC,IAAI,CAAC,UAAU,EAAE,aAAa,CAAC;iBAClF;aACmB,CAAC;QACvB,CAAC;QAED,MAAM,IAAI,KAAK,CAAC,2BAA2B,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;IAC7D,CAAC,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,226 @@
1
+ import { isCinematicKeyCut } from "./guards";
2
+ /**
3
+ * Defines the name of the sequence created for the cinematics saved before sequences existed.
4
+ */
5
+ export const defaultCinematicSequenceName = "Sequence 1";
6
+ /**
7
+ * Returns the sequences of the given cinematic. The tracks of the cinematics saved before sequences existed are returned
8
+ * in a single sequence.
9
+ * @param cinematic defines the reference to the cinematic (parsed or not) to get its sequences.
10
+ */
11
+ export function getCinematicSequences(cinematic) {
12
+ return cinematic.sequences ?? [{ name: defaultCinematicSequenceName, tracks: cinematic.tracks ?? [] }];
13
+ }
14
+ /**
15
+ * Returns the number of frames an animation group of a track plays, its speed and repeat count included.
16
+ * @param animationGroup defines the reference to the animation group key of the track.
17
+ */
18
+ export function getCinematicAnimationGroupFramesCount(animationGroup) {
19
+ const framesCount = (animationGroup.endFrame - animationGroup.startFrame) * (1 + (animationGroup.repeatCount ?? 0));
20
+ return framesCount / (Math.abs(animationGroup.speed) || 1);
21
+ }
22
+ /**
23
+ * Returns the number of frames of the given sequence: a sequence lasts until its last key, event, sound or animation group.
24
+ * @param sequence defines the reference to the sequence to get its number of frames.
25
+ */
26
+ export function getCinematicSequenceFramesCount(sequence) {
27
+ let framesCount = 0;
28
+ sequence.tracks.forEach((track) => {
29
+ [track.keyFrameAnimations, track.animationGroupWeight, track.soundVolume].forEach((keys) => {
30
+ if (Array.isArray(keys)) {
31
+ keys.forEach((key) => {
32
+ framesCount = Math.max(framesCount, getKeyFrame(key));
33
+ });
34
+ }
35
+ });
36
+ track.keyFrameEvents?.forEach((event) => {
37
+ framesCount = Math.max(framesCount, event.frame);
38
+ });
39
+ track.sounds?.forEach((sound) => {
40
+ framesCount = Math.max(framesCount, sound.frame + (sound.endFrame - sound.startFrame));
41
+ });
42
+ track.animationGroups?.forEach((animationGroup) => {
43
+ framesCount = Math.max(framesCount, animationGroup.frame + getCinematicAnimationGroupFramesCount(animationGroup));
44
+ });
45
+ });
46
+ return framesCount;
47
+ }
48
+ /**
49
+ * Returns the frame, in the whole cinematic, where the given sequence starts: after all the sequences placed before it.
50
+ * @param cinematic defines the reference to the cinematic that contains the sequence.
51
+ * @param sequence defines the reference to the sequence to get its start frame.
52
+ */
53
+ export function getCinematicSequenceStartFrame(cinematic, sequence) {
54
+ let startFrame = 0;
55
+ for (const s of getCinematicSequences(cinematic)) {
56
+ if (s === sequence) {
57
+ break;
58
+ }
59
+ startFrame += getCinematicSequenceFramesCount(s);
60
+ }
61
+ return startFrame;
62
+ }
63
+ /**
64
+ * Returns the number of frames of the given cinematic: the sum of the number of frames of all its sequences.
65
+ * @param cinematic defines the reference to the cinematic to get its number of frames.
66
+ */
67
+ export function getCinematicFramesCount(cinematic) {
68
+ return getCinematicSequences(cinematic).reduce((framesCount, sequence) => framesCount + getCinematicSequenceFramesCount(sequence), 0);
69
+ }
70
+ /**
71
+ * Merges the sequences of the given cinematic into the tracks of a single timeline: keys are moved to the frames of the
72
+ * whole cinematic and the tracks that animate the same target (property, animation group or sound) in several sequences
73
+ * are merged into a single track. A merged value holds until the next sequence that animates it starts, and jumps there to
74
+ * its value in that sequence, like a cut. Tracks of a single sequence starting at frame 0 are returned as is.
75
+ * @param cinematic defines the reference to the cinematic to merge its sequences.
76
+ */
77
+ export function mergeCinematicSequences(cinematic) {
78
+ const merged = [];
79
+ const mergedByTarget = new Map();
80
+ const propertyTargets = new Map();
81
+ let startFrame = 0;
82
+ getCinematicSequences(cinematic).forEach((sequence) => {
83
+ // A target animated by several tracks of a same sequence keeps several tracks: the n-th track of each sequence
84
+ // for a target is merged with the n-th tracks of the other sequences.
85
+ const occurrences = new Map();
86
+ sequence.tracks.forEach((track) => {
87
+ const target = getTrackTarget(track, propertyTargets);
88
+ let parts;
89
+ if (target) {
90
+ const occurrence = occurrences.get(target) ?? 0;
91
+ occurrences.set(target, occurrence + 1);
92
+ let targetParts = mergedByTarget.get(target);
93
+ if (!targetParts) {
94
+ targetParts = [];
95
+ mergedByTarget.set(target, targetParts);
96
+ }
97
+ parts = targetParts[occurrence];
98
+ if (!parts) {
99
+ parts = targetParts[occurrence] = [];
100
+ merged.push(parts);
101
+ }
102
+ }
103
+ else {
104
+ parts = [];
105
+ merged.push(parts);
106
+ }
107
+ parts.push({ track, startFrame });
108
+ });
109
+ startFrame += getCinematicSequenceFramesCount(sequence);
110
+ });
111
+ return merged.map((parts) => mergeTrackParts(parts));
112
+ }
113
+ /**
114
+ * Returns the object that identifies what the given track animates, so tracks animating the same target in several
115
+ * sequences can be merged. Events are never merged.
116
+ */
117
+ function getTrackTarget(track, propertyTargets) {
118
+ if (track.keyFrameEvents) {
119
+ return null;
120
+ }
121
+ if (track.propertyPath) {
122
+ const object = track.defaultRenderingPipeline ? "defaultRenderingPipeline" : track.volumetricLightScattering ? "volumetricLightScattering" : track.node;
123
+ if (!object) {
124
+ return null;
125
+ }
126
+ let properties = propertyTargets.get(object);
127
+ if (!properties) {
128
+ properties = new Map();
129
+ propertyTargets.set(object, properties);
130
+ }
131
+ let target = properties.get(track.propertyPath);
132
+ if (!target) {
133
+ target = {};
134
+ properties.set(track.propertyPath, target);
135
+ }
136
+ return target;
137
+ }
138
+ return track.animationGroup ?? track.sound ?? null;
139
+ }
140
+ function mergeTrackParts(parts) {
141
+ const track = parts[0].track;
142
+ if (parts.length === 1 && parts[0].startFrame === 0) {
143
+ return track;
144
+ }
145
+ return {
146
+ ...track,
147
+ keyFrameAnimations: mergeKeys(parts, (track) => track.keyFrameAnimations),
148
+ animationGroupWeight: mergeKeys(parts, (track) => track.animationGroupWeight),
149
+ soundVolume: mergeKeys(parts, (track) => track.soundVolume),
150
+ animationGroups: mergeFrameItems(parts, (track) => track.animationGroups),
151
+ sounds: mergeFrameItems(parts, (track) => track.sounds),
152
+ keyFrameEvents: mergeFrameItems(parts, (track) => track.keyFrameEvents),
153
+ };
154
+ }
155
+ /**
156
+ * Merges the keys of the given parts of a track: keys are moved to the start of their sequence and, between two
157
+ * sequences, a cut makes the value hold until the next sequence starts and jump to the first value of that sequence.
158
+ */
159
+ function mergeKeys(parts, getKeys) {
160
+ if (!parts.some((part) => Array.isArray(getKeys(part.track)))) {
161
+ return getKeys(parts[0].track);
162
+ }
163
+ const result = [];
164
+ parts.forEach((part) => {
165
+ const keys = getKeys(part.track);
166
+ if (!Array.isArray(keys) || !keys.length) {
167
+ return;
168
+ }
169
+ const shiftedKeys = keys.map((key) => shiftKey(key, part.startFrame)).sort((a, b) => getKeyFrame(a) - getKeyFrame(b));
170
+ const previousKey = result[result.length - 1];
171
+ if (previousKey) {
172
+ const firstKey = shiftedKeys[0];
173
+ // The first key of the sequence is the value after the jump when it is at the start of the sequence.
174
+ // Otherwise, the first value of the sequence holds until its first key.
175
+ let afterJump;
176
+ if (getKeyFrame(firstKey) > part.startFrame) {
177
+ afterJump = { frame: part.startFrame, value: getInKey(firstKey).value };
178
+ }
179
+ else {
180
+ shiftedKeys.shift();
181
+ afterJump = getOutKey(firstKey);
182
+ }
183
+ result.push({
184
+ type: "cut",
185
+ key1: { frame: part.startFrame, value: getOutKey(previousKey).value },
186
+ key2: afterJump,
187
+ });
188
+ }
189
+ result.push(...shiftedKeys);
190
+ });
191
+ return result;
192
+ }
193
+ function mergeFrameItems(parts, getItems) {
194
+ if (!parts.some((part) => getItems(part.track))) {
195
+ return getItems(parts[0].track);
196
+ }
197
+ return parts.flatMap((part) => {
198
+ return (getItems(part.track) ?? []).map((item) => ({ ...item, frame: item.frame + part.startFrame }));
199
+ });
200
+ }
201
+ function shiftKey(key, frames) {
202
+ if (isCinematicKeyCut(key)) {
203
+ return {
204
+ ...key,
205
+ key1: { ...key.key1, frame: key.key1.frame + frames },
206
+ key2: { ...key.key2, frame: key.key2.frame + frames },
207
+ };
208
+ }
209
+ return { ...key, frame: key.frame + frames };
210
+ }
211
+ function getKeyFrame(key) {
212
+ return isCinematicKeyCut(key) ? key.key1.frame : key.frame;
213
+ }
214
+ /**
215
+ * Returns the key that gives the value before the given key: the first key of a cut.
216
+ */
217
+ function getInKey(key) {
218
+ return isCinematicKeyCut(key) ? key.key1 : key;
219
+ }
220
+ /**
221
+ * Returns the key that gives the value after the given key: the second key of a cut.
222
+ */
223
+ function getOutKey(key) {
224
+ return isCinematicKeyCut(key) ? key.key2 : key;
225
+ }
226
+ //# sourceMappingURL=sequences.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sequences.js","sourceRoot":"","sources":["../../../src/cinematic/sequences.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAG7C;;GAEG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,YAAY,CAAC;AAEzD;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CAAC,SAAqB;IAC1D,OAAO,SAAS,CAAC,SAAS,IAAI,CAAC,EAAE,IAAI,EAAE,4BAA4B,EAAE,MAAM,EAAE,SAAS,CAAC,MAAM,IAAI,EAAE,EAAE,CAAC,CAAC;AACxG,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,qCAAqC,CAAC,cAAwC;IAC7F,MAAM,WAAW,GAAG,CAAC,cAAc,CAAC,QAAQ,GAAG,cAAc,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,cAAc,CAAC,WAAW,IAAI,CAAC,CAAC,CAAC,CAAC;IACpH,OAAO,WAAW,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,cAAc,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;AAC5D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G,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;IACvG,CAAC,CAAC,CAAC;AACJ,CAAC;AAED,SAAS,QAAQ,CAAC,GAAqC,EAAE,MAAc;IACtE,IAAI,iBAAiB,CAAC,GAAG,CAAC,EAAE,CAAC;QAC5B,OAAO;YACN,GAAG,GAAG;YACN,IAAI,EAAE,EAAE,GAAG,GAAG,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,CAAC,IAAI,CAAC,KAAK,GAAG,MAAM,EAAE;YACrD,IAAI,EAAE,EAAE,GAAG,GAAG,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,CAAC,IAAI,CAAC,KAAK,GAAG,MAAM,EAAE;SACrD,CAAC;IACH,CAAC;IAED,OAAO,EAAE,GAAG,GAAG,EAAE,KAAK,EAAE,GAAG,CAAC,KAAK,GAAG,MAAM,EAAE,CAAC;AAC9C,CAAC;AAED,SAAS,WAAW,CAAC,GAAqC;IACzD,OAAO,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC;AAC5D,CAAC;AAED;;GAEG;AACH,SAAS,QAAQ,CAAC,GAAqC;IACtD,OAAO,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC;AAChD,CAAC;AAED;;GAEG;AACH,SAAS,SAAS,CAAC,GAAqC;IACvD,OAAO,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC;AAChD,CAAC"}
@@ -42,6 +42,7 @@ export * from "./script";
42
42
  export * from "./cinematic/parse";
43
43
  export * from "./cinematic/typings";
44
44
  export * from "./cinematic/generate";
45
+ export * from "./cinematic/sequences";
45
46
  export * from "./cinematic/guards";
46
47
  export * from "./cinematic/cinematic";
47
48
  export * from "./loading/database/indexdb";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AAEtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AAEnC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,6BAA6B,CAAC;AAE5C,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AAEzC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAEhC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AACxC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,iCAAiC,CAAC;AAEhD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,iCAAiC,CAAC;AAChD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,iCAAiC,CAAC;AAEhD,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAElC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AAEpC,cAAc,UAAU,CAA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