gaussian-splat-lite 1.2.2 → 1.3.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 (250) hide show
  1. package/CHANGELOG.md +61 -2
  2. package/CONTRIBUTING.md +4 -2
  3. package/README.md +4 -3
  4. package/dist/gaussian-splat-lite.cjs +6782 -1661
  5. package/dist/gaussian-splat-lite.cjs.map +1 -1
  6. package/dist/gaussian-splat-lite.min.cjs +991 -15
  7. package/dist/gaussian-splat-lite.min.cjs.map +1 -1
  8. package/dist/gaussian-splat-lite.module.js +6328 -1207
  9. package/dist/gaussian-splat-lite.module.js.map +1 -1
  10. package/dist/gaussian-splat-lite.module.min.js +8208 -3572
  11. package/dist/gaussian-splat-lite.module.min.js.map +1 -1
  12. package/dist/types/addons/NeuralDenoiseNode.d.cts +72 -0
  13. package/dist/types/addons/NeuralDenoiseNode.d.ts +72 -0
  14. package/dist/types/addons/NeuralDenoisePass.d.cts +34 -0
  15. package/dist/types/addons/NeuralDenoisePass.d.ts +34 -0
  16. package/dist/types/addons/TAANode.d.cts +46 -33
  17. package/dist/types/addons/TAANode.d.ts +46 -33
  18. package/dist/types/addons/TAAPass.d.cts +47 -32
  19. package/dist/types/addons/TAAPass.d.ts +47 -32
  20. package/dist/types/addons/neuralDenoiseGL.d.cts +25 -0
  21. package/dist/types/addons/neuralDenoiseGL.d.ts +25 -0
  22. package/dist/types/addons/neuralDenoiseGLSL.d.cts +8 -0
  23. package/dist/types/addons/neuralDenoiseGLSL.d.ts +8 -0
  24. package/dist/types/addons/neuralDenoisePasses.d.cts +26 -0
  25. package/dist/types/addons/neuralDenoisePasses.d.ts +26 -0
  26. package/dist/types/addons/neuralDenoiseShaders.d.cts +38 -0
  27. package/dist/types/addons/neuralDenoiseShaders.d.ts +38 -0
  28. package/dist/types/addons/neuralDenoiseWeights.d.cts +118 -0
  29. package/dist/types/addons/neuralDenoiseWeights.d.ts +118 -0
  30. package/dist/types/addons/stochasticCoverage.d.cts +14 -0
  31. package/dist/types/addons/stochasticCoverage.d.ts +14 -0
  32. package/dist/types/addons/taaShared.d.cts +58 -39
  33. package/dist/types/addons/taaShared.d.ts +58 -39
  34. package/dist/types/capture/SplatCapture.d.cts +54 -53
  35. package/dist/types/capture/SplatCapture.d.ts +54 -53
  36. package/dist/types/capture/WebGLCapture.d.cts +10 -10
  37. package/dist/types/capture/WebGLCapture.d.ts +10 -10
  38. package/dist/types/capture/WebGPUCapture.d.cts +14 -14
  39. package/dist/types/capture/WebGPUCapture.d.ts +14 -14
  40. package/dist/types/capture/pixels.d.cts +15 -4
  41. package/dist/types/capture/pixels.d.ts +15 -4
  42. package/dist/types/capture/rendererState.d.cts +5 -2
  43. package/dist/types/capture/rendererState.d.ts +5 -2
  44. package/dist/types/data/IndexedSplats.d.cts +83 -58
  45. package/dist/types/data/IndexedSplats.d.ts +83 -58
  46. package/dist/types/data/RadPagedSplats.d.cts +66 -61
  47. package/dist/types/data/RadPagedSplats.d.ts +66 -61
  48. package/dist/types/data/SogRegionSplats.d.cts +25 -19
  49. package/dist/types/data/SogRegionSplats.d.ts +25 -19
  50. package/dist/types/data/SplatOpacityTable.d.cts +36 -29
  51. package/dist/types/data/SplatOpacityTable.d.ts +36 -29
  52. package/dist/types/data/Splats.d.cts +99 -69
  53. package/dist/types/data/Splats.d.ts +99 -69
  54. package/dist/types/data/defines.d.cts +24 -24
  55. package/dist/types/data/defines.d.ts +24 -24
  56. package/dist/types/data/raycast.d.cts +13 -9
  57. package/dist/types/data/raycast.d.ts +13 -9
  58. package/dist/types/data/splatCodec.d.cts +29 -5
  59. package/dist/types/data/splatCodec.d.ts +29 -5
  60. package/dist/types/data/splatData.d.cts +18 -11
  61. package/dist/types/data/splatData.d.ts +18 -11
  62. package/dist/types/data/splatRange.d.cts +6 -2
  63. package/dist/types/data/splatRange.d.ts +6 -2
  64. package/dist/types/data/textureLayout.d.cts +9 -6
  65. package/dist/types/data/textureLayout.d.ts +9 -6
  66. package/dist/types/data/unpack.d.cts +16 -9
  67. package/dist/types/data/unpack.d.ts +16 -9
  68. package/dist/types/index.d.cts +65 -19
  69. package/dist/types/index.d.ts +65 -19
  70. package/dist/types/loaders/SplatLoader.d.cts +27 -14
  71. package/dist/types/loaders/SplatLoader.d.ts +27 -14
  72. package/dist/types/loaders/loadSplatData.d.cts +35 -17
  73. package/dist/types/loaders/loadSplatData.d.ts +35 -17
  74. package/dist/types/loaders/loadTypes.d.cts +46 -40
  75. package/dist/types/loaders/loadTypes.d.ts +46 -40
  76. package/dist/types/loaders/morton.d.cts +9 -3
  77. package/dist/types/loaders/morton.d.ts +9 -3
  78. package/dist/types/loaders/postDecode/builder.d.cts +222 -127
  79. package/dist/types/loaders/postDecode/builder.d.ts +222 -127
  80. package/dist/types/loaders/postDecode/compiler.d.cts +25 -11
  81. package/dist/types/loaders/postDecode/compiler.d.ts +25 -11
  82. package/dist/types/loaders/postDecode/operations.d.cts +22 -3
  83. package/dist/types/loaders/postDecode/operations.d.ts +22 -3
  84. package/dist/types/loaders/postDecode/optimizer.d.cts +5 -2
  85. package/dist/types/loaders/postDecode/optimizer.d.ts +5 -2
  86. package/dist/types/loaders/postDecode/program.d.cts +13 -6
  87. package/dist/types/loaders/postDecode/program.d.ts +13 -6
  88. package/dist/types/loaders/postDecode/protocol.d.cts +136 -111
  89. package/dist/types/loaders/postDecode/protocol.d.ts +136 -111
  90. package/dist/types/loaders/postDecode/registers.d.cts +12 -7
  91. package/dist/types/loaders/postDecode/registers.d.ts +12 -7
  92. package/dist/types/loaders/postDecode/runtime.d.cts +9 -2
  93. package/dist/types/loaders/postDecode/runtime.d.ts +9 -2
  94. package/dist/types/loaders/rad/RadSource.d.cts +81 -66
  95. package/dist/types/loaders/rad/RadSource.d.ts +81 -66
  96. package/dist/types/loaders/rad/radFormat.d.cts +41 -36
  97. package/dist/types/loaders/rad/radFormat.d.ts +41 -36
  98. package/dist/types/loaders/rad.d.cts +4 -4
  99. package/dist/types/loaders/rad.d.ts +4 -4
  100. package/dist/types/loaders/sog/SogSource.d.cts +14 -4
  101. package/dist/types/loaders/sog/SogSource.d.ts +14 -4
  102. package/dist/types/loaders/sog/sogZip.d.cts +12 -12
  103. package/dist/types/loaders/sog/sogZip.d.ts +12 -12
  104. package/dist/types/loaders/sog.d.cts +3 -3
  105. package/dist/types/loaders/sog.d.ts +3 -3
  106. package/dist/types/loaders/source.d.cts +43 -15
  107. package/dist/types/loaders/source.d.ts +43 -15
  108. package/dist/types/loaders/stream/StreamCameras.d.cts +27 -18
  109. package/dist/types/loaders/stream/StreamCameras.d.ts +27 -18
  110. package/dist/types/loaders/stream/StreamWorkerPool.d.cts +37 -37
  111. package/dist/types/loaders/stream/StreamWorkerPool.d.ts +37 -37
  112. package/dist/types/loaders/stream/rad-stream/RadSelectionState.d.cts +20 -13
  113. package/dist/types/loaders/stream/rad-stream/RadSelectionState.d.ts +20 -13
  114. package/dist/types/loaders/stream/rad-stream/RadStreamBatch.d.cts +13 -9
  115. package/dist/types/loaders/stream/rad-stream/RadStreamBatch.d.ts +13 -9
  116. package/dist/types/loaders/stream/rad-stream/RadStreamLoader.d.cts +69 -51
  117. package/dist/types/loaders/stream/rad-stream/RadStreamLoader.d.ts +69 -51
  118. package/dist/types/loaders/stream/rad-stream/RadStreamScheduler.d.cts +126 -102
  119. package/dist/types/loaders/stream/rad-stream/RadStreamScheduler.d.ts +126 -102
  120. package/dist/types/loaders/stream/rad-stream/RadStreamWorker.d.cts +4 -4
  121. package/dist/types/loaders/stream/rad-stream/RadStreamWorker.d.ts +4 -4
  122. package/dist/types/loaders/stream/rad-stream/prepareRadSelection.d.cts +20 -17
  123. package/dist/types/loaders/stream/rad-stream/prepareRadSelection.d.ts +20 -17
  124. package/dist/types/loaders/stream/rad-stream/radFade.d.cts +13 -8
  125. package/dist/types/loaders/stream/rad-stream/radFade.d.ts +13 -8
  126. package/dist/types/loaders/stream/rad-stream/radLod.d.cts +29 -27
  127. package/dist/types/loaders/stream/rad-stream/radLod.d.ts +29 -27
  128. package/dist/types/loaders/stream/rad-stream/worker.d.cts +3 -59
  129. package/dist/types/loaders/stream/rad-stream/worker.d.ts +3 -59
  130. package/dist/types/loaders/stream/rad-stream/workerHandlers.d.cts +58 -61
  131. package/dist/types/loaders/stream/rad-stream/workerHandlers.d.ts +58 -61
  132. package/dist/types/loaders/stream/sog-stream/SogStreamBatch.d.cts +16 -12
  133. package/dist/types/loaders/stream/sog-stream/SogStreamBatch.d.ts +16 -12
  134. package/dist/types/loaders/stream/sog-stream/SogStreamLoader.d.cts +56 -41
  135. package/dist/types/loaders/stream/sog-stream/SogStreamLoader.d.ts +56 -41
  136. package/dist/types/loaders/stream/sog-stream/SogStreamScheduler.d.cts +102 -81
  137. package/dist/types/loaders/stream/sog-stream/SogStreamScheduler.d.ts +102 -81
  138. package/dist/types/loaders/stream/sog-stream/SogStreamWorker.d.cts +3 -3
  139. package/dist/types/loaders/stream/sog-stream/SogStreamWorker.d.ts +3 -3
  140. package/dist/types/loaders/stream/sog-stream/sogLod.d.cts +67 -46
  141. package/dist/types/loaders/stream/sog-stream/sogLod.d.ts +67 -46
  142. package/dist/types/loaders/stream/sog-stream/sogVisibility.d.cts +28 -22
  143. package/dist/types/loaders/stream/sog-stream/sogVisibility.d.ts +28 -22
  144. package/dist/types/loaders/stream/sog-stream/worker.d.cts +7 -40
  145. package/dist/types/loaders/stream/sog-stream/worker.d.ts +7 -40
  146. package/dist/types/loaders/stream/sog-stream/workerHandlers.d.cts +63 -44
  147. package/dist/types/loaders/stream/sog-stream/workerHandlers.d.ts +63 -44
  148. package/dist/types/loaders/stream/streamOptions.d.cts +43 -33
  149. package/dist/types/loaders/stream/streamOptions.d.ts +43 -33
  150. package/dist/types/loaders/workerDecode.d.cts +30 -12
  151. package/dist/types/loaders/workerDecode.d.ts +30 -12
  152. package/dist/types/patches/threeR186.d.cts +3 -0
  153. package/dist/types/patches/threeR186.d.ts +3 -0
  154. package/dist/types/rendering/GaussianSplatRenderer.d.cts +393 -376
  155. package/dist/types/rendering/GaussianSplatRenderer.d.ts +393 -376
  156. package/dist/types/rendering/MaterialState.d.cts +9 -0
  157. package/dist/types/rendering/MaterialState.d.ts +9 -0
  158. package/dist/types/rendering/SortCenterCache.d.cts +17 -17
  159. package/dist/types/rendering/SortCenterCache.d.ts +17 -17
  160. package/dist/types/rendering/SplatAccumulator.d.cts +93 -77
  161. package/dist/types/rendering/SplatAccumulator.d.ts +93 -77
  162. package/dist/types/rendering/SplatGeometry.d.cts +2 -2
  163. package/dist/types/rendering/SplatGeometry.d.ts +2 -2
  164. package/dist/types/rendering/StochasticSplatMaterial.d.cts +14 -0
  165. package/dist/types/rendering/StochasticSplatMaterial.d.ts +14 -0
  166. package/dist/types/rendering/backend.d.cts +30 -18
  167. package/dist/types/rendering/backend.d.ts +30 -18
  168. package/dist/types/rendering/blueNoise.d.cts +1 -1
  169. package/dist/types/rendering/blueNoise.d.ts +1 -1
  170. package/dist/types/rendering/rendererUtils.d.cts +25 -10
  171. package/dist/types/rendering/rendererUtils.d.ts +25 -10
  172. package/dist/types/rendering/tsl/GenerateProgram.d.cts +19 -17
  173. package/dist/types/rendering/tsl/GenerateProgram.d.ts +19 -17
  174. package/dist/types/rendering/tsl/ProjectionProgram.d.cts +38 -33
  175. package/dist/types/rendering/tsl/ProjectionProgram.d.ts +38 -33
  176. package/dist/types/rendering/tsl/SplatBackend.d.cts +22 -10
  177. package/dist/types/rendering/tsl/SplatBackend.d.ts +22 -10
  178. package/dist/types/rendering/tsl/SplatMaterial.d.cts +38 -25
  179. package/dist/types/rendering/tsl/SplatMaterial.d.ts +38 -25
  180. package/dist/types/rendering/tsl/shaderUtils.d.cts +55 -17
  181. package/dist/types/rendering/tsl/shaderUtils.d.ts +55 -17
  182. package/dist/types/rendering/tsl/stochasticCoverage.d.cts +7 -0
  183. package/dist/types/rendering/tsl/stochasticCoverage.d.ts +7 -0
  184. package/dist/types/rendering/tsl/viewUniforms.d.cts +19 -9
  185. package/dist/types/rendering/tsl/viewUniforms.d.ts +19 -9
  186. package/dist/types/rendering/uniforms.d.cts +83 -83
  187. package/dist/types/rendering/uniforms.d.ts +83 -83
  188. package/dist/types/rendering/webgl/AccumulatorGenerator.d.cts +28 -12
  189. package/dist/types/rendering/webgl/AccumulatorGenerator.d.ts +28 -12
  190. package/dist/types/rendering/webgl/OrderingTexture.d.cts +10 -7
  191. package/dist/types/rendering/webgl/OrderingTexture.d.ts +10 -7
  192. package/dist/types/rendering/webgl/SplatBackend.d.cts +20 -15
  193. package/dist/types/rendering/webgl/SplatBackend.d.ts +20 -15
  194. package/dist/types/rendering/webgl/SplatMaterial.d.cts +9 -4
  195. package/dist/types/rendering/webgl/SplatMaterial.d.ts +9 -4
  196. package/dist/types/rendering/webgl/textureUtils.d.cts +10 -3
  197. package/dist/types/rendering/webgl/textureUtils.d.ts +10 -3
  198. package/dist/types/rendering/webgl-fallback/AccumulatorGenerator.d.cts +8 -10
  199. package/dist/types/rendering/webgl-fallback/AccumulatorGenerator.d.ts +8 -10
  200. package/dist/types/rendering/webgl-fallback/SplatBackend.d.cts +18 -14
  201. package/dist/types/rendering/webgl-fallback/SplatBackend.d.ts +18 -14
  202. package/dist/types/rendering/webgpu/ProjectedSplats.d.cts +76 -66
  203. package/dist/types/rendering/webgpu/ProjectedSplats.d.ts +76 -66
  204. package/dist/types/rendering/webgpu/ProjectionCache.d.cts +43 -28
  205. package/dist/types/rendering/webgpu/ProjectionCache.d.ts +43 -28
  206. package/dist/types/rendering/webgpu/ProjectionKernel.d.cts +22 -0
  207. package/dist/types/rendering/webgpu/ProjectionKernel.d.ts +22 -0
  208. package/dist/types/rendering/webgpu/RadixSort.d.cts +44 -40
  209. package/dist/types/rendering/webgpu/RadixSort.d.ts +44 -40
  210. package/dist/types/rendering/webgpu/SplatBackend.d.cts +14 -12
  211. package/dist/types/rendering/webgpu/SplatBackend.d.ts +14 -12
  212. package/dist/types/runtime/SplatWorker.d.cts +17 -13
  213. package/dist/types/runtime/SplatWorker.d.ts +17 -13
  214. package/dist/types/runtime/WorkerRpc.d.cts +26 -20
  215. package/dist/types/runtime/WorkerRpc.d.ts +26 -20
  216. package/dist/types/runtime/abort.d.cts +10 -5
  217. package/dist/types/runtime/abort.d.ts +10 -5
  218. package/dist/types/runtime/retry.d.cts +6 -6
  219. package/dist/types/runtime/retry.d.ts +6 -6
  220. package/dist/types/runtime/wasmCall.d.cts +3 -3
  221. package/dist/types/runtime/wasmCall.d.ts +3 -3
  222. package/dist/types/runtime/worker.d.cts +44 -24
  223. package/dist/types/runtime/worker.d.ts +44 -24
  224. package/dist/types/runtime/workerServer.d.cts +3 -1
  225. package/dist/types/runtime/workerServer.d.ts +3 -1
  226. package/dist/types/scene/SplatEdit.d.cts +74 -67
  227. package/dist/types/scene/SplatEdit.d.ts +74 -67
  228. package/dist/types/scene/SplatMesh.d.cts +92 -70
  229. package/dist/types/scene/SplatMesh.d.ts +92 -70
  230. package/dist/types/utils/index.d.cts +15 -7
  231. package/dist/types/utils/index.d.ts +15 -7
  232. package/dist/types/utils/three.d.cts +3 -3
  233. package/dist/types/utils/three.d.ts +3 -3
  234. package/dist/types/utils/transforms.d.cts +10 -3
  235. package/dist/types/utils/transforms.d.ts +10 -3
  236. package/docs/GaussianSplatRenderer.md +3 -1
  237. package/docs/NeuralDenoiseNode.md +148 -0
  238. package/docs/RadStreamScheduler.md +14 -5
  239. package/docs/SogStreamScheduler.md +8 -6
  240. package/docs/SplatMesh.md +1 -1
  241. package/docs/StochasticRendering.md +36 -10
  242. package/docs/TAAPass.md +20 -3
  243. package/package.json +9 -11
  244. package/dist/types/capture/sceneView.d.cts +0 -3
  245. package/dist/types/capture/sceneView.d.ts +0 -3
  246. package/dist/types/loaders/stream/StreamByteBudget.d.cts +0 -7
  247. package/dist/types/loaders/stream/StreamByteBudget.d.ts +0 -7
  248. package/dist/types/rendering/tsl/tslCompat.d.cts +0 -68
  249. package/dist/types/rendering/tsl/tslCompat.d.ts +0 -68
  250. package/docs/Architecture.md +0 -200
