@meimu/mutracer 0.0.0-stage → 0.1.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 (536) hide show
  1. package/LICENSE +21 -0
  2. package/LICENSES/Apache-2.0.txt +202 -0
  3. package/LICENSES/GLSL-PathTracer-MIT.txt +21 -0
  4. package/LICENSES/GlMatrix-MIT.txt +19 -0
  5. package/LICENSES/KinoBloom-MIT.txt +21 -0
  6. package/LICENSES/OIDNWeb-MIT.txt +21 -0
  7. package/LICENSES/Octicons-MIT.txt +21 -0
  8. package/LICENSES/RayTracingRenderer-MIT.txt +21 -0
  9. package/LICENSES/TinyBVH-MIT.txt +21 -0
  10. package/LICENSES/WebGPUUtils-MIT.txt +21 -0
  11. package/LICENSES/ZetaRay-MIT.txt +21 -0
  12. package/README.md +240 -2
  13. package/THIRD_PARTY_NOTICES.md +160 -0
  14. package/dist/assets/bvh.worker.js +1 -0
  15. package/dist/mutracer.umd.js +14360 -0
  16. package/docs/api.md +394 -0
  17. package/docs/bvh.md +141 -0
  18. package/docs/denoising.md +301 -0
  19. package/docs/getting-started.md +308 -0
  20. package/docs/materials.md +281 -0
  21. package/docs/performance.md +85 -0
  22. package/docs/post-processing.md +87 -0
  23. package/docs/progressive-rendering.md +160 -0
  24. package/docs/sampling.md +40 -0
  25. package/docs/threejs.md +274 -0
  26. package/docs/todo.md +61 -0
  27. package/docs/updates.md +208 -0
  28. package/lib/Display.d.ts +72 -0
  29. package/lib/Display.js +123 -0
  30. package/lib/Display.js.map +1 -0
  31. package/lib/Engine.d.ts +161 -0
  32. package/lib/Engine.js +681 -0
  33. package/lib/Engine.js.map +1 -0
  34. package/lib/Render.d.ts +265 -0
  35. package/lib/Render.js +742 -0
  36. package/lib/Render.js.map +1 -0
  37. package/lib/RenderLoop.d.ts +79 -0
  38. package/lib/RenderLoop.js +236 -0
  39. package/lib/RenderLoop.js.map +1 -0
  40. package/lib/Sync.d.ts +19 -0
  41. package/lib/Sync.js +19 -0
  42. package/lib/Sync.js.map +1 -0
  43. package/lib/constants.d.ts +2 -0
  44. package/lib/constants.js +3 -0
  45. package/lib/constants.js.map +1 -0
  46. package/lib/main.d.ts +56 -0
  47. package/lib/main.js +43 -0
  48. package/lib/main.js.map +1 -0
  49. package/lib/math.d.ts +23 -0
  50. package/lib/math.js +56 -0
  51. package/lib/math.js.map +1 -0
  52. package/lib/oidn.d.ts +45 -0
  53. package/lib/oidn.js +42 -0
  54. package/lib/oidn.js.map +1 -0
  55. package/lib/oidnBundledWeights.cdn.d.ts +2 -0
  56. package/lib/oidnBundledWeights.cdn.js +5 -0
  57. package/lib/oidnBundledWeights.cdn.js.map +1 -0
  58. package/lib/oidnBundledWeights.d.ts +2 -0
  59. package/lib/oidnBundledWeights.js +4 -0
  60. package/lib/oidnBundledWeights.js.map +1 -0
  61. package/lib/renderer/DisplayPostProcess.d.ts +14 -0
  62. package/lib/renderer/DisplayPostProcess.js +41 -0
  63. package/lib/renderer/DisplayPostProcess.js.map +1 -0
  64. package/lib/renderer/MaterialTable.d.ts +119 -0
  65. package/lib/renderer/MaterialTable.js +550 -0
  66. package/lib/renderer/MaterialTable.js.map +1 -0
  67. package/lib/renderer/OfflineAdaptiveSampling.d.ts +47 -0
  68. package/lib/renderer/OfflineAdaptiveSampling.js +36 -0
  69. package/lib/renderer/OfflineAdaptiveSampling.js.map +1 -0
  70. package/lib/renderer/RenderingPipeline.d.ts +232 -0
  71. package/lib/renderer/RenderingPipeline.js +18 -0
  72. package/lib/renderer/RenderingPipeline.js.map +1 -0
  73. package/lib/renderer/ScratchPool.d.ts +13 -0
  74. package/lib/renderer/ScratchPool.js +21 -0
  75. package/lib/renderer/ScratchPool.js.map +1 -0
  76. package/lib/renderer/TileRender.d.ts +44 -0
  77. package/lib/renderer/TileRender.js +283 -0
  78. package/lib/renderer/TileRender.js.map +1 -0
  79. package/lib/renderer/WGPUBloomPass.d.ts +17 -0
  80. package/lib/renderer/WGPUBloomPass.js +243 -0
  81. package/lib/renderer/WGPUBloomPass.js.map +1 -0
  82. package/lib/renderer/WGPUCanvasSurface.d.ts +21 -0
  83. package/lib/renderer/WGPUCanvasSurface.js +48 -0
  84. package/lib/renderer/WGPUCanvasSurface.js.map +1 -0
  85. package/lib/renderer/WGPUComputePass.d.ts +73 -0
  86. package/lib/renderer/WGPUComputePass.js +317 -0
  87. package/lib/renderer/WGPUComputePass.js.map +1 -0
  88. package/lib/renderer/WGPUFullQuadPass.d.ts +73 -0
  89. package/lib/renderer/WGPUFullQuadPass.js +389 -0
  90. package/lib/renderer/WGPUFullQuadPass.js.map +1 -0
  91. package/lib/renderer/WGPUHDRPeakMeter.d.ts +19 -0
  92. package/lib/renderer/WGPUHDRPeakMeter.js +112 -0
  93. package/lib/renderer/WGPUHDRPeakMeter.js.map +1 -0
  94. package/lib/renderer/WGPUJNLMDenoiser.d.ts +61 -0
  95. package/lib/renderer/WGPUJNLMDenoiser.js +412 -0
  96. package/lib/renderer/WGPUJNLMDenoiser.js.map +1 -0
  97. package/lib/renderer/WGPURayTraceOutput.d.ts +44 -0
  98. package/lib/renderer/WGPURayTraceOutput.js +368 -0
  99. package/lib/renderer/WGPURayTraceOutput.js.map +1 -0
  100. package/lib/renderer/WGPURayTracePass.d.ts +284 -0
  101. package/lib/renderer/WGPURayTracePass.js +2323 -0
  102. package/lib/renderer/WGPURayTracePass.js.map +1 -0
  103. package/lib/renderer/WGPURenderingPipeline.d.ts +9 -0
  104. package/lib/renderer/WGPURenderingPipeline.js +1448 -0
  105. package/lib/renderer/WGPURenderingPipeline.js.map +1 -0
  106. package/lib/renderer/WGPUSceneFeatures.d.ts +3 -0
  107. package/lib/renderer/WGPUSceneFeatures.js +20 -0
  108. package/lib/renderer/WGPUSceneFeatures.js.map +1 -0
  109. package/lib/renderer/WGPUScratchBuffer.d.ts +9 -0
  110. package/lib/renderer/WGPUScratchBuffer.js +21 -0
  111. package/lib/renderer/WGPUScratchBuffer.js.map +1 -0
  112. package/lib/renderer/WGPUScratchTexture.d.ts +10 -0
  113. package/lib/renderer/WGPUScratchTexture.js +27 -0
  114. package/lib/renderer/WGPUScratchTexture.js.map +1 -0
  115. package/lib/renderer/WGPUShaderCache.d.ts +26 -0
  116. package/lib/renderer/WGPUShaderCache.js +103 -0
  117. package/lib/renderer/WGPUShaderCache.js.map +1 -0
  118. package/lib/renderer/WebGLBloomPass.d.ts +18 -0
  119. package/lib/renderer/WebGLBloomPass.js +113 -0
  120. package/lib/renderer/WebGLBloomPass.js.map +1 -0
  121. package/lib/renderer/WebGLFullQuadPass.d.ts +65 -0
  122. package/lib/renderer/WebGLFullQuadPass.js +208 -0
  123. package/lib/renderer/WebGLFullQuadPass.js.map +1 -0
  124. package/lib/renderer/WebGLJNLMDenoiser.d.ts +32 -0
  125. package/lib/renderer/WebGLJNLMDenoiser.js +328 -0
  126. package/lib/renderer/WebGLJNLMDenoiser.js.map +1 -0
  127. package/lib/renderer/WebGLRayTraceOutputPass.d.ts +20 -0
  128. package/lib/renderer/WebGLRayTraceOutputPass.js +106 -0
  129. package/lib/renderer/WebGLRayTraceOutputPass.js.map +1 -0
  130. package/lib/renderer/WebGLRayTracePass.d.ts +142 -0
  131. package/lib/renderer/WebGLRayTracePass.js +845 -0
  132. package/lib/renderer/WebGLRayTracePass.js.map +1 -0
  133. package/lib/renderer/WebGLReadback.d.ts +4 -0
  134. package/lib/renderer/WebGLReadback.js +75 -0
  135. package/lib/renderer/WebGLReadback.js.map +1 -0
  136. package/lib/renderer/WebGLRenderingPipeline.d.ts +4 -0
  137. package/lib/renderer/WebGLRenderingPipeline.js +510 -0
  138. package/lib/renderer/WebGLRenderingPipeline.js.map +1 -0
  139. package/lib/renderer/WebGLScratchCopy.d.ts +10 -0
  140. package/lib/renderer/WebGLScratchCopy.js +27 -0
  141. package/lib/renderer/WebGLScratchCopy.js.map +1 -0
  142. package/lib/renderer/accumulationTarget.d.ts +26 -0
  143. package/lib/renderer/accumulationTarget.js +2 -0
  144. package/lib/renderer/accumulationTarget.js.map +1 -0
  145. package/lib/renderer/binnedSahBvh.d.ts +31 -0
  146. package/lib/renderer/binnedSahBvh.js +263 -0
  147. package/lib/renderer/binnedSahBvh.js.map +1 -0
  148. package/lib/renderer/bvh.worker.d.ts +1 -0
  149. package/lib/renderer/bvh.worker.js +16 -0
  150. package/lib/renderer/bvh.worker.js.map +1 -0
  151. package/lib/renderer/bvhAccel.d.ts +81 -0
  152. package/lib/renderer/bvhAccel.js +621 -0
  153. package/lib/renderer/bvhAccel.js.map +1 -0
  154. package/lib/renderer/bvhWorkerBuild.d.ts +12 -0
  155. package/lib/renderer/bvhWorkerBuild.js +17 -0
  156. package/lib/renderer/bvhWorkerBuild.js.map +1 -0
  157. package/lib/renderer/bvhWorkerClient.d.ts +57 -0
  158. package/lib/renderer/bvhWorkerClient.js +166 -0
  159. package/lib/renderer/bvhWorkerClient.js.map +1 -0
  160. package/lib/renderer/cameraLens.d.ts +5 -0
  161. package/lib/renderer/cameraLens.js +15 -0
  162. package/lib/renderer/cameraLens.js.map +1 -0
  163. package/lib/renderer/cameraSnapshot.d.ts +3 -0
  164. package/lib/renderer/cameraSnapshot.js +7 -0
  165. package/lib/renderer/cameraSnapshot.js.map +1 -0
  166. package/lib/renderer/committedScene.d.ts +13 -0
  167. package/lib/renderer/committedScene.js +126 -0
  168. package/lib/renderer/committedScene.js.map +1 -0
  169. package/lib/renderer/dataTextureUtil.d.ts +32 -0
  170. package/lib/renderer/dataTextureUtil.js +46 -0
  171. package/lib/renderer/dataTextureUtil.js.map +1 -0
  172. package/lib/renderer/denoiser.d.ts +65 -0
  173. package/lib/renderer/denoiser.js +2 -0
  174. package/lib/renderer/denoiser.js.map +1 -0
  175. package/lib/renderer/depthQuery.d.ts +14 -0
  176. package/lib/renderer/depthQuery.js +14 -0
  177. package/lib/renderer/depthQuery.js.map +1 -0
  178. package/lib/renderer/deviceRequirements.d.ts +23 -0
  179. package/lib/renderer/deviceRequirements.js +50 -0
  180. package/lib/renderer/deviceRequirements.js.map +1 -0
  181. package/lib/renderer/envMapCreation.d.ts +10 -0
  182. package/lib/renderer/envMapCreation.js +96 -0
  183. package/lib/renderer/envMapCreation.js.map +1 -0
  184. package/lib/renderer/envMapDistribution.d.ts +9 -0
  185. package/lib/renderer/envMapDistribution.js +107 -0
  186. package/lib/renderer/envMapDistribution.js.map +1 -0
  187. package/lib/renderer/float16.d.ts +1 -0
  188. package/lib/renderer/float16.js +19 -0
  189. package/lib/renderer/float16.js.map +1 -0
  190. package/lib/renderer/geometryBvh.d.ts +11 -0
  191. package/lib/renderer/geometryBvh.js +24 -0
  192. package/lib/renderer/geometryBvh.js.map +1 -0
  193. package/lib/renderer/geometryUpdates.d.ts +28 -0
  194. package/lib/renderer/geometryUpdates.js +131 -0
  195. package/lib/renderer/geometryUpdates.js.map +1 -0
  196. package/lib/renderer/glsl/chunks/cameraRay.glsl.d.ts +2 -0
  197. package/lib/renderer/glsl/chunks/cameraRay.glsl.js +37 -0
  198. package/lib/renderer/glsl/chunks/cameraRay.glsl.js.map +1 -0
  199. package/lib/renderer/glsl/chunks/common.glsl.d.ts +2 -0
  200. package/lib/renderer/glsl/chunks/common.glsl.js +17 -0
  201. package/lib/renderer/glsl/chunks/common.glsl.js.map +1 -0
  202. package/lib/renderer/glsl/chunks/envMap.glsl.d.ts +2 -0
  203. package/lib/renderer/glsl/chunks/envMap.glsl.js +192 -0
  204. package/lib/renderer/glsl/chunks/envMap.glsl.js.map +1 -0
  205. package/lib/renderer/glsl/chunks/intersect.glsl.d.ts +2 -0
  206. package/lib/renderer/glsl/chunks/intersect.glsl.js +1091 -0
  207. package/lib/renderer/glsl/chunks/intersect.glsl.js.map +1 -0
  208. package/lib/renderer/glsl/chunks/materialBuffer.glsl.d.ts +2 -0
  209. package/lib/renderer/glsl/chunks/materialBuffer.glsl.js +371 -0
  210. package/lib/renderer/glsl/chunks/materialBuffer.glsl.js.map +1 -0
  211. package/lib/renderer/glsl/chunks/openPbrBsdf.glsl.d.ts +2 -0
  212. package/lib/renderer/glsl/chunks/openPbrBsdf.glsl.js +1767 -0
  213. package/lib/renderer/glsl/chunks/openPbrBsdf.glsl.js.map +1 -0
  214. package/lib/renderer/glsl/chunks/rand.glsl.d.ts +2 -0
  215. package/lib/renderer/glsl/chunks/rand.glsl.js +26 -0
  216. package/lib/renderer/glsl/chunks/rand.glsl.js.map +1 -0
  217. package/lib/renderer/glsl/chunks/random.glsl.d.ts +2 -0
  218. package/lib/renderer/glsl/chunks/random.glsl.js +27 -0
  219. package/lib/renderer/glsl/chunks/random.glsl.js.map +1 -0
  220. package/lib/renderer/glsl/chunks/rayTraceCore.glsl.d.ts +2 -0
  221. package/lib/renderer/glsl/chunks/rayTraceCore.glsl.js +287 -0
  222. package/lib/renderer/glsl/chunks/rayTraceCore.glsl.js.map +1 -0
  223. package/lib/renderer/glsl/chunks/sampleLight.glsl.d.ts +2 -0
  224. package/lib/renderer/glsl/chunks/sampleLight.glsl.js +254 -0
  225. package/lib/renderer/glsl/chunks/sampleLight.glsl.js.map +1 -0
  226. package/lib/renderer/glsl/chunks/sampleMaterial.glsl.d.ts +2 -0
  227. package/lib/renderer/glsl/chunks/sampleMaterial.glsl.js +279 -0
  228. package/lib/renderer/glsl/chunks/sampleMaterial.glsl.js.map +1 -0
  229. package/lib/renderer/glsl/chunks/sampleShadowCatcher.glsl.d.ts +2 -0
  230. package/lib/renderer/glsl/chunks/sampleShadowCatcher.glsl.js +48 -0
  231. package/lib/renderer/glsl/chunks/sampleShadowCatcher.glsl.js.map +1 -0
  232. package/lib/renderer/glsl/chunks/sampling.glsl.d.ts +2 -0
  233. package/lib/renderer/glsl/chunks/sampling.glsl.js +194 -0
  234. package/lib/renderer/glsl/chunks/sampling.glsl.js.map +1 -0
  235. package/lib/renderer/glsl/chunks/sobol.glsl.d.ts +2 -0
  236. package/lib/renderer/glsl/chunks/sobol.glsl.js +170 -0
  237. package/lib/renderer/glsl/chunks/sobol.glsl.js.map +1 -0
  238. package/lib/renderer/glsl/chunks/textureLinear.glsl.d.ts +2 -0
  239. package/lib/renderer/glsl/chunks/textureLinear.glsl.js +27 -0
  240. package/lib/renderer/glsl/chunks/textureLinear.glsl.js.map +1 -0
  241. package/lib/renderer/glsl/chunks/uvProjection.glsl.d.ts +2 -0
  242. package/lib/renderer/glsl/chunks/uvProjection.glsl.js +72 -0
  243. package/lib/renderer/glsl/chunks/uvProjection.glsl.js.map +1 -0
  244. package/lib/renderer/glsl/depthQuery.frag.d.ts +3 -0
  245. package/lib/renderer/glsl/depthQuery.frag.js +55 -0
  246. package/lib/renderer/glsl/depthQuery.frag.js.map +1 -0
  247. package/lib/renderer/glsl/normalizeRayTraceOutput.frag.d.ts +6 -0
  248. package/lib/renderer/glsl/normalizeRayTraceOutput.frag.js +46 -0
  249. package/lib/renderer/glsl/normalizeRayTraceOutput.frag.js.map +1 -0
  250. package/lib/renderer/glsl/rayTrace.frag.d.ts +2 -0
  251. package/lib/renderer/glsl/rayTrace.frag.js +623 -0
  252. package/lib/renderer/glsl/rayTrace.frag.js.map +1 -0
  253. package/lib/renderer/glsl/shadowCatcher.frag.d.ts +3 -0
  254. package/lib/renderer/glsl/shadowCatcher.frag.js +119 -0
  255. package/lib/renderer/glsl/shadowCatcher.frag.js.map +1 -0
  256. package/lib/renderer/glsl/webglPipeline.frag.d.ts +4 -0
  257. package/lib/renderer/glsl/webglPipeline.frag.js +208 -0
  258. package/lib/renderer/glsl/webglPipeline.frag.js.map +1 -0
  259. package/lib/renderer/gpuMemory.d.ts +2 -0
  260. package/lib/renderer/gpuMemory.js +10 -0
  261. package/lib/renderer/gpuMemory.js.map +1 -0
  262. package/lib/renderer/halton.d.ts +1 -0
  263. package/lib/renderer/halton.js +15 -0
  264. package/lib/renderer/halton.js.map +1 -0
  265. package/lib/renderer/jnlm.d.ts +85 -0
  266. package/lib/renderer/jnlm.js +87 -0
  267. package/lib/renderer/jnlm.js.map +1 -0
  268. package/lib/renderer/lightSampling.d.ts +75 -0
  269. package/lib/renderer/lightSampling.js +305 -0
  270. package/lib/renderer/lightSampling.js.map +1 -0
  271. package/lib/renderer/lightsUtil.d.ts +26 -0
  272. package/lib/renderer/lightsUtil.js +154 -0
  273. package/lib/renderer/lightsUtil.js.map +1 -0
  274. package/lib/renderer/materialChanges.d.ts +13 -0
  275. package/lib/renderer/materialChanges.js +59 -0
  276. package/lib/renderer/materialChanges.js.map +1 -0
  277. package/lib/renderer/materialComparison.generated.d.ts +5 -0
  278. package/lib/renderer/materialComparison.generated.js +655 -0
  279. package/lib/renderer/materialComparison.generated.js.map +1 -0
  280. package/lib/renderer/materialConstants.d.ts +6 -0
  281. package/lib/renderer/materialConstants.js +3 -0
  282. package/lib/renderer/materialConstants.js.map +1 -0
  283. package/lib/renderer/materialEmission.d.ts +9 -0
  284. package/lib/renderer/materialEmission.js +21 -0
  285. package/lib/renderer/materialEmission.js.map +1 -0
  286. package/lib/renderer/materialIndices.d.ts +7 -0
  287. package/lib/renderer/materialIndices.js +34 -0
  288. package/lib/renderer/materialIndices.js.map +1 -0
  289. package/lib/renderer/materialLayout.d.ts +102 -0
  290. package/lib/renderer/materialLayout.js +189 -0
  291. package/lib/renderer/materialLayout.js.map +1 -0
  292. package/lib/renderer/materialTextureSlots.d.ts +537 -0
  293. package/lib/renderer/materialTextureSlots.js +219 -0
  294. package/lib/renderer/materialTextureSlots.js.map +1 -0
  295. package/lib/renderer/mergeMeshesToGeometry.d.ts +8 -0
  296. package/lib/renderer/mergeMeshesToGeometry.js +236 -0
  297. package/lib/renderer/mergeMeshesToGeometry.js.map +1 -0
  298. package/lib/renderer/meshInstances.d.ts +23 -0
  299. package/lib/renderer/meshInstances.js +66 -0
  300. package/lib/renderer/meshInstances.js.map +1 -0
  301. package/lib/renderer/meshMembership.d.ts +10 -0
  302. package/lib/renderer/meshMembership.js +72 -0
  303. package/lib/renderer/meshMembership.js.map +1 -0
  304. package/lib/renderer/oidnNetwork.d.ts +20 -0
  305. package/lib/renderer/oidnNetwork.js +123 -0
  306. package/lib/renderer/oidnNetwork.js.map +1 -0
  307. package/lib/renderer/openPbrEnergyLut.d.ts +32 -0
  308. package/lib/renderer/openPbrEnergyLut.js +965 -0
  309. package/lib/renderer/openPbrEnergyLut.js.map +1 -0
  310. package/lib/renderer/pathLimits.d.ts +4 -0
  311. package/lib/renderer/pathLimits.js +7 -0
  312. package/lib/renderer/pathLimits.js.map +1 -0
  313. package/lib/renderer/prepareMeshBVH.d.ts +110 -0
  314. package/lib/renderer/prepareMeshBVH.js +857 -0
  315. package/lib/renderer/prepareMeshBVH.js.map +1 -0
  316. package/lib/renderer/progressiveScheduler.d.ts +11 -0
  317. package/lib/renderer/progressiveScheduler.js +19 -0
  318. package/lib/renderer/progressiveScheduler.js.map +1 -0
  319. package/lib/renderer/renderPipeline.d.ts +57 -0
  320. package/lib/renderer/renderPipeline.js +49 -0
  321. package/lib/renderer/renderPipeline.js.map +1 -0
  322. package/lib/renderer/sampling.d.ts +10 -0
  323. package/lib/renderer/sampling.js +28 -0
  324. package/lib/renderer/sampling.js.map +1 -0
  325. package/lib/renderer/sceneChangeDetector.d.ts +29 -0
  326. package/lib/renderer/sceneChangeDetector.js +232 -0
  327. package/lib/renderer/sceneChangeDetector.js.map +1 -0
  328. package/lib/renderer/sceneLightChanges.d.ts +14 -0
  329. package/lib/renderer/sceneLightChanges.js +34 -0
  330. package/lib/renderer/sceneLightChanges.js.map +1 -0
  331. package/lib/renderer/scratchSampling.d.ts +3 -0
  332. package/lib/renderer/scratchSampling.js +39 -0
  333. package/lib/renderer/scratchSampling.js.map +1 -0
  334. package/lib/renderer/shader.d.ts +37 -0
  335. package/lib/renderer/shader.js +41 -0
  336. package/lib/renderer/shader.js.map +1 -0
  337. package/lib/renderer/staticBvhPreparation.d.ts +24 -0
  338. package/lib/renderer/staticBvhPreparation.js +116 -0
  339. package/lib/renderer/staticBvhPreparation.js.map +1 -0
  340. package/lib/renderer/textureRegion.d.ts +8 -0
  341. package/lib/renderer/textureRegion.js +9 -0
  342. package/lib/renderer/textureRegion.js.map +1 -0
  343. package/lib/renderer/texturesFromMaterials.d.ts +6 -0
  344. package/lib/renderer/texturesFromMaterials.js +37 -0
  345. package/lib/renderer/texturesFromMaterials.js.map +1 -0
  346. package/lib/renderer/util.d.ts +17 -0
  347. package/lib/renderer/util.js +56 -0
  348. package/lib/renderer/util.js.map +1 -0
  349. package/lib/renderer/webgl.d.ts +131 -0
  350. package/lib/renderer/webgl.js +586 -0
  351. package/lib/renderer/webgl.js.map +1 -0
  352. package/lib/renderer/webglShaders.d.ts +4 -0
  353. package/lib/renderer/webglShaders.js +41 -0
  354. package/lib/renderer/webglShaders.js.map +1 -0
  355. package/lib/renderer/wgsl/chunks/common.wgsl.d.ts +2 -0
  356. package/lib/renderer/wgsl/chunks/common.wgsl.js +23 -0
  357. package/lib/renderer/wgsl/chunks/common.wgsl.js.map +1 -0
  358. package/lib/renderer/wgsl/chunks/envMap.wgsl.d.ts +2 -0
  359. package/lib/renderer/wgsl/chunks/envMap.wgsl.js +128 -0
  360. package/lib/renderer/wgsl/chunks/envMap.wgsl.js.map +1 -0
  361. package/lib/renderer/wgsl/chunks/intersect.wgsl.d.ts +6 -0
  362. package/lib/renderer/wgsl/chunks/intersect.wgsl.js +1441 -0
  363. package/lib/renderer/wgsl/chunks/intersect.wgsl.js.map +1 -0
  364. package/lib/renderer/wgsl/chunks/intersectionAlpha.wgsl.d.ts +8 -0
  365. package/lib/renderer/wgsl/chunks/intersectionAlpha.wgsl.js +85 -0
  366. package/lib/renderer/wgsl/chunks/intersectionAlpha.wgsl.js.map +1 -0
  367. package/lib/renderer/wgsl/chunks/materialBuffer.wgsl.d.ts +7 -0
  368. package/lib/renderer/wgsl/chunks/materialBuffer.wgsl.js +315 -0
  369. package/lib/renderer/wgsl/chunks/materialBuffer.wgsl.js.map +1 -0
  370. package/lib/renderer/wgsl/chunks/openPbrBsdf.wgsl.d.ts +3 -0
  371. package/lib/renderer/wgsl/chunks/openPbrBsdf.wgsl.js +1737 -0
  372. package/lib/renderer/wgsl/chunks/openPbrBsdf.wgsl.js.map +1 -0
  373. package/lib/renderer/wgsl/chunks/pdm_displacement.wgsl.d.ts +4 -0
  374. package/lib/renderer/wgsl/chunks/pdm_displacement.wgsl.js +352 -0
  375. package/lib/renderer/wgsl/chunks/pdm_displacement.wgsl.js.map +1 -0
  376. package/lib/renderer/wgsl/chunks/rand.wgsl.d.ts +2 -0
  377. package/lib/renderer/wgsl/chunks/rand.wgsl.js +25 -0
  378. package/lib/renderer/wgsl/chunks/rand.wgsl.js.map +1 -0
  379. package/lib/renderer/wgsl/chunks/random.wgsl.d.ts +1 -0
  380. package/lib/renderer/wgsl/chunks/random.wgsl.js +2 -0
  381. package/lib/renderer/wgsl/chunks/random.wgsl.js.map +1 -0
  382. package/lib/renderer/wgsl/chunks/rayTraceCore.wgsl.d.ts +5 -0
  383. package/lib/renderer/wgsl/chunks/rayTraceCore.wgsl.js +328 -0
  384. package/lib/renderer/wgsl/chunks/rayTraceCore.wgsl.js.map +1 -0
  385. package/lib/renderer/wgsl/chunks/sampleLight.wgsl.d.ts +2 -0
  386. package/lib/renderer/wgsl/chunks/sampleLight.wgsl.js +400 -0
  387. package/lib/renderer/wgsl/chunks/sampleLight.wgsl.js.map +1 -0
  388. package/lib/renderer/wgsl/chunks/sampleMaterial.wgsl.d.ts +3 -0
  389. package/lib/renderer/wgsl/chunks/sampleMaterial.wgsl.js +439 -0
  390. package/lib/renderer/wgsl/chunks/sampleMaterial.wgsl.js.map +1 -0
  391. package/lib/renderer/wgsl/chunks/sampleShadowCatcher.wgsl.d.ts +2 -0
  392. package/lib/renderer/wgsl/chunks/sampleShadowCatcher.wgsl.js +40 -0
  393. package/lib/renderer/wgsl/chunks/sampleShadowCatcher.wgsl.js.map +1 -0
  394. package/lib/renderer/wgsl/chunks/sampling.wgsl.d.ts +2 -0
  395. package/lib/renderer/wgsl/chunks/sampling.wgsl.js +198 -0
  396. package/lib/renderer/wgsl/chunks/sampling.wgsl.js.map +1 -0
  397. package/lib/renderer/wgsl/chunks/shadowCatcherAccumulation.wgsl.d.ts +8 -0
  398. package/lib/renderer/wgsl/chunks/shadowCatcherAccumulation.wgsl.js +16 -0
  399. package/lib/renderer/wgsl/chunks/shadowCatcherAccumulation.wgsl.js.map +1 -0
  400. package/lib/renderer/wgsl/chunks/sobol.wgsl.d.ts +2 -0
  401. package/lib/renderer/wgsl/chunks/sobol.wgsl.js +170 -0
  402. package/lib/renderer/wgsl/chunks/sobol.wgsl.js.map +1 -0
  403. package/lib/renderer/wgsl/chunks/uvProjection.wgsl.d.ts +2 -0
  404. package/lib/renderer/wgsl/chunks/uvProjection.wgsl.js +42 -0
  405. package/lib/renderer/wgsl/chunks/uvProjection.wgsl.js.map +1 -0
  406. package/lib/renderer/wgsl/compose.frag.wgsl.d.ts +5 -0
  407. package/lib/renderer/wgsl/compose.frag.wgsl.js +218 -0
  408. package/lib/renderer/wgsl/compose.frag.wgsl.js.map +1 -0
  409. package/lib/renderer/wgsl/customDenoise.wgsl.d.ts +4 -0
  410. package/lib/renderer/wgsl/customDenoise.wgsl.js +28 -0
  411. package/lib/renderer/wgsl/customDenoise.wgsl.js.map +1 -0
  412. package/lib/renderer/wgsl/depthQuery.wgsl.d.ts +3 -0
  413. package/lib/renderer/wgsl/depthQuery.wgsl.js +34 -0
  414. package/lib/renderer/wgsl/depthQuery.wgsl.js.map +1 -0
  415. package/lib/renderer/wgsl/offlineAdaptive.compute.d.ts +2 -0
  416. package/lib/renderer/wgsl/offlineAdaptive.compute.js +108 -0
  417. package/lib/renderer/wgsl/offlineAdaptive.compute.js.map +1 -0
  418. package/lib/renderer/wgsl/rayTrace.compute.d.ts +16 -0
  419. package/lib/renderer/wgsl/rayTrace.compute.js +927 -0
  420. package/lib/renderer/wgsl/rayTrace.compute.js.map +1 -0
  421. package/lib/scene/AmbientLight.d.ts +17 -0
  422. package/lib/scene/AmbientLight.js +15 -0
  423. package/lib/scene/AmbientLight.js.map +1 -0
  424. package/lib/scene/Camera.d.ts +78 -0
  425. package/lib/scene/Camera.js +111 -0
  426. package/lib/scene/Camera.js.map +1 -0
  427. package/lib/scene/DirectionalLight.d.ts +18 -0
  428. package/lib/scene/DirectionalLight.js +17 -0
  429. package/lib/scene/DirectionalLight.js.map +1 -0
  430. package/lib/scene/EnvironmentLight.d.ts +14 -0
  431. package/lib/scene/EnvironmentLight.js +14 -0
  432. package/lib/scene/EnvironmentLight.js.map +1 -0
  433. package/lib/scene/Geometry.d.ts +87 -0
  434. package/lib/scene/Geometry.js +108 -0
  435. package/lib/scene/Geometry.js.map +1 -0
  436. package/lib/scene/IESProfile.d.ts +19 -0
  437. package/lib/scene/IESProfile.js +165 -0
  438. package/lib/scene/IESProfile.js.map +1 -0
  439. package/lib/scene/InstancedMesh.d.ts +43 -0
  440. package/lib/scene/InstancedMesh.js +79 -0
  441. package/lib/scene/InstancedMesh.js.map +1 -0
  442. package/lib/scene/Mesh.d.ts +14 -0
  443. package/lib/scene/Mesh.js +17 -0
  444. package/lib/scene/Mesh.js.map +1 -0
  445. package/lib/scene/OpenPBRMaterial.d.ts +224 -0
  446. package/lib/scene/OpenPBRMaterial.js +240 -0
  447. package/lib/scene/OpenPBRMaterial.js.map +1 -0
  448. package/lib/scene/RectLight.d.ts +31 -0
  449. package/lib/scene/RectLight.js +26 -0
  450. package/lib/scene/RectLight.js.map +1 -0
  451. package/lib/scene/Scene.d.ts +55 -0
  452. package/lib/scene/Scene.js +2 -0
  453. package/lib/scene/Scene.js.map +1 -0
  454. package/lib/scene/SceneNode.d.ts +16 -0
  455. package/lib/scene/SceneNode.js +33 -0
  456. package/lib/scene/SceneNode.js.map +1 -0
  457. package/lib/scene/SphereLight.d.ts +22 -0
  458. package/lib/scene/SphereLight.js +20 -0
  459. package/lib/scene/SphereLight.js.map +1 -0
  460. package/lib/scene/SpotLight.d.ts +35 -0
  461. package/lib/scene/SpotLight.js +29 -0
  462. package/lib/scene/SpotLight.js.map +1 -0
  463. package/lib/scene/Texture.d.ts +38 -0
  464. package/lib/scene/Texture.js +37 -0
  465. package/lib/scene/Texture.js.map +1 -0
  466. package/lib/scene/anisotropyParameters.d.ts +1 -0
  467. package/lib/scene/anisotropyParameters.js +13 -0
  468. package/lib/scene/anisotropyParameters.js.map +1 -0
  469. package/lib/scene/geometryChanges.d.ts +5 -0
  470. package/lib/scene/geometryChanges.js +18 -0
  471. package/lib/scene/geometryChanges.js.map +1 -0
  472. package/lib/scene/materialTextureNames.d.ts +2 -0
  473. package/lib/scene/materialTextureNames.js +9 -0
  474. package/lib/scene/materialTextureNames.js.map +1 -0
  475. package/lib/scene/openPbrSchema.d.ts +400 -0
  476. package/lib/scene/openPbrSchema.js +149 -0
  477. package/lib/scene/openPbrSchema.js.map +1 -0
  478. package/lib/scene/thinFilmParameters.d.ts +4 -0
  479. package/lib/scene/thinFilmParameters.js +12 -0
  480. package/lib/scene/thinFilmParameters.js.map +1 -0
  481. package/lib/settings/display.d.ts +118 -0
  482. package/lib/settings/display.js +34 -0
  483. package/lib/settings/display.js.map +1 -0
  484. package/lib/settings/engine.d.ts +37 -0
  485. package/lib/settings/engine.js +26 -0
  486. package/lib/settings/engine.js.map +1 -0
  487. package/lib/settings/render.d.ts +178 -0
  488. package/lib/settings/render.js +36 -0
  489. package/lib/settings/render.js.map +1 -0
  490. package/lib/tinybvh/LICENSE +21 -0
  491. package/lib/tinybvh/TinyBvhBuilder.d.ts +17 -0
  492. package/lib/tinybvh/TinyBvhBuilder.js +211 -0
  493. package/lib/tinybvh/TinyBvhBuilder.js.map +1 -0
  494. package/lib/tinybvh/tinybvh.wasm +0 -0
  495. package/lib/types.d.ts +13 -0
  496. package/lib/types.js +2 -0
  497. package/lib/types.js.map +1 -0
  498. package/lib/util/canvas.d.ts +2 -0
  499. package/lib/util/canvas.js +13 -0
  500. package/lib/util/canvas.js.map +1 -0
  501. package/lib/util/commonGeometry.d.ts +15 -0
  502. package/lib/util/commonGeometry.js +240 -0
  503. package/lib/util/commonGeometry.js.map +1 -0
  504. package/lib/util/events.d.ts +7 -0
  505. package/lib/util/events.js +23 -0
  506. package/lib/util/events.js.map +1 -0
  507. package/lib/util/frame.d.ts +2 -0
  508. package/lib/util/frame.js +10 -0
  509. package/lib/util/frame.js.map +1 -0
  510. package/lib/util/fromTHREE.d.ts +105 -0
  511. package/lib/util/fromTHREE.js +1111 -0
  512. package/lib/util/fromTHREE.js.map +1 -0
  513. package/lib/util/geometry.d.ts +13 -0
  514. package/lib/util/geometry.js +292 -0
  515. package/lib/util/geometry.js.map +1 -0
  516. package/lib/util/loadRGBE.d.ts +7 -0
  517. package/lib/util/loadRGBE.js +168 -0
  518. package/lib/util/loadRGBE.js.map +1 -0
  519. package/lib/util/math.d.ts +8 -0
  520. package/lib/util/math.js +64 -0
  521. package/lib/util/math.js.map +1 -0
  522. package/lib/util/mesh.d.ts +7 -0
  523. package/lib/util/mesh.js +20 -0
  524. package/lib/util/mesh.js.map +1 -0
  525. package/lib/util/threeDeformation.d.ts +20 -0
  526. package/lib/util/threeDeformation.js +218 -0
  527. package/lib/util/threeDeformation.js.map +1 -0
  528. package/lib/version.d.ts +2 -0
  529. package/lib/version.js +3 -0
  530. package/lib/version.js.map +1 -0
  531. package/llms.txt +62 -0
  532. package/oidn/weights/LICENSE.txt +202 -0
  533. package/oidn/weights/README.md +43 -0
  534. package/oidn/weights/rt_hdr_alb_nrm.tza +0 -0
  535. package/oidn/weights/rt_hdr_alb_nrm_small.tza +0 -0
  536. package/package.json +124 -4