@@ -0,0 +1,26 @@
1
+ import type { NeuralDenoiseModel } from "./neuralDenoiseWeights.js";
2
+ /** Shared pass order and state layout for the two graphics APIs. */
3
+ export declare class NeuralDenoisePasses {
4
+ uniforms: Float32Array;
5
+ halfBias: number;
6
+ protected initialize(
7
+ model: NeuralDenoiseModel,
8
+ multisampled: boolean,
9
+ ): string;
10
+ }
11
+ export declare class WebGPUDenoisePasses extends NeuralDenoisePasses {
12
+ constructor(device: object, model: NeuralDenoiseModel, multisampled: boolean);
13
+ render(
14
+ width: number,
15
+ height: number,
16
+ external: {
17
+ color: object;
18
+ depth: object;
19
+ exposed: object | null;
20
+ history: object[];
21
+ encode: boolean;
22
+ },
23
+ previous: number,
24
+ ): void;
25
+ dispose(): void;
26
+ }
@@ -0,0 +1,38 @@
1
+ import type { NeuralDenoiseModel } from "./neuralDenoiseWeights.cjs";
2
+ /** Floats in the uniform block shared by every pass; see PARAMS below. */
3
+ export declare const NEURAL_DENOISE_UNIFORM_FLOATS = 68;
4
+ /**
5
+ * The WGSL of every pass, with the trained weights written in as constants.
6
+ * Each fragment shader's bindings are: the uniform block, a linear sampler,
7
+ * then its textures in the order they are declared.
8
+ *
9
+ * Both modes keep view depth per 2x2 block. The network runs on 4x4 blocks,
10
+ * followed by per-pixel reprojection, filtering, blending and stabilization.
11
+ * Performance uses fixed local filtering and simpler history sampling;
12
+ * Quality uses learned multiscale filtering.
13
+ */
14
+ export declare function neuralDenoiseShaders(
15
+ weights: NeuralDenoiseModel,
16
+ multisampled?: boolean,
17
+ ): NeuralDenoiseShaders;
18
+ type NeuralDenoiseShaders = {
19
+ cells: string;
20
+ wider: string;
21
+ depth: string;
22
+ expose: string;
23
+ encode: string;
24
+ downsample: string;
25
+ features: string;
26
+ stage: string;
27
+ predict: string;
28
+ resolve: string;
29
+ rounding: string;
30
+ filter: {
31
+ encode: string[];
32
+ kernel: string[];
33
+ top: string;
34
+ groups: number;
35
+ };
36
+ groups: number;
37
+ };
38
+ export {};
@@ -0,0 +1,38 @@
1
+ import type { NeuralDenoiseModel } from "./neuralDenoiseWeights.js";
2
+ /** Floats in the uniform block shared by every pass; see PARAMS below. */
3
+ export declare const NEURAL_DENOISE_UNIFORM_FLOATS = 68;
4
+ /**
5
+ * The WGSL of every pass, with the trained weights written in as constants.
6
+ * Each fragment shader's bindings are: the uniform block, a linear sampler,
7
+ * then its textures in the order they are declared.
8
+ *
9
+ * Both modes keep view depth per 2x2 block. The network runs on 4x4 blocks,
10
+ * followed by per-pixel reprojection, filtering, blending and stabilization.
11
+ * Performance uses fixed local filtering and simpler history sampling;
12
+ * Quality uses learned multiscale filtering.
13
+ */
14
+ export declare function neuralDenoiseShaders(
15
+ weights: NeuralDenoiseModel,
16
+ multisampled?: boolean,
17
+ ): NeuralDenoiseShaders;
18
+ type NeuralDenoiseShaders = {
19
+ cells: string;
20
+ wider: string;
21
+ depth: string;
22
+ expose: string;
23
+ encode: string;
24
+ downsample: string;
25
+ features: string;
26
+ stage: string;
27
+ predict: string;
28
+ resolve: string;
29
+ rounding: string;
30
+ filter: {
31
+ encode: string[];
32
+ kernel: string[];
33
+ top: string;
34
+ groups: number;
35
+ };
36
+ groups: number;
37
+ };
38
+ export {};
@@ -0,0 +1,118 @@
1
+ /** One layer: weights in PyTorch's order (output, input, row, column), then biases. */
2
+ export type NeuralDenoiseLayer = {
3
+ w: number[];
4
+ b: number[];
5
+ };
6
+ /**
7
+ * A trained model behind NeuralDenoiseNode: the trust network, the spatial
8
+ * filter and gate's gain, with the constants it was trained under.
9
+ * Trained on this renderer's stochastic frames.
10
+ */
11
+ export type NeuralDenoiseModel = {
12
+ /** Use fixed local filtering without learned multiscale passes. */
13
+ compact?: boolean;
14
+ /** Strengthen display stabilization for single-sample stochastic noise. */
15
+ stabilizeNoise?: boolean;
16
+ /** Gain of the variance gate between the two history paths. */
17
+ gamma: number;
18
+ /** Longest history of the accumulated and of the denoised path, in frames. */
19
+ accumulatedFrames: number;
20
+ denoisedFrames: number;
21
+ /** Frames after which the gate starts to prefer the accumulated path. */
22
+ gateFrames: number;
23
+ /** Screen motion in pixels at which the motion input reads one half. */
24
+ motionKnee: number;
25
+ /** Stabilization: the largest blend with the previous image, and the clamp's slack. */
26
+ stabilizeBlend: number;
27
+ stabilizeSlack: number;
28
+ /** Lengths, in frames, of the four running means of the evidence that history lags. */
29
+ evidenceFrames: number[];
30
+ /**
31
+ * The frames of denoised history under which, where the camera changes the
32
+ * image fast, the denoised path takes the learned filter's half-resolution
33
+ * result in place of the filtered frame.
34
+ */
35
+ reach: number;
36
+ /**
37
+ * The relative difference in view depth beyond which the place a pixel
38
+ * reads its history from held another surface, whose history the pixel
39
+ * then drops, and the camera motion, in pixels per frame, at which that
40
+ * test has half its say: it is void on a still view.
41
+ */
42
+ surfaceApart: number;
43
+ surfaceKnee: number;
44
+ /** Share of rejected-surface fallback taken from the fixed 4x4 mean. */
45
+ surfaceWide: number;
46
+ /**
47
+ * For a block where too little was drawn for a depth of its own: how many
48
+ * drawn pixels a cell around it needs before it lends the block their
49
+ * depth, how far their disparities may spread about their mean, the
50
+ * accumulated history such a block keeps while the camera moves, in
51
+ * frames, and the camera motion, in pixels per frame, at which that limit
52
+ * has half its say. With `sparseWide` the block's denoised path takes the
53
+ * wider filter's result while its own history is short.
54
+ */
55
+ lendLeast: number;
56
+ lendSpread: number;
57
+ sparseFrames: number;
58
+ sparseKnee: number;
59
+ /** Remaining display-history blend at full sparse camera motion. */
60
+ sparseStabilize: number;
61
+ sparseWide: boolean;
62
+ /**
63
+ * The learned spatial filter: a 3x3 kernel predicted at each level of
64
+ * the frame's image pyramid, coarsest first, and then at full resolution.
65
+ * `levels[0]` is the half-resolution level. A level's `encode` takes its
66
+ * colour, the result of the level below, the noise at its scale and the
67
+ * hidden channels of the level below (the last level has no level below);
68
+ * `head`, and `top` at full resolution, give the nine kernel weights and
69
+ * the share of the filtered image to keep over the level below.
70
+ */
71
+ filter: {
72
+ /**
73
+ * Set on a filter whose full-resolution kernel can leave a single sample
74
+ * out: `top` then has two more inputs (how far the pixel is from the
75
+ * half-resolution result in luma, signed and unsigned) and an eleventh
76
+ * output, the rate at which a tap loses weight with its own distance from
77
+ * that result. This is the scale of that rate.
78
+ */
79
+ robust?: number;
80
+ levels: {
81
+ encode: NeuralDenoiseLayer;
82
+ depthwise: NeuralDenoiseLayer;
83
+ pointwise: NeuralDenoiseLayer;
84
+ head: NeuralDenoiseLayer;
85
+ }[];
86
+ top: NeuralDenoiseLayer;
87
+ };
88
+ /** Optional pixel-local logit correction: twelve inputs, four hidden channels, four outputs. */
89
+ correction?: {
90
+ hidden: NeuralDenoiseLayer;
91
+ out: NeuralDenoiseLayer;
92
+ };
93
+ /**
94
+ * 28 inputs to five outputs: trust in the accumulated history, the
95
+ * stabilization blend, the accumulated path's share of the gate, the
96
+ * strength of the spatial filter, and trust in the denoised history. The
97
+ * hidden layers have 8 or 16 channels; `blocks` are extra residual blocks
98
+ * between the two stages every model has.
99
+ */
100
+ network: {
101
+ encode: NeuralDenoiseLayer;
102
+ depthwise1: NeuralDenoiseLayer;
103
+ pointwise1: NeuralDenoiseLayer;
104
+ pointwise2: NeuralDenoiseLayer;
105
+ blocks: {
106
+ depthwise: NeuralDenoiseLayer;
107
+ pointwise1: NeuralDenoiseLayer;
108
+ pointwise2: NeuralDenoiseLayer;
109
+ }[];
110
+ depthwise2: NeuralDenoiseLayer;
111
+ pointwise3: NeuralDenoiseLayer;
112
+ head: NeuralDenoiseLayer;
113
+ };
114
+ };
115
+ export declare const neuralDenoiseModels: {
116
+ quality: NeuralDenoiseModel;
117
+ performance: NeuralDenoiseModel;
118
+ };
@@ -0,0 +1,118 @@
1
+ /** One layer: weights in PyTorch's order (output, input, row, column), then biases. */
2
+ export type NeuralDenoiseLayer = {
3
+ w: number[];
4
+ b: number[];
5
+ };
6
+ /**
7
+ * A trained model behind NeuralDenoiseNode: the trust network, the spatial
8
+ * filter and gate's gain, with the constants it was trained under.
9
+ * Trained on this renderer's stochastic frames.
10
+ */
11
+ export type NeuralDenoiseModel = {
12
+ /** Use fixed local filtering without learned multiscale passes. */
13
+ compact?: boolean;
14
+ /** Strengthen display stabilization for single-sample stochastic noise. */
15
+ stabilizeNoise?: boolean;
16
+ /** Gain of the variance gate between the two history paths. */
17
+ gamma: number;
18
+ /** Longest history of the accumulated and of the denoised path, in frames. */
19
+ accumulatedFrames: number;
20
+ denoisedFrames: number;
21
+ /** Frames after which the gate starts to prefer the accumulated path. */
22
+ gateFrames: number;
23
+ /** Screen motion in pixels at which the motion input reads one half. */
24
+ motionKnee: number;
25
+ /** Stabilization: the largest blend with the previous image, and the clamp's slack. */
26
+ stabilizeBlend: number;
27
+ stabilizeSlack: number;
28
+ /** Lengths, in frames, of the four running means of the evidence that history lags. */
29
+ evidenceFrames: number[];
30
+ /**
31
+ * The frames of denoised history under which, where the camera changes the
32
+ * image fast, the denoised path takes the learned filter's half-resolution
33
+ * result in place of the filtered frame.
34
+ */
35
+ reach: number;
36
+ /**
37
+ * The relative difference in view depth beyond which the place a pixel
38
+ * reads its history from held another surface, whose history the pixel
39
+ * then drops, and the camera motion, in pixels per frame, at which that
40
+ * test has half its say: it is void on a still view.
41
+ */
42
+ surfaceApart: number;
43
+ surfaceKnee: number;
44
+ /** Share of rejected-surface fallback taken from the fixed 4x4 mean. */
45
+ surfaceWide: number;
46
+ /**
47
+ * For a block where too little was drawn for a depth of its own: how many
48
+ * drawn pixels a cell around it needs before it lends the block their
49
+ * depth, how far their disparities may spread about their mean, the
50
+ * accumulated history such a block keeps while the camera moves, in
51
+ * frames, and the camera motion, in pixels per frame, at which that limit
52
+ * has half its say. With `sparseWide` the block's denoised path takes the
53
+ * wider filter's result while its own history is short.
54
+ */
55
+ lendLeast: number;
56
+ lendSpread: number;
57
+ sparseFrames: number;
58
+ sparseKnee: number;
59
+ /** Remaining display-history blend at full sparse camera motion. */
60
+ sparseStabilize: number;
61
+ sparseWide: boolean;
62
+ /**
63
+ * The learned spatial filter: a 3x3 kernel predicted at each level of
64
+ * the frame's image pyramid, coarsest first, and then at full resolution.
65
+ * `levels[0]` is the half-resolution level. A level's `encode` takes its
66
+ * colour, the result of the level below, the noise at its scale and the
67
+ * hidden channels of the level below (the last level has no level below);
68
+ * `head`, and `top` at full resolution, give the nine kernel weights and
69
+ * the share of the filtered image to keep over the level below.
70
+ */
71
+ filter: {
72
+ /**
73
+ * Set on a filter whose full-resolution kernel can leave a single sample
74
+ * out: `top` then has two more inputs (how far the pixel is from the
75
+ * half-resolution result in luma, signed and unsigned) and an eleventh
76
+ * output, the rate at which a tap loses weight with its own distance from
77
+ * that result. This is the scale of that rate.
78
+ */
79
+ robust?: number;
80
+ levels: {
81
+ encode: NeuralDenoiseLayer;
82
+ depthwise: NeuralDenoiseLayer;
83
+ pointwise: NeuralDenoiseLayer;
84
+ head: NeuralDenoiseLayer;
85
+ }[];
86
+ top: NeuralDenoiseLayer;
87
+ };
88
+ /** Optional pixel-local logit correction: twelve inputs, four hidden channels, four outputs. */
89
+ correction?: {
90
+ hidden: NeuralDenoiseLayer;
91
+ out: NeuralDenoiseLayer;
92
+ };
93
+ /**
94
+ * 28 inputs to five outputs: trust in the accumulated history, the
95
+ * stabilization blend, the accumulated path's share of the gate, the
96
+ * strength of the spatial filter, and trust in the denoised history. The
97
+ * hidden layers have 8 or 16 channels; `blocks` are extra residual blocks
98
+ * between the two stages every model has.
99
+ */
100
+ network: {
101
+ encode: NeuralDenoiseLayer;
102
+ depthwise1: NeuralDenoiseLayer;
103
+ pointwise1: NeuralDenoiseLayer;
104
+ pointwise2: NeuralDenoiseLayer;
105
+ blocks: {
106
+ depthwise: NeuralDenoiseLayer;
107
+ pointwise1: NeuralDenoiseLayer;
108
+ pointwise2: NeuralDenoiseLayer;
109
+ }[];
110
+ depthwise2: NeuralDenoiseLayer;
111
+ pointwise3: NeuralDenoiseLayer;
112
+ head: NeuralDenoiseLayer;
113
+ };
114
+ };
115
+ export declare const neuralDenoiseModels: {
116
+ quality: NeuralDenoiseModel;
117
+ performance: NeuralDenoiseModel;
118
+ };
@@ -0,0 +1,14 @@
1
+ import type { Camera, Scene, WebGLRenderer } from "three";
2
+ import type { Renderer } from "three/webgpu";
3
+ /** Four coverage decisions in one fragment, resolved by 4x MSAA. */
4
+ export declare class StochasticCoverage {
5
+ private readonly materials;
6
+ constructor();
7
+ private material;
8
+ render(
9
+ renderer: Renderer | WebGLRenderer,
10
+ scene: Scene,
11
+ camera: Camera,
12
+ ): void;
13
+ dispose(): void;
14
+ }
@@ -0,0 +1,14 @@
1
+ import type { Camera, Scene, WebGLRenderer } from "three";
2
+ import type { Renderer } from "three/webgpu";
3
+ /** Four coverage decisions in one fragment, resolved by 4x MSAA. */
4
+ export declare class StochasticCoverage {
5
+ private readonly materials;
6
+ constructor();
7
+ private material;
8
+ render(
9
+ renderer: Renderer | WebGLRenderer,
10
+ scene: Scene,
11
+ camera: Camera,
12
+ ): void;
13
+ dispose(): void;
14
+ }
@@ -1,55 +1,74 @@
1
- import { Camera, Matrix4, OrthographicCamera, PerspectiveCamera, RenderTarget, TextureDataType, Vector2, Vector3 } from 'three';
1
+ import type {
2
+ Camera,
3
+ Matrix4,
4
+ OrthographicCamera,
5
+ PerspectiveCamera,
6
+ RenderTarget,
7
+ Vector2,
8
+ Vector3,
9
+ } from "three";
2
10
  type TAACamera = PerspectiveCamera | OrthographicCamera;