@@ -0,0 +1 @@
1
+ {"version":3,"file":"threeDeformation.js","sourceRoot":"","sources":["../../src/util/threeDeformation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAGlC,MAAM,UAAU,GAAG,CAAC,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,CAAU,CAAC;AACzF,sFAAsF;AACtF,SAAS,MAAM,CAAC,SAAyB;IACvC,MAAM,WAAW,GAAG,SAA6C,CAAC;IAClE,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AE,MAAM,EAAE,IAAI,CAAC,CAAC;YAClF,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;gBAAC,WAAW,CAAC,MAAO,EAAE,YAAY,EAAE,MAAM,CAAC,CAAC;gBAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;YAAC,CAAC;YACnG,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;gBACjB,KAAK,IAAI,SAAS,GAAG,CAAC,EAAE,SAAS,GAAG,CAAC,EAAE,SAAS,EAAE;oBAAE,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC,OAAQ,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC;gBAChH,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;gBAC9D,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;gBACzC,IAAI,IAAI,KAAK,CAAC;oBAAE,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,OAAQ,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC;YAC3E,CAAC;QACH,CAAC;QACD,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC;QAAC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QAAC,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC;QAC7E,OAAO,IAAI,CAAC;IACd,CAAC;CACF","sourcesContent":["import type * as THREE from 'three';\nimport { mat4 } from '../math.js';\n\ntype FloatAttribute = THREE.BufferAttribute | THREE.InterleavedBufferAttribute;\nconst attributes = ['position', 'normal', 'tangent', 'skinIndex', 'skinWeight'] as const;\n/** Decode storage directly, including interleaved offsets and normalized integers. */\nfunction reader(attribute: FloatAttribute) {\n const interleaved = attribute as THREE.InterleavedBufferAttribute;\n const array = interleaved.isInterleavedBufferAttribute ? interleaved.data.array : attribute.array;\n const stride = interleaved.isInterleavedBufferAttribute ? interleaved.data.stride : attribute.itemSize;\n const offset = interleaved.isInterleavedBufferAttribute ? interleaved.offset : 0;\n if (!attribute.normalized && !(attribute as FloatAttribute & { isFloat16BufferAttribute?: boolean }).isFloat16BufferAttribute) {\n return { array, stride, offset };\n }\n const decoded = new Float64Array(attribute.count * attribute.itemSize);\n let divisor = 1, signed = false;\n if (attribute.normalized) {\n if (array instanceof Uint8Array || array instanceof Uint8ClampedArray) divisor = 255;\n else if (array instanceof Uint16Array) divisor = 65535;\n else if (array instanceof Uint32Array) divisor = 4294967295;\n else if (array instanceof Int8Array) { divisor = 127; signed = true; }\n else if (array instanceof Int16Array) { divisor = 32767; signed = true; }\n else if (array instanceof Int32Array) { divisor = 2147483647; signed = true; }\n }\n const half = (attribute as FloatAttribute & { isFloat16BufferAttribute?: boolean }).isFloat16BufferAttribute;\n for (let i = 0; i < attribute.count; i++) for (let c = 0; c < attribute.itemSize; c++) {\n let value = array[i * stride + offset + c];\n if (half) {\n const exponent = (value >> 10) & 31, fraction = value & 1023, sign = value & 32768 ? -1 : 1;\n value = sign * (exponent === 31 ? fraction ? NaN : Infinity :\n exponent === 0 ? fraction * 2 ** -24 : (1 + fraction / 1024) * 2 ** (exponent - 15));\n }\n value /= divisor;\n decoded[i * attribute.itemSize + c] = signed ? Math.max(-1, value) : value;\n }\n return { array: decoded, stride: attribute.itemSize, offset: 0 };\n}\ntype Reader = ReturnType<typeof reader>;\nfunction read(attribute: Reader, vertex: number, component: number) {\n return attribute.array[vertex * attribute.stride + attribute.offset + component];\n}\n\nexport function isDeformingMesh(mesh: THREE.Mesh) {\n return !!(mesh as THREE.SkinnedMesh).isSkinnedMesh || !!mesh.morphTargetInfluences &&\n (!!mesh.geometry.morphAttributes.position?.length || !!mesh.geometry.morphAttributes.normal?.length);\n}\n\n/** One reusable evaluator per mesh, since skeletons may share a BufferGeometry. */\nexport class THREEDeformation {\n readonly position: Float32Array;\n readonly normal?: Float32Array;\n readonly tangent?: Float32Array;\n private _accepted: unknown[] = [];\n private _next: unknown[] = [];\n private _bones = new Float32Array(0);\n private _boundBones = new Float64Array(0);\n private _temporary = new Float64Array(16);\n private _skin = new Float64Array(16);\n private _vector = new Float64Array(3);\n private _initialized = false;\n\n constructor(readonly geometry: THREE.BufferGeometry) {\n const count = geometry.attributes.position.count;\n this.position = new Float32Array(count * 3);\n if (geometry.attributes.normal) this.normal = new Float32Array(count * 3);\n if (geometry.attributes.tangent) this.tangent = new Float32Array(count * Math.min(4, geometry.attributes.tangent.itemSize));\n }\n\n matches(geometry: THREE.BufferGeometry) {\n return this.geometry === geometry && this.position.length === geometry.attributes.position.count * 3 &&\n !!this.normal === !!geometry.attributes.normal && !!this.tangent === !!geometry.attributes.tangent &&\n (!this.tangent || this.tangent.length === geometry.attributes.position.count * Math.min(4, geometry.attributes.tangent.itemSize));\n }\n\n update(mesh: THREE.Mesh) {\n const geometry = mesh.geometry, skinned = mesh as THREE.SkinnedMesh;\n if (skinned.isSkinnedMesh) skinned.skeleton.update();\n const next = this._next; next.length = 0;\n next.push(geometry, geometry.morphTargetsRelative);\n const capture = (attribute?: FloatAttribute) => {\n if (!attribute) { next.push(undefined); return; }\n const interleaved = attribute as THREE.InterleavedBufferAttribute;\n const buffer = interleaved.isInterleavedBufferAttribute ? interleaved.data : attribute as THREE.BufferAttribute;\n next.push(attribute, buffer.array, buffer.version, attribute.count, attribute.itemSize, attribute.normalized, interleaved.offset, interleaved.data?.stride);\n };\n for (const name of attributes) capture(geometry.getAttribute(name));\n for (const name of ['position', 'normal'] as const) {\n const morphs = geometry.morphAttributes[name]; next.push(morphs?.length);\n if (morphs) for (const attribute of morphs) capture(attribute);\n }\n const influences = mesh.morphTargetInfluences;\n next.push(influences?.length);\n if (influences) for (const influence of influences) next.push(influence);\n if (skinned.isSkinnedMesh) {\n next.push(skinned.skeleton, skinned.skeleton.boneMatrices!.length);\n\n for (const value of skinned.bindMatrix.elements) next.push(value);\n for (const value of skinned.bindMatrixInverse.elements) next.push(value);\n }\n const boneMatrices = skinned.isSkinnedMesh ? skinned.skeleton.boneMatrices! : undefined;\n let bonesChanged = !!boneMatrices && boneMatrices.length !== this._bones.length;\n if (boneMatrices && !bonesChanged) for (let i = 0; i < boneMatrices.length; i++) {\n if (!Object.is(boneMatrices[i], this._bones[i])) { bonesChanged = true; break; }\n }\n if (this._initialized && !bonesChanged && next.length === this._accepted.length && next.every((v, i) => Object.is(v, this._accepted[i]))) return false;\n const position = reader(geometry.getAttribute('position'));\n const normal = this.normal && reader(geometry.getAttribute('normal'));\n const tangent = this.tangent && reader(geometry.getAttribute('tangent'));\n const indices = boneMatrices && reader(geometry.getAttribute('skinIndex'));\n const weights = boneMatrices && reader(geometry.getAttribute('skinWeight'));\n const positionMorphs = geometry.morphAttributes.position?.map(reader);\n const normalMorphs = geometry.morphAttributes.normal?.map(reader);\n if (boneMatrices) {\n if (this._bones.length !== boneMatrices.length) {\n this._bones = new Float32Array(boneMatrices.length);\n this._boundBones = new Float64Array(boneMatrices.length);\n }\n this._bones.set(boneMatrices);\n for (let bone = 0; bone < boneMatrices.length; bone += 16) {\n mat4.multiply(this._temporary, boneMatrices.subarray(bone, bone + 16), skinned.bindMatrix.elements);\n mat4.multiply(this._boundBones.subarray(bone, bone + 16), skinned.bindMatrixInverse.elements, this._temporary);\n }\n }\n const morphVector = (base: Reader, morphs: Reader[] | undefined, vertex: number) => {\n for (let component = 0; component < 3; component++) {\n const b = read(base, vertex, component); let value = b;\n if (influences && morphs) for (let target = 0; target < morphs.length; target++) {\n const weight = influences[target] ?? 0;\n if (weight) value += weight * (read(morphs[target], vertex, component) - (geometry.morphTargetsRelative ? 0 : b));\n }\n this._vector[component] = value;\n }\n };\n const write = (target: Float32Array, vertex: number, position: boolean, size = 3) => {\n let x = this._vector[0], y = this._vector[1], z = this._vector[2];\n if (skinned.isSkinnedMesh) {\n const matrix = this._skin;\n const tx = matrix[0] * x + matrix[4] * y + matrix[8] * z + (position ? matrix[12] : 0);\n const ty = matrix[1] * x + matrix[5] * y + matrix[9] * z + (position ? matrix[13] : 0);\n const tz = matrix[2] * x + matrix[6] * y + matrix[10] * z + (position ? matrix[14] : 0);\n x = tx; y = ty; z = tz;\n if (!position) { const length = Math.hypot(x,y,z); if (length) { x /= length; y /= length; z /= length; } }\n }\n target[vertex * size] = x; target[vertex * size + 1] = y; target[vertex * size + 2] = z;\n };\n for (let vertex = 0; vertex < this.position.length / 3; vertex++) {\n if (skinned.isSkinnedMesh) {\n this._skin.fill(0);\n for (let component = 0; component < 4; component++) {\n const bone = read(indices!, vertex, component), weight = read(weights!, vertex, component);\n if (!weight) continue;\n const start = bone * 16;\n for (let i = 0; i < 16; i++) this._skin[i] += weight * this._boundBones[start + i];\n }\n }\n morphVector(position, positionMorphs, vertex); write(this.position, vertex, true);\n if (this.normal) { morphVector(normal!, normalMorphs, vertex); write(this.normal, vertex, false); }\n if (this.tangent) {\n for (let component = 0; component < 3; component++) this._vector[component] = read(tangent!, vertex, component);\n const size = this.tangent.length / (this.position.length / 3);\n write(this.tangent, vertex, false, size);\n if (size === 4) this.tangent[vertex * 4 + 3] = read(tangent!, vertex, 3);\n }\n }\n this._next = this._accepted; this._accepted = next; this._initialized = true;\n return true;\n }\n}\n"]}
@@ -0,0 +1,2 @@
1
+ /** Library version. Kept in sync with package.json by a unit test. */
2
+ export declare const VERSION = "0.1.1";
package/lib/version.js ADDED
@@ -0,0 +1,3 @@
1
+ /** Library version. Kept in sync with package.json by a unit test. */
2
+ export const VERSION = '0.1.1';
3
+ //# sourceMappingURL=version.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC","sourcesContent":["/** Library version. Kept in sync with package.json by a unit test. */\nexport const VERSION = '0.1.1';\n"]}
package/llms.txt ADDED
@@ -0,0 +1,62 @@
1
+ # MuTracer
2
+
3
+ > MuTracer is a progressive, physically based path tracer for the browser. npm package `@meimu/mutracer`. WebGPU with a WebGL 2 fallback, OpenPBR 1.1 materials, BVH acceleration (JavaScript or TinyBVH WebAssembly), and denoising with a built-in JNLM filter or Intel Open Image Denoise (OIDN). MIT licensed.
4
+
5
+ ## Essentials
6
+
7
+ - Interactive loop: `new RenderLoop(engine, {sync, preview?, final?}).start()`; manual `tick()` is an alternative. Preview events/counts are excluded; [loop policy](docs/progressive-rendering.md#loop-policy).
8
+ - Custom integrations: extend Sync(engine), write inputs in update, report activity through active; [API](docs/api.md#renderloop-and-sync).
9
+
10
+ - Install: `npm install @meimu/mutracer` (+ `three` for Three.js integration). ESM and TypeScript; [quick start](docs/getting-started.md).
11
+ - First layer: `new Engine({canvas})`, set `engine.scene` / `engine.camera`, then create `new Render(engine, options?)`; [independent renders](docs/progressive-rendering.md).
12
+ - Frame: update controls/source adapters, call `engine.update()` once, `current.refine()`, then `engine.display.present(current)`. Only update detects/commits external edits; rendering compares revisions.
13
+ - Batch settings: `Object.assign(render, settings)` / `Object.assign(engine.display, settings)` with `RenderSettings` / `DisplaySettings`; constructor options configure Render. [Defaults](docs/api.md).
14
+ - Ownership: Engine owns shared scene/device/BVH/atlas; Display owns tone mapping, bloom, HDR and channel; Render owns resolution, quality, samples, fallback and denoiser. `transmissiveOutputAlphaMin` is a Render option; [API](docs/api.md).
15
+ - Initialization: optional `await engine.init()` gives backend, adapter and limits; `backend: 'auto'` defaults to WebGPU with WebGL fallback. `webgpu` requires WebGPU and `webgl` forces WebGL 2.
16
+ - Status: each render exposes `status`, `samples` and `converged`; statuses are preparing, compiling, converging, denoising, finished and error. The first layer leaves frame selection/UI status to the application.
17
+ - Scene: plain `{meshes, lights, background?}`; meshes use world `transform`. `engine.update()` detects assignments, materials and lights; in-place array/pixel edits need `markUpdated()` or dedicated geometry/instance notifications; [updates](docs/updates.md).
18
+ - Conversion hooks: `convertMaterial` / `convertLight` on `FromTHREESceneOptions` and `THREESyncOptions`; undefined uses defaults, null skips; sync caches by source identity/version. [Ownership and light revisions](docs/threejs.md#custom-conversion).
19
+ - Three.js: use `new THREESync(engine, {scene?, camera?, controls?})` with RenderLoop; use GLTFLoader for glTF. [Three.js](docs/threejs.md).
20
+ - Preview: explicit `new Render(engine, {resolutionScale:.5, adaptiveResolution:{targetFrameMs:20,minScale:.25},bounces:2,bevel:false,dispersionWavelengths:1,directLightCandidates:2})`. Give the final render `fallback: preview`; [fallback rules](docs/progressive-rendering.md#caveats).
21
+ - Denoising: required `type`, frozen `render.denoiser` getter; `await render.setDenoiser({type:'jnlm'})` (both backends) or `{type:'oidn',model:'standard'}` (WebGPU, ignored with a warning on WebGL). Schedules: converged (default), progressive, every-sample; [denoising](docs/denoising.md).
22
+ - Sampling: `render.samplingPattern` is sobol (default), zsobol or random; [sampling](docs/sampling.md).
23
+ - GPU output/overlays: `render.getOutputTexture('hdr'|'display')` and `display.addPostProcess(pass)` are WebGPU-only; present/export run display passes, raw readbacks do not. [Formats and lifetime](docs/post-processing.md).
24
+ - Export: `await final.converge({samples:64,sampleSequenceOffset:0,camera?})`, `await final.readPixels('hdr')`, `await engine.display.toBlob(final)`. Fixed width/height are constructor-only; Blob uses render dimensions and leaves canvas unchanged.
25
+ - Concurrency: converge blocks refine only on that render, copies its camera override, and rejects when engine input revisions change. readPixels and present always select the requested result.
26
+ - BVH: automatic CPU preparation; optional `await engine.prepare(nextScene,{onProgress?,signal?})` leaves current GPU scene unchanged. Engine BVH options rebuild at the next update; [BVH](docs/bvh.md).
27
+ - Events: `engine.on('progress'|'error'|'devicelost',listener)` returns unsubscribe; per-render samples/status are polled. Async errors use error events; [API](docs/api.md).
28
+ - Depth: `await engine.readDepthSamples({x,y,size})` uses the committed engine camera; [depth sampling](docs/api.md#depth-sampling).
29
+ - Materials, lights, geometry: OpenPBR constructor parameters, rigid analytic-light transforms and itemSize=1 raw materialIndex; [materials](docs/materials.md), [getting started](docs/getting-started.md).
30
+ - Release resources with `render.dispose()` or `engine.dispose()` for everything; `sync.dispose()` releases adapter caches.
31
+
32
+ ## Common pitfalls
33
+
34
+ - Texture pixel and geometry array edits need a notification; material parameters do not. See [updates](./docs/updates.md#what-to-do-after-a-change).
35
+ - Use `geometry.markVerticesUpdated()`, not `markUpdated()`, for vertex animation; neither recomputes normals.
36
+ - `createPlaneGeometry()` is 2×2 in XZ; `createSphereGeometry()` and `createCubeGeometry()` span -1..1. Scale with `transform`.
37
+ - Rect lights are one-sided; rotate them to face the scene.
38
+ - Custom denoisers: `{type:'custom',denoiser}` on WebGPU; caller owns disposal; tightly packed native HDR RGBA32F input/output before display composition, linear albedo and 0–1 normal guides; [lifecycle and buffers](docs/denoising.md#custom-denoisers).
39
+ - OIDN: packaged `model` or custom `weightsUrl` through `render.setDenoiser()`; `/oidn` only exports weight constants/URL helpers. OIDN and HDR output require WebGPU; [options](docs/denoising.md#custom-oidn-networks).
40
+ - Call `engine.display.setSize` with drawing-buffer pixels ; camera aspect is automatic unless explicitly set.
41
+ - Changing `bvhBuilder`, `bvhLayout` or `bvhSpatialSplits` automatically rebuilds existing static BVHs on the next engine.update().
42
+ - In Vite development, add `optimizeDeps: { exclude: ['@meimu/mutracer'] }` so bundled assets load.
43
+
44
+ ## Host integration
45
+
46
+ - Caller-owned GPUDevice: pass `device` to Engine; obtain a descriptor with `getRecommendedDeviceDescriptor(adapter)`. Ownership and limits: [API](docs/api.md#device-requirements).
47
+ - Device loss: shared WebGPU devices recover lazily; caller-owned devices require `await engine.setDevice(replacement)` then update. Active convergence rejects. [API](docs/api.md#device-loss).
48
+ - OffscreenCanvas/Worker: Engine defaults to OffscreenCanvas without document; textures accept ImageBitmap/OffscreenCanvas. Forward visibility and controls; [worker guide](docs/getting-started.md#running-in-a-worker).
49
+
50
+ ## Docs
51
+
52
+ - [Getting started](docs/getting-started.md): scene model, render loop, geometry, cameras, lights, export, bundlers
53
+ - [Scene updates](docs/updates.md): what to call after each kind of edit, animation, update costs
54
+ - [API reference](docs/api.md): Engine, Display, Render, RenderLoop and Sync options and defaults, methods, statuses, scene types, helpers
55
+ - [Materials](docs/materials.md): OpenPBR inputs, textures, alpha, bevel, displacement
56
+ - [InstancedMesh](docs/updates.md#instanced-meshes): shared geometry/materials, active count, local Float32 transforms/colors; markUpdated notifies both arrays, markTransformsUpdated/markColorsUpdated avoids unrelated work; then engine.update.
57
+ - [Three.js](docs/threejs.md): `THREESync`, conversions, skinning, instancing, `userData` keys
58
+ - [Denoising](docs/denoising.md): JNLM and OIDN, options, weight hosting, denoising while converging
59
+ - [Sampling](docs/sampling.md): choosing a sampling pattern
60
+ - [BVH](docs/bvh.md): automatic and up-front preparation, builders, layouts
61
+ - [Performance](docs/performance.md): tuning checklist; resident target dimensions/bytes and complete-image presentation diagnostics
62
+ - [Examples](https://github.com/pissang/mutracer/tree/main/examples): basic, Three.js, animation, advanced
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
@@ -0,0 +1,43 @@
1
+ # Intel® Open Image Denoise weights
2
+
3
+ Trained weights of the convolutional networks used by
4
+ [Intel Open Image Denoise](https://github.com/OpenImageDenoise/oidn) (OIDN),
5
+ stored in OIDN's `.tza` format and released under the Apache License 2.0
6
+ (see [`LICENSE.txt`](./LICENSE.txt)).
7
+
8
+ | File | Used by |
9
+ | --- | --- |
10
+ | `rt_hdr_alb_nrm.tza` | `model: 'standard'` (default): HDR color + albedo + normal |
11
+ | `rt_hdr_alb_nrm_small.tza` | `model: 'small'`: fastest, for denoising while converging |
12
+ | `rt_hdr_calb_cnrm_large.tza` | `model: 'cleanAuxLarge'`: highest quality, with prefiltered guides |
13
+ | `rt_alb_large.tza`, `rt_nrm_large.tza` | Albedo / normal prefilters for `cleanAuxLarge` |
14
+
15
+ All five files come from [RenderKit/oidn-weights](https://github.com/RenderKit/oidn-weights/tree/28883d1769d5930e13cf7f1676dd852bd81ed9e7)
16
+ at commit `28883d1769d5930e13cf7f1676dd852bd81ed9e7` (OIDN 2.3).
17
+
18
+ ## SHA-256
19
+
20
+ ```text
21
+ e586ef2ff48d7fbb7611986405220ed8fc5c13ca79bfc40be4dc742fbf959e1a rt_hdr_alb_nrm.tza
22
+ 980ea307e7825cae23ed8b1addf8de62ece84b61094795a5631ebf1c91b2e1a7 rt_hdr_alb_nrm_small.tza
23
+ 08130cdc4f33b7a513d0073757f089ac830f900613bb5bad72ca42c52b934465 rt_hdr_calb_cnrm_large.tza
24
+ a8efbe6eed511f41c8f5ff9145923214cefb0703cf91a3b00a1dc131ade1600a rt_alb_large.tza
25
+ 8ac7705ec5ac303116b40ad2f0880cd741ed1f4280828bf2f18f7635c3377257 rt_nrm_large.tza
26
+ ```
27
+
28
+ ## Loading
29
+
30
+ MuTracer bundles standard and small, loading them from application assets by
31
+ default. Vite development requires `optimizeDeps: { exclude: ['@meimu/mutracer'] }`;
32
+ otherwise MuTracer warns once and falls back to its version-pinned CDN copy.
33
+ The complete `oidn-weights@2.3.0-1` package also includes all three large networks:
34
+
35
+ ```text
36
+ https://cdn.jsdelivr.net/npm/oidn-weights@2.3.0-1/<filename>.tza
37
+ ```
38
+
39
+ To self-host, install `oidn-weights@2.3.0-1`, copy `node_modules/oidn-weights/*.tza`
40
+ to static assets, then pass `weightsBaseUrl: '/assets/oidn/weights/'` to
41
+ `renderer.setDenoiser()`. When using only standard/small, copy the two `.tza`
42
+ files from `node_modules/@meimu/mutracer/oidn/weights/` instead. This repository retains
43
+ all five files for examples and viewer builds.
Binary file
package/package.json CHANGED
@@ -1,6 +1,126 @@
1
1
  {
2
2
  "name": "@meimu/mutracer",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.1",
4
+ "description": "MuTracer: a physically based WebGPU path tracer with WebGL 2 fallback, OpenPBR materials, TinyBVH and OIDN denoising.",
5
+ "keywords": [
6
+ "path tracing",
7
+ "webgpu",
8
+ "webgl",
9
+ "raytracing",
10
+ "pbr",
11
+ "openpbr",
12
+ "oidn",
13
+ "three.js",
14
+ "renderer"
15
+ ],
16
+ "homepage": "https://mutracer.meimu-studio.com",
17
+ "bugs": {
18
+ "url": "https://github.com/pissang/mutracer/issues"
19
+ },
20
+ "repository": {
21
+ "type": "git",
22
+ "url": "git+https://github.com/pissang/mutracer.git"
23
+ },
24
+ "license": "MIT",
25
+ "publishConfig": {
26
+ "access": "public"
27
+ },
28
+ "author": "Yi Shen",
29
+ "type": "module",
30
+ "main": "lib/main.js",
31
+ "types": "lib/main.d.ts",
32
+ "unpkg": "dist/mutracer.umd.js",
33
+ "jsdelivr": "dist/mutracer.umd.js",
34
+ "exports": {
35
+ ".": {
36
+ "types": "./lib/main.d.ts",
37
+ "import": "./lib/main.js",
38
+ "default": "./lib/main.js"
39
+ },
40
+ "./oidn": {
41
+ "types": "./lib/oidn.d.ts",
42
+ "import": "./lib/oidn.js",
43
+ "default": "./lib/oidn.js"
44
+ },
45
+ "./oidn/weights/*": "./oidn/weights/*",
46
+ "./package.json": "./package.json"
47
+ },
48
+ "sideEffects": false,
49
+ "files": [
50
+ "lib",
51
+ "dist",
52
+ "oidn/weights/rt_hdr_alb_nrm.tza",
53
+ "oidn/weights/rt_hdr_alb_nrm_small.tza",
54
+ "oidn/weights/LICENSE.txt",
55
+ "oidn/weights/README.md",
56
+ "LICENSE",
57
+ "LICENSES",
58
+ "THIRD_PARTY_NOTICES.md",
59
+ "README.md",
60
+ "docs",
61
+ "llms.txt"
62
+ ],
63
+ "scripts": {
64
+ "dev": "vite",
65
+ "build": "npm run typecheck && vite build",
66
+ "typecheck": "npm run check:material-comparison && tsc --noEmit",
67
+ "test": "vitest run",
68
+ "test:watch": "vitest",
69
+ "build:tinybvh": "./scripts/build-tinybvh.sh",
70
+ "build:tinybvh:windows": "powershell -NoProfile -ExecutionPolicy Bypass -File scripts/build-tinybvh.ps1",
71
+ "typecheck:examples": "tsc --noEmit -p tsconfig.examples.json",
72
+ "watch": "vite build -w",
73
+ "preview": "vite preview",
74
+ "prepare": "npm run build:lib",
75
+ "prepublishOnly": "npm run build && npm run build:lib",
76
+ "build:lib": "npm run check:material-comparison && node scripts/build-lib.mjs",
77
+ "watch:lib": "tsc --watch",
78
+ "viewer": "vite --config viewer/vite.config.ts",
79
+ "build:viewer": "vite build --config viewer/vite.config.ts",
80
+ "typecheck:viewer": "tsc --noEmit -p viewer/tsconfig.json",
81
+ "site": "vite --config site/vite.config.ts",
82
+ "build:site": "node scripts/build-site.mjs",
83
+ "typecheck:site": "tsc --noEmit -p site/tsconfig.json",
84
+ "deploy": "wrangler deploy",
85
+ "pack:oidn-weights": "node scripts/pack-oidn-weights.mjs",
86
+ "check:lib-esm": "node scripts/check-lib-esm.mjs",
87
+ "test:viewer": "vitest run --config viewer/vitest.config.ts",
88
+ "generate:material-comparison": "node scripts/generate-material-comparison.mjs",
89
+ "check:material-comparison": "node scripts/generate-material-comparison.mjs --check"
90
+ },
91
+ "dependencies": {
92
+ "gl-matrix": "^3.4.4",
93
+ "oidn-web": "^0.5.0",
94
+ "webgpu-utils": "^1.9.3",
95
+ "@webgpu/types": "^0.1.40"
96
+ },
97
+ "peerDependencies": {
98
+ "@types/three": ">=0.150.0",
99
+ "three": ">=0.150.0"
100
+ },
101
+ "peerDependenciesMeta": {
102
+ "@types/three": {
103
+ "optional": true
104
+ },
105
+ "three": {
106
+ "optional": true
107
+ }
108
+ },
109
+ "devDependencies": {
110
+ "@types/node": "^20.19.43",
111
+ "@types/react": "^18.3.31",
112
+ "@types/react-dom": "^18.3.7",
113
+ "@types/three": "^0.185.4",
114
+ "@vitejs/plugin-react": "^4.7.0",
115
+ "lucide-react": "^1.54.0",
116
+ "react": "^18.3.1",
117
+ "react-aria-components": "^1.22.0",
118
+ "react-dom": "^18.3.1",
119
+ "three": "^0.185.1",
120
+ "typescript": "^5.8.2",
121
+ "vite": "^4.1.2",
122
+ "vitest": "^1.6.1",
123
+ "wrangler": "^4.54.0",
124
+ "zustand": "^5.0.15"
125
+ }
126
+ }