3
11
  type TAAParameters = {
4
- depthThreshold: number;
5
- edgeDepthDiff: number;
6
- maxMotionLength: number;
7
- useSubpixelCorrection: boolean;
12
+ depthThreshold: number;
13
+ edgeDepthDiff: number;
14
+ maxMotionLength: number;
15
+ useSubpixelCorrection: boolean;
8
16
  };
9
- export declare function createTAAState<FloatUniform extends {
17
+ export declare function createTAAState<
18
+ FloatUniform extends {
10
19
  value: number;
11
- }, BoolUniform extends {
20
+ },
21
+ BoolUniform extends {
12
22
  value: boolean;
13
- }, Vec2Uniform extends {
23
+ },
24
+ Vec2Uniform extends {
14
25
  value: Vector2;
15
- }, Vec3Uniform extends {
26
+ },
27
+ Vec3Uniform extends {
16
28
  value: Vector3;
17
- }, Mat4Uniform extends {
29
+ },
30
+ Mat4Uniform extends {
18
31
  value: Matrix4;
19
- }>(makeUniform: {
32
+ },
33
+ >(
34
+ makeUniform: {
20
35
  (value: number): FloatUniform;
21
36
  (value: boolean): BoolUniform;
22
37
  (value: Vector2): Vec2Uniform;
23
38
  (value: Vector3): Vec3Uniform;
24
39
  (value: Matrix4): Mat4Uniform;
25
- }, targets: RenderTarget[], nodeLogDepth?: boolean): {
26
- uniforms: {
27
- renderSize: Vec2Uniform;
28
- projection: Mat4Uniform;
29
- unjitteredProjection: Mat4Uniform;
30
- previousProjection: Mat4Uniform;
31
- viewToPreviousClip: Mat4Uniform;
32
- previousViewToView: Mat4Uniform;
33
- valid: BoolUniform;
34
- reversed: BoolUniform;
35
- logarithmic: BoolUniform;
36
- logFar: Vec2Uniform;
37
- logNear: Vec2Uniform;
38
- depthThreshold: FloatUniform;
39
- edgeDepthDiff: FloatUniform;
40
- maxMotionLength: FloatUniform;
41
- useSubpixelCorrection: BoolUniform;
42
- luminanceCoefficients: Vec3Uniform;
43
- };
44
- historyIndex: number;
45
- jitterIndex: number;
46
- reset(): void;
47
- setSize(width: number, height: number): void;
48
- setStencil(stencil: boolean, depthType: TextureDataType): void;
49
- beginCapture(camera: TAACamera): void;
50
- endCapture(camera: TAACamera): void;
51
- prepareResolve(camera: TAACamera, parameters: TAAParameters): 0 | 1;
52
- advance(camera: TAACamera): void;
40
+ },
41
+ targets: RenderTarget[],
42
+ nodeLogDepth?: boolean,
43
+ margin?: number,
44
+ ): {
45
+ uniforms: {
46
+ renderSize: Vec2Uniform;
47
+ projection: Mat4Uniform;
48
+ unjitteredProjection: Mat4Uniform;
49
+ previousProjection: Mat4Uniform;
50
+ viewToPreviousClip: Mat4Uniform;
51
+ previousViewToView: Mat4Uniform;
52
+ valid: BoolUniform;
53
+ reversed: BoolUniform;
54
+ logarithmic: BoolUniform;
55
+ logFar: Vec2Uniform;
56
+ logNear: Vec2Uniform;
57
+ depthThreshold: FloatUniform;
58
+ edgeDepthDiff: FloatUniform;
59
+ maxMotionLength: FloatUniform;
60
+ useSubpixelCorrection: BoolUniform;
61
+ luminanceCoefficients: Vec3Uniform;
62
+ };
63
+ historyIndex: number;
64
+ jitterIndex: number;
65
+ reset(): void;
66
+ setSize(width: number, height: number): void;
67
+ setStencil(stencil: boolean): void;
68
+ beginCapture(camera: TAACamera): void;
69
+ endCapture(camera: TAACamera): void;
70
+ prepareResolve(camera: TAACamera, parameters: TAAParameters): 0 | 1;
71
+ advance(camera: TAACamera): void;
53
72
  };
54
73
  export declare const getTAAProjection: (camera: Camera) => Matrix4 | undefined;
55
74
  export {};
@@ -1,55 +1,74 @@
1
- import { Camera, Matrix4, OrthographicCamera, PerspectiveCamera, RenderTarget, TextureDataType, Vector2, Vector3 } from 'three';
1
+ import type {
2
+ Camera,
3
+ Matrix4,
4
+ OrthographicCamera,
5
+ PerspectiveCamera,
6
+ RenderTarget,
7
+ Vector2,
8
+ Vector3,
9
+ } from "three";
2
10
  type TAACamera = PerspectiveCamera | OrthographicCamera;
3
11
  type TAAParameters = {
4
- depthThreshold: number;
5
- edgeDepthDiff: number;
6
- maxMotionLength: number;
7
- useSubpixelCorrection: boolean;
12
+ depthThreshold: number;
13
+ edgeDepthDiff: number;
14
+ maxMotionLength: number;
15
+ useSubpixelCorrection: boolean;
8
16
  };
9
- export declare function createTAAState<FloatUniform extends {
17
+ export declare function createTAAState<
18
+ FloatUniform extends {
10
19
  value: number;
11
- }, BoolUniform extends {
20
+ },
21
+ BoolUniform extends {
12
22
  value: boolean;
13
- }, Vec2Uniform extends {
23
+ },
24
+ Vec2Uniform extends {
14
25
  value: Vector2;
15
- }, Vec3Uniform extends {
26
+ },
27
+ Vec3Uniform extends {
16
28
  value: Vector3;
17
- }, Mat4Uniform extends {
29
+ },
30
+ Mat4Uniform extends {
18
31
  value: Matrix4;
19
- }>(makeUniform: {
32
+ },
33
+ >(
34
+ makeUniform: {
20
35
  (value: number): FloatUniform;
21
36
  (value: boolean): BoolUniform;
22
37
  (value: Vector2): Vec2Uniform;
23
38
  (value: Vector3): Vec3Uniform;
24
39
  (value: Matrix4): Mat4Uniform;
25
- }, targets: RenderTarget[], nodeLogDepth?: boolean): {
26
- uniforms: {
27
- renderSize: Vec2Uniform;
28
- projection: Mat4Uniform;
29
- unjitteredProjection: Mat4Uniform;
30
- previousProjection: Mat4Uniform;
31
- viewToPreviousClip: Mat4Uniform;
32
- previousViewToView: Mat4Uniform;
33
- valid: BoolUniform;
34
- reversed: BoolUniform;
35
- logarithmic: BoolUniform;
36
- logFar: Vec2Uniform;
37
- logNear: Vec2Uniform;
38
- depthThreshold: FloatUniform;
39
- edgeDepthDiff: FloatUniform;
40
- maxMotionLength: FloatUniform;
41
- useSubpixelCorrection: BoolUniform;
42
- luminanceCoefficients: Vec3Uniform;
43
- };
44
- historyIndex: number;
45
- jitterIndex: number;
46
- reset(): void;
47
- setSize(width: number, height: number): void;
48
- setStencil(stencil: boolean, depthType: TextureDataType): void;
49
- beginCapture(camera: TAACamera): void;
50
- endCapture(camera: TAACamera): void;
51
- prepareResolve(camera: TAACamera, parameters: TAAParameters): 0 | 1;
52
- advance(camera: TAACamera): void;
40
+ },
41
+ targets: RenderTarget[],
42
+ nodeLogDepth?: boolean,
43
+ margin?: number,
44
+ ): {
45
+ uniforms: {
46
+ renderSize: Vec2Uniform;
47
+ projection: Mat4Uniform;
48
+ unjitteredProjection: Mat4Uniform;
49
+ previousProjection: Mat4Uniform;
50
+ viewToPreviousClip: Mat4Uniform;
51
+ previousViewToView: Mat4Uniform;
52
+ valid: BoolUniform;
53
+ reversed: BoolUniform;
54
+ logarithmic: BoolUniform;
55
+ logFar: Vec2Uniform;
56
+ logNear: Vec2Uniform;
57
+ depthThreshold: FloatUniform;
58
+ edgeDepthDiff: FloatUniform;
59
+ maxMotionLength: FloatUniform;
60
+ useSubpixelCorrection: BoolUniform;
61
+ luminanceCoefficients: Vec3Uniform;
62
+ };
63
+ historyIndex: number;
64
+ jitterIndex: number;
65
+ reset(): void;
66
+ setSize(width: number, height: number): void;
67
+ setStencil(stencil: boolean): void;
68
+ beginCapture(camera: TAACamera): void;
69
+ endCapture(camera: TAACamera): void;
70
+ prepareResolve(camera: TAACamera, parameters: TAAParameters): 0 | 1;
71
+ advance(camera: TAACamera): void;
53
72
  };
54
73
  export declare const getTAAProjection: (camera: Camera) => Matrix4 | undefined;
55
74
  export {};