@unikia/upe-renderer 0.0.0-stage → 0.186.110

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 (2234) hide show
  1. package/LICENSE +21 -0
  2. package/LICENSE.types +21 -0
  3. package/README.md +37 -2
  4. package/README.three.md +85 -0
  5. package/UPSTREAM.md +11 -0
  6. package/build/three.cjs +17 -0
  7. package/build/three.core.d.ts +1 -0
  8. package/build/three.core.js +60602 -0
  9. package/build/three.d.cts +1 -0
  10. package/build/three.module.d.ts +1 -0
  11. package/build/three.module.js +19719 -0
  12. package/build/three.tsl.d.ts +1 -0
  13. package/build/three.tsl.js +691 -0
  14. package/build/three.webgpu.d.ts +1 -0
  15. package/build/three.webgpu.js +93270 -0
  16. package/build/three.webgpu.nodes.d.ts +1 -0
  17. package/build/three.webgpu.nodes.js +92988 -0
  18. package/examples/jsm/Addons.d.ts +300 -0
  19. package/examples/jsm/Addons.js +301 -0
  20. package/examples/jsm/animation/AnimationClipCreator.d.ts +12 -0
  21. package/examples/jsm/animation/AnimationClipCreator.js +168 -0
  22. package/examples/jsm/animation/CCDIKSolver.d.ts +44 -0
  23. package/examples/jsm/animation/CCDIKSolver.js +595 -0
  24. package/examples/jsm/capabilities/WebGL.d.ts +6 -0
  25. package/examples/jsm/capabilities/WebGL.js +113 -0
  26. package/examples/jsm/capabilities/WebGPU.d.ts +7 -0
  27. package/examples/jsm/capabilities/WebGPU.js +59 -0
  28. package/examples/jsm/controls/ArcballControls.d.ts +208 -0
  29. package/examples/jsm/controls/ArcballControls.js +3543 -0
  30. package/examples/jsm/controls/DragControls.d.ts +81 -0
  31. package/examples/jsm/controls/DragControls.js +452 -0
  32. package/examples/jsm/controls/FirstPersonControls.d.ts +105 -0
  33. package/examples/jsm/controls/FirstPersonControls.js +512 -0
  34. package/examples/jsm/controls/FlyControls.d.ts +44 -0
  35. package/examples/jsm/controls/FlyControls.js +384 -0
  36. package/examples/jsm/controls/MapControls.d.ts +21 -0
  37. package/examples/jsm/controls/MapControls.js +116 -0
  38. package/examples/jsm/controls/OrbitControls.d.ts +295 -0
  39. package/examples/jsm/controls/OrbitControls.js +1972 -0
  40. package/examples/jsm/controls/PointerLockControls.d.ts +84 -0
  41. package/examples/jsm/controls/PointerLockControls.js +264 -0
  42. package/examples/jsm/controls/TrackballControls.d.ts +152 -0
  43. package/examples/jsm/controls/TrackballControls.js +1106 -0
  44. package/examples/jsm/controls/TransformControls.d.ts +363 -0
  45. package/examples/jsm/controls/TransformControls.js +2003 -0
  46. package/examples/jsm/csm/CSM.d.ts +55 -0
  47. package/examples/jsm/csm/CSM.js +598 -0
  48. package/examples/jsm/csm/CSMFrustum.d.ts +85 -0
  49. package/examples/jsm/csm/CSMFrustum.js +234 -0
  50. package/examples/jsm/csm/CSMHelper.d.ts +28 -0
  51. package/examples/jsm/csm/CSMHelper.js +243 -0
  52. package/examples/jsm/csm/CSMShader.d.ts +4 -0
  53. package/examples/jsm/csm/CSMShader.js +307 -0
  54. package/examples/jsm/csm/CSMShadowNode.d.ts +44 -0
  55. package/examples/jsm/csm/CSMShadowNode.js +619 -0
  56. package/examples/jsm/curves/CurveExtras.d.ts +68 -0
  57. package/examples/jsm/curves/CurveExtras.js +694 -0
  58. package/examples/jsm/curves/NURBSCurve.d.ts +28 -0
  59. package/examples/jsm/curves/NURBSCurve.js +155 -0
  60. package/examples/jsm/curves/NURBSSurface.d.ts +13 -0
  61. package/examples/jsm/curves/NURBSSurface.js +98 -0
  62. package/examples/jsm/curves/NURBSUtils.d.ts +146 -0
  63. package/examples/jsm/curves/NURBSUtils.js +532 -0
  64. package/examples/jsm/curves/NURBSVolume.d.ts +23 -0
  65. package/examples/jsm/curves/NURBSVolume.js +82 -0
  66. package/examples/jsm/effects/AnaglyphEffect.d.ts +21 -0
  67. package/examples/jsm/effects/AnaglyphEffect.js +274 -0
  68. package/examples/jsm/effects/AsciiEffect.d.ts +18 -0
  69. package/examples/jsm/effects/AsciiEffect.js +323 -0
  70. package/examples/jsm/effects/OutlineEffect.d.ts +28 -0
  71. package/examples/jsm/effects/OutlineEffect.js +489 -0
  72. package/examples/jsm/effects/ParallaxBarrierEffect.d.ts +11 -0
  73. package/examples/jsm/effects/ParallaxBarrierEffect.js +155 -0
  74. package/examples/jsm/effects/StereoEffect.d.ts +9 -0
  75. package/examples/jsm/effects/StereoEffect.js +91 -0
  76. package/examples/jsm/environments/ColorEnvironment.d.ts +9 -0
  77. package/examples/jsm/environments/ColorEnvironment.js +59 -0
  78. package/examples/jsm/environments/DebugEnvironment.d.ts +5 -0
  79. package/examples/jsm/environments/DebugEnvironment.js +102 -0
  80. package/examples/jsm/environments/RoomEnvironment.d.ts +6 -0
  81. package/examples/jsm/environments/RoomEnvironment.js +185 -0
  82. package/examples/jsm/exporters/DRACOExporter.d.ts +17 -0
  83. package/examples/jsm/exporters/DRACOExporter.js +332 -0
  84. package/examples/jsm/exporters/EXRExporter.d.ts +27 -0
  85. package/examples/jsm/exporters/EXRExporter.js +618 -0
  86. package/examples/jsm/exporters/GLTFExporter.d.ts +161 -0
  87. package/examples/jsm/exporters/GLTFExporter.js +3856 -0
  88. package/examples/jsm/exporters/KTX2Exporter.d.ts +7 -0
  89. package/examples/jsm/exporters/KTX2Exporter.js +347 -0
  90. package/examples/jsm/exporters/OBJExporter.d.ts +7 -0
  91. package/examples/jsm/exporters/OBJExporter.js +308 -0
  92. package/examples/jsm/exporters/PLYExporter.d.ts +31 -0
  93. package/examples/jsm/exporters/PLYExporter.js +775 -0
  94. package/examples/jsm/exporters/STLExporter.d.ts +21 -0
  95. package/examples/jsm/exporters/STLExporter.js +221 -0
  96. package/examples/jsm/exporters/USDZExporter.d.ts +30 -0
  97. package/examples/jsm/exporters/USDZExporter.js +1489 -0
  98. package/examples/jsm/generators/CityGenerator.d.ts +131 -0
  99. package/examples/jsm/generators/CityGenerator.js +678 -0
  100. package/examples/jsm/generators/ForestGenerator.d.ts +73 -0
  101. package/examples/jsm/generators/ForestGenerator.js +347 -0
  102. package/examples/jsm/generators/TerrainGenerator.d.ts +57 -0
  103. package/examples/jsm/generators/TerrainGenerator.js +516 -0
  104. package/examples/jsm/generators/TreeGenerator.d.ts +102 -0
  105. package/examples/jsm/generators/TreeGenerator.js +371 -0
  106. package/examples/jsm/generators/city/BenchGenerator.d.ts +29 -0
  107. package/examples/jsm/generators/city/BenchGenerator.js +127 -0
  108. package/examples/jsm/generators/city/CarGenerator.d.ts +43 -0
  109. package/examples/jsm/generators/city/CarGenerator.js +479 -0
  110. package/examples/jsm/generators/city/CityGeneratorUtils.js +31 -0
  111. package/examples/jsm/generators/city/HydrantGenerator.d.ts +27 -0
  112. package/examples/jsm/generators/city/HydrantGenerator.js +106 -0
  113. package/examples/jsm/generators/city/InstancedMeshGenerator.d.ts +29 -0
  114. package/examples/jsm/generators/city/InstancedMeshGenerator.js +86 -0
  115. package/examples/jsm/generators/city/PersonGenerator.d.ts +44 -0
  116. package/examples/jsm/generators/city/PersonGenerator.js +447 -0
  117. package/examples/jsm/generators/city/SidewalkGenerator.d.ts +40 -0
  118. package/examples/jsm/generators/city/SidewalkGenerator.js +248 -0
  119. package/examples/jsm/generators/city/SkyscraperGenerator.d.ts +83 -0
  120. package/examples/jsm/generators/city/SkyscraperGenerator.js +1757 -0
  121. package/examples/jsm/generators/city/StreetTreeGenerator.d.ts +30 -0
  122. package/examples/jsm/generators/city/StreetTreeGenerator.js +231 -0
  123. package/examples/jsm/generators/city/StreetlightGenerator.d.ts +28 -0
  124. package/examples/jsm/generators/city/StreetlightGenerator.js +100 -0
  125. package/examples/jsm/generators/city/TrafficlightGenerator.d.ts +29 -0
  126. package/examples/jsm/generators/city/TrafficlightGenerator.js +106 -0
  127. package/examples/jsm/generators/city/TrashcanGenerator.d.ts +24 -0
  128. package/examples/jsm/generators/city/TrashcanGenerator.js +100 -0
  129. package/examples/jsm/geometries/BoxLineGeometry.d.ts +12 -0
  130. package/examples/jsm/geometries/BoxLineGeometry.js +92 -0
  131. package/examples/jsm/geometries/ConvexGeometry.d.ts +5 -0
  132. package/examples/jsm/geometries/ConvexGeometry.js +72 -0
  133. package/examples/jsm/geometries/DecalGeometry.d.ts +16 -0
  134. package/examples/jsm/geometries/DecalGeometry.js +420 -0
  135. package/examples/jsm/geometries/LoftGeometry.d.ts +83 -0
  136. package/examples/jsm/geometries/LoftGeometry.js +355 -0
  137. package/examples/jsm/geometries/ParametricFunctions.d.ts +8 -0
  138. package/examples/jsm/geometries/ParametricFunctions.js +100 -0
  139. package/examples/jsm/geometries/ParametricGeometry.d.ts +18 -0
  140. package/examples/jsm/geometries/ParametricGeometry.js +172 -0
  141. package/examples/jsm/geometries/RoundedBoxGeometry.d.ts +5 -0
  142. package/examples/jsm/geometries/RoundedBoxGeometry.js +216 -0
  143. package/examples/jsm/geometries/TeapotGeometry.d.ts +37 -0
  144. package/examples/jsm/geometries/TeapotGeometry.js +689 -0
  145. package/examples/jsm/geometries/TextGeometry.d.ts +89 -0
  146. package/examples/jsm/geometries/TextGeometry.js +102 -0
  147. package/examples/jsm/gpgpu/BitonicSort.d.ts +21 -0
  148. package/examples/jsm/gpgpu/BitonicSort.js +715 -0
  149. package/examples/jsm/gpgpu/CountingSort.d.ts +31 -0
  150. package/examples/jsm/gpgpu/CountingSort.js +271 -0
  151. package/examples/jsm/helpers/AnimationPathHelper.d.ts +38 -0
  152. package/examples/jsm/helpers/AnimationPathHelper.js +302 -0
  153. package/examples/jsm/helpers/LightProbeGridHelper.d.ts +12 -0
  154. package/examples/jsm/helpers/LightProbeGridHelper.js +166 -0
  155. package/examples/jsm/helpers/LightProbeGridHelperWebGL.d.ts +12 -0
  156. package/examples/jsm/helpers/LightProbeGridHelperWebGL.js +221 -0
  157. package/examples/jsm/helpers/LightProbeHelper.d.ts +12 -0
  158. package/examples/jsm/helpers/LightProbeHelper.js +166 -0
  159. package/examples/jsm/helpers/LightProbeHelperGPU.d.ts +12 -0
  160. package/examples/jsm/helpers/LightProbeHelperGPU.js +102 -0
  161. package/examples/jsm/helpers/OctreeHelper.d.ts +17 -0
  162. package/examples/jsm/helpers/OctreeHelper.js +109 -0
  163. package/examples/jsm/helpers/PositionalAudioHelper.d.ts +13 -0
  164. package/examples/jsm/helpers/PositionalAudioHelper.js +169 -0
  165. package/examples/jsm/helpers/RapierHelper.d.ts +13 -0
  166. package/examples/jsm/helpers/RapierHelper.js +59 -0
  167. package/examples/jsm/helpers/RectAreaLightHelper.d.ts +10 -0
  168. package/examples/jsm/helpers/RectAreaLightHelper.js +118 -0
  169. package/examples/jsm/helpers/TextureHelper.d.ts +10 -0
  170. package/examples/jsm/helpers/TextureHelper.js +265 -0
  171. package/examples/jsm/helpers/TextureHelperGPU.d.ts +10 -0
  172. package/examples/jsm/helpers/TextureHelperGPU.js +214 -0
  173. package/examples/jsm/helpers/VertexNormalsHelper.d.ts +14 -0
  174. package/examples/jsm/helpers/VertexNormalsHelper.js +155 -0
  175. package/examples/jsm/helpers/VertexTangentsHelper.d.ts +12 -0
  176. package/examples/jsm/helpers/VertexTangentsHelper.js +133 -0
  177. package/examples/jsm/helpers/ViewHelper.d.ts +20 -0
  178. package/examples/jsm/helpers/ViewHelper.js +529 -0
  179. package/examples/jsm/inspector/Extension.d.ts +22 -0
  180. package/examples/jsm/inspector/Extension.js +107 -0
  181. package/examples/jsm/inspector/Inspector.d.ts +54 -0
  182. package/examples/jsm/inspector/Inspector.js +684 -0
  183. package/examples/jsm/inspector/RendererInspector.d.ts +9 -0
  184. package/examples/jsm/inspector/RendererInspector.js +589 -0
  185. package/examples/jsm/inspector/extensions/color-grading/ColorGrading.d.ts +34 -0
  186. package/examples/jsm/inspector/extensions/color-grading/ColorGrading.js +2609 -0
  187. package/examples/jsm/inspector/extensions/color-grading/ColorWheel.js +352 -0
  188. package/examples/jsm/inspector/extensions/color-grading/CurveEditor.js +599 -0
  189. package/examples/jsm/inspector/extensions/color-grading/LUT3DStyle.js +1201 -0
  190. package/examples/jsm/inspector/extensions/color-grading/LUTMath.js +788 -0
  191. package/examples/jsm/inspector/extensions/color-grading/modules/BrightnessModule.js +72 -0
  192. package/examples/jsm/inspector/extensions/color-grading/modules/ColorWheelModule.js +112 -0
  193. package/examples/jsm/inspector/extensions/color-grading/modules/ContrastModule.js +82 -0
  194. package/examples/jsm/inspector/extensions/color-grading/modules/CurvesModule.js +109 -0
  195. package/examples/jsm/inspector/extensions/color-grading/modules/ExposureHueModule.js +110 -0
  196. package/examples/jsm/inspector/extensions/color-grading/modules/ExposureModule.js +73 -0
  197. package/examples/jsm/inspector/extensions/color-grading/modules/HueModule.js +78 -0
  198. package/examples/jsm/inspector/extensions/color-grading/modules/ImportedCubeModule.js +89 -0
  199. package/examples/jsm/inspector/extensions/color-grading/modules/Module.js +285 -0
  200. package/examples/jsm/inspector/extensions/color-grading/modules/OutputModule.js +101 -0
  201. package/examples/jsm/inspector/extensions/color-grading/modules/RendererModule.js +225 -0
  202. package/examples/jsm/inspector/extensions/color-grading/modules/SatVibranceModule.js +102 -0
  203. package/examples/jsm/inspector/extensions/color-grading/modules/SaturationModule.js +76 -0
  204. package/examples/jsm/inspector/extensions/color-grading/modules/VibranceModule.js +76 -0
  205. package/examples/jsm/inspector/extensions/color-grading/modules/WhiteBalanceModule.js +86 -0
  206. package/examples/jsm/inspector/extensions/tsl-graph/TSLGraphEditor.d.ts +20 -0
  207. package/examples/jsm/inspector/extensions/tsl-graph/TSLGraphEditor.js +911 -0
  208. package/examples/jsm/inspector/extensions/tsl-graph/TSLGraphLoader.d.ts +11 -0
  209. package/examples/jsm/inspector/extensions/tsl-graph/TSLGraphLoader.js +282 -0
  210. package/examples/jsm/inspector/tabs/Console.js +420 -0
  211. package/examples/jsm/inspector/tabs/Memory.js +134 -0
  212. package/examples/jsm/inspector/tabs/Parameters.d.ts +122 -0
  213. package/examples/jsm/inspector/tabs/Parameters.js +440 -0
  214. package/examples/jsm/inspector/tabs/Performance.js +283 -0
  215. package/examples/jsm/inspector/tabs/Settings.js +310 -0
  216. package/examples/jsm/inspector/tabs/Timeline.js +1748 -0
  217. package/examples/jsm/inspector/tabs/Viewer.js +1374 -0
  218. package/examples/jsm/inspector/ui/Graph.js +232 -0
  219. package/examples/jsm/inspector/ui/Item.d.ts +5 -0
  220. package/examples/jsm/inspector/ui/Item.js +249 -0
  221. package/examples/jsm/inspector/ui/List.js +81 -0
  222. package/examples/jsm/inspector/ui/Profiler.js +2273 -0
  223. package/examples/jsm/inspector/ui/Style.js +2300 -0
  224. package/examples/jsm/inspector/ui/Tab.d.ts +9 -0
  225. package/examples/jsm/inspector/ui/Tab.js +269 -0
  226. package/examples/jsm/inspector/ui/Values.d.ts +103 -0
  227. package/examples/jsm/inspector/ui/Values.js +553 -0
  228. package/examples/jsm/inspector/ui/utils.js +189 -0
  229. package/examples/jsm/interaction/InteractionManager.d.ts +18 -0
  230. package/examples/jsm/interaction/InteractionManager.js +226 -0
  231. package/examples/jsm/interactive/HTMLMesh.d.ts +13 -0
  232. package/examples/jsm/interactive/HTMLMesh.js +617 -0
  233. package/examples/jsm/interactive/InteractiveGroup.d.ts +28 -0
  234. package/examples/jsm/interactive/InteractiveGroup.js +224 -0
  235. package/examples/jsm/interactive/SelectionBox.d.ts +16 -0
  236. package/examples/jsm/interactive/SelectionBox.js +324 -0
  237. package/examples/jsm/interactive/SelectionHelper.d.ts +17 -0
  238. package/examples/jsm/interactive/SelectionHelper.js +150 -0
  239. package/examples/jsm/libs/basis/README.md +45 -0
  240. package/examples/jsm/libs/basis/basis_transcoder.js +19 -0
  241. package/examples/jsm/libs/basis/basis_transcoder.wasm +0 -0
  242. package/examples/jsm/libs/chevrotain.module.min.js +141 -0
  243. package/examples/jsm/libs/demuxer_mp4.js +109 -0
  244. package/examples/jsm/libs/draco/README.md +31 -0
  245. package/examples/jsm/libs/draco/draco_decoder.js +34 -0
  246. package/examples/jsm/libs/draco/draco_decoder.wasm +0 -0
  247. package/examples/jsm/libs/draco/draco_wasm_wrapper.js +117 -0
  248. package/examples/jsm/libs/draco/gltf/draco_decoder.js +33 -0
  249. package/examples/jsm/libs/draco/gltf/draco_decoder.wasm +0 -0
  250. package/examples/jsm/libs/draco/gltf/draco_wasm_wrapper.js +116 -0
  251. package/examples/jsm/libs/fflate.module.d.ts +1 -0
  252. package/examples/jsm/libs/fflate.module.js +2672 -0
  253. package/examples/jsm/libs/ktx-parse.module.js +1 -0
  254. package/examples/jsm/libs/lil-gui.module.min.d.ts +608 -0
  255. package/examples/jsm/libs/lil-gui.module.min.js +8 -0
  256. package/examples/jsm/libs/meshopt_clusterizer.module.js +421 -0
  257. package/examples/jsm/libs/meshopt_decoder.module.d.ts +1 -0
  258. package/examples/jsm/libs/meshopt_decoder.module.js +196 -0
  259. package/examples/jsm/libs/meshopt_simplifier.module.js +627 -0
  260. package/examples/jsm/libs/mikktspace.module.d.ts +19 -0
  261. package/examples/jsm/libs/mikktspace.module.js +153 -0
  262. package/examples/jsm/libs/motion-controllers.module.js +397 -0
  263. package/examples/jsm/libs/potpack.module.js +125 -0
  264. package/examples/jsm/libs/stats.module.d.ts +3 -0
  265. package/examples/jsm/libs/stats.module.js +167 -0
  266. package/examples/jsm/libs/surfaceNet.js +201 -0
  267. package/examples/jsm/libs/tween.module.d.ts +2 -0
  268. package/examples/jsm/libs/tween.module.js +876 -0
  269. package/examples/jsm/libs/utif.module.js +1665 -0
  270. package/examples/jsm/libs/zstddec.module.d.ts +5 -0
  271. package/examples/jsm/libs/zstddec.module.js +1 -0
  272. package/examples/jsm/lighting/ClusteredLighting.d.ts +45 -0
  273. package/examples/jsm/lighting/ClusteredLighting.js +55 -0
  274. package/examples/jsm/lighting/DynamicLighting.d.ts +16 -0
  275. package/examples/jsm/lighting/DynamicLighting.js +82 -0
  276. package/examples/jsm/lighting/LightProbeGrid.d.ts +177 -0
  277. package/examples/jsm/lighting/LightProbeGrid.js +820 -0
  278. package/examples/jsm/lighting/LightProbeGridUtils.js +107 -0
  279. package/examples/jsm/lighting/LightProbeGridWebGL.d.ts +178 -0
  280. package/examples/jsm/lighting/LightProbeGridWebGL.js +830 -0
  281. package/examples/jsm/lighting/vxgi/VXGIConeTracer.js +194 -0
  282. package/examples/jsm/lighting/vxgi/VXGINode.d.ts +100 -0
  283. package/examples/jsm/lighting/vxgi/VXGINode.js +660 -0
  284. package/examples/jsm/lighting/vxgi/VXGISceneCollector.js +478 -0
  285. package/examples/jsm/lighting/vxgi/VXGIVolume.d.ts +245 -0
  286. package/examples/jsm/lighting/vxgi/VXGIVolume.js +1430 -0
  287. package/examples/jsm/lights/LightProbeGenerator.d.ts +16 -0
  288. package/examples/jsm/lights/LightProbeGenerator.js +337 -0
  289. package/examples/jsm/lights/RectAreaLightTexturesLib.d.ts +7 -0
  290. package/examples/jsm/lights/RectAreaLightTexturesLib.js +127 -0
  291. package/examples/jsm/lights/RectAreaLightUniformsLib.d.ts +5 -0
  292. package/examples/jsm/lights/RectAreaLightUniformsLib.js +40 -0
  293. package/examples/jsm/lights/SunLight.d.ts +53 -0
  294. package/examples/jsm/lights/SunLight.js +95 -0
  295. package/examples/jsm/lights/SunLightNode.d.ts +25 -0
  296. package/examples/jsm/lights/SunLightNode.js +56 -0
  297. package/examples/jsm/lights/SunLightShadow.d.ts +57 -0
  298. package/examples/jsm/lights/SunLightShadow.js +319 -0
  299. package/examples/jsm/lights/SunShadowNode.d.ts +53 -0
  300. package/examples/jsm/lights/SunShadowNode.js +312 -0
  301. package/examples/jsm/lines/Line2.d.ts +25 -0
  302. package/examples/jsm/lines/Line2.js +56 -0
  303. package/examples/jsm/lines/LineGeometry.d.ts +27 -0
  304. package/examples/jsm/lines/LineGeometry.js +157 -0
  305. package/examples/jsm/lines/LineMaterial.d.ts +82 -0
  306. package/examples/jsm/lines/LineMaterial.js +726 -0
  307. package/examples/jsm/lines/LineSegments2.d.ts +39 -0
  308. package/examples/jsm/lines/LineSegments2.js +434 -0
  309. package/examples/jsm/lines/LineSegmentsGeometry.d.ts +53 -0
  310. package/examples/jsm/lines/LineSegmentsGeometry.js +298 -0
  311. package/examples/jsm/lines/Wireframe.d.ts +14 -0
  312. package/examples/jsm/lines/Wireframe.js +108 -0
  313. package/examples/jsm/lines/WireframeGeometry2.d.ts +8 -0
  314. package/examples/jsm/lines/WireframeGeometry2.js +49 -0
  315. package/examples/jsm/lines/webgpu/Line2.d.ts +14 -0
  316. package/examples/jsm/lines/webgpu/Line2.js +46 -0
  317. package/examples/jsm/lines/webgpu/LineSegments2.d.ts +15 -0
  318. package/examples/jsm/lines/webgpu/LineSegments2.js +419 -0
  319. package/examples/jsm/lines/webgpu/Wireframe.d.ts +13 -0
  320. package/examples/jsm/lines/webgpu/Wireframe.js +86 -0
  321. package/examples/jsm/loaders/3DMLoader.d.ts +12 -0
  322. package/examples/jsm/loaders/3DMLoader.js +1937 -0
  323. package/examples/jsm/loaders/3MFLoader.d.ts +9 -0
  324. package/examples/jsm/loaders/3MFLoader.js +1822 -0
  325. package/examples/jsm/loaders/AMFLoader.d.ts +7 -0
  326. package/examples/jsm/loaders/AMFLoader.js +541 -0
  327. package/examples/jsm/loaders/BVHLoader.d.ts +14 -0
  328. package/examples/jsm/loaders/BVHLoader.js +484 -0
  329. package/examples/jsm/loaders/ColladaLoader.d.ts +35 -0
  330. package/examples/jsm/loaders/ColladaLoader.js +153 -0
  331. package/examples/jsm/loaders/DDSLoader.d.ts +22 -0
  332. package/examples/jsm/loaders/DDSLoader.js +385 -0
  333. package/examples/jsm/loaders/DRACOLoader.d.ts +39 -0
  334. package/examples/jsm/loaders/DRACOLoader.js +772 -0
  335. package/examples/jsm/loaders/EXRLoader.d.ts +24 -0
  336. package/examples/jsm/loaders/EXRLoader.js +3395 -0
  337. package/examples/jsm/loaders/FBXLoader.d.ts +8 -0
  338. package/examples/jsm/loaders/FBXLoader.js +4656 -0
  339. package/examples/jsm/loaders/FontLoader.d.ts +41 -0
  340. package/examples/jsm/loaders/FontLoader.js +260 -0
  341. package/examples/jsm/loaders/GCodeLoader.d.ts +8 -0
  342. package/examples/jsm/loaders/GCodeLoader.js +318 -0
  343. package/examples/jsm/loaders/GLTFGaussianSplatLoaderExtension.d.ts +14 -0
  344. package/examples/jsm/loaders/GLTFGaussianSplatLoaderExtension.js +330 -0
  345. package/examples/jsm/loaders/GLTFLoader.d.ts +153 -0
  346. package/examples/jsm/loaders/GLTFLoader.js +4925 -0
  347. package/examples/jsm/loaders/GaussianSplatPLYLoader.d.ts +9 -0
  348. package/examples/jsm/loaders/GaussianSplatPLYLoader.js +386 -0
  349. package/examples/jsm/loaders/HDRCubeTextureLoader.d.ts +18 -0
  350. package/examples/jsm/loaders/HDRCubeTextureLoader.js +164 -0
  351. package/examples/jsm/loaders/HDRLoader.d.ts +12 -0
  352. package/examples/jsm/loaders/HDRLoader.js +463 -0
  353. package/examples/jsm/loaders/IESLoader.d.ts +5 -0
  354. package/examples/jsm/loaders/IESLoader.js +379 -0
  355. package/examples/jsm/loaders/KMZLoader.d.ts +9 -0
  356. package/examples/jsm/loaders/KMZLoader.js +163 -0
  357. package/examples/jsm/loaders/KSPLATLoader.d.ts +9 -0
  358. package/examples/jsm/loaders/KSPLATLoader.js +463 -0
  359. package/examples/jsm/loaders/KTX2Loader.d.ts +58 -0
  360. package/examples/jsm/loaders/KTX2Loader.js +1276 -0
  361. package/examples/jsm/loaders/KTXLoader.d.ts +22 -0
  362. package/examples/jsm/loaders/KTXLoader.js +197 -0
  363. package/examples/jsm/loaders/LDrawLoader.d.ts +38 -0
  364. package/examples/jsm/loaders/LDrawLoader.js +2510 -0
  365. package/examples/jsm/loaders/LUT3dlLoader.d.ts +39 -0
  366. package/examples/jsm/loaders/LUT3dlLoader.js +205 -0
  367. package/examples/jsm/loaders/LUTCubeLoader.d.ts +42 -0
  368. package/examples/jsm/loaders/LUTCubeLoader.js +190 -0
  369. package/examples/jsm/loaders/LUTImageLoader.d.ts +18 -0
  370. package/examples/jsm/loaders/LUTImageLoader.js +190 -0
  371. package/examples/jsm/loaders/LWOLoader.d.ts +25 -0
  372. package/examples/jsm/loaders/LWOLoader.js +1051 -0
  373. package/examples/jsm/loaders/MD2Loader.d.ts +7 -0
  374. package/examples/jsm/loaders/MD2Loader.js +435 -0
  375. package/examples/jsm/loaders/MDDLoader.d.ts +12 -0
  376. package/examples/jsm/loaders/MDDLoader.js +147 -0
  377. package/examples/jsm/loaders/MTLLoader.d.ts +95 -0
  378. package/examples/jsm/loaders/MTLLoader.js +593 -0
  379. package/examples/jsm/loaders/MaterialXLoader.d.ts +70 -0
  380. package/examples/jsm/loaders/MaterialXLoader.js +227 -0
  381. package/examples/jsm/loaders/NRRDLoader.d.ts +15 -0
  382. package/examples/jsm/loaders/NRRDLoader.js +718 -0
  383. package/examples/jsm/loaders/OBJLoader.d.ts +10 -0
  384. package/examples/jsm/loaders/OBJLoader.js +955 -0
  385. package/examples/jsm/loaders/PCDLoader.d.ts +8 -0
  386. package/examples/jsm/loaders/PCDLoader.js +620 -0
  387. package/examples/jsm/loaders/PDBLoader.d.ts +15 -0
  388. package/examples/jsm/loaders/PDBLoader.js +272 -0
  389. package/examples/jsm/loaders/PLYLoader.d.ts +11 -0
  390. package/examples/jsm/loaders/PLYLoader.js +968 -0
  391. package/examples/jsm/loaders/PVRLoader.d.ts +16 -0
  392. package/examples/jsm/loaders/PVRLoader.js +270 -0
  393. package/examples/jsm/loaders/RGBELoader.d.ts +7 -0
  394. package/examples/jsm/loaders/RGBELoader.js +18 -0
  395. package/examples/jsm/loaders/SPLATLoader.d.ts +9 -0
  396. package/examples/jsm/loaders/SPLATLoader.js +139 -0
  397. package/examples/jsm/loaders/SPZLoader.d.ts +18 -0
  398. package/examples/jsm/loaders/SPZLoader.js +561 -0
  399. package/examples/jsm/loaders/STLLoader.d.ts +7 -0
  400. package/examples/jsm/loaders/STLLoader.js +421 -0
  401. package/examples/jsm/loaders/SVGLoader.d.ts +67 -0
  402. package/examples/jsm/loaders/SVGLoader.js +3319 -0
  403. package/examples/jsm/loaders/TDSLoader.d.ts +35 -0
  404. package/examples/jsm/loaders/TDSLoader.js +1142 -0
  405. package/examples/jsm/loaders/TGALoader.d.ts +7 -0
  406. package/examples/jsm/loaders/TGALoader.js +538 -0
  407. package/examples/jsm/loaders/TIFFLoader.d.ts +7 -0
  408. package/examples/jsm/loaders/TIFFLoader.js +59 -0
  409. package/examples/jsm/loaders/TTFLoader.d.ts +10 -0
  410. package/examples/jsm/loaders/TTFLoader.js +261 -0
  411. package/examples/jsm/loaders/USDLoader.d.ts +14 -0
  412. package/examples/jsm/loaders/USDLoader.js +303 -0
  413. package/examples/jsm/loaders/USDZLoader.d.ts +14 -0
  414. package/examples/jsm/loaders/USDZLoader.js +16 -0
  415. package/examples/jsm/loaders/UltraHDRLoader.d.ts +28 -0
  416. package/examples/jsm/loaders/UltraHDRLoader.js +755 -0
  417. package/examples/jsm/loaders/VOXLoader.d.ts +38 -0
  418. package/examples/jsm/loaders/VOXLoader.js +919 -0
  419. package/examples/jsm/loaders/VRMLLoader.d.ts +7 -0
  420. package/examples/jsm/loaders/VRMLLoader.js +3646 -0
  421. package/examples/jsm/loaders/VTKLoader.d.ts +13 -0
  422. package/examples/jsm/loaders/VTKLoader.js +1293 -0
  423. package/examples/jsm/loaders/XYZLoader.d.ts +7 -0
  424. package/examples/jsm/loaders/XYZLoader.js +143 -0
  425. package/examples/jsm/loaders/collada/ColladaComposer.js +3044 -0
  426. package/examples/jsm/loaders/collada/ColladaParser.js +1977 -0
  427. package/examples/jsm/loaders/lwo/IFFParser.js +1217 -0
  428. package/examples/jsm/loaders/lwo/LWO2Parser.js +414 -0
  429. package/examples/jsm/loaders/lwo/LWO3Parser.js +373 -0
  430. package/examples/jsm/loaders/materialx/MaterialXArchive.js +108 -0
  431. package/examples/jsm/loaders/materialx/MaterialXDocument.js +878 -0
  432. package/examples/jsm/loaders/materialx/MaterialXHextile.d.ts +24 -0
  433. package/examples/jsm/loaders/materialx/MaterialXHextile.js +183 -0
  434. package/examples/jsm/loaders/materialx/MaterialXInterfaceValidation.d.ts +8 -0
  435. package/examples/jsm/loaders/materialx/MaterialXInterfaceValidation.js +376 -0
  436. package/examples/jsm/loaders/materialx/MaterialXLog.d.ts +33 -0
  437. package/examples/jsm/loaders/materialx/MaterialXLog.js +75 -0
  438. package/examples/jsm/loaders/materialx/MaterialXNodeInterfaceRegistry.js +4 -0
  439. package/examples/jsm/loaders/materialx/MaterialXNodeLibrary.js +1021 -0
  440. package/examples/jsm/loaders/materialx/MaterialXSurfaceMappings.js +661 -0
  441. package/examples/jsm/loaders/materialx/MaterialXUtils.js +57 -0
  442. package/examples/jsm/loaders/materialx/compile/MaterialXCompileRegistry.js +997 -0
  443. package/examples/jsm/loaders/materialx/parse/MaterialXParser.js +28 -0
  444. package/examples/jsm/loaders/usd/USDAParser.js +914 -0
  445. package/examples/jsm/loaders/usd/USDCParser.js +1875 -0
  446. package/examples/jsm/loaders/usd/USDComposer.js +4665 -0
  447. package/examples/jsm/materials/LDrawConditionalLineMaterial.d.ts +9 -0
  448. package/examples/jsm/materials/LDrawConditionalLineMaterial.js +183 -0
  449. package/examples/jsm/materials/LDrawConditionalLineNodeMaterial.d.ts +9 -0
  450. package/examples/jsm/materials/LDrawConditionalLineNodeMaterial.js +154 -0
  451. package/examples/jsm/materials/WoodNodeMaterial.d.ts +75 -0
  452. package/examples/jsm/materials/WoodNodeMaterial.js +431 -0
  453. package/examples/jsm/math/Capsule.d.ts +26 -0
  454. package/examples/jsm/math/Capsule.js +159 -0
  455. package/examples/jsm/math/ColorConverter.d.ts +19 -0
  456. package/examples/jsm/math/ColorConverter.js +58 -0
  457. package/examples/jsm/math/ColorSpaces.d.ts +15 -0
  458. package/examples/jsm/math/ColorSpaces.js +147 -0
  459. package/examples/jsm/math/ConvexHull.d.ts +89 -0
  460. package/examples/jsm/math/ConvexHull.js +1695 -0
  461. package/examples/jsm/math/ImprovedNoise.d.ts +4 -0
  462. package/examples/jsm/math/ImprovedNoise.js +88 -0
  463. package/examples/jsm/math/Lut.d.ts +27 -0
  464. package/examples/jsm/math/Lut.js +317 -0
  465. package/examples/jsm/math/MeshSurfaceSampler.d.ts +21 -0
  466. package/examples/jsm/math/MeshSurfaceSampler.js +315 -0
  467. package/examples/jsm/math/OBB.d.ts +24 -0
  468. package/examples/jsm/math/OBB.js +535 -0
  469. package/examples/jsm/math/Octree.d.ts +54 -0
  470. package/examples/jsm/math/Octree.js +822 -0
  471. package/examples/jsm/math/SimplexNoise.d.ts +9 -0
  472. package/examples/jsm/math/SimplexNoise.js +470 -0
  473. package/examples/jsm/misc/ConvexObjectBreaker.d.ts +25 -0
  474. package/examples/jsm/misc/ConvexObjectBreaker.js +539 -0
  475. package/examples/jsm/misc/GPUComputationRenderer.d.ts +55 -0
  476. package/examples/jsm/misc/GPUComputationRenderer.js +508 -0
  477. package/examples/jsm/misc/Gyroscope.d.ts +5 -0
  478. package/examples/jsm/misc/Gyroscope.js +78 -0
  479. package/examples/jsm/misc/MD2Character.d.ts +33 -0
  480. package/examples/jsm/misc/MD2Character.js +391 -0
  481. package/examples/jsm/misc/MD2CharacterComplex.d.ts +55 -0
  482. package/examples/jsm/misc/MD2CharacterComplex.js +740 -0
  483. package/examples/jsm/misc/MorphAnimMesh.d.ts +13 -0
  484. package/examples/jsm/misc/MorphAnimMesh.js +119 -0
  485. package/examples/jsm/misc/MorphBlendMesh.d.ts +21 -0
  486. package/examples/jsm/misc/MorphBlendMesh.js +425 -0
  487. package/examples/jsm/misc/ProgressiveLightMap.d.ts +58 -0
  488. package/examples/jsm/misc/ProgressiveLightMap.js +370 -0
  489. package/examples/jsm/misc/ProgressiveLightMapGPU.d.ts +27 -0
  490. package/examples/jsm/misc/ProgressiveLightMapGPU.js +322 -0
  491. package/examples/jsm/misc/RollerCoaster.d.ts +26 -0
  492. package/examples/jsm/misc/RollerCoaster.js +661 -0
  493. package/examples/jsm/misc/SculptGL.LICENSE.txt +21 -0
  494. package/examples/jsm/misc/Sculptor.d.ts +259 -0
  495. package/examples/jsm/misc/Sculptor.js +1679 -0
  496. package/examples/jsm/misc/SculptorMesh.js +1504 -0
  497. package/examples/jsm/misc/SculptorTools.js +1180 -0
  498. package/examples/jsm/misc/SculptorUtils.js +345 -0
  499. package/examples/jsm/misc/TileCreasedNormalsPlugin.d.ts +49 -0
  500. package/examples/jsm/misc/TileCreasedNormalsPlugin.js +270 -0
  501. package/examples/jsm/misc/TubePainter.d.ts +10 -0
  502. package/examples/jsm/misc/TubePainter.js +611 -0
  503. package/examples/jsm/misc/Volume.d.ts +37 -0
  504. package/examples/jsm/misc/Volume.js +520 -0
  505. package/examples/jsm/misc/VolumeSlice.d.ts +28 -0
  506. package/examples/jsm/misc/VolumeSlice.js +275 -0
  507. package/examples/jsm/modifiers/CurveModifier.d.ts +41 -0
  508. package/examples/jsm/modifiers/CurveModifier.js +374 -0
  509. package/examples/jsm/modifiers/CurveModifierGPU.d.ts +31 -0
  510. package/examples/jsm/modifiers/CurveModifierGPU.js +256 -0
  511. package/examples/jsm/modifiers/EdgeSplitModifier.d.ts +26 -0
  512. package/examples/jsm/modifiers/EdgeSplitModifier.js +299 -0
  513. package/examples/jsm/modifiers/SimplifyModifier.d.ts +6 -0
  514. package/examples/jsm/modifiers/SimplifyModifier.js +139 -0
  515. package/examples/jsm/modifiers/TessellateModifier.d.ts +9 -0
  516. package/examples/jsm/modifiers/TessellateModifier.js +340 -0
  517. package/examples/jsm/objects/GaussianSplat.d.ts +35 -0
  518. package/examples/jsm/objects/GaussianSplat.js +1039 -0
  519. package/examples/jsm/objects/GroundedSkybox.d.ts +5 -0
  520. package/examples/jsm/objects/GroundedSkybox.js +69 -0
  521. package/examples/jsm/objects/Lensflare.d.ts +21 -0
  522. package/examples/jsm/objects/Lensflare.js +489 -0
  523. package/examples/jsm/objects/LensflareMesh.d.ts +21 -0
  524. package/examples/jsm/objects/LensflareMesh.js +376 -0
  525. package/examples/jsm/objects/MarchingCubes.d.ts +76 -0
  526. package/examples/jsm/objects/MarchingCubes.js +1261 -0
  527. package/examples/jsm/objects/Reflector.d.ts +54 -0
  528. package/examples/jsm/objects/Reflector.js +385 -0
  529. package/examples/jsm/objects/ReflectorForSSRPass.d.ts +62 -0
  530. package/examples/jsm/objects/ReflectorForSSRPass.js +393 -0
  531. package/examples/jsm/objects/Refractor.d.ts +21 -0
  532. package/examples/jsm/objects/Refractor.js +389 -0
  533. package/examples/jsm/objects/ShadowMesh.d.ts +10 -0
  534. package/examples/jsm/objects/ShadowMesh.js +130 -0
  535. package/examples/jsm/objects/Sky.d.ts +28 -0
  536. package/examples/jsm/objects/Sky.js +342 -0
  537. package/examples/jsm/objects/SkyMesh.d.ts +26 -0
  538. package/examples/jsm/objects/SkyMesh.js +396 -0
  539. package/examples/jsm/objects/Water.d.ts +22 -0
  540. package/examples/jsm/objects/Water.js +374 -0
  541. package/examples/jsm/objects/Water2.d.ts +21 -0
  542. package/examples/jsm/objects/Water2.js +403 -0
  543. package/examples/jsm/objects/Water2Mesh.d.ts +53 -0
  544. package/examples/jsm/objects/Water2Mesh.js +199 -0
  545. package/examples/jsm/objects/WaterMesh.d.ts +40 -0
  546. package/examples/jsm/objects/WaterMesh.js +194 -0
  547. package/examples/jsm/offscreen/jank.js +45 -0
  548. package/examples/jsm/offscreen/offscreen.js +8 -0
  549. package/examples/jsm/offscreen/scene.js +86 -0
  550. package/examples/jsm/physics/AmmoPhysics.d.ts +9 -0
  551. package/examples/jsm/physics/AmmoPhysics.js +366 -0
  552. package/examples/jsm/physics/JoltPhysics.d.ts +10 -0
  553. package/examples/jsm/physics/JoltPhysics.js +334 -0
  554. package/examples/jsm/physics/RapierPhysics.d.ts +26 -0
  555. package/examples/jsm/physics/RapierPhysics.js +461 -0
  556. package/examples/jsm/postprocessing/AfterimagePass.d.ts +17 -0
  557. package/examples/jsm/postprocessing/AfterimagePass.js +187 -0
  558. package/examples/jsm/postprocessing/BloomPass.d.ts +14 -0
  559. package/examples/jsm/postprocessing/BloomPass.js +274 -0
  560. package/examples/jsm/postprocessing/BokehPass.d.ts +23 -0
  561. package/examples/jsm/postprocessing/BokehPass.js +218 -0
  562. package/examples/jsm/postprocessing/ClearPass.d.ts +9 -0
  563. package/examples/jsm/postprocessing/ClearPass.js +97 -0
  564. package/examples/jsm/postprocessing/CubeTexturePass.d.ts +14 -0
  565. package/examples/jsm/postprocessing/CubeTexturePass.js +146 -0
  566. package/examples/jsm/postprocessing/DotScreenPass.d.ts +10 -0
  567. package/examples/jsm/postprocessing/DotScreenPass.js +114 -0
  568. package/examples/jsm/postprocessing/EffectComposer.d.ts +30 -0
  569. package/examples/jsm/postprocessing/EffectComposer.js +365 -0
  570. package/examples/jsm/postprocessing/FXAAPass.d.ts +7 -0
  571. package/examples/jsm/postprocessing/FXAAPass.js +40 -0
  572. package/examples/jsm/postprocessing/FilmPass.d.ts +10 -0
  573. package/examples/jsm/postprocessing/FilmPass.js +113 -0
  574. package/examples/jsm/postprocessing/GTAOPass.d.ts +121 -0
  575. package/examples/jsm/postprocessing/GTAOPass.js +727 -0
  576. package/examples/jsm/postprocessing/GlitchPass.d.ts +16 -0
  577. package/examples/jsm/postprocessing/GlitchPass.js +177 -0
  578. package/examples/jsm/postprocessing/HalftonePass.d.ts +37 -0
  579. package/examples/jsm/postprocessing/HalftonePass.js +134 -0
  580. package/examples/jsm/postprocessing/LUTPass.d.ts +13 -0
  581. package/examples/jsm/postprocessing/LUTPass.js +138 -0
  582. package/examples/jsm/postprocessing/MaskPass.d.ts +14 -0
  583. package/examples/jsm/postprocessing/MaskPass.js +195 -0
  584. package/examples/jsm/postprocessing/OutlinePass.d.ts +64 -0
  585. package/examples/jsm/postprocessing/OutlinePass.js +776 -0
  586. package/examples/jsm/postprocessing/OutputPass.d.ts +14 -0
  587. package/examples/jsm/postprocessing/OutputPass.js +148 -0
  588. package/examples/jsm/postprocessing/Pass.d.ts +31 -0
  589. package/examples/jsm/postprocessing/Pass.js +191 -0
  590. package/examples/jsm/postprocessing/RenderPass.d.ts +28 -0
  591. package/examples/jsm/postprocessing/RenderPass.js +193 -0
  592. package/examples/jsm/postprocessing/RenderPixelatedPass.d.ts +30 -0
  593. package/examples/jsm/postprocessing/RenderPixelatedPass.js +314 -0
  594. package/examples/jsm/postprocessing/RenderTransitionPass.d.ts +33 -0
  595. package/examples/jsm/postprocessing/RenderTransitionPass.js +267 -0
  596. package/examples/jsm/postprocessing/SAOPass.d.ts +70 -0
  597. package/examples/jsm/postprocessing/SAOPass.js +407 -0
  598. package/examples/jsm/postprocessing/SMAAPass.d.ts +21 -0
  599. package/examples/jsm/postprocessing/SMAAPass.js +230 -0
  600. package/examples/jsm/postprocessing/SSAARenderPass.d.ts +26 -0
  601. package/examples/jsm/postprocessing/SSAARenderPass.js +313 -0
  602. package/examples/jsm/postprocessing/SSAOPass.d.ts +68 -0
  603. package/examples/jsm/postprocessing/SSAOPass.js +527 -0
  604. package/examples/jsm/postprocessing/SSRPass.d.ts +99 -0
  605. package/examples/jsm/postprocessing/SSRPass.js +858 -0
  606. package/examples/jsm/postprocessing/SavePass.d.ts +12 -0
  607. package/examples/jsm/postprocessing/SavePass.js +132 -0
  608. package/examples/jsm/postprocessing/ShaderPass.d.ts +11 -0
  609. package/examples/jsm/postprocessing/ShaderPass.js +135 -0
  610. package/examples/jsm/postprocessing/TAARenderPass.d.ts +8 -0
  611. package/examples/jsm/postprocessing/TAARenderPass.js +243 -0
  612. package/examples/jsm/postprocessing/TexturePass.d.ts +12 -0
  613. package/examples/jsm/postprocessing/TexturePass.js +131 -0
  614. package/examples/jsm/postprocessing/UnrealBloomPass.d.ts +26 -0
  615. package/examples/jsm/postprocessing/UnrealBloomPass.js +541 -0
  616. package/examples/jsm/renderers/CSS2DRenderer.d.ts +29 -0
  617. package/examples/jsm/renderers/CSS2DRenderer.js +352 -0
  618. package/examples/jsm/renderers/CSS3DRenderer.d.ts +26 -0
  619. package/examples/jsm/renderers/CSS3DRenderer.js +454 -0
  620. package/examples/jsm/renderers/Projector.d.ts +60 -0
  621. package/examples/jsm/renderers/Projector.js +1154 -0
  622. package/examples/jsm/renderers/SVGRenderer.d.ts +26 -0
  623. package/examples/jsm/renderers/SVGRenderer.js +799 -0
  624. package/examples/jsm/shaders/ACESFilmicToneMappingShader.d.ts +11 -0
  625. package/examples/jsm/shaders/ACESFilmicToneMappingShader.js +96 -0
  626. package/examples/jsm/shaders/AfterimageShader.d.ts +12 -0
  627. package/examples/jsm/shaders/AfterimageShader.js +63 -0
  628. package/examples/jsm/shaders/BasicShader.d.ts +6 -0
  629. package/examples/jsm/shaders/BasicShader.js +36 -0
  630. package/examples/jsm/shaders/BleachBypassShader.d.ts +10 -0
  631. package/examples/jsm/shaders/BleachBypassShader.js +68 -0
  632. package/examples/jsm/shaders/BlendShader.d.ts +13 -0
  633. package/examples/jsm/shaders/BlendShader.js +56 -0
  634. package/examples/jsm/shaders/BokehShader.d.ts +21 -0
  635. package/examples/jsm/shaders/BokehShader.js +151 -0
  636. package/examples/jsm/shaders/BokehShader2.d.ts +44 -0
  637. package/examples/jsm/shaders/BokehShader2.js +404 -0
  638. package/examples/jsm/shaders/BrightnessContrastShader.d.ts +12 -0
  639. package/examples/jsm/shaders/BrightnessContrastShader.js +62 -0
  640. package/examples/jsm/shaders/ColorCorrectionShader.d.ts +13 -0
  641. package/examples/jsm/shaders/ColorCorrectionShader.js +59 -0
  642. package/examples/jsm/shaders/ColorifyShader.d.ts +10 -0
  643. package/examples/jsm/shaders/ColorifyShader.js +57 -0
  644. package/examples/jsm/shaders/ConvolutionShader.d.ts +17 -0
  645. package/examples/jsm/shaders/ConvolutionShader.js +74 -0
  646. package/examples/jsm/shaders/CopyShader.d.ts +10 -0
  647. package/examples/jsm/shaders/CopyShader.js +52 -0
  648. package/examples/jsm/shaders/DOFMipMapShader.d.ts +13 -0
  649. package/examples/jsm/shaders/DOFMipMapShader.js +63 -0
  650. package/examples/jsm/shaders/DepthLimitedBlurShader.d.ts +28 -0
  651. package/examples/jsm/shaders/DepthLimitedBlurShader.js +183 -0
  652. package/examples/jsm/shaders/DigitalGlitch.d.ts +19 -0
  653. package/examples/jsm/shaders/DigitalGlitch.js +104 -0
  654. package/examples/jsm/shaders/DotScreenShader.d.ts +13 -0
  655. package/examples/jsm/shaders/DotScreenShader.js +75 -0
  656. package/examples/jsm/shaders/ExposureShader.d.ts +11 -0
  657. package/examples/jsm/shaders/ExposureShader.js +51 -0
  658. package/examples/jsm/shaders/FXAAShader.d.ts +11 -0
  659. package/examples/jsm/shaders/FXAAShader.js +298 -0
  660. package/examples/jsm/shaders/FilmShader.d.ts +12 -0
  661. package/examples/jsm/shaders/FilmShader.js +73 -0
  662. package/examples/jsm/shaders/FocusShader.d.ts +14 -0
  663. package/examples/jsm/shaders/FocusShader.js +94 -0
  664. package/examples/jsm/shaders/FreiChenShader.d.ts +11 -0
  665. package/examples/jsm/shaders/FreiChenShader.js +103 -0
  666. package/examples/jsm/shaders/GTAOShader.d.ts +59 -0
  667. package/examples/jsm/shaders/GTAOShader.js +434 -0
  668. package/examples/jsm/shaders/GammaCorrectionShader.d.ts +9 -0
  669. package/examples/jsm/shaders/GammaCorrectionShader.js +52 -0
  670. package/examples/jsm/shaders/HalftoneShader.d.ts +22 -0
  671. package/examples/jsm/shaders/HalftoneShader.js +332 -0
  672. package/examples/jsm/shaders/HorizontalBlurShader.d.ts +10 -0
  673. package/examples/jsm/shaders/HorizontalBlurShader.js +68 -0
  674. package/examples/jsm/shaders/HorizontalTiltShiftShader.d.ts +12 -0
  675. package/examples/jsm/shaders/HorizontalTiltShiftShader.js +70 -0
  676. package/examples/jsm/shaders/HueSaturationShader.d.ts +12 -0
  677. package/examples/jsm/shaders/HueSaturationShader.js +74 -0
  678. package/examples/jsm/shaders/KaleidoShader.d.ts +12 -0
  679. package/examples/jsm/shaders/KaleidoShader.js +65 -0
  680. package/examples/jsm/shaders/LuminosityHighPassShader.d.ts +15 -0
  681. package/examples/jsm/shaders/LuminosityHighPassShader.js +68 -0
  682. package/examples/jsm/shaders/LuminosityShader.d.ts +10 -0
  683. package/examples/jsm/shaders/LuminosityShader.js +54 -0
  684. package/examples/jsm/shaders/MirrorShader.d.ts +11 -0
  685. package/examples/jsm/shaders/MirrorShader.js +62 -0
  686. package/examples/jsm/shaders/NormalMapShader.d.ts +13 -0
  687. package/examples/jsm/shaders/NormalMapShader.js +60 -0
  688. package/examples/jsm/shaders/OutputShader.d.ts +11 -0
  689. package/examples/jsm/shaders/OutputShader.js +103 -0
  690. package/examples/jsm/shaders/PoissonDenoiseShader.d.ts +28 -0
  691. package/examples/jsm/shaders/PoissonDenoiseShader.js +239 -0
  692. package/examples/jsm/shaders/RGBShiftShader.d.ts +11 -0
  693. package/examples/jsm/shaders/RGBShiftShader.js +61 -0
  694. package/examples/jsm/shaders/SAOShader.d.ts +29 -0
  695. package/examples/jsm/shaders/SAOShader.js +201 -0
  696. package/examples/jsm/shaders/SMAAShader.d.ts +43 -0
  697. package/examples/jsm/shaders/SMAAShader.js +489 -0
  698. package/examples/jsm/shaders/SSAOShader.d.ts +49 -0
  699. package/examples/jsm/shaders/SSAOShader.js +331 -0
  700. package/examples/jsm/shaders/SSRShader.d.ts +62 -0
  701. package/examples/jsm/shaders/SSRShader.js +396 -0
  702. package/examples/jsm/shaders/SepiaShader.d.ts +10 -0
  703. package/examples/jsm/shaders/SepiaShader.js +57 -0
  704. package/examples/jsm/shaders/SobelOperatorShader.d.ts +11 -0
  705. package/examples/jsm/shaders/SobelOperatorShader.js +98 -0
  706. package/examples/jsm/shaders/SubsurfaceScatteringShader.d.ts +38 -0
  707. package/examples/jsm/shaders/SubsurfaceScatteringShader.js +95 -0
  708. package/examples/jsm/shaders/TechnicolorShader.d.ts +10 -0
  709. package/examples/jsm/shaders/TechnicolorShader.js +51 -0
  710. package/examples/jsm/shaders/ToonShader.d.ts +54 -0
  711. package/examples/jsm/shaders/ToonShader.js +349 -0
  712. package/examples/jsm/shaders/TriangleBlurShader.d.ts +11 -0
  713. package/examples/jsm/shaders/TriangleBlurShader.js +79 -0
  714. package/examples/jsm/shaders/UnpackDepthRGBAShader.d.ts +11 -0
  715. package/examples/jsm/shaders/UnpackDepthRGBAShader.js +60 -0
  716. package/examples/jsm/shaders/VelocityShader.d.ts +16 -0
  717. package/examples/jsm/shaders/VelocityShader.js +137 -0
  718. package/examples/jsm/shaders/VerticalBlurShader.d.ts +10 -0
  719. package/examples/jsm/shaders/VerticalBlurShader.js +66 -0
  720. package/examples/jsm/shaders/VerticalTiltShiftShader.d.ts +12 -0
  721. package/examples/jsm/shaders/VerticalTiltShiftShader.js +70 -0
  722. package/examples/jsm/shaders/VignetteShader.d.ts +11 -0
  723. package/examples/jsm/shaders/VignetteShader.js +56 -0
  724. package/examples/jsm/shaders/VolumeShader.d.ts +14 -0
  725. package/examples/jsm/shaders/VolumeShader.js +285 -0
  726. package/examples/jsm/shaders/WaterRefractionShader.d.ts +14 -0
  727. package/examples/jsm/shaders/WaterRefractionShader.js +106 -0
  728. package/examples/jsm/textures/FlakesTexture.d.ts +3 -0
  729. package/examples/jsm/textures/FlakesTexture.js +54 -0
  730. package/examples/jsm/transpiler/AST.d.ts +293 -0
  731. package/examples/jsm/transpiler/AST.js +694 -0
  732. package/examples/jsm/transpiler/GLSLDecoder.d.ts +7 -0
  733. package/examples/jsm/transpiler/GLSLDecoder.js +1718 -0
  734. package/examples/jsm/transpiler/Linker.js +327 -0
  735. package/examples/jsm/transpiler/ShaderToyDecoder.d.ts +3 -0
  736. package/examples/jsm/transpiler/ShaderToyDecoder.js +51 -0
  737. package/examples/jsm/transpiler/TSLEncoder.d.ts +51 -0
  738. package/examples/jsm/transpiler/TSLEncoder.js +1055 -0
  739. package/examples/jsm/transpiler/Transpiler.d.ts +5 -0
  740. package/examples/jsm/transpiler/Transpiler.js +67 -0
  741. package/examples/jsm/transpiler/TranspilerUtils.js +29 -0
  742. package/examples/jsm/transpiler/WGSLEncoder.js +868 -0
  743. package/examples/jsm/tsl/WebGLNodesHandler.d.ts +17 -0
  744. package/examples/jsm/tsl/WebGLNodesHandler.js +595 -0
  745. package/examples/jsm/tsl/display/AfterImageNode.d.ts +15 -0
  746. package/examples/jsm/tsl/display/AfterImageNode.js +256 -0
  747. package/examples/jsm/tsl/display/AnaglyphPassNode.d.ts +42 -0
  748. package/examples/jsm/tsl/display/AnaglyphPassNode.js +550 -0
  749. package/examples/jsm/tsl/display/BilateralBlurNode.d.ts +27 -0
  750. package/examples/jsm/tsl/display/BilateralBlurNode.js +377 -0
  751. package/examples/jsm/tsl/display/BleachBypass.d.ts +3 -0
  752. package/examples/jsm/tsl/display/BleachBypass.js +33 -0
  753. package/examples/jsm/tsl/display/BloomNode.d.ts +44 -0
  754. package/examples/jsm/tsl/display/BloomNode.js +599 -0
  755. package/examples/jsm/tsl/display/CRT.d.ts +22 -0
  756. package/examples/jsm/tsl/display/CRT.js +150 -0
  757. package/examples/jsm/tsl/display/ChromaticAberrationNode.d.ts +19 -0
  758. package/examples/jsm/tsl/display/ChromaticAberrationNode.js +174 -0
  759. package/examples/jsm/tsl/display/DenoiseNode.d.ts +26 -0
  760. package/examples/jsm/tsl/display/DenoiseNode.js +354 -0
  761. package/examples/jsm/tsl/display/DepthOfFieldNode.d.ts +28 -0
  762. package/examples/jsm/tsl/display/DepthOfFieldNode.js +572 -0
  763. package/examples/jsm/tsl/display/DotScreenNode.d.ts +17 -0
  764. package/examples/jsm/tsl/display/DotScreenNode.js +104 -0
  765. package/examples/jsm/tsl/display/FSR1Node.d.ts +17 -0
  766. package/examples/jsm/tsl/display/FSR1Node.js +481 -0
  767. package/examples/jsm/tsl/display/FXAANode.d.ts +11 -0
  768. package/examples/jsm/tsl/display/FXAANode.js +364 -0
  769. package/examples/jsm/tsl/display/FilmNode.d.ts +17 -0
  770. package/examples/jsm/tsl/display/FilmNode.js +101 -0
  771. package/examples/jsm/tsl/display/GTAONode.d.ts +37 -0
  772. package/examples/jsm/tsl/display/GTAONode.js +719 -0
  773. package/examples/jsm/tsl/display/GaussianBlurNode.d.ts +56 -0
  774. package/examples/jsm/tsl/display/GaussianBlurNode.js +412 -0
  775. package/examples/jsm/tsl/display/GodraysNode.d.ts +20 -0
  776. package/examples/jsm/tsl/display/GodraysNode.js +618 -0
  777. package/examples/jsm/tsl/display/ImportanceSampledEnvironment.d.ts +84 -0
  778. package/examples/jsm/tsl/display/ImportanceSampledEnvironment.js +560 -0
  779. package/examples/jsm/tsl/display/LensflareNode.d.ts +34 -0
  780. package/examples/jsm/tsl/display/LensflareNode.js +282 -0
  781. package/examples/jsm/tsl/display/Lut3DNode.d.ts +19 -0
  782. package/examples/jsm/tsl/display/Lut3DNode.js +109 -0
  783. package/examples/jsm/tsl/display/MotionBlur.d.ts +7 -0
  784. package/examples/jsm/tsl/display/MotionBlur.js +33 -0
  785. package/examples/jsm/tsl/display/OITPassNode.d.ts +64 -0
  786. package/examples/jsm/tsl/display/OITPassNode.js +352 -0
  787. package/examples/jsm/tsl/display/OutlineNode.d.ts +31 -0
  788. package/examples/jsm/tsl/display/OutlineNode.js +814 -0
  789. package/examples/jsm/tsl/display/ParallaxBarrierPassNode.d.ts +12 -0
  790. package/examples/jsm/tsl/display/ParallaxBarrierPassNode.js +90 -0
  791. package/examples/jsm/tsl/display/PixelationPassNode.d.ts +27 -0
  792. package/examples/jsm/tsl/display/PixelationPassNode.js +335 -0
  793. package/examples/jsm/tsl/display/RGBShiftNode.d.ts +15 -0
  794. package/examples/jsm/tsl/display/RGBShiftNode.js +96 -0
  795. package/examples/jsm/tsl/display/RecurrentDenoiseNode.d.ts +89 -0
  796. package/examples/jsm/tsl/display/RecurrentDenoiseNode.js +915 -0
  797. package/examples/jsm/tsl/display/RetroPassNode.d.ts +17 -0
  798. package/examples/jsm/tsl/display/RetroPassNode.js +263 -0
  799. package/examples/jsm/tsl/display/SMAANode.d.ts +17 -0
  800. package/examples/jsm/tsl/display/SMAANode.js +729 -0
  801. package/examples/jsm/tsl/display/SSAAPassNode.d.ts +18 -0
  802. package/examples/jsm/tsl/display/SSAAPassNode.js +344 -0
  803. package/examples/jsm/tsl/display/SSAONode.d.ts +116 -0
  804. package/examples/jsm/tsl/display/SSAONode.js +436 -0
  805. package/examples/jsm/tsl/display/SSGINode.d.ts +33 -0
  806. package/examples/jsm/tsl/display/SSGINode.js +691 -0
  807. package/examples/jsm/tsl/display/SSRNode.d.ts +315 -0
  808. package/examples/jsm/tsl/display/SSRNode.js +1358 -0
  809. package/examples/jsm/tsl/display/SSSNode.d.ts +20 -0
  810. package/examples/jsm/tsl/display/SSSNode.js +493 -0
  811. package/examples/jsm/tsl/display/Sepia.d.ts +3 -0
  812. package/examples/jsm/tsl/display/Sepia.js +24 -0
  813. package/examples/jsm/tsl/display/Shape.d.ts +3 -0
  814. package/examples/jsm/tsl/display/Shape.js +29 -0
  815. package/examples/jsm/tsl/display/SharpenNode.d.ts +22 -0
  816. package/examples/jsm/tsl/display/SharpenNode.js +284 -0
  817. package/examples/jsm/tsl/display/SobelOperatorNode.d.ts +11 -0
  818. package/examples/jsm/tsl/display/SobelOperatorNode.js +168 -0
  819. package/examples/jsm/tsl/display/StereoCompositePassNode.d.ts +13 -0
  820. package/examples/jsm/tsl/display/StereoCompositePassNode.js +190 -0
  821. package/examples/jsm/tsl/display/StereoPassNode.d.ts +13 -0
  822. package/examples/jsm/tsl/display/StereoPassNode.js +117 -0
  823. package/examples/jsm/tsl/display/TAAUNode.d.ts +31 -0
  824. package/examples/jsm/tsl/display/TAAUNode.js +732 -0
  825. package/examples/jsm/tsl/display/TRAANode.d.ts +26 -0
  826. package/examples/jsm/tsl/display/TRAANode.js +641 -0
  827. package/examples/jsm/tsl/display/TemporalReprojectNode.d.ts +64 -0
  828. package/examples/jsm/tsl/display/TemporalReprojectNode.js +1029 -0
  829. package/examples/jsm/tsl/display/TransitionNode.d.ts +31 -0
  830. package/examples/jsm/tsl/display/TransitionNode.js +141 -0
  831. package/examples/jsm/tsl/display/boxBlur.d.ts +10 -0
  832. package/examples/jsm/tsl/display/boxBlur.js +65 -0
  833. package/examples/jsm/tsl/display/depthAwareBlend.d.ts +15 -0
  834. package/examples/jsm/tsl/display/depthAwareBlend.js +80 -0
  835. package/examples/jsm/tsl/display/depthAwareBlur.d.ts +10 -0
  836. package/examples/jsm/tsl/display/depthAwareBlur.js +63 -0
  837. package/examples/jsm/tsl/display/hashBlur.d.ts +12 -0
  838. package/examples/jsm/tsl/display/hashBlur.js +55 -0
  839. package/examples/jsm/tsl/display/radialBlur.d.ts +12 -0
  840. package/examples/jsm/tsl/display/radialBlur.js +68 -0
  841. package/examples/jsm/tsl/lighting/ClusteredLightsNode.d.ts +54 -0
  842. package/examples/jsm/tsl/lighting/ClusteredLightsNode.js +633 -0
  843. package/examples/jsm/tsl/lighting/DynamicLightsNode.d.ts +21 -0
  844. package/examples/jsm/tsl/lighting/DynamicLightsNode.js +300 -0
  845. package/examples/jsm/tsl/lighting/LightProbeGridNode.js +136 -0
  846. package/examples/jsm/tsl/lighting/data/AmbientLightDataNode.d.ts +9 -0
  847. package/examples/jsm/tsl/lighting/data/AmbientLightDataNode.js +61 -0
  848. package/examples/jsm/tsl/lighting/data/DirectionalLightDataNode.d.ts +9 -0
  849. package/examples/jsm/tsl/lighting/data/DirectionalLightDataNode.js +111 -0
  850. package/examples/jsm/tsl/lighting/data/HemisphereLightDataNode.d.ts +9 -0
  851. package/examples/jsm/tsl/lighting/data/HemisphereLightDataNode.js +99 -0
  852. package/examples/jsm/tsl/lighting/data/PointLightDataNode.d.ts +9 -0
  853. package/examples/jsm/tsl/lighting/data/PointLightDataNode.js +134 -0
  854. package/examples/jsm/tsl/lighting/data/SpotLightDataNode.d.ts +9 -0
  855. package/examples/jsm/tsl/lighting/data/SpotLightDataNode.js +161 -0
  856. package/examples/jsm/tsl/math/Bayer.d.ts +5 -0
  857. package/examples/jsm/tsl/math/Bayer.js +84 -0
  858. package/examples/jsm/tsl/math/curlNoise.d.ts +38 -0
  859. package/examples/jsm/tsl/math/curlNoise.js +107 -0
  860. package/examples/jsm/tsl/math/voronoiNoise.d.ts +52 -0
  861. package/examples/jsm/tsl/math/voronoiNoise.js +112 -0
  862. package/examples/jsm/tsl/shadows/TileShadowNode.d.ts +14 -0
  863. package/examples/jsm/tsl/shadows/TileShadowNode.js +454 -0
  864. package/examples/jsm/tsl/shadows/TileShadowNodeHelper.d.ts +14 -0
  865. package/examples/jsm/tsl/shadows/TileShadowNodeHelper.js +212 -0
  866. package/examples/jsm/tsl/utils/GroundedSkybox.d.ts +17 -0
  867. package/examples/jsm/tsl/utils/GroundedSkybox.js +62 -0
  868. package/examples/jsm/tsl/utils/RNoise.d.ts +12 -0
  869. package/examples/jsm/tsl/utils/RNoise.js +51 -0
  870. package/examples/jsm/tsl/utils/Raymarching.d.ts +8 -0
  871. package/examples/jsm/tsl/utils/Raymarching.js +70 -0
  872. package/examples/jsm/tsl/utils/SoftParticles.d.ts +21 -0
  873. package/examples/jsm/tsl/utils/SoftParticles.js +60 -0
  874. package/examples/jsm/tsl/utils/SpecularHelpers.d.ts +20 -0
  875. package/examples/jsm/tsl/utils/SpecularHelpers.js +325 -0
  876. package/examples/jsm/tsl/utils/TAAUtils.js +195 -0
  877. package/examples/jsm/utils/BufferGeometryUtils.d.ts +37 -0
  878. package/examples/jsm/utils/BufferGeometryUtils.js +1501 -0
  879. package/examples/jsm/utils/CameraUtils.d.ts +9 -0
  880. package/examples/jsm/utils/CameraUtils.js +82 -0
  881. package/examples/jsm/utils/ColorUtils.d.ts +5 -0
  882. package/examples/jsm/utils/ColorUtils.js +76 -0
  883. package/examples/jsm/utils/GaussianSplatUtils.d.ts +68 -0
  884. package/examples/jsm/utils/GaussianSplatUtils.js +229 -0
  885. package/examples/jsm/utils/GeometryCompressionUtils.d.ts +21 -0
  886. package/examples/jsm/utils/GeometryCompressionUtils.js +547 -0
  887. package/examples/jsm/utils/GeometryUtils.d.ts +25 -0
  888. package/examples/jsm/utils/GeometryUtils.js +226 -0
  889. package/examples/jsm/utils/LDrawUtils.d.ts +5 -0
  890. package/examples/jsm/utils/LDrawUtils.js +211 -0
  891. package/examples/jsm/utils/SceneOptimizer.d.ts +18 -0
  892. package/examples/jsm/utils/SceneOptimizer.js +458 -0
  893. package/examples/jsm/utils/SceneUtils.d.ts +57 -0
  894. package/examples/jsm/utils/SceneUtils.js +363 -0
  895. package/examples/jsm/utils/ShadowMapViewer.d.ts +26 -0
  896. package/examples/jsm/utils/ShadowMapViewer.js +244 -0
  897. package/examples/jsm/utils/ShadowMapViewerGPU.d.ts +26 -0
  898. package/examples/jsm/utils/ShadowMapViewerGPU.js +233 -0
  899. package/examples/jsm/utils/SkeletonUtils.d.ts +32 -0
  900. package/examples/jsm/utils/SkeletonUtils.js +496 -0
  901. package/examples/jsm/utils/SortUtils.d.ts +7 -0
  902. package/examples/jsm/utils/SortUtils.js +175 -0
  903. package/examples/jsm/utils/UVsDebug.d.ts +3 -0
  904. package/examples/jsm/utils/UVsDebug.js +173 -0
  905. package/examples/jsm/utils/WebGLTextureUtils.d.ts +3 -0
  906. package/examples/jsm/utils/WebGLTextureUtils.js +115 -0
  907. package/examples/jsm/utils/WebGPUTextureUtils.d.ts +3 -0
  908. package/examples/jsm/utils/WebGPUTextureUtils.js +81 -0
  909. package/examples/jsm/utils/WorkerPool.d.ts +26 -0
  910. package/examples/jsm/utils/WorkerPool.js +167 -0
  911. package/examples/jsm/webxr/ARButton.d.ts +9 -0
  912. package/examples/jsm/webxr/ARButton.js +251 -0
  913. package/examples/jsm/webxr/OculusHandModel.d.ts +23 -0
  914. package/examples/jsm/webxr/OculusHandModel.js +194 -0
  915. package/examples/jsm/webxr/OculusHandPointerModel.d.ts +67 -0
  916. package/examples/jsm/webxr/OculusHandPointerModel.js +539 -0
  917. package/examples/jsm/webxr/Text2D.d.ts +3 -0
  918. package/examples/jsm/webxr/Text2D.js +52 -0
  919. package/examples/jsm/webxr/VRButton.d.ts +7 -0
  920. package/examples/jsm/webxr/VRButton.js +264 -0
  921. package/examples/jsm/webxr/WebGLXRFallback.d.ts +14 -0
  922. package/examples/jsm/webxr/WebGLXRFallback.js +75 -0
  923. package/examples/jsm/webxr/XRButton.d.ts +7 -0
  924. package/examples/jsm/webxr/XRButton.js +246 -0
  925. package/examples/jsm/webxr/XRControllerModelFactory.d.ts +23 -0
  926. package/examples/jsm/webxr/XRControllerModelFactory.js +415 -0
  927. package/examples/jsm/webxr/XREstimatedLight.d.ts +69 -0
  928. package/examples/jsm/webxr/XREstimatedLight.js +254 -0
  929. package/examples/jsm/webxr/XRHandMeshModel.d.ts +20 -0
  930. package/examples/jsm/webxr/XRHandMeshModel.js +177 -0
  931. package/examples/jsm/webxr/XRHandModelFactory.d.ts +32 -0
  932. package/examples/jsm/webxr/XRHandModelFactory.js +198 -0
  933. package/examples/jsm/webxr/XRHandPrimitiveModel.d.ts +24 -0
  934. package/examples/jsm/webxr/XRHandPrimitiveModel.js +147 -0
  935. package/examples/jsm/webxr/XRPlanes.d.ts +5 -0
  936. package/examples/jsm/webxr/XRPlanes.js +118 -0
  937. package/index.d.ts +6 -0
  938. package/package.json +68 -4
  939. package/src/Three.Core.d.ts +176 -0
  940. package/src/Three.Core.js +189 -0
  941. package/src/Three.Legacy.js +0 -0
  942. package/src/Three.TSL.d.ts +686 -0
  943. package/src/Three.TSL.js +684 -0
  944. package/src/Three.WebGPU.Nodes.d.ts +36 -0
  945. package/src/Three.WebGPU.Nodes.js +33 -0
  946. package/src/Three.WebGPU.d.ts +44 -0
  947. package/src/Three.WebGPU.js +43 -0
  948. package/src/Three.d.ts +47 -0
  949. package/src/Three.js +10 -0
  950. package/src/animation/AnimationAction.d.ts +286 -0
  951. package/src/animation/AnimationAction.js +946 -0
  952. package/src/animation/AnimationClip.d.ts +168 -0
  953. package/src/animation/AnimationClip.js +502 -0
  954. package/src/animation/AnimationMixer.d.ts +175 -0
  955. package/src/animation/AnimationMixer.js +860 -0
  956. package/src/animation/AnimationObjectGroup.d.ts +58 -0
  957. package/src/animation/AnimationObjectGroup.js +423 -0
  958. package/src/animation/AnimationUtils.d.ts +182 -0
  959. package/src/animation/AnimationUtils.js +521 -0
  960. package/src/animation/KeyframeTrack.d.ts +197 -0
  961. package/src/animation/KeyframeTrack.js +673 -0
  962. package/src/animation/PropertyBinding.d.ts +101 -0
  963. package/src/animation/PropertyBinding.js +794 -0
  964. package/src/animation/PropertyMixer.d.ts +75 -0
  965. package/src/animation/PropertyMixer.js +385 -0
  966. package/src/animation/tracks/BooleanKeyframeTrack.d.ts +18 -0
  967. package/src/animation/tracks/BooleanKeyframeTrack.js +55 -0
  968. package/src/animation/tracks/ColorKeyframeTrack.d.ts +17 -0
  969. package/src/animation/tracks/ColorKeyframeTrack.js +36 -0
  970. package/src/animation/tracks/NumberKeyframeTrack.d.ts +17 -0
  971. package/src/animation/tracks/NumberKeyframeTrack.js +36 -0
  972. package/src/animation/tracks/QuaternionKeyframeTrack.d.ts +17 -0
  973. package/src/animation/tracks/QuaternionKeyframeTrack.js +51 -0
  974. package/src/animation/tracks/StringKeyframeTrack.d.ts +18 -0
  975. package/src/animation/tracks/StringKeyframeTrack.js +55 -0
  976. package/src/animation/tracks/VectorKeyframeTrack.d.ts +17 -0
  977. package/src/animation/tracks/VectorKeyframeTrack.js +36 -0
  978. package/src/audio/Audio.d.ts +340 -0
  979. package/src/audio/Audio.js +778 -0
  980. package/src/audio/AudioAnalyser.d.ts +63 -0
  981. package/src/audio/AudioAnalyser.js +97 -0
  982. package/src/audio/AudioContext.d.ts +19 -0
  983. package/src/audio/AudioContext.js +40 -0
  984. package/src/audio/AudioListener.d.ts +75 -0
  985. package/src/audio/AudioListener.js +218 -0
  986. package/src/audio/PositionalAudio.d.ts +108 -0
  987. package/src/audio/PositionalAudio.js +253 -0
  988. package/src/cameras/ArrayCamera.d.ts +35 -0
  989. package/src/cameras/ArrayCamera.js +54 -0
  990. package/src/cameras/Camera.d.ts +42 -0
  991. package/src/cameras/Camera.js +160 -0
  992. package/src/cameras/CubeCamera.d.ts +89 -0
  993. package/src/cameras/CubeCamera.js +259 -0
  994. package/src/cameras/OrthographicCamera.d.ts +144 -0
  995. package/src/cameras/OrthographicCamera.js +245 -0
  996. package/src/cameras/PerspectiveCamera.d.ts +241 -0
  997. package/src/cameras/PerspectiveCamera.js +407 -0
  998. package/src/cameras/StereoCamera.d.ts +44 -0
  999. package/src/cameras/StereoCamera.js +149 -0
  1000. package/src/constants.d.ts +976 -0
  1001. package/src/constants.js +1782 -0
  1002. package/src/core/BufferAttribute.d.ts +650 -0
  1003. package/src/core/BufferAttribute.js +1057 -0
  1004. package/src/core/BufferGeometry.d.ts +442 -0
  1005. package/src/core/BufferGeometry.js +1480 -0
  1006. package/src/core/Clock.d.ts +73 -0
  1007. package/src/core/Clock.js +135 -0
  1008. package/src/core/EventDispatcher.d.ts +82 -0
  1009. package/src/core/EventDispatcher.js +131 -0
  1010. package/src/core/GLBufferAttribute.d.ts +138 -0
  1011. package/src/core/GLBufferAttribute.js +171 -0
  1012. package/src/core/InstancedBufferAttribute.d.ts +32 -0
  1013. package/src/core/InstancedBufferAttribute.js +68 -0
  1014. package/src/core/InstancedBufferGeometry.d.ts +37 -0
  1015. package/src/core/InstancedBufferGeometry.js +60 -0
  1016. package/src/core/InstancedInterleavedBuffer.d.ts +22 -0
  1017. package/src/core/InstancedInterleavedBuffer.js +74 -0
  1018. package/src/core/InterleavedBuffer.d.ts +162 -0
  1019. package/src/core/InterleavedBuffer.js +295 -0
  1020. package/src/core/InterleavedBufferAttribute.d.ts +201 -0
  1021. package/src/core/InterleavedBufferAttribute.js +549 -0
  1022. package/src/core/Layers.d.ts +72 -0
  1023. package/src/core/Layers.js +121 -0
  1024. package/src/core/Object3D.d.ts +725 -0
  1025. package/src/core/Object3D.js +1709 -0
  1026. package/src/core/Raycaster.d.ts +212 -0
  1027. package/src/core/Raycaster.js +266 -0
  1028. package/src/core/RenderTarget.d.ts +153 -0
  1029. package/src/core/RenderTarget.js +495 -0
  1030. package/src/core/RenderTarget3D.d.ts +9 -0
  1031. package/src/core/RenderTarget3D.js +52 -0
  1032. package/src/core/Timer.d.ts +77 -0
  1033. package/src/core/Timer.js +184 -0
  1034. package/src/core/Uniform.d.ts +38 -0
  1035. package/src/core/Uniform.js +46 -0
  1036. package/src/core/UniformsGroup.d.ts +39 -0
  1037. package/src/core/UniformsGroup.js +180 -0
  1038. package/src/extras/Controls.d.ts +59 -0
  1039. package/src/extras/Controls.js +112 -0
  1040. package/src/extras/DataUtils.d.ts +22 -0
  1041. package/src/extras/DataUtils.js +217 -0
  1042. package/src/extras/Earcut.d.ts +17 -0
  1043. package/src/extras/Earcut.js +28 -0
  1044. package/src/extras/ImageUtils.d.ts +33 -0
  1045. package/src/extras/ImageUtils.js +137 -0
  1046. package/src/extras/PMREMGenerator.d.ts +95 -0
  1047. package/src/extras/PMREMGenerator.js +1063 -0
  1048. package/src/extras/ShapeUtils.d.ts +25 -0
  1049. package/src/extras/ShapeUtils.js +114 -0
  1050. package/src/extras/TextureUtils.d.ts +42 -0
  1051. package/src/extras/TextureUtils.js +297 -0
  1052. package/src/extras/core/Curve.d.ts +162 -0
  1053. package/src/extras/core/Curve.js +517 -0
  1054. package/src/extras/core/CurvePath.d.ts +77 -0
  1055. package/src/extras/core/CurvePath.js +296 -0
  1056. package/src/extras/core/Interpolations.d.ts +36 -0
  1057. package/src/extras/core/Interpolations.js +111 -0
  1058. package/src/extras/core/Path.d.ts +166 -0
  1059. package/src/extras/core/Path.js +329 -0
  1060. package/src/extras/core/Shape.d.ts +86 -0
  1061. package/src/extras/core/Shape.js +165 -0
  1062. package/src/extras/core/ShapePath.d.ts +94 -0
  1063. package/src/extras/core/ShapePath.js +356 -0
  1064. package/src/extras/curves/ArcCurve.d.ts +41 -0
  1065. package/src/extras/curves/ArcCurve.js +39 -0
  1066. package/src/extras/curves/CatmullRomCurve3.d.ts +77 -0
  1067. package/src/extras/curves/CatmullRomCurve3.js +327 -0
  1068. package/src/extras/curves/CubicBezierCurve.d.ts +72 -0
  1069. package/src/extras/curves/CubicBezierCurve.js +145 -0
  1070. package/src/extras/curves/CubicBezierCurve3.d.ts +72 -0
  1071. package/src/extras/curves/CubicBezierCurve3.js +129 -0
  1072. package/src/extras/curves/Curves.d.ts +10 -0
  1073. package/src/extras/curves/Curves.js +10 -0
  1074. package/src/extras/curves/EllipseCurve.d.ts +115 -0
  1075. package/src/extras/curves/EllipseCurve.js +258 -0
  1076. package/src/extras/curves/LineCurve.d.ts +42 -0
  1077. package/src/extras/curves/LineCurve.js +128 -0
  1078. package/src/extras/curves/LineCurve3.d.ts +42 -0
  1079. package/src/extras/curves/LineCurve3.js +128 -0
  1080. package/src/extras/curves/QuadraticBezierCurve.d.ts +64 -0
  1081. package/src/extras/curves/QuadraticBezierCurve.js +133 -0
  1082. package/src/extras/curves/QuadraticBezierCurve3.d.ts +64 -0
  1083. package/src/extras/curves/QuadraticBezierCurve3.js +118 -0
  1084. package/src/extras/curves/SplineCurve.d.ts +52 -0
  1085. package/src/extras/curves/SplineCurve.js +145 -0
  1086. package/src/extras/lib/earcut.js +685 -0
  1087. package/src/geometries/BoxGeometry.d.ts +59 -0
  1088. package/src/geometries/BoxGeometry.js +219 -0
  1089. package/src/geometries/CapsuleGeometry.d.ts +56 -0
  1090. package/src/geometries/CapsuleGeometry.js +218 -0
  1091. package/src/geometries/CircleGeometry.d.ts +51 -0
  1092. package/src/geometries/CircleGeometry.js +142 -0
  1093. package/src/geometries/ConeGeometry.d.ts +64 -0
  1094. package/src/geometries/ConeGeometry.js +70 -0
  1095. package/src/geometries/CylinderGeometry.d.ts +64 -0
  1096. package/src/geometries/CylinderGeometry.js +333 -0
  1097. package/src/geometries/DodecahedronGeometry.d.ts +25 -0
  1098. package/src/geometries/DodecahedronGeometry.js +99 -0
  1099. package/src/geometries/EdgesGeometry.d.ts +41 -0
  1100. package/src/geometries/EdgesGeometry.js +180 -0
  1101. package/src/geometries/ExtrudeGeometry.d.ts +138 -0
  1102. package/src/geometries/ExtrudeGeometry.js +910 -0
  1103. package/src/geometries/Geometries.d.ts +21 -0
  1104. package/src/geometries/Geometries.js +21 -0
  1105. package/src/geometries/IcosahedronGeometry.d.ts +26 -0
  1106. package/src/geometries/IcosahedronGeometry.js +75 -0
  1107. package/src/geometries/LatheGeometry.d.ts +55 -0
  1108. package/src/geometries/LatheGeometry.js +230 -0
  1109. package/src/geometries/OctahedronGeometry.d.ts +25 -0
  1110. package/src/geometries/OctahedronGeometry.js +70 -0
  1111. package/src/geometries/PlaneGeometry.d.ts +48 -0
  1112. package/src/geometries/PlaneGeometry.js +133 -0
  1113. package/src/geometries/PolyhedronGeometry.d.ts +54 -0
  1114. package/src/geometries/PolyhedronGeometry.js +348 -0
  1115. package/src/geometries/RingGeometry.d.ts +59 -0
  1116. package/src/geometries/RingGeometry.js +165 -0
  1117. package/src/geometries/ShapeGeometry.d.ts +53 -0
  1118. package/src/geometries/ShapeGeometry.js +233 -0
  1119. package/src/geometries/SphereGeometry.d.ts +67 -0
  1120. package/src/geometries/SphereGeometry.js +180 -0
  1121. package/src/geometries/TetrahedronGeometry.d.ts +25 -0
  1122. package/src/geometries/TetrahedronGeometry.js +67 -0
  1123. package/src/geometries/TorusGeometry.d.ts +69 -0
  1124. package/src/geometries/TorusGeometry.js +161 -0
  1125. package/src/geometries/TorusKnotGeometry.d.ts +59 -0
  1126. package/src/geometries/TorusKnotGeometry.js +206 -0
  1127. package/src/geometries/TubeGeometry.d.ts +86 -0
  1128. package/src/geometries/TubeGeometry.js +253 -0
  1129. package/src/geometries/WireframeGeometry.d.ts +40 -0
  1130. package/src/geometries/WireframeGeometry.js +179 -0
  1131. package/src/helpers/ArrowHelper.d.ts +72 -0
  1132. package/src/helpers/ArrowHelper.js +173 -0
  1133. package/src/helpers/AxesHelper.d.ts +33 -0
  1134. package/src/helpers/AxesHelper.js +98 -0
  1135. package/src/helpers/Box3Helper.d.ts +28 -0
  1136. package/src/helpers/Box3Helper.js +85 -0
  1137. package/src/helpers/BoxHelper.d.ts +48 -0
  1138. package/src/helpers/BoxHelper.js +151 -0
  1139. package/src/helpers/CameraHelper.d.ts +54 -0
  1140. package/src/helpers/CameraHelper.js +347 -0
  1141. package/src/helpers/DirectionalLightHelper.d.ts +55 -0
  1142. package/src/helpers/DirectionalLightHelper.js +152 -0
  1143. package/src/helpers/GridHelper.d.ts +28 -0
  1144. package/src/helpers/GridHelper.js +84 -0
  1145. package/src/helpers/HemisphereLightHelper.d.ts +44 -0
  1146. package/src/helpers/HemisphereLightHelper.js +134 -0
  1147. package/src/helpers/PlaneHelper.d.ts +33 -0
  1148. package/src/helpers/PlaneHelper.js +98 -0
  1149. package/src/helpers/PointLightHelper.d.ts +43 -0
  1150. package/src/helpers/PointLightHelper.js +115 -0
  1151. package/src/helpers/PolarGridHelper.d.ts +37 -0
  1152. package/src/helpers/PolarGridHelper.js +128 -0
  1153. package/src/helpers/SkeletonHelper.d.ts +44 -0
  1154. package/src/helpers/SkeletonHelper.js +196 -0
  1155. package/src/helpers/SpotLightHelper.d.ts +45 -0
  1156. package/src/helpers/SpotLightHelper.js +156 -0
  1157. package/src/lights/AmbientLight.d.ts +28 -0
  1158. package/src/lights/AmbientLight.js +42 -0
  1159. package/src/lights/DirectionalLight.d.ts +68 -0
  1160. package/src/lights/DirectionalLight.js +113 -0
  1161. package/src/lights/DirectionalLightShadow.d.ts +18 -0
  1162. package/src/lights/DirectionalLightShadow.js +31 -0
  1163. package/src/lights/HemisphereLight.d.ts +41 -0
  1164. package/src/lights/HemisphereLight.js +76 -0
  1165. package/src/lights/Light.d.ts +39 -0
  1166. package/src/lights/Light.js +75 -0
  1167. package/src/lights/LightProbe.d.ts +46 -0
  1168. package/src/lights/LightProbe.js +75 -0
  1169. package/src/lights/LightShadow.d.ts +201 -0
  1170. package/src/lights/LightShadow.js +378 -0
  1171. package/src/lights/PointLight.d.ts +72 -0
  1172. package/src/lights/PointLight.js +131 -0
  1173. package/src/lights/PointLightShadow.d.ts +18 -0
  1174. package/src/lights/PointLightShadow.js +31 -0
  1175. package/src/lights/RectAreaLight.d.ts +62 -0
  1176. package/src/lights/RectAreaLight.js +115 -0
  1177. package/src/lights/SpotLight.d.ts +124 -0
  1178. package/src/lights/SpotLight.js +194 -0
  1179. package/src/lights/SpotLightShadow.d.ts +44 -0
  1180. package/src/lights/SpotLightShadow.js +98 -0
  1181. package/src/lights/webgpu/IESSpotLight.d.ts +18 -0
  1182. package/src/lights/webgpu/IESSpotLight.js +47 -0
  1183. package/src/lights/webgpu/ProjectorLight.d.ts +16 -0
  1184. package/src/lights/webgpu/ProjectorLight.js +46 -0
  1185. package/src/loaders/AnimationLoader.d.ts +9 -0
  1186. package/src/loaders/AnimationLoader.js +98 -0
  1187. package/src/loaders/AudioLoader.d.ts +6 -0
  1188. package/src/loaders/AudioLoader.js +108 -0
  1189. package/src/loaders/BufferGeometryLoader.d.ts +10 -0
  1190. package/src/loaders/BufferGeometryLoader.js +247 -0
  1191. package/src/loaders/Cache.d.ts +21 -0
  1192. package/src/loaders/Cache.js +115 -0
  1193. package/src/loaders/CompressedTextureLoader.d.ts +14 -0
  1194. package/src/loaders/CompressedTextureLoader.js +167 -0
  1195. package/src/loaders/CubeTextureLoader.d.ts +14 -0
  1196. package/src/loaders/CubeTextureLoader.js +103 -0
  1197. package/src/loaders/DataTextureLoader.d.ts +48 -0
  1198. package/src/loaders/DataTextureLoader.js +205 -0
  1199. package/src/loaders/FileLoader.d.ts +19 -0
  1200. package/src/loaders/FileLoader.js +367 -0
  1201. package/src/loaders/ImageBitmapLoader.d.ts +22 -0
  1202. package/src/loaders/ImageBitmapLoader.js +225 -0
  1203. package/src/loaders/ImageLoader.d.ts +17 -0
  1204. package/src/loaders/ImageLoader.js +168 -0
  1205. package/src/loaders/Loader.d.ts +51 -0
  1206. package/src/loaders/Loader.js +222 -0
  1207. package/src/loaders/LoaderUtils.d.ts +5 -0
  1208. package/src/loaders/LoaderUtils.js +59 -0
  1209. package/src/loaders/LoadingManager.d.ts +73 -0
  1210. package/src/loaders/LoadingManager.js +334 -0
  1211. package/src/loaders/MaterialLoader.d.ts +29 -0
  1212. package/src/loaders/MaterialLoader.js +209 -0
  1213. package/src/loaders/ObjectLoader.d.ts +35 -0
  1214. package/src/loaders/ObjectLoader.js +1309 -0
  1215. package/src/loaders/TextureLoader.d.ts +18 -0
  1216. package/src/loaders/TextureLoader.js +74 -0
  1217. package/src/loaders/nodes/NodeLoader.d.ts +21 -0
  1218. package/src/loaders/nodes/NodeLoader.js +194 -0
  1219. package/src/loaders/nodes/NodeMaterialLoader.d.ts +11 -0
  1220. package/src/loaders/nodes/NodeMaterialLoader.js +108 -0
  1221. package/src/loaders/nodes/NodeObjectLoader.d.ts +22 -0
  1222. package/src/loaders/nodes/NodeObjectLoader.js +169 -0
  1223. package/src/materials/LineBasicMaterial.d.ts +93 -0
  1224. package/src/materials/LineBasicMaterial.js +126 -0
  1225. package/src/materials/LineDashedMaterial.d.ts +56 -0
  1226. package/src/materials/LineDashedMaterial.js +86 -0
  1227. package/src/materials/Material.d.ts +663 -0
  1228. package/src/materials/Material.js +1235 -0
  1229. package/src/materials/Materials.d.ts +18 -0
  1230. package/src/materials/Materials.js +39 -0
  1231. package/src/materials/MeshBasicMaterial.d.ts +204 -0
  1232. package/src/materials/MeshBasicMaterial.js +274 -0
  1233. package/src/materials/MeshDepthMaterial.d.ts +119 -0
  1234. package/src/materials/MeshDepthMaterial.js +158 -0
  1235. package/src/materials/MeshDistanceMaterial.d.ts +102 -0
  1236. package/src/materials/MeshDistanceMaterial.js +129 -0
  1237. package/src/materials/MeshLambertMaterial.d.ts +331 -0
  1238. package/src/materials/MeshLambertMaterial.js +441 -0
  1239. package/src/materials/MeshMatcapMaterial.d.ts +199 -0
  1240. package/src/materials/MeshMatcapMaterial.js +269 -0
  1241. package/src/materials/MeshNormalMaterial.d.ts +134 -0
  1242. package/src/materials/MeshNormalMaterial.js +183 -0
  1243. package/src/materials/MeshPhongMaterial.d.ts +343 -0
  1244. package/src/materials/MeshPhongMaterial.js +460 -0
  1245. package/src/materials/MeshPhysicalMaterial.d.ts +353 -0
  1246. package/src/materials/MeshPhysicalMaterial.js +606 -0
  1247. package/src/materials/MeshStandardMaterial.d.ts +352 -0
  1248. package/src/materials/MeshStandardMaterial.js +466 -0
  1249. package/src/materials/MeshToonMaterial.d.ts +265 -0
  1250. package/src/materials/MeshToonMaterial.js +354 -0
  1251. package/src/materials/PointsMaterial.d.ts +113 -0
  1252. package/src/materials/PointsMaterial.js +146 -0
  1253. package/src/materials/RawShaderMaterial.d.ts +17 -0
  1254. package/src/materials/RawShaderMaterial.js +42 -0
  1255. package/src/materials/ShaderMaterial.d.ts +268 -0
  1256. package/src/materials/ShaderMaterial.js +499 -0
  1257. package/src/materials/ShadowMaterial.d.ts +61 -0
  1258. package/src/materials/ShadowMaterial.js +91 -0
  1259. package/src/materials/SpriteMaterial.d.ts +100 -0
  1260. package/src/materials/SpriteMaterial.js +143 -0
  1261. package/src/materials/nodes/Line2NodeMaterial.d.ts +102 -0
  1262. package/src/materials/nodes/Line2NodeMaterial.js +634 -0
  1263. package/src/materials/nodes/LineBasicNodeMaterial.d.ts +38 -0
  1264. package/src/materials/nodes/LineBasicNodeMaterial.js +46 -0
  1265. package/src/materials/nodes/LineDashedNodeMaterial.d.ts +88 -0
  1266. package/src/materials/nodes/LineDashedNodeMaterial.js +132 -0
  1267. package/src/materials/nodes/MeshBasicNodeMaterial.d.ts +55 -0
  1268. package/src/materials/nodes/MeshBasicNodeMaterial.js +134 -0
  1269. package/src/materials/nodes/MeshLambertNodeMaterial.d.ts +55 -0
  1270. package/src/materials/nodes/MeshLambertNodeMaterial.js +82 -0
  1271. package/src/materials/nodes/MeshMatcapNodeMaterial.d.ts +45 -0
  1272. package/src/materials/nodes/MeshMatcapNodeMaterial.js +77 -0
  1273. package/src/materials/nodes/MeshNormalNodeMaterial.d.ts +41 -0
  1274. package/src/materials/nodes/MeshNormalNodeMaterial.js +67 -0
  1275. package/src/materials/nodes/MeshPhongNodeMaterial.d.ts +77 -0
  1276. package/src/materials/nodes/MeshPhongNodeMaterial.js +132 -0
  1277. package/src/materials/nodes/MeshPhysicalNodeMaterial.d.ts +286 -0
  1278. package/src/materials/nodes/MeshPhysicalNodeMaterial.js +528 -0
  1279. package/src/materials/nodes/MeshSSSNodeMaterial.d.ts +110 -0
  1280. package/src/materials/nodes/MeshSSSNodeMaterial.js +162 -0
  1281. package/src/materials/nodes/MeshStandardNodeMaterial.d.ts +93 -0
  1282. package/src/materials/nodes/MeshStandardNodeMaterial.js +176 -0
  1283. package/src/materials/nodes/MeshToonNodeMaterial.d.ts +45 -0
  1284. package/src/materials/nodes/MeshToonNodeMaterial.js +66 -0
  1285. package/src/materials/nodes/NodeMaterial.d.ts +503 -0
  1286. package/src/materials/nodes/NodeMaterial.js +1380 -0
  1287. package/src/materials/nodes/NodeMaterials.d.ts +18 -0
  1288. package/src/materials/nodes/NodeMaterials.js +21 -0
  1289. package/src/materials/nodes/PointsNodeMaterial.d.ts +60 -0
  1290. package/src/materials/nodes/PointsNodeMaterial.js +212 -0
  1291. package/src/materials/nodes/ShadowNodeMaterial.d.ts +45 -0
  1292. package/src/materials/nodes/ShadowNodeMaterial.js +76 -0
  1293. package/src/materials/nodes/SpriteNodeMaterial.d.ts +74 -0
  1294. package/src/materials/nodes/SpriteNodeMaterial.js +176 -0
  1295. package/src/materials/nodes/VolumeNodeMaterial.d.ts +56 -0
  1296. package/src/materials/nodes/VolumeNodeMaterial.js +81 -0
  1297. package/src/materials/nodes/manager/NodeMaterialObserver.d.ts +58 -0
  1298. package/src/materials/nodes/manager/NodeMaterialObserver.js +973 -0
  1299. package/src/math/Box2.d.ts +48 -0
  1300. package/src/math/Box2.js +381 -0
  1301. package/src/math/Box3.d.ts +310 -0
  1302. package/src/math/Box3.js +810 -0
  1303. package/src/math/Color.d.ts +376 -0
  1304. package/src/math/Color.js +967 -0
  1305. package/src/math/ColorManagement.d.ts +59 -0
  1306. package/src/math/ColorManagement.js +215 -0
  1307. package/src/math/Cylindrical.d.ts +26 -0
  1308. package/src/math/Cylindrical.js +120 -0
  1309. package/src/math/Euler.d.ts +50 -0
  1310. package/src/math/Euler.js +449 -0
  1311. package/src/math/Frustum.d.ts +30 -0
  1312. package/src/math/Frustum.js +294 -0
  1313. package/src/math/FrustumArray.d.ts +86 -0
  1314. package/src/math/FrustumArray.js +228 -0
  1315. package/src/math/Interpolant.d.ts +113 -0
  1316. package/src/math/Interpolant.js +320 -0
  1317. package/src/math/Line3.d.ts +30 -0
  1318. package/src/math/Line3.js +337 -0
  1319. package/src/math/MathUtils.d.ts +153 -0
  1320. package/src/math/MathUtils.js +753 -0
  1321. package/src/math/Matrix2.d.ts +53 -0
  1322. package/src/math/Matrix2.js +128 -0
  1323. package/src/math/Matrix3.d.ts +193 -0
  1324. package/src/math/Matrix3.js +628 -0
  1325. package/src/math/Matrix4.d.ts +506 -0
  1326. package/src/math/Matrix4.js +1332 -0
  1327. package/src/math/Plane.d.ts +55 -0
  1328. package/src/math/Plane.js +397 -0
  1329. package/src/math/Quaternion.d.ts +189 -0
  1330. package/src/math/Quaternion.js +908 -0
  1331. package/src/math/Ray.d.ts +60 -0
  1332. package/src/math/Ray.js +705 -0
  1333. package/src/math/Sphere.d.ts +55 -0
  1334. package/src/math/Sphere.js +420 -0
  1335. package/src/math/Spherical.d.ts +27 -0
  1336. package/src/math/Spherical.js +147 -0
  1337. package/src/math/SphericalHarmonics3.d.ts +50 -0
  1338. package/src/math/SphericalHarmonics3.js +341 -0
  1339. package/src/math/Triangle.d.ts +110 -0
  1340. package/src/math/Triangle.js +537 -0
  1341. package/src/math/Vector2.d.ts +321 -0
  1342. package/src/math/Vector2.js +870 -0
  1343. package/src/math/Vector3.d.ts +301 -0
  1344. package/src/math/Vector3.js +1263 -0
  1345. package/src/math/Vector4.d.ts +241 -0
  1346. package/src/math/Vector4.js +1063 -0
  1347. package/src/math/interpolants/BezierInterpolant.d.ts +23 -0
  1348. package/src/math/interpolants/BezierInterpolant.js +119 -0
  1349. package/src/math/interpolants/CubicInterpolant.d.ts +22 -0
  1350. package/src/math/interpolants/CubicInterpolant.js +159 -0
  1351. package/src/math/interpolants/DiscreteInterpolant.d.ts +12 -0
  1352. package/src/math/interpolants/DiscreteInterpolant.js +34 -0
  1353. package/src/math/interpolants/LinearInterpolant.d.ts +11 -0
  1354. package/src/math/interpolants/LinearInterpolant.js +51 -0
  1355. package/src/math/interpolants/QuaternionLinearInterpolant.d.ts +11 -0
  1356. package/src/math/interpolants/QuaternionLinearInterpolant.js +48 -0
  1357. package/src/nodes/Nodes.d.ts +170 -0
  1358. package/src/nodes/Nodes.js +165 -0
  1359. package/src/nodes/TSL.d.ts +183 -0
  1360. package/src/nodes/TSL.js +183 -0
  1361. package/src/nodes/accessors/AccessorsUtils.d.ts +8 -0
  1362. package/src/nodes/accessors/AccessorsUtils.js +53 -0
  1363. package/src/nodes/accessors/Arrays.d.ts +22 -0
  1364. package/src/nodes/accessors/Arrays.js +68 -0
  1365. package/src/nodes/accessors/Batch.d.ts +25 -0
  1366. package/src/nodes/accessors/Batch.js +180 -0
  1367. package/src/nodes/accessors/Bitangent.d.ts +6 -0
  1368. package/src/nodes/accessors/Bitangent.js +82 -0
  1369. package/src/nodes/accessors/BufferAttributeNode.d.ts +247 -0
  1370. package/src/nodes/accessors/BufferAttributeNode.js +452 -0
  1371. package/src/nodes/accessors/BufferNode.d.ts +33 -0
  1372. package/src/nodes/accessors/BufferNode.js +138 -0
  1373. package/src/nodes/accessors/BuiltinNode.d.ts +13 -0
  1374. package/src/nodes/accessors/BuiltinNode.js +63 -0
  1375. package/src/nodes/accessors/Camera.d.ts +16 -0
  1376. package/src/nodes/accessors/Camera.js +403 -0
  1377. package/src/nodes/accessors/ClippingNode.d.ts +19 -0
  1378. package/src/nodes/accessors/ClippingNode.js +255 -0
  1379. package/src/nodes/accessors/CubeTextureNode.d.ts +38 -0
  1380. package/src/nodes/accessors/CubeTextureNode.js +215 -0
  1381. package/src/nodes/accessors/Instance.d.ts +32 -0
  1382. package/src/nodes/accessors/Instance.js +349 -0
  1383. package/src/nodes/accessors/Lights.d.ts +17 -0
  1384. package/src/nodes/accessors/Lights.js +139 -0
  1385. package/src/nodes/accessors/MaterialNode.d.ts +134 -0
  1386. package/src/nodes/accessors/MaterialNode.js +808 -0
  1387. package/src/nodes/accessors/MaterialProperties.d.ts +8 -0
  1388. package/src/nodes/accessors/MaterialProperties.js +57 -0
  1389. package/src/nodes/accessors/MaterialReferenceNode.d.ts +15 -0
  1390. package/src/nodes/accessors/MaterialReferenceNode.js +84 -0
  1391. package/src/nodes/accessors/ModelNode.d.ts +49 -0
  1392. package/src/nodes/accessors/ModelNode.js +260 -0
  1393. package/src/nodes/accessors/ModelViewProjectionNode.d.ts +3 -0
  1394. package/src/nodes/accessors/ModelViewProjectionNode.js +13 -0
  1395. package/src/nodes/accessors/Morph.d.ts +11 -0
  1396. package/src/nodes/accessors/Morph.js +297 -0
  1397. package/src/nodes/accessors/Normal.d.ts +36 -0
  1398. package/src/nodes/accessors/Normal.js +243 -0
  1399. package/src/nodes/accessors/Object3DNode.d.ts +42 -0
  1400. package/src/nodes/accessors/Object3DNode.js +268 -0
  1401. package/src/nodes/accessors/PointUVNode.d.ts +9 -0
  1402. package/src/nodes/accessors/PointUVNode.js +55 -0
  1403. package/src/nodes/accessors/Position.d.ts +11 -0
  1404. package/src/nodes/accessors/Position.js +126 -0
  1405. package/src/nodes/accessors/ReferenceBaseNode.d.ts +26 -0
  1406. package/src/nodes/accessors/ReferenceBaseNode.js +288 -0
  1407. package/src/nodes/accessors/ReferenceElementNode.d.ts +15 -0
  1408. package/src/nodes/accessors/ReferenceElementNode.js +72 -0
  1409. package/src/nodes/accessors/ReferenceNode.d.ts +37 -0
  1410. package/src/nodes/accessors/ReferenceNode.js +356 -0
  1411. package/src/nodes/accessors/ReflectVector.d.ts +7 -0
  1412. package/src/nodes/accessors/ReflectVector.js +36 -0
  1413. package/src/nodes/accessors/RendererReferenceNode.d.ts +14 -0
  1414. package/src/nodes/accessors/RendererReferenceNode.js +78 -0
  1415. package/src/nodes/accessors/SceneProperties.d.ts +5 -0
  1416. package/src/nodes/accessors/SceneProperties.js +47 -0
  1417. package/src/nodes/accessors/Skinning.d.ts +23 -0
  1418. package/src/nodes/accessors/Skinning.js +375 -0
  1419. package/src/nodes/accessors/StorageBufferNode.d.ts +82 -0
  1420. package/src/nodes/accessors/StorageBufferNode.js +405 -0
  1421. package/src/nodes/accessors/StorageTexture3DNode.d.ts +17 -0
  1422. package/src/nodes/accessors/StorageTexture3DNode.js +100 -0
  1423. package/src/nodes/accessors/StorageTextureNode.d.ts +47 -0
  1424. package/src/nodes/accessors/StorageTextureNode.js +331 -0
  1425. package/src/nodes/accessors/Tangent.d.ts +6 -0
  1426. package/src/nodes/accessors/Tangent.js +60 -0
  1427. package/src/nodes/accessors/TangentUtils.d.ts +21 -0
  1428. package/src/nodes/accessors/TangentUtils.js +46 -0
  1429. package/src/nodes/accessors/Texture3DNode.d.ts +29 -0
  1430. package/src/nodes/accessors/Texture3DNode.js +196 -0
  1431. package/src/nodes/accessors/TextureBicubic.d.ts +6 -0
  1432. package/src/nodes/accessors/TextureBicubic.js +92 -0
  1433. package/src/nodes/accessors/TextureNode.d.ts +104 -0
  1434. package/src/nodes/accessors/TextureNode.js +1056 -0
  1435. package/src/nodes/accessors/TextureSizeNode.d.ts +17 -0
  1436. package/src/nodes/accessors/TextureSizeNode.js +79 -0
  1437. package/src/nodes/accessors/UV.d.ts +3 -0
  1438. package/src/nodes/accessors/UV.js +11 -0
  1439. package/src/nodes/accessors/UniformArrayNode.d.ts +29 -0
  1440. package/src/nodes/accessors/UniformArrayNode.js +375 -0
  1441. package/src/nodes/accessors/UserDataNode.d.ts +14 -0
  1442. package/src/nodes/accessors/UserDataNode.js +76 -0
  1443. package/src/nodes/accessors/VelocityNode.d.ts +19 -0
  1444. package/src/nodes/accessors/VelocityNode.js +224 -0
  1445. package/src/nodes/accessors/VertexColorNode.d.ts +11 -0
  1446. package/src/nodes/accessors/VertexColorNode.js +109 -0
  1447. package/src/nodes/code/CodeNode.d.ts +22 -0
  1448. package/src/nodes/code/CodeNode.js +181 -0
  1449. package/src/nodes/code/ExpressionNode.d.ts +9 -0
  1450. package/src/nodes/code/ExpressionNode.js +68 -0
  1451. package/src/nodes/code/FunctionCallNode.d.ts +27 -0
  1452. package/src/nodes/code/FunctionCallNode.js +187 -0
  1453. package/src/nodes/code/FunctionNode.d.ts +40 -0
  1454. package/src/nodes/code/FunctionNode.js +178 -0
  1455. package/src/nodes/core/ArrayNode.d.ts +33 -0
  1456. package/src/nodes/core/ArrayNode.js +174 -0
  1457. package/src/nodes/core/AssignNode.d.ts +15 -0
  1458. package/src/nodes/core/AssignNode.js +202 -0
  1459. package/src/nodes/core/AttributeNode.d.ts +21 -0
  1460. package/src/nodes/core/AttributeNode.js +168 -0
  1461. package/src/nodes/core/BypassNode.d.ts +17 -0
  1462. package/src/nodes/core/BypassNode.js +93 -0
  1463. package/src/nodes/core/ConstNode.d.ts +16 -0
  1464. package/src/nodes/core/ConstNode.js +67 -0
  1465. package/src/nodes/core/ContextNode.d.ts +65 -0
  1466. package/src/nodes/core/ContextNode.js +336 -0
  1467. package/src/nodes/core/IndexNode.d.ts +33 -0
  1468. package/src/nodes/core/IndexNode.js +230 -0
  1469. package/src/nodes/core/InputNode.d.ts +23 -0
  1470. package/src/nodes/core/InputNode.js +136 -0
  1471. package/src/nodes/core/InspectorNode.d.ts +15 -0
  1472. package/src/nodes/core/InspectorNode.js +128 -0
  1473. package/src/nodes/core/IsolateNode.d.ts +31 -0
  1474. package/src/nodes/core/IsolateNode.js +133 -0
  1475. package/src/nodes/core/LightingModel.d.ts +33 -0
  1476. package/src/nodes/core/LightingModel.js +77 -0
  1477. package/src/nodes/core/MRTNode.d.ts +38 -0
  1478. package/src/nodes/core/MRTNode.js +243 -0
  1479. package/src/nodes/core/Node.d.ts +622 -0
  1480. package/src/nodes/core/Node.js +1220 -0
  1481. package/src/nodes/core/NodeAttribute.d.ts +47 -0
  1482. package/src/nodes/core/NodeAttribute.js +53 -0
  1483. package/src/nodes/core/NodeBuilder.d.ts +25 -0
  1484. package/src/nodes/core/NodeBuilder.js +3476 -0
  1485. package/src/nodes/core/NodeCache.d.ts +50 -0
  1486. package/src/nodes/core/NodeCache.js +75 -0
  1487. package/src/nodes/core/NodeCode.d.ts +4 -0
  1488. package/src/nodes/core/NodeCode.js +46 -0
  1489. package/src/nodes/core/NodeError.d.ts +9 -0
  1490. package/src/nodes/core/NodeError.js +28 -0
  1491. package/src/nodes/core/NodeFrame.d.ts +36 -0
  1492. package/src/nodes/core/NodeFrame.js +322 -0
  1493. package/src/nodes/core/NodeFunction.d.ts +13 -0
  1494. package/src/nodes/core/NodeFunction.js +69 -0
  1495. package/src/nodes/core/NodeFunctionInput.d.ts +7 -0
  1496. package/src/nodes/core/NodeFunctionInput.js +61 -0
  1497. package/src/nodes/core/NodeParser.d.ts +18 -0
  1498. package/src/nodes/core/NodeParser.js +23 -0
  1499. package/src/nodes/core/NodeUniform.d.ts +66 -0
  1500. package/src/nodes/core/NodeUniform.js +91 -0
  1501. package/src/nodes/core/NodeUtils.d.ts +26 -0
  1502. package/src/nodes/core/NodeUtils.js +496 -0
  1503. package/src/nodes/core/NodeVar.d.ts +51 -0
  1504. package/src/nodes/core/NodeVar.js +60 -0
  1505. package/src/nodes/core/NodeVarying.d.ts +59 -0
  1506. package/src/nodes/core/NodeVarying.js +63 -0
  1507. package/src/nodes/core/OutputStructNode.d.ts +11 -0
  1508. package/src/nodes/core/OutputStructNode.js +105 -0
  1509. package/src/nodes/core/OverrideContextNode.d.ts +92 -0
  1510. package/src/nodes/core/OverrideContextNode.js +153 -0
  1511. package/src/nodes/core/ParameterNode.d.ts +18 -0
  1512. package/src/nodes/core/ParameterNode.js +94 -0
  1513. package/src/nodes/core/PropertyNode.d.ts +66 -0
  1514. package/src/nodes/core/PropertyNode.js +421 -0
  1515. package/src/nodes/core/StackNode.d.ts +25 -0
  1516. package/src/nodes/core/StackNode.js +447 -0
  1517. package/src/nodes/core/StackTrace.d.ts +9 -0
  1518. package/src/nodes/core/StackTrace.js +139 -0
  1519. package/src/nodes/core/StructNode.d.ts +37 -0
  1520. package/src/nodes/core/StructNode.js +133 -0
  1521. package/src/nodes/core/StructType.d.ts +10 -0
  1522. package/src/nodes/core/StructType.js +13 -0
  1523. package/src/nodes/core/StructTypeNode.d.ts +57 -0
  1524. package/src/nodes/core/StructTypeNode.js +148 -0
  1525. package/src/nodes/core/SubBuildNode.d.ts +14 -0
  1526. package/src/nodes/core/SubBuildNode.js +89 -0
  1527. package/src/nodes/core/TempNode.d.ts +16 -0
  1528. package/src/nodes/core/TempNode.js +88 -0
  1529. package/src/nodes/core/UniformGroupNode.d.ts +22 -0
  1530. package/src/nodes/core/UniformGroupNode.js +168 -0
  1531. package/src/nodes/core/UniformNode.d.ts +162 -0
  1532. package/src/nodes/core/UniformNode.js +273 -0
  1533. package/src/nodes/core/VarNode.d.ts +45 -0
  1534. package/src/nodes/core/VarNode.js +374 -0
  1535. package/src/nodes/core/VaryingNode.d.ts +36 -0
  1536. package/src/nodes/core/VaryingNode.js +220 -0
  1537. package/src/nodes/core/constants.d.ts +72 -0
  1538. package/src/nodes/core/constants.js +68 -0
  1539. package/src/nodes/display/BlendModes.d.ts +76 -0
  1540. package/src/nodes/display/BlendModes.js +131 -0
  1541. package/src/nodes/display/BumpMapNode.d.ts +16 -0
  1542. package/src/nodes/display/BumpMapNode.js +122 -0
  1543. package/src/nodes/display/ColorAdjustment.d.ts +54 -0
  1544. package/src/nodes/display/ColorAdjustment.js +159 -0
  1545. package/src/nodes/display/ColorSpaceFunctions.d.ts +5 -0
  1546. package/src/nodes/display/ColorSpaceFunctions.js +54 -0
  1547. package/src/nodes/display/ColorSpaceNode.d.ts +54 -0
  1548. package/src/nodes/display/ColorSpaceNode.js +164 -0
  1549. package/src/nodes/display/FrontFacingNode.d.ts +71 -0
  1550. package/src/nodes/display/FrontFacingNode.js +131 -0
  1551. package/src/nodes/display/NormalMapNode.d.ts +18 -0
  1552. package/src/nodes/display/NormalMapNode.js +153 -0
  1553. package/src/nodes/display/PassNode.d.ts +124 -0
  1554. package/src/nodes/display/PassNode.js +1108 -0
  1555. package/src/nodes/display/PremultiplyAlphaFunctions.d.ts +37 -0
  1556. package/src/nodes/display/PremultiplyAlphaFunctions.js +39 -0
  1557. package/src/nodes/display/RenderOutputNode.d.ts +29 -0
  1558. package/src/nodes/display/RenderOutputNode.js +159 -0
  1559. package/src/nodes/display/ScreenNode.d.ts +44 -0
  1560. package/src/nodes/display/ScreenNode.js +249 -0
  1561. package/src/nodes/display/ToneMappingFunctions.d.ts +13 -0
  1562. package/src/nodes/display/ToneMappingFunctions.js +242 -0
  1563. package/src/nodes/display/ToneMappingNode.d.ts +29 -0
  1564. package/src/nodes/display/ToneMappingNode.js +147 -0
  1565. package/src/nodes/display/ToonOutlinePassNode.d.ts +23 -0
  1566. package/src/nodes/display/ToonOutlinePassNode.js +191 -0
  1567. package/src/nodes/display/ViewportDepthNode.d.ts +41 -0
  1568. package/src/nodes/display/ViewportDepthNode.js +342 -0
  1569. package/src/nodes/display/ViewportDepthTextureNode.d.ts +14 -0
  1570. package/src/nodes/display/ViewportDepthTextureNode.js +63 -0
  1571. package/src/nodes/display/ViewportSharedTextureNode.d.ts +16 -0
  1572. package/src/nodes/display/ViewportSharedTextureNode.js +73 -0
  1573. package/src/nodes/display/ViewportTextureNode.d.ts +33 -0
  1574. package/src/nodes/display/ViewportTextureNode.js +256 -0
  1575. package/src/nodes/fog/Fog.d.ts +27 -0
  1576. package/src/nodes/fog/Fog.js +97 -0
  1577. package/src/nodes/functions/BSDF/BRDF_GGX.d.ts +15 -0
  1578. package/src/nodes/functions/BSDF/BRDF_GGX.js +55 -0
  1579. package/src/nodes/functions/BSDF/BRDF_Lambert.d.ts +6 -0
  1580. package/src/nodes/functions/BSDF/BRDF_Lambert.js +9 -0
  1581. package/src/nodes/functions/BSDF/BRDF_Sheen.d.ts +6 -0
  1582. package/src/nodes/functions/BSDF/BRDF_Sheen.js +57 -0
  1583. package/src/nodes/functions/BSDF/DFGLUT.d.ts +13 -0
  1584. package/src/nodes/functions/BSDF/DFGLUT.js +57 -0
  1585. package/src/nodes/functions/BSDF/D_GGX.d.ts +9 -0
  1586. package/src/nodes/functions/BSDF/D_GGX.js +23 -0
  1587. package/src/nodes/functions/BSDF/D_GGX_Anisotropic.d.ts +9 -0
  1588. package/src/nodes/functions/BSDF/D_GGX_Anisotropic.js +28 -0
  1589. package/src/nodes/functions/BSDF/EnvironmentBRDF.d.ts +8 -0
  1590. package/src/nodes/functions/BSDF/EnvironmentBRDF.js +13 -0
  1591. package/src/nodes/functions/BSDF/F_Schlick.d.ts +6 -0
  1592. package/src/nodes/functions/BSDF/F_Schlick.js +16 -0
  1593. package/src/nodes/functions/BSDF/LTC.d.ts +13 -0
  1594. package/src/nodes/functions/BSDF/LTC.js +175 -0
  1595. package/src/nodes/functions/BSDF/Schlick_to_F0.d.ts +9 -0
  1596. package/src/nodes/functions/BSDF/Schlick_to_F0.js +21 -0
  1597. package/src/nodes/functions/BSDF/V_GGX_SmithCorrelated.d.ts +10 -0
  1598. package/src/nodes/functions/BSDF/V_GGX_SmithCorrelated.js +26 -0
  1599. package/src/nodes/functions/BSDF/V_GGX_SmithCorrelated_Anisotropic.d.ts +15 -0
  1600. package/src/nodes/functions/BSDF/V_GGX_SmithCorrelated_Anisotropic.js +29 -0
  1601. package/src/nodes/functions/BasicLightingModel.d.ts +7 -0
  1602. package/src/nodes/functions/BasicLightingModel.js +100 -0
  1603. package/src/nodes/functions/PhongLightingModel.d.ts +7 -0
  1604. package/src/nodes/functions/PhongLightingModel.js +99 -0
  1605. package/src/nodes/functions/PhysicalLightingModel.d.ts +40 -0
  1606. package/src/nodes/functions/PhysicalLightingModel.js +936 -0
  1607. package/src/nodes/functions/ShadowMaskModel.d.ts +8 -0
  1608. package/src/nodes/functions/ShadowMaskModel.js +58 -0
  1609. package/src/nodes/functions/ToonLightingModel.d.ts +4 -0
  1610. package/src/nodes/functions/ToonLightingModel.js +70 -0
  1611. package/src/nodes/functions/VolumetricLightingModel.d.ts +6 -0
  1612. package/src/nodes/functions/VolumetricLightingModel.js +216 -0
  1613. package/src/nodes/functions/material/getAlphaHashThreshold.d.ts +5 -0
  1614. package/src/nodes/functions/material/getAlphaHashThreshold.js +68 -0
  1615. package/src/nodes/functions/material/getGeometryRoughness.d.ts +5 -0
  1616. package/src/nodes/functions/material/getGeometryRoughness.js +19 -0
  1617. package/src/nodes/functions/material/getParallaxCorrectNormal.d.ts +9 -0
  1618. package/src/nodes/functions/material/getParallaxCorrectNormal.js +37 -0
  1619. package/src/nodes/functions/material/getRoughness.d.ts +6 -0
  1620. package/src/nodes/functions/material/getRoughness.js +18 -0
  1621. package/src/nodes/functions/material/getShIrradianceAt.d.ts +5 -0
  1622. package/src/nodes/functions/material/getShIrradianceAt.js +28 -0
  1623. package/src/nodes/geometry/RangeNode.d.ts +62 -0
  1624. package/src/nodes/geometry/RangeNode.js +210 -0
  1625. package/src/nodes/gpgpu/AtomicFunctionNode.d.ts +91 -0
  1626. package/src/nodes/gpgpu/AtomicFunctionNode.js +325 -0
  1627. package/src/nodes/gpgpu/BarrierNode.d.ts +15 -0
  1628. package/src/nodes/gpgpu/BarrierNode.js +107 -0
  1629. package/src/nodes/gpgpu/ComputeBuiltinNode.d.ts +22 -0
  1630. package/src/nodes/gpgpu/ComputeBuiltinNode.js +227 -0
  1631. package/src/nodes/gpgpu/ComputeNode.d.ts +50 -0
  1632. package/src/nodes/gpgpu/ComputeNode.js +313 -0
  1633. package/src/nodes/gpgpu/SubgroupFunctionNode.d.ts +99 -0
  1634. package/src/nodes/gpgpu/SubgroupFunctionNode.js +583 -0
  1635. package/src/nodes/gpgpu/WorkgroupInfoNode.d.ts +24 -0
  1636. package/src/nodes/gpgpu/WorkgroupInfoNode.js +272 -0
  1637. package/src/nodes/lighting/AONode.d.ts +8 -0
  1638. package/src/nodes/lighting/AONode.js +45 -0
  1639. package/src/nodes/lighting/AmbientLightNode.d.ts +8 -0
  1640. package/src/nodes/lighting/AmbientLightNode.js +35 -0
  1641. package/src/nodes/lighting/AnalyticLightNode.d.ts +32 -0
  1642. package/src/nodes/lighting/AnalyticLightNode.js +309 -0
  1643. package/src/nodes/lighting/BasicEnvironmentNode.d.ts +10 -0
  1644. package/src/nodes/lighting/BasicEnvironmentNode.js +49 -0
  1645. package/src/nodes/lighting/BasicLightMapNode.d.ts +8 -0
  1646. package/src/nodes/lighting/BasicLightMapNode.js +49 -0
  1647. package/src/nodes/lighting/DirectionalLightNode.d.ts +8 -0
  1648. package/src/nodes/lighting/DirectionalLightNode.js +39 -0
  1649. package/src/nodes/lighting/EnvironmentNode.d.ts +8 -0
  1650. package/src/nodes/lighting/EnvironmentNode.js +214 -0
  1651. package/src/nodes/lighting/HemisphereLightNode.d.ts +14 -0
  1652. package/src/nodes/lighting/HemisphereLightNode.js +87 -0
  1653. package/src/nodes/lighting/IESSpotLightNode.d.ts +5 -0
  1654. package/src/nodes/lighting/IESSpotLightNode.js +87 -0
  1655. package/src/nodes/lighting/IrradianceNode.d.ts +8 -0
  1656. package/src/nodes/lighting/IrradianceNode.js +44 -0
  1657. package/src/nodes/lighting/LightProbeNode.d.ts +11 -0
  1658. package/src/nodes/lighting/LightProbeNode.js +73 -0
  1659. package/src/nodes/lighting/LightUtils.d.ts +8 -0
  1660. package/src/nodes/lighting/LightUtils.js +25 -0
  1661. package/src/nodes/lighting/LightingContextNode.d.ts +41 -0
  1662. package/src/nodes/lighting/LightingContextNode.js +123 -0
  1663. package/src/nodes/lighting/LightingNode.d.ts +7 -0
  1664. package/src/nodes/lighting/LightingNode.js +36 -0
  1665. package/src/nodes/lighting/LightsNode.d.ts +48 -0
  1666. package/src/nodes/lighting/LightsNode.js +501 -0
  1667. package/src/nodes/lighting/PointLightNode.d.ts +23 -0
  1668. package/src/nodes/lighting/PointLightNode.js +102 -0
  1669. package/src/nodes/lighting/PointShadowNode.d.ts +25 -0
  1670. package/src/nodes/lighting/PointShadowNode.js +330 -0
  1671. package/src/nodes/lighting/ProjectorLightNode.d.ts +5 -0
  1672. package/src/nodes/lighting/ProjectorLightNode.js +91 -0
  1673. package/src/nodes/lighting/RectAreaLightNode.d.ts +21 -0
  1674. package/src/nodes/lighting/RectAreaLightNode.js +133 -0
  1675. package/src/nodes/lighting/ShadowBaseNode.d.ts +47 -0
  1676. package/src/nodes/lighting/ShadowBaseNode.js +238 -0
  1677. package/src/nodes/lighting/ShadowFilterNode.d.ts +17 -0
  1678. package/src/nodes/lighting/ShadowFilterNode.js +129 -0
  1679. package/src/nodes/lighting/ShadowNode.d.ts +11 -0
  1680. package/src/nodes/lighting/ShadowNode.js +841 -0
  1681. package/src/nodes/lighting/SpotLightNode.d.ts +22 -0
  1682. package/src/nodes/lighting/SpotLightNode.js +168 -0
  1683. package/src/nodes/materialx/DISCLAIMER.md +199 -0
  1684. package/src/nodes/materialx/MaterialXColor.d.ts +5 -0
  1685. package/src/nodes/materialx/MaterialXColor.js +124 -0
  1686. package/src/nodes/materialx/MaterialXColorTransform.d.ts +3 -0
  1687. package/src/nodes/materialx/MaterialXColorTransform.js +20 -0
  1688. package/src/nodes/materialx/MaterialXCore.d.ts +5 -0
  1689. package/src/nodes/materialx/MaterialXCore.js +37 -0
  1690. package/src/nodes/materialx/MaterialXNodes.d.ts +206 -0
  1691. package/src/nodes/materialx/MaterialXNodes.js +189 -0
  1692. package/src/nodes/materialx/MaterialXNoise.d.ts +415 -0
  1693. package/src/nodes/materialx/MaterialXNoise.js +1720 -0
  1694. package/src/nodes/math/BitcastNode.d.ts +24 -0
  1695. package/src/nodes/math/BitcastNode.js +156 -0
  1696. package/src/nodes/math/BitcountNode.d.ts +23 -0
  1697. package/src/nodes/math/BitcountNode.js +453 -0
  1698. package/src/nodes/math/ConditionalNode.d.ts +51 -0
  1699. package/src/nodes/math/ConditionalNode.js +245 -0
  1700. package/src/nodes/math/Hash.d.ts +3 -0
  1701. package/src/nodes/math/Hash.js +21 -0
  1702. package/src/nodes/math/MathNode.d.ts +895 -0
  1703. package/src/nodes/math/MathNode.js +1230 -0
  1704. package/src/nodes/math/MathUtils.d.ts +10 -0
  1705. package/src/nodes/math/MathUtils.js +65 -0
  1706. package/src/nodes/math/OperatorNode.d.ts +709 -0
  1707. package/src/nodes/math/OperatorNode.js +752 -0
  1708. package/src/nodes/math/PackFloatNode.d.ts +24 -0
  1709. package/src/nodes/math/PackFloatNode.js +126 -0
  1710. package/src/nodes/math/Packed4x8IntegerNode.d.ts +49 -0
  1711. package/src/nodes/math/Packed4x8IntegerNode.js +433 -0
  1712. package/src/nodes/math/TriNoise3D.d.ts +11 -0
  1713. package/src/nodes/math/TriNoise3D.js +71 -0
  1714. package/src/nodes/math/UnpackFloatNode.d.ts +21 -0
  1715. package/src/nodes/math/UnpackFloatNode.js +124 -0
  1716. package/src/nodes/parsers/GLSLNodeFunction.d.ts +9 -0
  1717. package/src/nodes/parsers/GLSLNodeFunction.js +168 -0
  1718. package/src/nodes/parsers/GLSLNodeParser.d.ts +8 -0
  1719. package/src/nodes/parsers/GLSLNodeParser.js +25 -0
  1720. package/src/nodes/pmrem/PMREMNode.d.ts +21 -0
  1721. package/src/nodes/pmrem/PMREMNode.js +428 -0
  1722. package/src/nodes/pmrem/PMREMUtils.d.ts +21 -0
  1723. package/src/nodes/pmrem/PMREMUtils.js +354 -0
  1724. package/src/nodes/procedural/Checker.d.ts +3 -0
  1725. package/src/nodes/procedural/Checker.js +22 -0
  1726. package/src/nodes/shapes/Shapes.d.ts +3 -0
  1727. package/src/nodes/shapes/Shapes.js +33 -0
  1728. package/src/nodes/tsl/TSLBase.d.ts +30 -0
  1729. package/src/nodes/tsl/TSLBase.js +36 -0
  1730. package/src/nodes/tsl/TSLCore.d.ts +2420 -0
  1731. package/src/nodes/tsl/TSLCore.js +1265 -0
  1732. package/src/nodes/utils/ArrayElementNode.d.ts +15 -0
  1733. package/src/nodes/utils/ArrayElementNode.js +90 -0
  1734. package/src/nodes/utils/ConvertNode.d.ts +14 -0
  1735. package/src/nodes/utils/ConvertNode.js +100 -0
  1736. package/src/nodes/utils/CubeMapNode.d.ts +12 -0
  1737. package/src/nodes/utils/CubeMapNode.js +237 -0
  1738. package/src/nodes/utils/DebugNode.d.ts +22 -0
  1739. package/src/nodes/utils/DebugNode.js +83 -0
  1740. package/src/nodes/utils/Discard.d.ts +10 -0
  1741. package/src/nodes/utils/Discard.js +24 -0
  1742. package/src/nodes/utils/EquirectUV.d.ts +33 -0
  1743. package/src/nodes/utils/EquirectUV.js +52 -0
  1744. package/src/nodes/utils/EventNode.d.ts +41 -0
  1745. package/src/nodes/utils/EventNode.js +223 -0
  1746. package/src/nodes/utils/FlipNode.d.ts +11 -0
  1747. package/src/nodes/utils/FlipNode.js +106 -0
  1748. package/src/nodes/utils/FunctionOverloadingNode.d.ts +12 -0
  1749. package/src/nodes/utils/FunctionOverloadingNode.js +170 -0
  1750. package/src/nodes/utils/JoinNode.d.ts +14 -0
  1751. package/src/nodes/utils/JoinNode.js +117 -0
  1752. package/src/nodes/utils/LoopNode.d.ts +43 -0
  1753. package/src/nodes/utils/LoopNode.js +390 -0
  1754. package/src/nodes/utils/MatcapUV.d.ts +3 -0
  1755. package/src/nodes/utils/MatcapUV.js +22 -0
  1756. package/src/nodes/utils/MaxMipLevelNode.d.ts +13 -0
  1757. package/src/nodes/utils/MaxMipLevelNode.js +103 -0
  1758. package/src/nodes/utils/MemberNode.d.ts +11 -0
  1759. package/src/nodes/utils/MemberNode.js +120 -0
  1760. package/src/nodes/utils/Oscillators.d.ts +6 -0
  1761. package/src/nodes/utils/Oscillators.js +41 -0
  1762. package/src/nodes/utils/Packing.d.ts +52 -0
  1763. package/src/nodes/utils/Packing.js +64 -0
  1764. package/src/nodes/utils/PostProcessingUtils.d.ts +56 -0
  1765. package/src/nodes/utils/PostProcessingUtils.js +175 -0
  1766. package/src/nodes/utils/RTTNode.d.ts +46 -0
  1767. package/src/nodes/utils/RTTNode.js +370 -0
  1768. package/src/nodes/utils/ReflectorNode.d.ts +61 -0
  1769. package/src/nodes/utils/ReflectorNode.js +634 -0
  1770. package/src/nodes/utils/Remap.d.ts +223 -0
  1771. package/src/nodes/utils/Remap.js +48 -0
  1772. package/src/nodes/utils/RotateNode.d.ts +26 -0
  1773. package/src/nodes/utils/RotateNode.js +180 -0
  1774. package/src/nodes/utils/SampleNode.d.ts +26 -0
  1775. package/src/nodes/utils/SampleNode.js +91 -0
  1776. package/src/nodes/utils/SetNode.d.ts +11 -0
  1777. package/src/nodes/utils/SetNode.js +108 -0
  1778. package/src/nodes/utils/SplitNode.d.ts +14 -0
  1779. package/src/nodes/utils/SplitNode.js +179 -0
  1780. package/src/nodes/utils/SpriteSheetUV.d.ts +7 -0
  1781. package/src/nodes/utils/SpriteSheetUV.js +35 -0
  1782. package/src/nodes/utils/SpriteUtils.d.ts +5 -0
  1783. package/src/nodes/utils/SpriteUtils.js +98 -0
  1784. package/src/nodes/utils/StorageArrayElementNode.d.ts +28 -0
  1785. package/src/nodes/utils/StorageArrayElementNode.js +143 -0
  1786. package/src/nodes/utils/Timer.d.ts +5 -0
  1787. package/src/nodes/utils/Timer.js +26 -0
  1788. package/src/nodes/utils/TriplanarTextures.d.ts +19 -0
  1789. package/src/nodes/utils/TriplanarTextures.js +65 -0
  1790. package/src/nodes/utils/UVUtils.d.ts +19 -0
  1791. package/src/nodes/utils/UVUtils.js +67 -0
  1792. package/src/nodes/utils/ViewportUtils.d.ts +3 -0
  1793. package/src/nodes/utils/ViewportUtils.js +26 -0
  1794. package/src/objects/BatchedMesh.d.ts +280 -0
  1795. package/src/objects/BatchedMesh.js +1696 -0
  1796. package/src/objects/Bone.d.ts +36 -0
  1797. package/src/objects/Bone.js +41 -0
  1798. package/src/objects/ClippingGroup.d.ts +41 -0
  1799. package/src/objects/ClippingGroup.js +68 -0
  1800. package/src/objects/Group.d.ts +37 -0
  1801. package/src/objects/Group.js +41 -0
  1802. package/src/objects/InstancedMesh.d.ts +175 -0
  1803. package/src/objects/InstancedMesh.js +411 -0
  1804. package/src/objects/LOD.d.ts +112 -0
  1805. package/src/objects/LOD.js +329 -0
  1806. package/src/objects/Line.d.ts +96 -0
  1807. package/src/objects/Line.js +341 -0
  1808. package/src/objects/LineLoop.d.ts +40 -0
  1809. package/src/objects/LineLoop.js +37 -0
  1810. package/src/objects/LineSegments.d.ts +41 -0
  1811. package/src/objects/LineSegments.js +74 -0
  1812. package/src/objects/Mesh.d.ts +111 -0
  1813. package/src/objects/Mesh.js +508 -0
  1814. package/src/objects/Points.d.ts +75 -0
  1815. package/src/objects/Points.js +240 -0
  1816. package/src/objects/Skeleton.d.ts +120 -0
  1817. package/src/objects/Skeleton.js +383 -0
  1818. package/src/objects/SkinnedMesh.d.ts +163 -0
  1819. package/src/objects/SkinnedMesh.js +370 -0
  1820. package/src/objects/Sprite.d.ts +82 -0
  1821. package/src/objects/Sprite.js +257 -0
  1822. package/src/renderers/WebGL3DRenderTarget.d.ts +29 -0
  1823. package/src/renderers/WebGL3DRenderTarget.js +48 -0
  1824. package/src/renderers/WebGLArrayRenderTarget.d.ts +29 -0
  1825. package/src/renderers/WebGLArrayRenderTarget.js +48 -0
  1826. package/src/renderers/WebGLCubeRenderTarget.d.ts +18 -0
  1827. package/src/renderers/WebGLCubeRenderTarget.js +182 -0
  1828. package/src/renderers/WebGLRenderTarget.d.ts +8 -0
  1829. package/src/renderers/WebGLRenderTarget.js +34 -0
  1830. package/src/renderers/WebGLRenderer.d.ts +489 -0
  1831. package/src/renderers/WebGLRenderer.js +3769 -0
  1832. package/src/renderers/common/Animation.js +169 -0
  1833. package/src/renderers/common/Attributes.js +187 -0
  1834. package/src/renderers/common/Backend.d.ts +29 -0
  1835. package/src/renderers/common/Backend.js +841 -0
  1836. package/src/renderers/common/Background.js +225 -0
  1837. package/src/renderers/common/BindGroup.js +45 -0
  1838. package/src/renderers/common/Binding.js +71 -0
  1839. package/src/renderers/common/Bindings.js +535 -0
  1840. package/src/renderers/common/BlendMode.d.ts +22 -0
  1841. package/src/renderers/common/BlendMode.js +143 -0
  1842. package/src/renderers/common/Buffer.js +136 -0
  1843. package/src/renderers/common/BufferUtils.d.ts +28 -0
  1844. package/src/renderers/common/BufferUtils.js +58 -0
  1845. package/src/renderers/common/BundleGroup.d.ts +46 -0
  1846. package/src/renderers/common/BundleGroup.js +87 -0
  1847. package/src/renderers/common/CanvasTarget.d.ts +158 -0
  1848. package/src/renderers/common/CanvasTarget.js +341 -0
  1849. package/src/renderers/common/CapabilityTier.js +18 -0
  1850. package/src/renderers/common/ChainMap.js +122 -0
  1851. package/src/renderers/common/ClippingContext.d.ts +134 -0
  1852. package/src/renderers/common/ClippingContext.js +280 -0
  1853. package/src/renderers/common/Color4.d.ts +53 -0
  1854. package/src/renderers/common/Color4.js +86 -0
  1855. package/src/renderers/common/ComputePipeline.js +41 -0
  1856. package/src/renderers/common/Constants.d.ts +9 -0
  1857. package/src/renderers/common/Constants.js +10 -0
  1858. package/src/renderers/common/CubeRenderTarget.d.ts +47 -0
  1859. package/src/renderers/common/CubeRenderTarget.js +147 -0
  1860. package/src/renderers/common/DataMap.js +90 -0
  1861. package/src/renderers/common/DirectRenderPipeline.d.ts +20 -0
  1862. package/src/renderers/common/DirectRenderPipeline.js +233 -0
  1863. package/src/renderers/common/GPUInstanceCuller.d.ts +43 -0
  1864. package/src/renderers/common/GPUInstanceCuller.js +372 -0
  1865. package/src/renderers/common/GPUTimings.js +66 -0
  1866. package/src/renderers/common/Geometries.js +485 -0
  1867. package/src/renderers/common/IndirectStorageBufferAttribute.d.ts +10 -0
  1868. package/src/renderers/common/IndirectStorageBufferAttribute.js +38 -0
  1869. package/src/renderers/common/Info.d.ts +194 -0
  1870. package/src/renderers/common/Info.js +542 -0
  1871. package/src/renderers/common/InspectorBase.d.ts +129 -0
  1872. package/src/renderers/common/InspectorBase.js +180 -0
  1873. package/src/renderers/common/Lighting.d.ts +55 -0
  1874. package/src/renderers/common/Lighting.js +112 -0
  1875. package/src/renderers/common/Pipeline.js +35 -0
  1876. package/src/renderers/common/Pipelines.js +500 -0
  1877. package/src/renderers/common/PostProcessing.d.ts +21 -0
  1878. package/src/renderers/common/PostProcessing.js +28 -0
  1879. package/src/renderers/common/ProgrammableStage.js +78 -0
  1880. package/src/renderers/common/QuadMesh.d.ts +19 -0
  1881. package/src/renderers/common/QuadMesh.js +126 -0
  1882. package/src/renderers/common/ReadbackBuffer.d.ts +63 -0
  1883. package/src/renderers/common/ReadbackBuffer.js +78 -0
  1884. package/src/renderers/common/RenderBundle.js +26 -0
  1885. package/src/renderers/common/RenderBundles.js +71 -0
  1886. package/src/renderers/common/RenderContext.js +289 -0
  1887. package/src/renderers/common/RenderContexts.js +100 -0
  1888. package/src/renderers/common/RenderList.js +475 -0
  1889. package/src/renderers/common/RenderLists.js +125 -0
  1890. package/src/renderers/common/RenderObject.js +989 -0
  1891. package/src/renderers/common/RenderObjectPipeline.js +40 -0
  1892. package/src/renderers/common/RenderObjects.js +245 -0
  1893. package/src/renderers/common/RenderPipeline.d.ts +26 -0
  1894. package/src/renderers/common/RenderPipeline.js +263 -0
  1895. package/src/renderers/common/Renderer.d.ts +1209 -0
  1896. package/src/renderers/common/Renderer.js +4115 -0
  1897. package/src/renderers/common/RendererUtils.d.ts +77 -0
  1898. package/src/renderers/common/RendererUtils.js +200 -0
  1899. package/src/renderers/common/SampledTexture.js +152 -0
  1900. package/src/renderers/common/Sampler.js +133 -0
  1901. package/src/renderers/common/Storage3DTexture.d.ts +42 -0
  1902. package/src/renderers/common/Storage3DTexture.js +116 -0
  1903. package/src/renderers/common/StorageArrayTexture.d.ts +31 -0
  1904. package/src/renderers/common/StorageArrayTexture.js +84 -0
  1905. package/src/renderers/common/StorageBuffer.js +53 -0
  1906. package/src/renderers/common/StorageBufferAttribute.d.ts +7 -0
  1907. package/src/renderers/common/StorageBufferAttribute.js +46 -0
  1908. package/src/renderers/common/StorageInstancedBufferAttribute.d.ts +8 -0
  1909. package/src/renderers/common/StorageInstancedBufferAttribute.js +46 -0
  1910. package/src/renderers/common/StorageTexture.d.ts +7 -0
  1911. package/src/renderers/common/StorageTexture.js +86 -0
  1912. package/src/renderers/common/Textures.js +656 -0
  1913. package/src/renderers/common/TimestampQueryPool.d.ts +120 -0
  1914. package/src/renderers/common/TimestampQueryPool.js +173 -0
  1915. package/src/renderers/common/Uniform.js +375 -0
  1916. package/src/renderers/common/UniformBuffer.js +34 -0
  1917. package/src/renderers/common/UniformsGroup.js +570 -0
  1918. package/src/renderers/common/XRManager.d.ts +293 -0
  1919. package/src/renderers/common/XRManager.js +2009 -0
  1920. package/src/renderers/common/XRRenderTarget.js +91 -0
  1921. package/src/renderers/common/extras/PMREMGenerator.d.ts +52 -0
  1922. package/src/renderers/common/extras/PMREMGenerator.js +951 -0
  1923. package/src/renderers/common/nodes/NodeBuilderState.js +160 -0
  1924. package/src/renderers/common/nodes/NodeLibrary.d.ts +129 -0
  1925. package/src/renderers/common/nodes/NodeLibrary.js +196 -0
  1926. package/src/renderers/common/nodes/NodeManager.js +1170 -0
  1927. package/src/renderers/common/nodes/NodeSampledTexture.js +140 -0
  1928. package/src/renderers/common/nodes/NodeSampler.js +62 -0
  1929. package/src/renderers/common/nodes/NodeStorageBuffer.js +74 -0
  1930. package/src/renderers/common/nodes/NodeUniform.js +418 -0
  1931. package/src/renderers/common/nodes/NodeUniformBuffer.js +120 -0
  1932. package/src/renderers/common/nodes/NodeUniformsGroup.js +51 -0
  1933. package/src/renderers/shaders/DFGLUTData.js +50 -0
  1934. package/src/renderers/shaders/ShaderChunk/alphahash_fragment.glsl.js +7 -0
  1935. package/src/renderers/shaders/ShaderChunk/alphahash_pars_fragment.glsl.js +68 -0
  1936. package/src/renderers/shaders/ShaderChunk/alphamap_fragment.glsl.js +7 -0
  1937. package/src/renderers/shaders/ShaderChunk/alphamap_pars_fragment.glsl.js +7 -0
  1938. package/src/renderers/shaders/ShaderChunk/alphatest_fragment.glsl.js +16 -0
  1939. package/src/renderers/shaders/ShaderChunk/alphatest_pars_fragment.glsl.js +5 -0
  1940. package/src/renderers/shaders/ShaderChunk/aomap_fragment.glsl.js +26 -0
  1941. package/src/renderers/shaders/ShaderChunk/aomap_pars_fragment.glsl.js +8 -0
  1942. package/src/renderers/shaders/ShaderChunk/batching_pars_vertex.glsl.js +49 -0
  1943. package/src/renderers/shaders/ShaderChunk/batching_vertex.glsl.js +5 -0
  1944. package/src/renderers/shaders/ShaderChunk/begin_vertex.glsl.js +9 -0
  1945. package/src/renderers/shaders/ShaderChunk/beginnormal_vertex.glsl.js +9 -0
  1946. package/src/renderers/shaders/ShaderChunk/bsdfs.glsl.js +33 -0
  1947. package/src/renderers/shaders/ShaderChunk/bumpmap_pars_fragment.glsl.js +43 -0
  1948. package/src/renderers/shaders/ShaderChunk/clearcoat_normal_fragment_begin.glsl.js +7 -0
  1949. package/src/renderers/shaders/ShaderChunk/clearcoat_normal_fragment_maps.glsl.js +10 -0
  1950. package/src/renderers/shaders/ShaderChunk/clearcoat_pars_fragment.glsl.js +21 -0
  1951. package/src/renderers/shaders/ShaderChunk/clipping_planes_fragment.glsl.js +78 -0
  1952. package/src/renderers/shaders/ShaderChunk/clipping_planes_pars_fragment.glsl.js +9 -0
  1953. package/src/renderers/shaders/ShaderChunk/clipping_planes_pars_vertex.glsl.js +7 -0
  1954. package/src/renderers/shaders/ShaderChunk/clipping_planes_vertex.glsl.js +7 -0
  1955. package/src/renderers/shaders/ShaderChunk/color_fragment.glsl.js +7 -0
  1956. package/src/renderers/shaders/ShaderChunk/color_pars_fragment.glsl.js +7 -0
  1957. package/src/renderers/shaders/ShaderChunk/color_pars_vertex.glsl.js +7 -0
  1958. package/src/renderers/shaders/ShaderChunk/color_vertex.glsl.js +29 -0
  1959. package/src/renderers/shaders/ShaderChunk/colorspace_fragment.glsl.js +3 -0
  1960. package/src/renderers/shaders/ShaderChunk/colorspace_pars_fragment.glsl.js +15 -0
  1961. package/src/renderers/shaders/ShaderChunk/common.glsl.js +134 -0
  1962. package/src/renderers/shaders/ShaderChunk/cube_uv_reflection_fragment.glsl.js +186 -0
  1963. package/src/renderers/shaders/ShaderChunk/default_fragment.glsl.js +5 -0
  1964. package/src/renderers/shaders/ShaderChunk/default_vertex.glsl.js +5 -0
  1965. package/src/renderers/shaders/ShaderChunk/defaultnormal_vertex.glsl.js +59 -0
  1966. package/src/renderers/shaders/ShaderChunk/displacementmap_pars_vertex.glsl.js +9 -0
  1967. package/src/renderers/shaders/ShaderChunk/displacementmap_vertex.glsl.js +7 -0
  1968. package/src/renderers/shaders/ShaderChunk/dithering_fragment.glsl.js +7 -0
  1969. package/src/renderers/shaders/ShaderChunk/dithering_pars_fragment.glsl.js +20 -0
  1970. package/src/renderers/shaders/ShaderChunk/emissivemap_fragment.glsl.js +17 -0
  1971. package/src/renderers/shaders/ShaderChunk/emissivemap_pars_fragment.glsl.js +7 -0
  1972. package/src/renderers/shaders/ShaderChunk/envmap_common_pars_fragment.glsl.js +14 -0
  1973. package/src/renderers/shaders/ShaderChunk/envmap_fragment.glsl.js +58 -0
  1974. package/src/renderers/shaders/ShaderChunk/envmap_pars_fragment.glsl.js +21 -0
  1975. package/src/renderers/shaders/ShaderChunk/envmap_pars_vertex.glsl.js +22 -0
  1976. package/src/renderers/shaders/ShaderChunk/envmap_physical_pars_fragment.glsl.js +117 -0
  1977. package/src/renderers/shaders/ShaderChunk/envmap_vertex.glsl.js +37 -0
  1978. package/src/renderers/shaders/ShaderChunk/fog_fragment.glsl.js +17 -0
  1979. package/src/renderers/shaders/ShaderChunk/fog_pars_fragment.glsl.js +19 -0
  1980. package/src/renderers/shaders/ShaderChunk/fog_pars_vertex.glsl.js +7 -0
  1981. package/src/renderers/shaders/ShaderChunk/fog_vertex.glsl.js +7 -0
  1982. package/src/renderers/shaders/ShaderChunk/gradientmap_pars_fragment.glsl.js +27 -0
  1983. package/src/renderers/shaders/ShaderChunk/iridescence_fragment.glsl.js +120 -0
  1984. package/src/renderers/shaders/ShaderChunk/iridescence_pars_fragment.glsl.js +14 -0
  1985. package/src/renderers/shaders/ShaderChunk/lightmap_pars_fragment.glsl.js +8 -0
  1986. package/src/renderers/shaders/ShaderChunk/lightprobes_pars_fragment.glsl.js +80 -0
  1987. package/src/renderers/shaders/ShaderChunk/lights_fragment_begin.glsl.js +262 -0
  1988. package/src/renderers/shaders/ShaderChunk/lights_fragment_end.glsl.js +19 -0
  1989. package/src/renderers/shaders/ShaderChunk/lights_fragment_maps.glsl.js +62 -0
  1990. package/src/renderers/shaders/ShaderChunk/lights_lambert_fragment.glsl.js +5 -0
  1991. package/src/renderers/shaders/ShaderChunk/lights_lambert_pars_fragment.glsl.js +28 -0
  1992. package/src/renderers/shaders/ShaderChunk/lights_pars_begin.glsl.js +236 -0
  1993. package/src/renderers/shaders/ShaderChunk/lights_phong_fragment.glsl.js +7 -0
  1994. package/src/renderers/shaders/ShaderChunk/lights_phong_pars_fragment.glsl.js +32 -0
  1995. package/src/renderers/shaders/ShaderChunk/lights_physical_fragment.glsl.js +167 -0
  1996. package/src/renderers/shaders/ShaderChunk/lights_physical_pars_fragment.glsl.js +660 -0
  1997. package/src/renderers/shaders/ShaderChunk/lights_toon_fragment.glsl.js +4 -0
  1998. package/src/renderers/shaders/ShaderChunk/lights_toon_pars_fragment.glsl.js +26 -0
  1999. package/src/renderers/shaders/ShaderChunk/logdepthbuf_fragment.glsl.js +9 -0
  2000. package/src/renderers/shaders/ShaderChunk/logdepthbuf_pars_fragment.glsl.js +9 -0
  2001. package/src/renderers/shaders/ShaderChunk/logdepthbuf_pars_vertex.glsl.js +8 -0
  2002. package/src/renderers/shaders/ShaderChunk/logdepthbuf_vertex.glsl.js +8 -0
  2003. package/src/renderers/shaders/ShaderChunk/map_fragment.glsl.js +17 -0
  2004. package/src/renderers/shaders/ShaderChunk/map_pars_fragment.glsl.js +7 -0
  2005. package/src/renderers/shaders/ShaderChunk/map_particle_fragment.glsl.js +27 -0
  2006. package/src/renderers/shaders/ShaderChunk/map_particle_pars_fragment.glsl.js +27 -0
  2007. package/src/renderers/shaders/ShaderChunk/metalnessmap_fragment.glsl.js +12 -0
  2008. package/src/renderers/shaders/ShaderChunk/metalnessmap_pars_fragment.glsl.js +7 -0
  2009. package/src/renderers/shaders/ShaderChunk/morphcolor_vertex.glsl.js +24 -0
  2010. package/src/renderers/shaders/ShaderChunk/morphinstance_vertex.glsl.js +14 -0
  2011. package/src/renderers/shaders/ShaderChunk/morphnormal_vertex.glsl.js +16 -0
  2012. package/src/renderers/shaders/ShaderChunk/morphtarget_pars_vertex.glsl.js +26 -0
  2013. package/src/renderers/shaders/ShaderChunk/morphtarget_vertex.glsl.js +16 -0
  2014. package/src/renderers/shaders/ShaderChunk/normal_fragment_begin.glsl.js +76 -0
  2015. package/src/renderers/shaders/ShaderChunk/normal_fragment_maps.glsl.js +40 -0
  2016. package/src/renderers/shaders/ShaderChunk/normal_pars_fragment.glsl.js +14 -0
  2017. package/src/renderers/shaders/ShaderChunk/normal_pars_vertex.glsl.js +14 -0
  2018. package/src/renderers/shaders/ShaderChunk/normal_vertex.glsl.js +20 -0
  2019. package/src/renderers/shaders/ShaderChunk/normalmap_pars_fragment.glsl.js +43 -0
  2020. package/src/renderers/shaders/ShaderChunk/opaque_fragment.glsl.js +11 -0
  2021. package/src/renderers/shaders/ShaderChunk/packing.glsl.js +116 -0
  2022. package/src/renderers/shaders/ShaderChunk/premultiplied_alpha_fragment.glsl.js +7 -0
  2023. package/src/renderers/shaders/ShaderChunk/project_vertex.glsl.js +19 -0
  2024. package/src/renderers/shaders/ShaderChunk/roughnessmap_fragment.glsl.js +12 -0
  2025. package/src/renderers/shaders/ShaderChunk/roughnessmap_pars_fragment.glsl.js +7 -0
  2026. package/src/renderers/shaders/ShaderChunk/shadowmap_pars_fragment.glsl.js +458 -0
  2027. package/src/renderers/shaders/ShaderChunk/shadowmap_pars_vertex.glsl.js +80 -0
  2028. package/src/renderers/shaders/ShaderChunk/shadowmap_vertex.glsl.js +85 -0
  2029. package/src/renderers/shaders/ShaderChunk/shadowmask_pars_fragment.glsl.js +81 -0
  2030. package/src/renderers/shaders/ShaderChunk/skinbase_vertex.glsl.js +10 -0
  2031. package/src/renderers/shaders/ShaderChunk/skinning_pars_vertex.glsl.js +25 -0
  2032. package/src/renderers/shaders/ShaderChunk/skinning_vertex.glsl.js +15 -0
  2033. package/src/renderers/shaders/ShaderChunk/skinnormal_vertex.glsl.js +20 -0
  2034. package/src/renderers/shaders/ShaderChunk/specularmap_fragment.glsl.js +14 -0
  2035. package/src/renderers/shaders/ShaderChunk/specularmap_pars_fragment.glsl.js +7 -0
  2036. package/src/renderers/shaders/ShaderChunk/tonemapping_fragment.glsl.js +7 -0
  2037. package/src/renderers/shaders/ShaderChunk/tonemapping_pars_fragment.glsl.js +200 -0
  2038. package/src/renderers/shaders/ShaderChunk/transmission_fragment.glsl.js +36 -0
  2039. package/src/renderers/shaders/ShaderChunk/transmission_pars_fragment.glsl.js +235 -0
  2040. package/src/renderers/shaders/ShaderChunk/uv_pars_fragment.glsl.js +119 -0
  2041. package/src/renderers/shaders/ShaderChunk/uv_pars_vertex.glsl.js +145 -0
  2042. package/src/renderers/shaders/ShaderChunk/uv_vertex.glsl.js +122 -0
  2043. package/src/renderers/shaders/ShaderChunk/worldpos_vertex.glsl.js +21 -0
  2044. package/src/renderers/shaders/ShaderChunk.d.ts +144 -0
  2045. package/src/renderers/shaders/ShaderChunk.js +272 -0
  2046. package/src/renderers/shaders/ShaderLib/background.glsl.js +40 -0
  2047. package/src/renderers/shaders/ShaderLib/backgroundCube.glsl.js +62 -0
  2048. package/src/renderers/shaders/ShaderLib/cube.glsl.js +36 -0
  2049. package/src/renderers/shaders/ShaderLib/depth.glsl.js +117 -0
  2050. package/src/renderers/shaders/ShaderLib/distance.glsl.js +77 -0
  2051. package/src/renderers/shaders/ShaderLib/equirect.glsl.js +35 -0
  2052. package/src/renderers/shaders/ShaderLib/linedashed.glsl.js +76 -0
  2053. package/src/renderers/shaders/ShaderLib/meshbasic.glsl.js +116 -0
  2054. package/src/renderers/shaders/ShaderLib/meshlambert.glsl.js +126 -0
  2055. package/src/renderers/shaders/ShaderLib/meshmatcap.glsl.js +112 -0
  2056. package/src/renderers/shaders/ShaderLib/meshnormal.glsl.js +86 -0
  2057. package/src/renderers/shaders/ShaderLib/meshphong.glsl.js +128 -0
  2058. package/src/renderers/shaders/ShaderLib/meshphysical.glsl.js +228 -0
  2059. package/src/renderers/shaders/ShaderLib/meshtoon.glsl.js +118 -0
  2060. package/src/renderers/shaders/ShaderLib/points.glsl.js +87 -0
  2061. package/src/renderers/shaders/ShaderLib/shadow.glsl.js +58 -0
  2062. package/src/renderers/shaders/ShaderLib/sprite.glsl.js +79 -0
  2063. package/src/renderers/shaders/ShaderLib/vsm.glsl.js +51 -0
  2064. package/src/renderers/shaders/ShaderLib.d.ts +29 -0
  2065. package/src/renderers/shaders/ShaderLib.js +363 -0
  2066. package/src/renderers/shaders/UniformsLib.d.ts +209 -0
  2067. package/src/renderers/shaders/UniformsLib.js +250 -0
  2068. package/src/renderers/shaders/UniformsUtils.d.ts +14 -0
  2069. package/src/renderers/shaders/UniformsUtils.js +154 -0
  2070. package/src/renderers/webgl/WebGLAnimation.js +54 -0
  2071. package/src/renderers/webgl/WebGLAttributes.d.ts +23 -0
  2072. package/src/renderers/webgl/WebGLAttributes.js +237 -0
  2073. package/src/renderers/webgl/WebGLBackground.js +303 -0
  2074. package/src/renderers/webgl/WebGLBindingStates.d.ts +26 -0
  2075. package/src/renderers/webgl/WebGLBindingStates.js +666 -0
  2076. package/src/renderers/webgl/WebGLBufferRenderer.d.ts +15 -0
  2077. package/src/renderers/webgl/WebGLBufferRenderer.js +57 -0
  2078. package/src/renderers/webgl/WebGLCapabilities.d.ts +48 -0
  2079. package/src/renderers/webgl/WebGLCapabilities.js +150 -0
  2080. package/src/renderers/webgl/WebGLClipping.d.ts +26 -0
  2081. package/src/renderers/webgl/WebGLClipping.js +171 -0
  2082. package/src/renderers/webgl/WebGLEnvironments.d.ts +8 -0
  2083. package/src/renderers/webgl/WebGLEnvironments.js +228 -0
  2084. package/src/renderers/webgl/WebGLExtensions.d.ts +7 -0
  2085. package/src/renderers/webgl/WebGLExtensions.js +61 -0
  2086. package/src/renderers/webgl/WebGLGeometries.d.ts +13 -0
  2087. package/src/renderers/webgl/WebGLGeometries.js +186 -0
  2088. package/src/renderers/webgl/WebGLIndexedBufferRenderer.d.ts +13 -0
  2089. package/src/renderers/webgl/WebGLIndexedBufferRenderer.js +68 -0
  2090. package/src/renderers/webgl/WebGLInfo.d.ts +39 -0
  2091. package/src/renderers/webgl/WebGLInfo.js +73 -0
  2092. package/src/renderers/webgl/WebGLLights.d.ts +57 -0
  2093. package/src/renderers/webgl/WebGLLights.js +654 -0
  2094. package/src/renderers/webgl/WebGLMaterials.js +608 -0
  2095. package/src/renderers/webgl/WebGLMorphtargets.js +168 -0
  2096. package/src/renderers/webgl/WebGLObjects.d.ts +19 -0
  2097. package/src/renderers/webgl/WebGLObjects.js +94 -0
  2098. package/src/renderers/webgl/WebGLOutput.js +283 -0
  2099. package/src/renderers/webgl/WebGLProgram.d.ts +22 -0
  2100. package/src/renderers/webgl/WebGLProgram.js +1035 -0
  2101. package/src/renderers/webgl/WebGLPrograms.d.ts +242 -0
  2102. package/src/renderers/webgl/WebGLPrograms.js +694 -0
  2103. package/src/renderers/webgl/WebGLProperties.d.ts +9 -0
  2104. package/src/renderers/webgl/WebGLProperties.js +55 -0
  2105. package/src/renderers/webgl/WebGLRenderLists.d.ts +68 -0
  2106. package/src/renderers/webgl/WebGLRenderLists.js +257 -0
  2107. package/src/renderers/webgl/WebGLRenderStates.js +124 -0
  2108. package/src/renderers/webgl/WebGLShader.d.ts +1 -0
  2109. package/src/renderers/webgl/WebGLShader.js +12 -0
  2110. package/src/renderers/webgl/WebGLShaderCache.js +118 -0
  2111. package/src/renderers/webgl/WebGLShadowMap.d.ts +33 -0
  2112. package/src/renderers/webgl/WebGLShadowMap.js +611 -0
  2113. package/src/renderers/webgl/WebGLState.d.ts +399 -0
  2114. package/src/renderers/webgl/WebGLState.js +1370 -0
  2115. package/src/renderers/webgl/WebGLTextures.d.ts +31 -0
  2116. package/src/renderers/webgl/WebGLTextures.js +2519 -0
  2117. package/src/renderers/webgl/WebGLUniforms.d.ts +5 -0
  2118. package/src/renderers/webgl/WebGLUniforms.js +1203 -0
  2119. package/src/renderers/webgl/WebGLUniformsGroups.d.ts +17 -0
  2120. package/src/renderers/webgl/WebGLUniformsGroups.js +441 -0
  2121. package/src/renderers/webgl/WebGLUtils.d.ts +11 -0
  2122. package/src/renderers/webgl/WebGLUtils.js +217 -0
  2123. package/src/renderers/webgl-fallback/WebGLBackend.d.ts +16 -0
  2124. package/src/renderers/webgl-fallback/WebGLBackend.js +2950 -0
  2125. package/src/renderers/webgl-fallback/WebGLBufferRenderer.js +99 -0
  2126. package/src/renderers/webgl-fallback/nodes/GLSLNodeBuilder.d.ts +9 -0
  2127. package/src/renderers/webgl-fallback/nodes/GLSLNodeBuilder.js +1860 -0
  2128. package/src/renderers/webgl-fallback/utils/WebGLAttributeUtils.js +359 -0
  2129. package/src/renderers/webgl-fallback/utils/WebGLCapabilities.d.ts +51 -0
  2130. package/src/renderers/webgl-fallback/utils/WebGLCapabilities.js +105 -0
  2131. package/src/renderers/webgl-fallback/utils/WebGLConstants.js +13 -0
  2132. package/src/renderers/webgl-fallback/utils/WebGLExtensions.js +83 -0
  2133. package/src/renderers/webgl-fallback/utils/WebGLState.js +1507 -0
  2134. package/src/renderers/webgl-fallback/utils/WebGLTextureUtils.js +1381 -0
  2135. package/src/renderers/webgl-fallback/utils/WebGLTimestampQueryPool.js +406 -0
  2136. package/src/renderers/webgl-fallback/utils/WebGLUtils.js +319 -0
  2137. package/src/renderers/webgpu/WebGPUBackend.d.ts +32 -0
  2138. package/src/renderers/webgpu/WebGPUBackend.js +3321 -0
  2139. package/src/renderers/webgpu/WebGPURenderer.Nodes.d.ts +12 -0
  2140. package/src/renderers/webgpu/WebGPURenderer.Nodes.js +69 -0
  2141. package/src/renderers/webgpu/WebGPURenderer.d.ts +17 -0
  2142. package/src/renderers/webgpu/WebGPURenderer.js +107 -0
  2143. package/src/renderers/webgpu/descriptors/GPUBindGroupDescriptor.js +48 -0
  2144. package/src/renderers/webgpu/descriptors/GPUBufferDescriptor.js +57 -0
  2145. package/src/renderers/webgpu/descriptors/GPUCommandEncoderDescriptor.js +30 -0
  2146. package/src/renderers/webgpu/descriptors/GPUComputePassDescriptor.js +38 -0
  2147. package/src/renderers/webgpu/descriptors/GPUComputePipelineDescriptor.js +48 -0
  2148. package/src/renderers/webgpu/descriptors/GPUCopyExternalImageDestInfo.js +47 -0
  2149. package/src/renderers/webgpu/descriptors/GPUCopyExternalImageSourceInfo.js +50 -0
  2150. package/src/renderers/webgpu/descriptors/GPUExtent3D.js +51 -0
  2151. package/src/renderers/webgpu/descriptors/GPUPipelineLayoutDescriptor.js +39 -0
  2152. package/src/renderers/webgpu/descriptors/GPUQuerySetDescriptor.js +47 -0
  2153. package/src/renderers/webgpu/descriptors/GPURenderBundleEncoderDescriptor.js +74 -0
  2154. package/src/renderers/webgpu/descriptors/GPURenderPassColorAttachment.js +72 -0
  2155. package/src/renderers/webgpu/descriptors/GPURenderPassDepthStencilAttachment.js +99 -0
  2156. package/src/renderers/webgpu/descriptors/GPURenderPassDescriptor.js +72 -0
  2157. package/src/renderers/webgpu/descriptors/GPURenderPassTimestampWrites.js +49 -0
  2158. package/src/renderers/webgpu/descriptors/GPURenderPipelineDescriptor.js +130 -0
  2159. package/src/renderers/webgpu/descriptors/GPUSamplerDescriptor.js +119 -0
  2160. package/src/renderers/webgpu/descriptors/GPUShaderModuleDescriptor.js +46 -0
  2161. package/src/renderers/webgpu/descriptors/GPUTexelCopyBufferInfo.js +57 -0
  2162. package/src/renderers/webgpu/descriptors/GPUTexelCopyBufferLayout.js +48 -0
  2163. package/src/renderers/webgpu/descriptors/GPUTexelCopyTextureInfo.js +61 -0
  2164. package/src/renderers/webgpu/descriptors/GPUTextureDescriptor.js +99 -0
  2165. package/src/renderers/webgpu/descriptors/GPUTextureViewDescriptor.js +108 -0
  2166. package/src/renderers/webgpu/nodes/BasicNodeLibrary.d.ts +13 -0
  2167. package/src/renderers/webgpu/nodes/BasicNodeLibrary.js +66 -0
  2168. package/src/renderers/webgpu/nodes/StandardNodeLibrary.d.ts +91 -0
  2169. package/src/renderers/webgpu/nodes/StandardNodeLibrary.js +99 -0
  2170. package/src/renderers/webgpu/nodes/WGSLNodeBuilder.d.ts +9 -0
  2171. package/src/renderers/webgpu/nodes/WGSLNodeBuilder.js +2759 -0
  2172. package/src/renderers/webgpu/nodes/WGSLNodeFunction.js +188 -0
  2173. package/src/renderers/webgpu/nodes/WGSLNodeParser.js +25 -0
  2174. package/src/renderers/webgpu/utils/WebGPUAttributeUtils.js +573 -0
  2175. package/src/renderers/webgpu/utils/WebGPUBindingUtils.js +683 -0
  2176. package/src/renderers/webgpu/utils/WebGPUCapabilities.js +149 -0
  2177. package/src/renderers/webgpu/utils/WebGPUConstants.d.ts +348 -0
  2178. package/src/renderers/webgpu/utils/WebGPUConstants.js +354 -0
  2179. package/src/renderers/webgpu/utils/WebGPUPipelineUtils.js +1007 -0
  2180. package/src/renderers/webgpu/utils/WebGPUTexturePassUtils.js +452 -0
  2181. package/src/renderers/webgpu/utils/WebGPUTextureUtils.js +1884 -0
  2182. package/src/renderers/webgpu/utils/WebGPUTimestampQueryPool.js +337 -0
  2183. package/src/renderers/webgpu/utils/WebGPUUniformArena.js +240 -0
  2184. package/src/renderers/webgpu/utils/WebGPUUtils.js +342 -0
  2185. package/src/renderers/webxr/WebXRController.d.ts +67 -0
  2186. package/src/renderers/webxr/WebXRController.js +440 -0
  2187. package/src/renderers/webxr/WebXRDepthSensing.d.ts +21 -0
  2188. package/src/renderers/webxr/WebXRDepthSensing.js +155 -0
  2189. package/src/renderers/webxr/WebXRManager.d.ts +89 -0
  2190. package/src/renderers/webxr/WebXRManager.js +1126 -0
  2191. package/src/scenes/Fog.d.ts +71 -0
  2192. package/src/scenes/Fog.js +98 -0
  2193. package/src/scenes/FogExp2.d.ts +61 -0
  2194. package/src/scenes/FogExp2.js +86 -0
  2195. package/src/scenes/Scene.d.ts +104 -0
  2196. package/src/scenes/Scene.js +165 -0
  2197. package/src/textures/CanvasTexture.d.ts +51 -0
  2198. package/src/textures/CanvasTexture.js +45 -0
  2199. package/src/textures/CompressedArrayTexture.d.ts +65 -0
  2200. package/src/textures/CompressedArrayTexture.js +105 -0
  2201. package/src/textures/CompressedCubeTexture.d.ts +13 -0
  2202. package/src/textures/CompressedCubeTexture.js +48 -0
  2203. package/src/textures/CompressedTexture.d.ts +92 -0
  2204. package/src/textures/CompressedTexture.js +86 -0
  2205. package/src/textures/CubeDepthTexture.d.ts +40 -0
  2206. package/src/textures/CubeDepthTexture.js +76 -0
  2207. package/src/textures/CubeTexture.d.ts +82 -0
  2208. package/src/textures/CubeTexture.js +81 -0
  2209. package/src/textures/Data3DTexture.d.ts +94 -0
  2210. package/src/textures/Data3DTexture.js +128 -0
  2211. package/src/textures/DataArrayTexture.d.ts +123 -0
  2212. package/src/textures/DataArrayTexture.js +150 -0
  2213. package/src/textures/DataTexture.d.ts +112 -0
  2214. package/src/textures/DataTexture.js +87 -0
  2215. package/src/textures/DepthTexture.d.ts +105 -0
  2216. package/src/textures/DepthTexture.js +104 -0
  2217. package/src/textures/ExternalTexture.d.ts +14 -0
  2218. package/src/textures/ExternalTexture.js +53 -0
  2219. package/src/textures/FramebufferTexture.d.ts +67 -0
  2220. package/src/textures/FramebufferTexture.js +85 -0
  2221. package/src/textures/HTMLTexture.d.ts +27 -0
  2222. package/src/textures/HTMLTexture.js +74 -0
  2223. package/src/textures/Texture.d.ts +565 -0
  2224. package/src/textures/Texture.js +812 -0
  2225. package/src/textures/TextureSource.d.ts +99 -0
  2226. package/src/textures/TextureSource.js +261 -0
  2227. package/src/textures/VideoFrameTexture.d.ts +27 -0
  2228. package/src/textures/VideoFrameTexture.js +72 -0
  2229. package/src/textures/VideoTexture.d.ts +90 -0
  2230. package/src/textures/VideoTexture.js +127 -0
  2231. package/src/upe.d.ts +5 -0
  2232. package/src/upe.js +17 -0
  2233. package/src/utils.d.ts +36 -0
  2234. package/src/utils.js +493 -0
@@ -0,0 +1,1757 @@
1
+ import {
2
+ BoxGeometry,
3
+ BufferAttribute,
4
+ BufferGeometry,
5
+ ExtrudeGeometry,
6
+ InterpolationSamplingMode,
7
+ InterpolationSamplingType,
8
+ LatheGeometry,
9
+ Matrix3,
10
+ Matrix4,
11
+ Mesh,
12
+ MeshStandardMaterial,
13
+ Path,
14
+ PlaneGeometry,
15
+ ShapeGeometry,
16
+ Shape,
17
+ Sphere,
18
+ Vector2,
19
+ Vector3
20
+ } from 'three';
21
+
22
+ import { MeshStandardNodeMaterial } from 'three/webgpu';
23
+ import { attribute, cameraPosition, color, cross, dot, float, floor, Fn, fract, fwidth, hash as ihash, mix, mod, modelWorldMatrixInverse, mx_fractal_noise_float, normalLocal, normalWorldGeometry, positionLocal, positionWorld, select, smoothstep, step, uint, uv, varying, vec2, vec3, vec4 } from 'three/tsl';
24
+
25
+ import { mergeGeometries } from '../../utils/BufferGeometryUtils.js';
26
+ import { bumpNormal } from './CityGeneratorUtils.js';
27
+
28
+ const _scale = /*@__PURE__*/ new Vector3();
29
+ const _point = /*@__PURE__*/ new Vector3();
30
+ const _normalMatrix = /*@__PURE__*/ new Matrix3();
31
+ const _identity = /*@__PURE__*/ new Matrix4();
32
+
33
+ // material-zone codes baked per vertex into the merged geometry, so one material can
34
+ // branch on partId and shade every zone
35
+ const PartId = { WALL: 0, PIER: 1, FRAME: 2, ORNAMENT: 3, GLASS: 4, AC: 5, SHOPGLASS: 6, STORE: 7, AWNING: 8 };
36
+ const { WALL, PIER, FRAME, ORNAMENT, GLASS, AC, SHOPGLASS, STORE, AWNING } = PartId;
37
+
38
+ // fraction of a floor's height taken by the glazed opening; the remainder is
39
+ // the spandrel band. shared by the window module and the spandrels so they tile.
40
+ const WINDOW_HEIGHT_RATIO = 0.62;
41
+
42
+ // width of the flat window-frame band around the glazing; shared by the frame module
43
+ // and the glass pane so the pane always tucks inside the frame
44
+ const WINDOW_BORDER = 0.1;
45
+
46
+ // the masonry course module ( brick height × length ). the generator snaps floor and
47
+ // bay dimensions to it, and the material's coursing reads the same values, so the
48
+ // procedural brickwork lines up with the geometry
49
+ const BRICK = { height: 0.3, length: 0.6 };
50
+
51
+ // merging requires all-indexed or all-non-indexed inputs; extrusions are
52
+ // non-indexed while boxes/planes are indexed, so normalize before merging
53
+
54
+ function merge( geometries ) {
55
+
56
+ return mergeGeometries( geometries.map( ( g ) => g.index ? g.toNonIndexed() : g ) );
57
+
58
+ }
59
+
60
+ function nonIndexed( geometry ) {
61
+
62
+ return geometry.index ? geometry.toNonIndexed() : geometry;
63
+
64
+ }
65
+
66
+ // the unit box is identical for every building's shell boxes — build it once
67
+ const _unitBox = /*@__PURE__*/ nonIndexed( new BoxGeometry( 1, 1, 1 ) );
68
+
69
+ // a unit quad ( facing +Z ), scaled per placement for the storefront display glazing
70
+ const _unitPlane = /*@__PURE__*/ nonIndexed( new PlaneGeometry( 1, 1 ) );
71
+
72
+ /**
73
+ * Bakes a list of instance groups into one non-indexed BufferGeometry. Each group is a
74
+ * base geometry ( position + normal + uv ), an array of Matrix4 placements and a `partId`
75
+ * written to a per-vertex attribute. Transforming straight into preallocated typed arrays
76
+ * avoids mergeGeometries' per-instance allocations; the result is one geometry, ready for
77
+ * a single draw call and the compute rasterizer.
78
+ */
79
+ function bakeGroups( groups ) {
80
+
81
+ let total = 0;
82
+ for ( const group of groups ) total += group.geometry.attributes.position.count * group.matrices.length;
83
+
84
+ const position = new Float32Array( total * 3 );
85
+ const normal = new Float32Array( total * 3 );
86
+ const uv = new Float32Array( total * 2 );
87
+ const partId = new Float32Array( total );
88
+ // per-window interior-mapping room ( centre + size ) the glass pane looks into; only
89
+ // the glass group writes it, every other vertex stays zero. baked per vertex so the
90
+ // material reads each building's own room sizes without a global uniform.
91
+ const roomCenter = new Float32Array( total * 3 );
92
+ const roomSize = new Float32Array( total * 2 );
93
+
94
+ let w = 0;
95
+
96
+ // the bounding sphere falls out of the AABB gathered while transforming, sparing a
97
+ // second full pass over the positions ( computeBoundingSphere )
98
+ let minX = Infinity, minY = Infinity, minZ = Infinity;
99
+ let maxX = - Infinity, maxY = - Infinity, maxZ = - Infinity;
100
+
101
+ for ( const group of groups ) {
102
+
103
+ const geometry = group.geometry;
104
+ const P = geometry.attributes.position.array;
105
+ const N = geometry.attributes.normal.array;
106
+ const U = geometry.attributes.uv.array;
107
+ const count = geometry.attributes.position.count;
108
+ const id = group.partId;
109
+ const rooms = group.rooms; // per-instance { center, size }, glass only
110
+ const rigid = group.rigid === true; // pure rotation ( + translation ): the normal matrix is the rotation itself
111
+
112
+ for ( let i = 0; i < group.matrices.length; i ++ ) {
113
+
114
+ const room = rooms ? rooms[ i ] : null;
115
+
116
+ const matrix = group.matrices[ i ];
117
+ const e = matrix.elements;
118
+ const e0 = e[ 0 ], e1 = e[ 1 ], e2 = e[ 2 ], e4 = e[ 4 ], e5 = e[ 5 ], e6 = e[ 6 ], e8 = e[ 8 ], e9 = e[ 9 ], e10 = e[ 10 ], e12 = e[ 12 ], e13 = e[ 13 ], e14 = e[ 14 ];
119
+
120
+ // for a rigid frame the inverse-transpose equals the rotation, so its columns
121
+ // are read straight from the matrix and the per-instance 3×3 inverse is skipped
122
+ let n0, n1, n2, n3, n4, n5, n6, n7, n8;
123
+
124
+ if ( rigid ) {
125
+
126
+ n0 = e0; n1 = e1; n2 = e2; n3 = e4; n4 = e5; n5 = e6; n6 = e8; n7 = e9; n8 = e10;
127
+
128
+ } else {
129
+
130
+ const ne = _normalMatrix.getNormalMatrix( matrix ).elements;
131
+ n0 = ne[ 0 ]; n1 = ne[ 1 ]; n2 = ne[ 2 ]; n3 = ne[ 3 ]; n4 = ne[ 4 ]; n5 = ne[ 5 ]; n6 = ne[ 6 ]; n7 = ne[ 7 ]; n8 = ne[ 8 ];
132
+
133
+ }
134
+
135
+ for ( let v = 0; v < count; v ++ ) {
136
+
137
+ const v3 = v * 3, w3 = w * 3;
138
+ const x = P[ v3 ], y = P[ v3 + 1 ], z = P[ v3 + 2 ];
139
+ const wx = e0 * x + e4 * y + e8 * z + e12;
140
+ const wy = e1 * x + e5 * y + e9 * z + e13;
141
+ const wz = e2 * x + e6 * y + e10 * z + e14;
142
+ position[ w3 ] = wx; position[ w3 + 1 ] = wy; position[ w3 + 2 ] = wz;
143
+ if ( wx < minX ) minX = wx; if ( wx > maxX ) maxX = wx;
144
+ if ( wy < minY ) minY = wy; if ( wy > maxY ) maxY = wy;
145
+ if ( wz < minZ ) minZ = wz; if ( wz > maxZ ) maxZ = wz;
146
+
147
+ const nx = N[ v3 ], ny = N[ v3 + 1 ], nz = N[ v3 + 2 ];
148
+ const tx = n0 * nx + n3 * ny + n6 * nz, ty = n1 * nx + n4 * ny + n7 * nz, tz = n2 * nx + n5 * ny + n8 * nz;
149
+ const inv = 1 / ( Math.sqrt( tx * tx + ty * ty + tz * tz ) || 1 );
150
+ normal[ w3 ] = tx * inv; normal[ w3 + 1 ] = ty * inv; normal[ w3 + 2 ] = tz * inv;
151
+
152
+ uv[ w * 2 ] = U[ v * 2 ]; uv[ w * 2 + 1 ] = U[ v * 2 + 1 ];
153
+ partId[ w ] = id;
154
+
155
+ if ( room !== null ) {
156
+
157
+ roomCenter[ w3 ] = room.center.x; roomCenter[ w3 + 1 ] = room.center.y; roomCenter[ w3 + 2 ] = room.center.z;
158
+ roomSize[ w * 2 ] = room.size.x; roomSize[ w * 2 + 1 ] = room.size.y;
159
+
160
+ }
161
+
162
+ w ++;
163
+
164
+ }
165
+
166
+ }
167
+
168
+ }
169
+
170
+ const geometry = new BufferGeometry();
171
+ geometry.setAttribute( 'position', new BufferAttribute( position, 3 ) );
172
+ geometry.setAttribute( 'normal', new BufferAttribute( normal, 3 ) );
173
+ geometry.setAttribute( 'uv', new BufferAttribute( uv, 2 ) );
174
+ geometry.setAttribute( 'partId', new BufferAttribute( partId, 1 ) );
175
+ geometry.setAttribute( 'roomCenter', new BufferAttribute( roomCenter, 3 ) );
176
+ geometry.setAttribute( 'roomSize', new BufferAttribute( roomSize, 2 ) );
177
+
178
+ geometry.boundingSphere = new Sphere(
179
+ new Vector3( ( minX + maxX ) / 2, ( minY + maxY ) / 2, ( minZ + maxZ ) / 2 ),
180
+ Math.hypot( maxX - minX, maxY - minY, maxZ - minZ ) / 2
181
+ );
182
+
183
+ return geometry;
184
+
185
+ }
186
+
187
+ // deterministic PRNG (mulberry32) so a given seed always yields the same tower
188
+
189
+ function createRandom( seed ) {
190
+
191
+ let s = ( seed >>> 0 ) || 1;
192
+
193
+ return function () {
194
+
195
+ s = ( s + 0x6D2B79F5 ) | 0;
196
+ let t = Math.imul( s ^ ( s >>> 15 ), 1 | s );
197
+ t = ( t + Math.imul( t ^ ( t >>> 7 ), 61 | t ) ) ^ t;
198
+ return ( ( t ^ ( t >>> 14 ) ) >>> 0 ) / 4294967296;
199
+
200
+ };
201
+
202
+ }
203
+
204
+ // a stable per-floor hash ( from the floor index and the face origin ) used to pick the
205
+ // interior-mapping room module per floor without allocating a closure each floor
206
+ function floorHash( f, frame, k ) {
207
+
208
+ const s = Math.sin( f * 12.9898 + frame.origin.x * 0.07 + frame.origin.z * 0.131 + k ) * 43758.5453;
209
+ return s - Math.floor( s );
210
+
211
+ }
212
+
213
+ // the seed-driven "style" of a tower: footprint proportions, tier split and the
214
+ // shaping of piers and base arches. these sit between the fixed defaults and the
215
+ // caller's parameters, so any parameter passed in still overrides its seeded value.
216
+
217
+ function randomStyle( random ) {
218
+
219
+ const base = 0.10 + random() * 0.07;
220
+ const crown = 0.08 + random() * 0.08;
221
+
222
+ return {
223
+ footprint: { width: 26 + random() * 18, depth: 20 + random() * 14 },
224
+ tierFractions: { base, crown },
225
+ pierWidth: 0.4 + random() * 0.4,
226
+ pierDepth: 0.3 + random() * 0.3,
227
+ windowReveal: 0.12 + random() * 0.1,
228
+ stringCourseHeight: 0.5 + random() * 0.5,
229
+ archBayWidthRatio: Math.round( 1.5 + random() * 1.5 ),
230
+ archRise: 0.4 + random() * 0.5,
231
+ baseStyle: random() < 0.22 ? 'arcade' : 'storefront' // most towers get retail storefronts; a few take a grand arcade
232
+ };
233
+
234
+ }
235
+
236
+ /**
237
+ * Generates intricate, tripartite "Beaux-Arts / Neo-Gothic" terracotta
238
+ * skyscrapers from a small set of parameters.
239
+ *
240
+ * The mass is read as a footprint polygon (a rectangle with one chamfered
241
+ * corner) split into vertical faces, each split into three tiers — a tall
242
+ * arcaded base, a repeating shaft and an ornate crown — then into floors and
243
+ * bays. A handful of authored pieces (a pier, a window, a cornice profile, a
244
+ * gothic arch) are instanced across the whole tower, then baked — together with
245
+ * the bespoke base arcade — into a single non-indexed BufferGeometry tagged with
246
+ * a per-vertex `partId` ({@link PartId}) so one material can shade every zone.
247
+ *
248
+ * The generator is material agnostic — it only produces geometry. Pass a single
249
+ * material (e.g. a TSL node material that branches on `partId`) to dress it.
250
+ *
251
+ * ```js
252
+ * const generator = new SkyscraperGenerator( { seed: 35, totalHeight: 140 }, material );
253
+ * scene.add( generator.build() ); // a single Mesh
254
+ * ```
255
+ */
256
+ class SkyscraperGenerator {
257
+
258
+ constructor( parameters = {}, material = null ) {
259
+
260
+ this.parameters = parameters; // caller overrides; defaults + seed fill the rest at build time
261
+ this.material = material; // a single material; the look is driven by the baked `partId` attribute
262
+
263
+ this.mesh = null;
264
+
265
+ }
266
+
267
+ setParameters( parameters ) {
268
+
269
+ Object.assign( this.parameters, parameters );
270
+
271
+ return this;
272
+
273
+ }
274
+
275
+ build() {
276
+
277
+ const random = createRandom( this.parameters.seed ?? SkyscraperGenerator.defaults.seed );
278
+
279
+ // precedence: fixed defaults < seed-driven style < caller parameters
280
+
281
+ const p = Object.assign( {}, SkyscraperGenerator.defaults, randomStyle( random ), this.parameters );
282
+
283
+ // snap the masonry-driving dimensions to the brick module so the procedural
284
+ // brickwork ( courses up local Y, columns along each face ) lines up with the
285
+ // geometry: a whole number of courses per floor and bricks per bay
286
+ const vModule = BRICK.height * 2; // a course pair, so floor / window halves still land on a joint
287
+ p.floorHeight = Math.max( vModule * 3, Math.round( p.floorHeight / vModule ) * vModule );
288
+ p.windowHeight = Math.round( p.floorHeight * WINDOW_HEIGHT_RATIO / vModule ) * vModule;
289
+ p.bayWidth = Math.max( BRICK.length * 3, Math.round( p.bayWidth / BRICK.length ) * BRICK.length );
290
+ p.pierWidth = Math.max( BRICK.length, Math.round( p.pierWidth / BRICK.length ) * BRICK.length );
291
+
292
+ // vertical layout: base / shaft / crown as whole floor counts, so every floor
293
+ // line sits on a course ( the requested total height is rounded to suit )
294
+ const floors = Math.max( 3, Math.round( p.totalHeight / p.floorHeight ) );
295
+ const baseFloors = Math.max( 1, Math.round( floors * p.tierFractions.base ) );
296
+ const crownFloors = Math.max( 1, Math.round( floors * p.tierFractions.crown ) );
297
+ const shaftFloors = Math.max( 1, floors - baseFloors - crownFloors );
298
+
299
+ const baseHeight = baseFloors * p.floorHeight;
300
+ const crownHeight = crownFloors * p.floorHeight;
301
+ const shaftHeight = shaftFloors * p.floorHeight;
302
+ p.totalHeight = baseHeight + shaftHeight + crownHeight;
303
+
304
+ const baseTop = baseHeight;
305
+ const shaftTop = baseHeight + shaftHeight;
306
+
307
+ // one accumulator per kind of part, mostly instance matrices. kept separate so the
308
+ // bake below can order them by draw order ( which controls overdraw ), not build order.
309
+
310
+ const windows = [];
311
+ const glass = [];
312
+ const glassRooms = []; // per-glass interior-mapping room ( centre + size ), aligned with `glass`
313
+ const backWalls = []; // the thin wall closing the volume behind the glass
314
+ const bands = []; // spandrel bands, one at each floor line
315
+ const shopGlass = []; // ground-floor display glazing ( scaled unit quads )
316
+ const shopRooms = []; // interior-mapping room per shop, aligned with shopGlass
317
+ const mullions = []; // slim shopfront dividers
318
+ const storeBands = []; // storefront bulkhead and signboard fascia
319
+ const awnings = []; // projecting shop awnings
320
+ const piers = new Map(); // pier height -> matrices, so each tier's continuous piers share one geometry
321
+ const trim = []; // cornices and parapets ( axis-aligned unit boxes )
322
+ const acUnits = []; // window air-conditioner boxes on a random subset of shaft windows
323
+ const finials = []; // pinnacles along the crown
324
+ const extras = []; // bespoke geometry: the base arcade and the setback / roof slabs
325
+
326
+ const addPier = ( frame, u, vBottom, height ) => {
327
+
328
+ const key = Math.round( height * 1000 ); // bucket equal pier heights ( a number key, no string )
329
+ if ( piers.has( key ) === false ) piers.set( key, [] );
330
+ piers.get( key ).push( frame.matrix( u, vBottom, 0 ) );
331
+
332
+ };
333
+
334
+ // footprints: full mass, and the inset crown after the setback
335
+
336
+ const footprint = buildFootprint( p.footprint.width, p.footprint.depth, p.chamferWidth, p.chamferCornerX, p.chamferCornerZ );
337
+ const faces = buildFaces( footprint );
338
+
339
+ const inset = p.setbackDepth * p.bayWidth;
340
+ const crownFootprint = buildFootprint(
341
+ Math.max( p.bayWidth * 2, p.footprint.width - inset * 2 ),
342
+ Math.max( p.bayWidth * 2, p.footprint.depth - inset * 2 ),
343
+ Math.max( 0, p.chamferWidth - inset ),
344
+ p.chamferCornerX,
345
+ p.chamferCornerZ
346
+ );
347
+ const crownFaces = buildFaces( crownFootprint );
348
+
349
+ // --- generate the parts -----------------------------------------------
350
+
351
+ const crownCornice = p.stringCourseHeight * 1.6; // the crown's heavy cap; its piers stop below it
352
+
353
+ // the street-level retail floor; a few larger towers take a grand arcade instead
354
+ const groundHeight = p.floorHeight;
355
+ const useArcade = p.baseStyle === 'arcade' && baseHeight > groundHeight * 1.5;
356
+
357
+ // shaft and crown are the same facade over different faces, spans and pier heights;
358
+ // the masonry base above the storefront is that facade again
359
+ const tiers = [
360
+ { faces, bottom: baseTop, height: shaftHeight, pierHeight: shaftHeight, ac: acUnits },
361
+ { faces: crownFaces, bottom: shaftTop, height: crownHeight, pierHeight: crownHeight - crownCornice, ac: null }
362
+ ];
363
+
364
+ if ( ! useArcade && baseHeight > groundHeight + 0.1 ) {
365
+
366
+ tiers.push( { faces, bottom: groundHeight, height: baseHeight - groundHeight, pierHeight: baseHeight - groundHeight, ac: null } );
367
+
368
+ }
369
+
370
+ for ( const t of tiers ) {
371
+
372
+ for ( const frame of t.faces ) {
373
+
374
+ addWindows( frame, windows, glass, glassRooms, t.ac, t.bottom, t.height, p );
375
+ addWall( backWalls, frame, t.bottom, t.bottom + t.height, 0.8, - 0.6 );
376
+ addSpandrelBands( bands, frame, t.bottom, t.height, p );
377
+ addPiers( frame, t.bottom, t.pierHeight, p, addPier );
378
+
379
+ }
380
+
381
+ }
382
+
383
+ // the ground floor: NYC retail storefronts, or a grand gothic arcade. either is
384
+ // capped by the base string course
385
+ const storefront = { glass: shopGlass, glassRooms: shopRooms, mullions, storeBands, backWalls, awnings, addPier };
386
+ for ( const frame of faces ) {
387
+
388
+ if ( useArcade ) addArcade( extras, frame, baseHeight, p );
389
+ else addStorefront( frame, groundHeight, p, storefront );
390
+
391
+ addCornice( trim, frame, baseTop - p.stringCourseHeight, p.stringCourseHeight, 0.5 );
392
+
393
+ }
394
+
395
+ // periodic string courses banding the shaft
396
+ if ( p.stringCourseEvery > 0 ) {
397
+
398
+ for ( let f = p.stringCourseEvery; f < shaftFloors; f += p.stringCourseEvery ) {
399
+
400
+ for ( const frame of faces ) addCornice( trim, frame, baseTop + f * p.floorHeight - p.stringCourseHeight * 0.5, p.stringCourseHeight, 0.3 );
401
+
402
+ }
403
+
404
+ }
405
+
406
+ // the crown's heavy cornice, its parapet and the finials along the top
407
+ for ( const frame of crownFaces ) {
408
+
409
+ addCornice( trim, frame, p.totalHeight - crownCornice, crownCornice, 0.9 );
410
+ addParapet( trim, frame, p.totalHeight, p );
411
+ addFinials( frame, finials, shaftTop, crownHeight, p );
412
+
413
+ }
414
+
415
+ // thin slabs capping the setback ledge and the roof
416
+ extras.push( slab( footprint, shaftTop, 0.6 ) );
417
+ extras.push( slab( crownFootprint, p.totalHeight, 0.6 ) );
418
+
419
+ // --- bake every part into one geometry ---------------------------------
420
+
421
+ // one mesh = one draw the renderer can't sort, so bake order is draw order: the
422
+ // facade front-to-back, the backing wall last so its hidden fragments never shade.
423
+
424
+ const groups = [
425
+ { geometry: buildWindowGeometry( p ), matrices: windows, partId: FRAME, rigid: true },
426
+ { geometry: nonIndexed( buildGlassGeometry( p ) ), matrices: glass, partId: GLASS, rooms: glassRooms, rigid: true },
427
+ { geometry: _unitPlane, matrices: shopGlass, partId: SHOPGLASS, rooms: shopRooms }, // scaled per shop, so not rigid
428
+ { geometry: _unitBox, matrices: mullions, partId: FRAME },
429
+ { geometry: _unitBox, matrices: storeBands, partId: STORE },
430
+ { geometry: _unitBox, matrices: awnings, partId: AWNING },
431
+ { geometry: _unitBox, matrices: bands, partId: WALL }
432
+ ];
433
+
434
+ for ( const [ key, matrices ] of piers ) groups.push( { geometry: buildPierGeometry( p, key / 1000 ), matrices, partId: PIER, rigid: true } );
435
+
436
+ groups.push( { geometry: _unitBox, matrices: trim, partId: WALL } ); // cornices, parapets
437
+ groups.push( { geometry: _unitBox, matrices: acUnits, partId: AC } );
438
+ groups.push( { geometry: nonIndexed( buildFinialGeometry( p ) ), matrices: finials, partId: ORNAMENT, rigid: true } );
439
+
440
+ for ( const geometry of extras ) groups.push( { geometry: nonIndexed( geometry ), matrices: [ _identity ], partId: WALL, rigid: true } ); // base arcade + slabs, in building-local space
441
+
442
+ groups.push( { geometry: _unitBox, matrices: backWalls, partId: WALL } ); // last — hidden behind the facade
443
+
444
+ const geometry = bakeGroups( groups );
445
+
446
+ const mesh = new Mesh( geometry, this.material || new MeshStandardMaterial( { color: 0xddccaa, roughness: 0.9 } ) );
447
+ mesh.name = 'Skyscraper';
448
+
449
+ this.dispose();
450
+ this.mesh = mesh;
451
+
452
+ return mesh;
453
+
454
+ }
455
+
456
+ rebuild() {
457
+
458
+ return this.build();
459
+
460
+ }
461
+
462
+ dispose() {
463
+
464
+ if ( this.mesh === null ) return;
465
+
466
+ this.mesh.geometry.dispose();
467
+ this.mesh.dispose();
468
+ if ( this.material === null ) this.mesh.material.dispose();
469
+
470
+ this.mesh = null;
471
+
472
+ }
473
+
474
+ }
475
+
476
+ // fixed baseline. the remaining parameters (footprint, tierFractions, pierWidth,
477
+ // pierDepth, windowReveal, stringCourseHeight, archBayWidthRatio, archRise) are
478
+ // derived from the seed by randomStyle() unless the caller provides them.
479
+ SkyscraperGenerator.defaults = {
480
+ seed: 35,
481
+ totalHeight: 140,
482
+ floorHeight: 4,
483
+ bayWidth: 2.6,
484
+ stringCourseEvery: 6,
485
+ chamferWidth: 4,
486
+ chamferCornerX: 1,
487
+ chamferCornerZ: 1,
488
+ setbackDepth: 1.5,
489
+ acChance: 0.12
490
+ };
491
+
492
+ // --- footprint & faces ---------------------------------------------------
493
+
494
+ /**
495
+ * A rectangle (centred at the origin in the XZ plane) with one corner cut at
496
+ * 45 degrees, returned as an ordered list of `Vector2( x, z )`. `cornerX` /
497
+ * `cornerZ` ( each ±1 ) pick which corner is cut, so the chamfer can be aimed
498
+ * outward to a block corner.
499
+ */
500
+ function buildFootprint( width, depth, chamfer, cornerX = 1, cornerZ = 1 ) {
501
+
502
+ const hw = width / 2;
503
+ const hd = depth / 2;
504
+ const c = Math.min( chamfer, hw, hd );
505
+
506
+ // the four corners, counter-clockwise
507
+ const corners = [
508
+ new Vector2( hw, hd ),
509
+ new Vector2( - hw, hd ),
510
+ new Vector2( - hw, - hd ),
511
+ new Vector2( hw, - hd )
512
+ ];
513
+
514
+ const points = [];
515
+
516
+ for ( let i = 0; i < corners.length; i ++ ) {
517
+
518
+ const corner = corners[ i ];
519
+
520
+ // cut the requested corner: replace it with two points pulled back along
521
+ // each adjacent edge, leaving a 45° face that points out to that corner
522
+ if ( c > 0 && Math.sign( corner.x ) === cornerX && Math.sign( corner.y ) === cornerZ ) {
523
+
524
+ const prev = corners[ ( i + 3 ) % 4 ];
525
+ const next = corners[ ( i + 1 ) % 4 ];
526
+ points.push( corner.clone().lerp( prev, c / corner.distanceTo( prev ) ) );
527
+ points.push( corner.clone().lerp( next, c / corner.distanceTo( next ) ) );
528
+
529
+ } else {
530
+
531
+ points.push( corner.clone() );
532
+
533
+ }
534
+
535
+ }
536
+
537
+ return points;
538
+
539
+ }
540
+
541
+ /**
542
+ * Builds a face frame per footprint edge. Each frame is an orthonormal basis
543
+ * ( u along the edge, v up, n outward ) plus an origin and length, so all
544
+ * facade layout can happen in flat ( u, v ) space and bake to world with one
545
+ * matrix — the same authored piece then instances onto every face, including
546
+ * the diagonal chamfer.
547
+ */
548
+ function buildFaces( points ) {
549
+
550
+ const faces = [];
551
+ const up = new Vector3( 0, 1, 0 );
552
+
553
+ for ( let i = 0; i < points.length; i ++ ) {
554
+
555
+ const a = points[ i ];
556
+ const b = points[ ( i + 1 ) % points.length ];
557
+
558
+ // outward normal: perpendicular to the edge, pointing away from the
559
+ // origin (the footprint is centred there)
560
+
561
+ const n = new Vector3( b.y - a.y, 0, - ( b.x - a.x ) ).normalize();
562
+ const mid = new Vector3( ( a.x + b.x ) / 2, 0, ( a.y + b.y ) / 2 );
563
+ if ( n.dot( mid ) < 0 ) n.negate();
564
+
565
+ // right-handed basis: u = v × n, so makeBasis( u, v, n ) is a pure rotation
566
+
567
+ const u = new Vector3().crossVectors( up, n ).normalize();
568
+
569
+ const pa = new Vector3( a.x, 0, a.y );
570
+ const pb = new Vector3( b.x, 0, b.y );
571
+ const length = pa.distanceTo( pb );
572
+
573
+ // the edge end that u points away from becomes the origin
574
+
575
+ const origin = pb.clone().sub( pa ).dot( u ) > 0 ? pa : pb;
576
+
577
+ faces.push( new FaceFrame( origin, u, up.clone(), n, length ) );
578
+
579
+ }
580
+
581
+ return faces;
582
+
583
+ }
584
+
585
+ /** A face's local ( u along edge, v up, n outward ) frame in world space. */
586
+ class FaceFrame {
587
+
588
+ constructor( origin, u, v, n, length ) {
589
+
590
+ this.origin = origin;
591
+ this.u = u;
592
+ this.v = v;
593
+ this.n = n;
594
+ this.length = length;
595
+
596
+ }
597
+
598
+ point( u, v, w, target = new Vector3() ) {
599
+
600
+ return target
601
+ .copy( this.origin )
602
+ .addScaledVector( this.u, u )
603
+ .addScaledVector( this.v, v )
604
+ .addScaledVector( this.n, w );
605
+
606
+ }
607
+
608
+ /** Places a piece authored in the canonical local frame ( x across, y up, z outward ). */
609
+ matrix( u, v, w ) {
610
+
611
+ return new Matrix4()
612
+ .makeBasis( this.u, this.v, this.n )
613
+ .setPosition( this.point( u, v, w, _point ) );
614
+
615
+ }
616
+
617
+ /** How many bays of `bayWidth` fit, with the remainder split into end margins. */
618
+ bays( bayWidth ) {
619
+
620
+ const count = Math.max( 1, Math.floor( this.length / bayWidth ) );
621
+ const margin = ( this.length - count * bayWidth ) / 2;
622
+
623
+ return { count, margin, width: bayWidth };
624
+
625
+ }
626
+
627
+ }
628
+
629
+ // --- shell pieces --------------------------------------------------------
630
+
631
+ // a Matrix4 mapping the shared unit box ( 1×1×1, centred ) onto a face-aligned
632
+ // box of the given size, centred at the given face-local point. these matrices
633
+ // are what the shell InstancedMesh is built from.
634
+ function boxMatrix( frame, u, v, w, sizeU, sizeV, sizeN ) {
635
+
636
+ return new Matrix4()
637
+ .makeBasis( frame.u, frame.v, frame.n )
638
+ .scale( _scale.set( sizeU, sizeV, sizeN ) )
639
+ .setPosition( frame.point( u, v, w, _point ) );
640
+
641
+ }
642
+
643
+ function addWall( target, frame, vBottom, vTop, thickness = 0.8, front = 0 ) {
644
+
645
+ const h = vTop - vBottom;
646
+ target.push( boxMatrix( frame, frame.length / 2, vBottom + h / 2, front - thickness / 2, frame.length + thickness * 2, h, thickness ) );
647
+
648
+ }
649
+
650
+ /**
651
+ * Horizontal terracotta bands at every floor line. Together with the projecting
652
+ * piers they form the facade grid; the gaps between them are the window
653
+ * openings, with glass set behind.
654
+ */
655
+ function addSpandrelBands( target, frame, vBottom, height, p ) {
656
+
657
+ const floors = Math.max( 1, Math.round( height / p.floorHeight ) );
658
+ const fh = height / floors;
659
+ const bandHeight = p.floorHeight - p.windowHeight; // whole courses: floor minus the glazed opening
660
+
661
+ // pull the ends in by the band depth so a band doesn't poke its end-cap
662
+ // into the plane of the perpendicular face at the corners ( overdraw )
663
+ const bandLength = Math.max( 0.2, frame.length - 0.6 );
664
+
665
+ const vTop = vBottom + height;
666
+
667
+ for ( let f = 0; f <= floors; f ++ ) {
668
+
669
+ // the end bands ( f = 0 / f = floors ) are centred on the tier boundary; clamp
670
+ // them so they don't extend into the neighbouring tier
671
+ const center = vBottom + f * fh;
672
+ const top = Math.min( center + bandHeight / 2, vTop );
673
+ const bottom = Math.max( center - bandHeight / 2, vBottom );
674
+ const h = top - bottom;
675
+ if ( h <= 0 ) continue;
676
+
677
+ // front flush at w = 0, meeting the backing wall behind
678
+ target.push( boxMatrix( frame, frame.length / 2, ( top + bottom ) / 2, - 0.3, bandLength, h, 0.6 ) );
679
+
680
+ }
681
+
682
+ }
683
+
684
+ /**
685
+ * A thin horizontal cap over a footprint's bounding box at height `y`. Its
686
+ * sides are pulled in behind the facade plane ( into the backing-wall shell )
687
+ * so they never sit coplanar with the walls, spandrels or piers and z-fight.
688
+ */
689
+ function slab( footprint, y, thickness ) {
690
+
691
+ // a thin cap following the footprint OUTLINE ( so the chamfered corner is cut, not
692
+ // left overhanging as a rectangular box ), inset a little so its edge tucks just
693
+ // behind the facade and the wall top reads as a lip around it
694
+
695
+ const inset = 0.8;
696
+ let cx = 0, cz = 0;
697
+ for ( const p of footprint ) {
698
+
699
+ cx += p.x; cz += p.y;
700
+
701
+ }
702
+
703
+ cx /= footprint.length; cz /= footprint.length;
704
+
705
+ // consistent ( CCW ) winding so the extrude caps face up / down correctly
706
+ let area = 0;
707
+ for ( let i = 0; i < footprint.length; i ++ ) {
708
+
709
+ const a = footprint[ i ], b = footprint[ ( i + 1 ) % footprint.length ];
710
+ area += a.x * b.y - b.x * a.y;
711
+
712
+ }
713
+
714
+ const pts = area < 0 ? footprint.slice().reverse() : footprint;
715
+
716
+ const shape = new Shape();
717
+ pts.forEach( ( p, i ) => {
718
+
719
+ const dx = cx - p.x, dz = cz - p.y;
720
+ const d = Math.hypot( dx, dz ) || 1;
721
+ const x = p.x + dx / d * inset;
722
+ const z = p.y + dz / d * inset;
723
+ if ( i === 0 ) shape.moveTo( x, z ); else shape.lineTo( x, z );
724
+
725
+ } );
726
+
727
+ // extrude the XZ outline downward by the thickness, the top dropped just below height y:
728
+ // the inset cap would otherwise sit coplanar with the surrounding wall top faces and
729
+ // z-fight, and the parapet / spandrel bands around the edge hide the shallow recess
730
+ const drop = 0.2;
731
+ const geometry = new ExtrudeGeometry( shape, { depth: thickness, bevelEnabled: false } );
732
+ geometry.rotateX( Math.PI / 2 );
733
+ geometry.translate( 0, y - drop, 0 );
734
+ return geometry;
735
+
736
+ }
737
+
738
+ /** A two-step projecting cornice / string-course band wrapping a face. */
739
+ function addCornice( target, frame, vBottom, height, depth ) {
740
+
741
+ target.push( boxMatrix( frame, frame.length / 2, vBottom + height * 0.275, depth / 2, frame.length, height * 0.55, depth ) );
742
+ target.push( boxMatrix( frame, frame.length / 2, vBottom + height * 0.775, depth * 0.85, frame.length, height * 0.45, depth * 1.7 ) );
743
+
744
+ }
745
+
746
+ /** A low parapet wall capping the crown. */
747
+ function addParapet( target, frame, vTop, p ) {
748
+
749
+ const height = 1.4;
750
+ target.push( boxMatrix( frame, frame.length / 2, vTop + height / 2, p.pierDepth * 0.4, frame.length, height, p.pierDepth * 0.8 ) );
751
+
752
+ }
753
+
754
+ // the arch openings' inner reveal walls, each hole outline swept back to the wall
755
+ // thickness; holes wind clockwise, so an edge's inward normal is ( dy, -dx )
756
+ function buildArchReveals( holes, depth, curveSegments ) {
757
+
758
+ const positions = [], normals = [], uvs = [];
759
+
760
+ for ( const hole of holes ) {
761
+
762
+ const points = hole.getPoints( curveSegments );
763
+
764
+ for ( let i = 0; i < points.length - 1; i ++ ) {
765
+
766
+ const a = points[ i ], b = points[ i + 1 ];
767
+ const dx = b.x - a.x, dy = b.y - a.y;
768
+ const inv = 1 / ( Math.hypot( dx, dy ) || 1 );
769
+ const nx = dy * inv, ny = - dx * inv;
770
+
771
+ // the two triangles of the quad a → b, both facing into the opening
772
+ positions.push( a.x, a.y, 0, a.x, a.y, - depth, b.x, b.y, - depth );
773
+ positions.push( a.x, a.y, 0, b.x, b.y, - depth, b.x, b.y, 0 );
774
+
775
+ for ( let v = 0; v < 6; v ++ ) {
776
+
777
+ normals.push( nx, ny, 0 );
778
+ uvs.push( 0, 0 );
779
+
780
+ }
781
+
782
+ }
783
+
784
+ }
785
+
786
+ const geometry = new BufferGeometry();
787
+ geometry.setAttribute( 'position', new BufferAttribute( new Float32Array( positions ), 3 ) );
788
+ geometry.setAttribute( 'normal', new BufferAttribute( new Float32Array( normals ), 3 ) );
789
+ geometry.setAttribute( 'uv', new BufferAttribute( new Float32Array( uvs ), 2 ) );
790
+ return geometry;
791
+
792
+ }
793
+
794
+ /**
795
+ * The base storey: a wall pierced by tall pointed-arch openings, built as a flat front
796
+ * face and the openings' reveals so they read as deep recesses.
797
+ */
798
+ function addArcade( target, frame, height, p ) {
799
+
800
+ const archWidth = p.bayWidth * p.archBayWidthRatio;
801
+ const { count, margin } = frame.bays( archWidth );
802
+
803
+ const sill = height * 0.04;
804
+ const spring = height * 0.55;
805
+ const apex = Math.min( height * 0.96, spring + ( archWidth / 2 ) * ( 0.8 + p.archRise ) );
806
+
807
+ const shape = new Shape();
808
+ shape.moveTo( 0, 0 );
809
+ shape.lineTo( frame.length, 0 );
810
+ shape.lineTo( frame.length, height );
811
+ shape.lineTo( 0, height );
812
+ shape.lineTo( 0, 0 );
813
+
814
+ for ( let i = 0; i < count; i ++ ) {
815
+
816
+ const cx = margin + ( i + 0.5 ) * archWidth;
817
+ const hw = archWidth * 0.34;
818
+
819
+ const hole = new Path();
820
+ hole.moveTo( cx - hw, sill );
821
+ hole.lineTo( cx - hw, spring );
822
+ hole.quadraticCurveTo( cx - hw, apex, cx, apex );
823
+ hole.quadraticCurveTo( cx + hw, apex, cx + hw, spring );
824
+ hole.lineTo( cx + hw, sill );
825
+ hole.lineTo( cx - hw, sill );
826
+ shape.holes.push( hole );
827
+
828
+ }
829
+
830
+ const thickness = 1.1;
831
+ const curveSegments = 8;
832
+
833
+ // flat front face plus the swept reveals; the openings show through to the dark plane behind
834
+ const front = new ShapeGeometry( shape, curveSegments );
835
+ const reveals = buildArchReveals( shape.holes, thickness, curveSegments );
836
+ const geometry = merge( [ front, reveals ] );
837
+ geometry.applyMatrix4( frame.matrix( 0, 0, 0 ) );
838
+
839
+ target.push( geometry );
840
+
841
+ // a dark plane set behind the openings so the recesses read
842
+
843
+ const back = new PlaneGeometry( frame.length, height );
844
+ back.applyMatrix4( frame.matrix( frame.length / 2, height / 2, - thickness - 0.4 ) );
845
+ target.push( back );
846
+
847
+ }
848
+
849
+ /**
850
+ * The street-level retail front: glazed shopfronts on a low bulkhead, under a
851
+ * signboard fascia, framed by the building's ground-floor piers and split by slim
852
+ * mullions, with a projecting awning over some shops. Reads as a row of NYC
853
+ * storefronts. All pieces are pushed into the caller's `parts` accumulators.
854
+ */
855
+ function addStorefront( frame, height, p, parts ) {
856
+
857
+ const bulkhead = 0.5; // the solid kickplate the glazing stands on
858
+ const fascia = Math.min( 0.9, height * 0.22 ); // the signboard band above the glass
859
+ const glassBottom = bulkhead;
860
+ const glassHeight = height - fascia - bulkhead;
861
+ const len = frame.length;
862
+
863
+ // a stone bulkhead and a projecting signboard band run the full face
864
+ parts.storeBands.push( boxMatrix( frame, len / 2, bulkhead / 2, 0, len, bulkhead, 0.55 ) );
865
+ parts.storeBands.push( boxMatrix( frame, len / 2, height - fascia / 2, 0.08, len, fascia, 0.72 ) );
866
+
867
+ // the shop interior wall behind the glazing
868
+ addWall( parts.backWalls, frame, 0, height, 0.8, - 0.6 );
869
+
870
+ // shopfronts are wider than the window bays above, so group bays into ~4 m shops
871
+ const shopWidth = Math.max( 4, p.bayWidth * 2 );
872
+ const { count, margin, width } = frame.bays( shopWidth );
873
+
874
+ for ( let i = 0; i < count; i ++ ) {
875
+
876
+ const x0 = margin + i * width;
877
+ const cx = x0 + width / 2;
878
+
879
+ // a structural pier at each shopfront edge, full ground-floor height ( the far
880
+ // end is the shared corner the next face piers, like addPiers )
881
+ parts.addPier( frame, x0, 0, height );
882
+
883
+ // the display glazing for this shop, set back behind the frame, with the
884
+ // interior-mapping room it looks into ( one shop-wide, ground-floor-tall box )
885
+ const reveal = 0.18;
886
+ const gw = width - p.pierWidth - 0.12;
887
+ const cy = glassBottom + glassHeight / 2;
888
+ parts.glass.push( boxMatrix( frame, cx, cy, - reveal, gw, glassHeight, 1 ) );
889
+ parts.glassRooms.push( { center: frame.point( cx, cy, - reveal ), size: new Vector2( gw, glassHeight ) } );
890
+
891
+ // two slim mullions dividing the shopfront into three lights
892
+ parts.mullions.push( boxMatrix( frame, x0 + width / 3, glassBottom + glassHeight / 2, 0, 0.08, glassHeight, 0.16 ) );
893
+ parts.mullions.push( boxMatrix( frame, x0 + width * 2 / 3, glassBottom + glassHeight / 2, 0, 0.08, glassHeight, 0.16 ) );
894
+
895
+ // an awning over roughly half the shops, projecting from below the signboard
896
+ const r = Math.sin( i * 23.7 + frame.origin.x * 0.21 + frame.origin.z * 0.11 ) * 43758.5453;
897
+ if ( r - Math.floor( r ) < 0.5 ) {
898
+
899
+ const depth = 1.3;
900
+ parts.awnings.push( boxMatrix( frame, cx, height - fascia - 0.12, depth / 2 + 0.05, width - 0.3, 0.14, depth ) );
901
+
902
+ }
903
+
904
+ }
905
+
906
+ }
907
+
908
+ // --- repeating field -----------------------------------------------------
909
+
910
+ function addPiers( frame, vBottom, height, p, addPier ) {
911
+
912
+ const { count, margin, width } = frame.bays( p.bayWidth );
913
+
914
+ // a pier on every bay edge except the far end: that corner is shared with
915
+ // the next face, which places its own pier there, so emitting both would
916
+ // stack two piers at each corner
917
+
918
+ for ( let i = 0; i < count; i ++ ) {
919
+
920
+ addPier( frame, margin + i * width, vBottom, height );
921
+
922
+ }
923
+
924
+ }
925
+
926
+ function addWindows( frame, windows, glass, glassRooms, acUnits, vBottom, height, p ) {
927
+
928
+ const { count, margin, width } = frame.bays( p.bayWidth );
929
+ const floors = Math.max( 1, Math.round( height / p.floorHeight ) );
930
+ const fh = height / floors;
931
+
932
+ // a window AC unit sitting on the sill, protruding from the facade. about half the window
933
+ // width, capped at a real unit's size ( ~0.66 m ) and kept wider than tall, sticking out
934
+ // about half its width
935
+ const acW = Math.min( ( p.bayWidth - p.pierWidth ) * 0.55, 0.66 );
936
+ const acH = acW * 0.6;
937
+ const acD = acW * 0.5;
938
+ const acV = - p.windowHeight / 2 + acH / 2 + WINDOW_BORDER; // bottom rests on the sill ( the top of the window's bottom frame rail )
939
+
940
+ // a real ~0.66 m unit looks lost in a wide opening, so only fit ACs where it still spans a
941
+ // fair share of the window — in practice, the narrower ( older-style ) windows
942
+ const acFits = acW >= ( width - p.pierWidth ) * 0.34;
943
+
944
+ for ( let f = 0; f < floors; f ++ ) {
945
+
946
+ const cy = vBottom + ( f + 0.5 ) * fh;
947
+
948
+ // the interior-mapping room module: one floor tall, a run of two or three bays
949
+ // wide, chosen per floor so neighbouring windows share an interior. the choice
950
+ // is deterministic ( seeded by the floor and the face ) so it is stable, and the
951
+ // run is recorded per window so the material can ray-march the right box.
952
+ const roomBays = floorHash( f, frame, 0 ) > 0.5 ? 3 : 2;
953
+ const roomPhase = Math.floor( floorHash( f, frame, 1 ) * roomBays );
954
+
955
+ for ( let b = 0; b < count; b ++ ) {
956
+
957
+ const cx = margin + ( b + 0.5 ) * width;
958
+
959
+ windows.push( frame.matrix( cx, cy, 0 ) );
960
+ glass.push( frame.matrix( cx, cy, - p.windowReveal ) );
961
+
962
+ // the run of bays this window's room spans, clamped at the face ends, recorded
963
+ // as the room's centre on the facade and its width × height in metres
964
+ const room = Math.floor( ( b + roomPhase ) / roomBays );
965
+ const bStart = Math.max( 0, room * roomBays - roomPhase );
966
+ const bEnd = Math.min( count, ( room + 1 ) * roomBays - roomPhase );
967
+ const span = bEnd - bStart;
968
+ glassRooms.push( { center: frame.point( margin + ( bStart + span / 2 ) * width, cy, - p.windowReveal ), size: new Vector2( span * width, fh - 1 ) } ); // centred on the glass plane, so the interior is anchored to the pane it is drawn on
969
+
970
+ if ( acUnits && acFits ) {
971
+
972
+ // deterministic per-window hash ( varies per face via the frame origin )
973
+ const r = Math.sin( f * 41.3 + b * 12.7 + frame.origin.x * 0.13 + frame.origin.z * 0.31 ) * 43758.5453;
974
+ // the back tucks into the window reveal ( just in front of the glass ) so the unit sits
975
+ // in the opening instead of floating on the facade
976
+ const acW0 = acD / 2 - p.windowReveal + 0.04;
977
+ if ( r - Math.floor( r ) < p.acChance ) acUnits.push( boxMatrix( frame, cx, cy + acV, acW0, acW, acH, acD ) );
978
+
979
+ }
980
+
981
+ }
982
+
983
+ }
984
+
985
+ }
986
+
987
+ function addFinials( frame, finials, vBottom, height, p ) {
988
+
989
+ const { count, margin, width } = frame.bays( p.bayWidth );
990
+ const top = vBottom + height;
991
+
992
+ // skip the far-end bay edge: it is the shared corner the next face also
993
+ // caps, so emitting both would stack two finials at each corner
994
+
995
+ for ( let i = 0; i < count; i ++ ) {
996
+
997
+ finials.push( new Matrix4().setPosition( frame.point( margin + i * width, top, p.pierDepth * 0.5, _point ) ) );
998
+
999
+ }
1000
+
1001
+ }
1002
+
1003
+ // --- authored modules ----------------------------------------------------
1004
+
1005
+ function buildPierGeometry( p, height ) {
1006
+
1007
+ // a wide pier with a slimmer pilaster raised on its face, giving the
1008
+ // continuous vertical rib a stepped, terracotta profile
1009
+
1010
+ const back = new BoxGeometry( p.pierWidth, height, p.pierDepth * 0.6 );
1011
+ back.translate( 0, height / 2, p.pierDepth * 0.3 );
1012
+
1013
+ // the pilaster stops just short of the pier top so that where a pier is left
1014
+ // exposed ( at a setback ) the cap reads as one clean block rather than the
1015
+ // back box and the pilaster stacked into a T
1016
+ const pilasterHeight = Math.max( 1, height - 0.6 );
1017
+ const front = new BoxGeometry( p.pierWidth * 0.55, pilasterHeight, p.pierDepth * 0.45 );
1018
+ front.translate( 0, pilasterHeight / 2, p.pierDepth * 0.6 + p.pierDepth * 0.225 );
1019
+
1020
+ return merge( [ back, front ] );
1021
+
1022
+ }
1023
+
1024
+ function buildWindowGeometry( p ) {
1025
+
1026
+ // the flat frame face ( a rectangle with the glazing hole ), the four reveal walls
1027
+ // of the opening and the glazing bars, merged into one instanced module. a full
1028
+ // extrusion would also emit a hidden back cap and outer side walls; windows are by
1029
+ // far the heaviest part of a building, so those are skipped.
1030
+
1031
+ const w = p.bayWidth - p.pierWidth;
1032
+ const h = p.windowHeight;
1033
+ const border = WINDOW_BORDER;
1034
+ const depth = p.windowReveal; // reveal walls run all the way back to the glass ( placed at -windowReveal ), so no gap opens between them and the pane
1035
+ const iw = w / 2 - border;
1036
+ const ih = h / 2 - border;
1037
+
1038
+ const shape = new Shape();
1039
+ shape.moveTo( - w / 2, - h / 2 );
1040
+ shape.lineTo( w / 2, - h / 2 );
1041
+ shape.lineTo( w / 2, h / 2 );
1042
+ shape.lineTo( - w / 2, h / 2 );
1043
+ shape.lineTo( - w / 2, - h / 2 );
1044
+
1045
+ const hole = new Path();
1046
+ hole.moveTo( - iw, - ih );
1047
+ hole.lineTo( - iw, ih );
1048
+ hole.lineTo( iw, ih );
1049
+ hole.lineTo( iw, - ih );
1050
+ hole.lineTo( - iw, - ih );
1051
+ shape.holes.push( hole );
1052
+
1053
+ const front = new ShapeGeometry( shape ); // visible frame face, flush with the facade
1054
+
1055
+ // the four reveal walls of the opening, set back to the glazing
1056
+ const wall = ( x, y, rx, ry, sw, sh ) => {
1057
+
1058
+ const pl = new PlaneGeometry( sw, sh );
1059
+ pl.rotateX( rx );
1060
+ pl.rotateY( ry );
1061
+ pl.translate( x, y, - depth / 2 );
1062
+ return pl;
1063
+
1064
+ };
1065
+
1066
+ const left = wall( - iw, 0, 0, Math.PI / 2, depth, ih * 2 );
1067
+ const right = wall( iw, 0, 0, - Math.PI / 2, depth, ih * 2 );
1068
+ const sill = wall( 0, - ih, - Math.PI / 2, 0, iw * 2, depth );
1069
+ const head = wall( 0, ih, Math.PI / 2, 0, iw * 2, depth );
1070
+
1071
+ // a single horizontal glazing bar ( transom ), flat, just in front of the glass —
1072
+ // a thin box would triple the window's triangle count for sub-pixel thickness
1073
+ const transom = new PlaneGeometry( iw * 2, 0.05 );
1074
+ transom.translate( 0, h * 0.04, - depth + 0.02 ); // meeting rail, just above centre
1075
+
1076
+ return merge( [ front, left, right, sill, head, transom ] );
1077
+
1078
+ }
1079
+
1080
+ function buildGlassGeometry( p ) {
1081
+
1082
+ const w = p.bayWidth - p.pierWidth - WINDOW_BORDER * 2;
1083
+ const h = p.windowHeight - WINDOW_BORDER * 2;
1084
+
1085
+ return new PlaneGeometry( w, h );
1086
+
1087
+ }
1088
+
1089
+ function buildFinialGeometry( p ) {
1090
+
1091
+ // a tapering pinnacle revolved around its axis
1092
+
1093
+ const s = p.pierWidth;
1094
+ const profile = [
1095
+ new Vector2( 0.0, 0 ),
1096
+ new Vector2( s * 0.9, 0 ),
1097
+ new Vector2( s * 0.9, s * 0.4 ),
1098
+ new Vector2( s * 0.55, s * 1.0 ),
1099
+ new Vector2( 0.0, s * 3.2 )
1100
+ ];
1101
+
1102
+ return new LatheGeometry( profile, 8 ); // round enough to read as a smooth pinnacle, still light
1103
+
1104
+ }
1105
+
1106
+ // --- material ------------------------------------------------------------
1107
+
1108
+ // interior mapping: fakes a furnished room behind each glass pane in the fragment
1109
+ // shader — no geometry, no texture. every pane carries the room it looks into ( centre +
1110
+ // size, baked per window by addWindows ), so neighbouring panes share one interior. the
1111
+ // view ray is cast into that box and the walls, floor, ceiling and a few furniture pieces
1112
+ // it meets are shaded procedurally, keyed off a per-room hash. returns vec4( colour, lit ).
1113
+ const interior = /*@__PURE__*/ Fn( () => {
1114
+
1115
+ // flat so floor() below can't split one pane across two cell ids ( centre is per-room )
1116
+ const roomCenter = varying( attribute( 'roomCenter', 'vec3' ) ).setInterpolation( InterpolationSamplingType.FLAT, InterpolationSamplingMode.EITHER );
1117
+ const roomSize = attribute( 'roomSize', 'vec2' );
1118
+
1119
+ // a per-face frame from the geometry normal ( holds on every facade, including the
1120
+ // 45° chamfer ): u runs across the face, v is up, n points outward
1121
+ const n = normalLocal;
1122
+ const up = vec3( 0, 1, 0 );
1123
+ const uAxis = cross( up, n ).normalize();
1124
+
1125
+ // this pixel and the view ray, in the room's ( across, up, depth ) frame; depth
1126
+ // runs into the wall, so the ray's depth component is positive
1127
+ const d = positionLocal.sub( roomCenter );
1128
+ const camLocal = modelWorldMatrixInverse.mul( vec4( cameraPosition, 1 ) ).xyz;
1129
+ const rayLocal = positionLocal.sub( camLocal ).normalize();
1130
+ const origin = vec3( dot( d, uAxis ), d.y, 0 );
1131
+ const dir = vec3( dot( rayLocal, uAxis ), rayLocal.y, dot( rayLocal, n ).negate() );
1132
+
1133
+ // the room box: the pane-wide × ceiling-height front rectangle ( centred on the pane ),
1134
+ // set back behind the glass and run a little deeper than it is tall. shade the far
1135
+ // side the ray exits ( slab method: nearest of the three far-plane crossings;
1136
+ // dividing by a near-zero direction gives ±inf, which min() harmlessly drops ).
1137
+ const setback = float( 0.1 ); // the room starts just behind the glass, so it sits flush in the frame opening
1138
+ const boxMax = vec3( roomSize.x.mul( 0.5 ), roomSize.y.mul( 0.5 ), setback.add( roomSize.y.mul( 1.55 ) ) );
1139
+ const boxMin = vec3( boxMax.x.negate(), boxMax.y.negate(), setback );
1140
+ const tFar = boxMin.sub( origin ).div( dir ).max( boxMax.sub( origin ).div( dir ) );
1141
+ const t = tFar.x.min( tFar.y ).min( tFar.z );
1142
+ const hit = origin.add( dir.mul( t ) );
1143
+ const q = hit.sub( boxMin ).div( boxMax.sub( boxMin ) ); // 0..1 inside the room
1144
+
1145
+ const onBack = q.z.greaterThan( 0.998 );
1146
+ const onCeil = q.y.greaterThan( 0.998 );
1147
+ const onFloor = q.y.lessThan( 0.002 );
1148
+
1149
+ // per-room key for a portable integer hash — fract( sin() ) isn't bit-exact across drivers
1150
+ const cell = floor( roomCenter.mul( 2.0 ) ); // + offset before the u32 cast keeps it non-negative
1151
+ const ckey = uint( cell.x.add( 1 << 21 ) ).mul( uint( 73856093 ) )
1152
+ .bitXor( uint( cell.y.add( 1 << 21 ) ).mul( uint( 19349663 ) ) )
1153
+ .bitXor( uint( cell.z.add( 1 << 21 ) ).mul( uint( 83492791 ) ) ).toVar();
1154
+ const hash = ( kx, ky, kz ) => ihash( ckey.add( uint( Math.round( ( kx + ky * 7 + kz * 13 ) * 100 ) ) ) );
1155
+ const seed = hash( 12.9898, 78.233, 37.719 );
1156
+ const seed2 = hash( 39.346, 11.135, 83.155 );
1157
+ const lit = step( 0.8, hash( 63.21, 9.17, 51.43 ) ); // ~20% of rooms have the lights on; the rest sit dark
1158
+
1159
+ // each room's bulb colour. most run warm, drifting from a dim amber ( ~2400K ) up to a
1160
+ // warm white ( ~3200K ); a minority run cool, from a fluorescent / LED daylight to a TV's
1161
+ // bluer glow — so a lit facade reads as a spread of bulb temperatures, not one flat tint
1162
+ const warmLight = mix( color( 0xffb845 ), color( 0xffe49c ), hash( 27.1, 4.9, 61.7 ) );
1163
+ const coolLight = mix( color( 0xdfe8ff ), color( 0x9fb6ff ), hash( 8.3, 51.2, 17.6 ) );
1164
+ const lightCol = select( hash( 44.7, 19.3, 6.1 ).greaterThan( 0.88 ), coolLight, warmLight ); // ~12% of lit rooms run cool
1165
+
1166
+ // depth falloff ( darker toward the back ), and a panel mask on a face given its
1167
+ // two 0..1 coordinates — used for the flat fittings below
1168
+ const depth = roomSize.y.mul( 1.55 );
1169
+ const falloffAt = ( z ) => mix( float( 1.0 ), float( 0.42 ), z.sub( setback ).div( depth ).clamp( 0, 1 ) );
1170
+ const rect = ( ax, ay, cx, cy, hw, hh ) => smoothstep( hw + 0.006, hw - 0.006, ax.sub( cx ).abs() ).mul( smoothstep( hh + 0.006, hh - 0.006, ay.sub( cy ).abs() ) );
1171
+
1172
+ // --- the room shell: walls, floor, ceiling, back wall, with flat fittings ----
1173
+
1174
+ // muted plaster, picked per room, with a darker skirting board along the wall foot
1175
+ let wall = mix( color( 0x9a8b73 ), color( 0x6f7a82 ), seed );
1176
+ wall = mix( wall, color( 0xb9ad97 ), seed2.mul( 0.6 ) );
1177
+ const wallCol = mix( wall, wall.mul( 0.5 ), smoothstep( 0.05, 0.04, q.y ) );
1178
+
1179
+ // floorboards with a thin seam every few, and a centred rug
1180
+ const seam = step( 0.94, fract( q.x.mul( 6 ) ) );
1181
+ const boards = mix( color( 0x4a3320 ), color( 0x6a4c30 ), seed ).mul( seam.mul( 0.3 ).oneMinus() );
1182
+ const rug = mix( color( 0x7a3b32 ), color( 0x3a5760 ), seed2 );
1183
+ const floorCol = mix( boards, rug, rect( q.x, q.z, 0.5, 0.62, 0.3, 0.26 ).mul( 0.9 ) );
1184
+
1185
+ // ceiling, lighter than the walls, with a round overhead light in the middle; in a
1186
+ // lit room the fixture reads bright and glows ( the material's emissive = colour × lit )
1187
+ const lamp = smoothstep( 0.16, 0.13, vec2( q.x.sub( 0.5 ), q.z.sub( 0.5 ) ).length() );
1188
+ const ceilCol = mix( mix( wall, color( 0xffffff ), 0.5 ), lightCol.mul( mix( float( 1.0 ), float( 4.5 ), lit ) ), lamp );
1189
+
1190
+ // back wall: a panelled door to one side, and a framed picture kept on the
1191
+ // opposite half of the wall so it never lands on the door
1192
+ const doorX = mix( float( 0.22 ), float( 0.78 ), seed );
1193
+ const door = mix( color( 0x5a4631 ), color( 0x39383c ), step( 0.5, seed2 ) );
1194
+ const picX = select( doorX.lessThan( 0.5 ), mix( float( 0.68 ), float( 0.82 ), seed2 ), mix( float( 0.18 ), float( 0.32 ), seed2 ) );
1195
+ const picCol = mix( color( 0x2c3a4a ), color( 0x7a5a3a ), hash( 5.1, 9.2, 3.3 ) );
1196
+ let backCol = mix( wallCol, door, rect( q.x, q.y, doorX, 0.33, 0.085, 0.35 ) );
1197
+ backCol = mix( backCol, color( 0x141210 ), rect( q.x, q.y, picX, 0.56, 0.075, 0.085 ) ); // dark frame
1198
+ backCol = mix( backCol, picCol, rect( q.x, q.y, picX, 0.56, 0.055, 0.065 ) ); // the picture
1199
+
1200
+ const shellCol = select( onBack, backCol, select( onCeil, ceilCol, select( onFloor, floorCol, wallCol ) ) );
1201
+
1202
+ // fake ambient occlusion: darken the hit toward the room's edges ( where two surfaces
1203
+ // meet ), so the box reads with soft corner shading instead of flat-lit walls. the two
1204
+ // in-plane axes depend on which face the ray exits through ( q is 0..1 inside the room ).
1205
+ const aoBand = 0.15;
1206
+ const aoEdge = ( a ) => smoothstep( 0, aoBand, a ).mul( smoothstep( 0, aoBand, a.oneMinus() ) );
1207
+ const edgeAO = select( onBack, aoEdge( q.x ).mul( aoEdge( q.y ) ), select( onFloor.or( onCeil ), aoEdge( q.x ).mul( aoEdge( q.z ) ), aoEdge( q.y ).mul( aoEdge( q.z ) ) ) );
1208
+ const shellAO = mix( float( 0.72 ), float( 1.0 ), edgeAO );
1209
+
1210
+ // --- nearest surface: the shell, then any furniture block that lies closer ----
1211
+ // each block is a solid axis-aligned box in room space; boxHit returns its near
1212
+ // face. consider() keeps whichever surface the ray meets first.
1213
+ let bestT = t;
1214
+ let bestCol = shellCol.mul( shellAO ).mul( falloffAt( hit.z ) );
1215
+ let bestEmit = float( 1 ); // per-hit emissive weight: shell and fittings emit fully, curtains far less
1216
+
1217
+ const boxHit = ( bMin, bMax ) => {
1218
+
1219
+ const ta = bMin.sub( origin ).div( dir );
1220
+ const tb = bMax.sub( origin ).div( dir );
1221
+ const lo = ta.min( tb ), hi = ta.max( tb );
1222
+ const tN = lo.x.max( lo.y ).max( lo.z );
1223
+ const p = origin.add( dir.mul( tN ) );
1224
+ return { tN, p, hit: hi.x.min( hi.y ).min( hi.z ).greaterThan( tN ).and( tN.greaterThan( 0 ) ), qb: p.sub( bMin ).div( bMax.sub( bMin ) ) };
1225
+
1226
+ };
1227
+
1228
+ const consider = ( h, tN, c, emit = 1 ) => {
1229
+
1230
+ const near = h.and( tN.lessThan( bestT ) ); bestCol = select( near, c, bestCol ); bestEmit = select( near, float( emit ), bestEmit ); bestT = select( near, tN, bestT );
1231
+
1232
+ };
1233
+
1234
+ const halfU = boxMax.x, floorY = boxMin.y, ceilY = boxMax.y, backZ = boxMax.z;
1235
+ const midZ = setback.add( depth.mul( 0.5 ) ); // room centre, in depth
1236
+
1237
+ // a low table near the middle of the room ( its top catches the light )
1238
+ const tCx = mix( float( - 0.6 ), float( 0.6 ), seed );
1239
+ const tCz = midZ.add( mix( float( - 0.4 ), float( 0.5 ), seed2 ) );
1240
+ const tbl = boxHit( vec3( tCx.sub( 0.6 ), floorY, tCz.sub( 0.35 ) ), vec3( tCx.add( 0.6 ), floorY.add( 0.42 ), tCz.add( 0.35 ) ) );
1241
+ const tblCol = mix( color( 0x4a3526 ), color( 0x6b4a30 ), seed2 ).mul( select( tbl.qb.y.greaterThan( 0.94 ), float( 1.25 ), float( 0.8 ) ) );
1242
+ consider( tbl.hit, tbl.tN, tblCol.mul( falloffAt( tbl.p.z ) ) );
1243
+
1244
+ // a wide low sofa against the back wall, facing the window
1245
+ const sofaCx = mix( halfU.mul( - 0.3 ), halfU.mul( 0.3 ), seed2 );
1246
+ const sofa = boxHit( vec3( sofaCx.sub( 1.1 ), floorY, backZ.sub( 0.95 ) ), vec3( sofaCx.add( 1.1 ), floorY.add( mix( float( 0.8 ), float( 0.9 ), seed ) ), backZ.sub( 0.1 ) ) );
1247
+ const sofaCol = mix( color( 0x5a4a3a ), color( 0x42566a ), seed ).mul( select( sofa.qb.y.greaterThan( 0.9 ), float( 1.12 ), float( 0.85 ) ) );
1248
+ consider( sofa.hit, sofa.tN, sofaCol.mul( falloffAt( sofa.p.z ) ) );
1249
+
1250
+ // tall wardrobes in the back corners — each side stands in some rooms
1251
+ const wardrobe = ( cx, gate, h ) => {
1252
+
1253
+ const w = boxHit( vec3( cx.sub( 0.5 ), floorY, backZ.sub( 0.7 ) ), vec3( cx.add( 0.5 ), floorY.add( h ), backZ.sub( 0.1 ) ) );
1254
+ const c = mix( color( 0x3a2c22 ), color( 0x55473a ), seed ).mul( select( w.qb.y.greaterThan( 0.94 ), float( 1.2 ), float( 0.82 ) ) );
1255
+ consider( w.hit.and( gate ), w.tN, c.mul( falloffAt( w.p.z ) ) );
1256
+
1257
+ };
1258
+
1259
+ wardrobe( halfU.mul( - 0.82 ), hash( 7.3, 2.1, 9.9 ).greaterThan( 0.4 ), mix( float( 1.7 ), float( 2.3 ), seed ) );
1260
+ wardrobe( halfU.mul( 0.82 ), hash( 3.7, 8.4, 1.5 ).greaterThan( 0.4 ), mix( float( 1.7 ), float( 2.3 ), seed2 ) );
1261
+
1262
+ // curtains hung just inside the glass: drapes drawn part-way in from each side,
1263
+ // so some windows read open and others half-covered
1264
+
1265
+ // curtain fabric colour, picked per room from a muted domestic palette — creams and
1266
+ // taupes through warm grey, dusty blue, sage and faded terracotta — with a small
1267
+ // in-family drift so drawn drapes vary window to window instead of all reading beige
1268
+ const swatch = ( a, b ) => mix( color( a ), color( b ), seed2 );
1269
+ const pick = hash( 22.4, 6.7, 91.2 ).mul( 6 ); // 0..6, one bucket per family
1270
+ let fabric = swatch( 0xcabfa6, 0xd8cdb8 ); // cream
1271
+ fabric = select( pick.greaterThan( 1 ), swatch( 0x8a7a64, 0x9b8c72 ), fabric ); // beige / taupe
1272
+ fabric = select( pick.greaterThan( 2 ), swatch( 0x706a64, 0x837d76 ), fabric ); // warm grey
1273
+ fabric = select( pick.greaterThan( 3 ), swatch( 0x5f7079, 0x6f818b ), fabric ); // dusty blue
1274
+ fabric = select( pick.greaterThan( 4 ), swatch( 0x6c7558, 0x79835f ), fabric ); // sage green
1275
+ fabric = select( pick.greaterThan( 5 ), swatch( 0x8c5a44, 0x9a6a52 ), fabric ); // faded terracotta
1276
+ const drape = ( bMin, bMax, gate ) => {
1277
+
1278
+ const h = boxHit( bMin, bMax );
1279
+ const pleat = fabric.mul( mix( float( 0.78 ), float( 1.12 ), fract( h.p.x.mul( 2.5 ) ) ) ); // soft vertical pleats
1280
+ consider( h.hit.and( gate ), h.tN, pleat.mul( falloffAt( h.p.z ) ), 0.2 ); // a drape only transmits a little of the room's glow, never out-glowing the interior
1281
+
1282
+ };
1283
+
1284
+ const cz0 = setback, cz1 = setback.add( 0.12 );
1285
+ // drape widths, biased narrow ( squared ) and each capped at half the room width, so
1286
+ // the two sides only meet — fully curtaining the window — in the rare room where both
1287
+ // are nearly closed; most rooms read partly open
1288
+ const sL = smoothstep( 0.3, 1.0, seed ), sR = smoothstep( 0.3, 1.0, seed2 );
1289
+ const lw = halfU.mul( sL.mul( sL ) ); // left drape width ( 0 below seed 0.3 )
1290
+ const rw = halfU.mul( sR.mul( sR ) ); // right drape width
1291
+ drape( vec3( halfU.negate(), floorY, cz0 ), vec3( halfU.negate().add( lw ), ceilY, cz1 ), lw.greaterThan( 0.05 ) );
1292
+ drape( vec3( halfU.sub( rw ), floorY, cz0 ), vec3( halfU, ceilY, cz1 ), rw.greaterThan( 0.05 ) );
1293
+
1294
+ // lit rooms read brighter and take on their bulb's colour ( the lights are on )
1295
+ const warmth = mix( vec3( 1.0, 1.0, 1.0 ), lightCol, lit.mul( 0.85 ) );
1296
+ return vec4( bestCol.mul( warmth ).mul( mix( float( 1.0 ), float( 1.3 ), lit ) ), lit.mul( bestEmit ) );
1297
+
1298
+ } );
1299
+
1300
+ // the ground-floor shops' interior mapping: the same box raymarch as interior(), but
1301
+ // dressed as retail space ( tile floor, troffer-lit ceiling, stocked shelving, a sales
1302
+ // counter and a window display ), so storefronts read as shops rather than living rooms.
1303
+ // most shops trade with the lights on; the rest sit dark, some behind a roller grille.
1304
+ // returns vec4( colour, lit ), like interior().
1305
+ const shopInterior = /*@__PURE__*/ Fn( () => {
1306
+
1307
+ // flat for the same reason as interior(): floor() must not split a pane across cells
1308
+ const roomCenter = varying( attribute( 'roomCenter', 'vec3' ) ).setInterpolation( InterpolationSamplingType.FLAT, InterpolationSamplingMode.EITHER );
1309
+ const roomSize = attribute( 'roomSize', 'vec2' );
1310
+
1311
+ // the per-face frame and the view ray in room space ( across, up, depth ), as interior()
1312
+ const n = normalLocal;
1313
+ const up = vec3( 0, 1, 0 );
1314
+ const uAxis = cross( up, n ).normalize();
1315
+
1316
+ const d = positionLocal.sub( roomCenter );
1317
+ const camLocal = modelWorldMatrixInverse.mul( vec4( cameraPosition, 1 ) ).xyz;
1318
+ const rayLocal = positionLocal.sub( camLocal ).normalize();
1319
+ const origin = vec3( dot( d, uAxis ), d.y, 0 );
1320
+ const dir = vec3( dot( rayLocal, uAxis ), rayLocal.y, dot( rayLocal, n ).negate() );
1321
+
1322
+ // the shop box: retail runs deeper than the flats above
1323
+ const setback = float( 0.1 );
1324
+ const depth = roomSize.y.mul( 2.4 );
1325
+ const boxMax = vec3( roomSize.x.mul( 0.5 ), roomSize.y.mul( 0.5 ), setback.add( depth ) );
1326
+ const boxMin = vec3( boxMax.x.negate(), boxMax.y.negate(), setback );
1327
+ const tFar = boxMin.sub( origin ).div( dir ).max( boxMax.sub( origin ).div( dir ) );
1328
+ const t = tFar.x.min( tFar.y ).min( tFar.z );
1329
+ const hit = origin.add( dir.mul( t ) );
1330
+ const q = hit.sub( boxMin ).div( boxMax.sub( boxMin ) ); // 0..1 inside the shop
1331
+
1332
+ const onBack = q.z.greaterThan( 0.998 );
1333
+ const onCeil = q.y.greaterThan( 0.998 );
1334
+ const onFloor = q.y.lessThan( 0.002 );
1335
+
1336
+ // per-shop key + hash, the same scheme as interior()
1337
+ const cell = floor( roomCenter.mul( 2.0 ) );
1338
+ const ckey = uint( cell.x.add( 1 << 21 ) ).mul( uint( 73856093 ) )
1339
+ .bitXor( uint( cell.y.add( 1 << 21 ) ).mul( uint( 19349663 ) ) )
1340
+ .bitXor( uint( cell.z.add( 1 << 21 ) ).mul( uint( 83492791 ) ) ).toVar();
1341
+ const hash = ( kx, ky, kz ) => ihash( ckey.add( uint( Math.round( ( kx + ky * 7 + kz * 13 ) * 100 ) ) ) );
1342
+ const seed = hash( 12.9898, 78.233, 37.719 );
1343
+ const seed2 = hash( 39.346, 11.135, 83.155 );
1344
+
1345
+ const lit = step( 0.18, hash( 63.21, 9.17, 51.43 ) ); // most shops trade with the lights on; the rest sit closed
1346
+ const market = step( 0.45, hash( 71.7, 23.9, 8.3 ) ); // shelf-stocked store, else a sparser showroom / boutique
1347
+
1348
+ // retail lighting: mostly cool fluorescent / LED whites, with a warm halogen minority
1349
+ // ( boutiques, cafes ), so a shopping street reads as a mix of trades
1350
+ const coolLight = mix( color( 0xeef2f6 ), color( 0xdfe8ff ), hash( 8.3, 51.2, 17.6 ) );
1351
+ const warmLight = mix( color( 0xffd9a0 ), color( 0xffeacb ), hash( 27.1, 4.9, 61.7 ) );
1352
+ const lightCol = select( hash( 44.7, 19.3, 6.1 ).greaterThan( 0.65 ), warmLight, coolLight );
1353
+
1354
+ // depth falloff: a lit shop carries its lighting deep into the room, a dark one falls away fast
1355
+ const falloffAt = ( z ) => mix( float( 1.0 ), mix( float( 0.25 ), float( 0.6 ), lit ), z.sub( setback ).div( depth ).clamp( 0, 1 ) );
1356
+ const rect = ( ax, ay, cx, cy, hw, hh ) => smoothstep( hw + 0.006, hw - 0.006, ax.sub( cx ).abs() ).mul( smoothstep( hh + 0.006, hh - 0.006, ay.sub( cy ).abs() ) );
1357
+
1358
+ // merchandise: a goods colour per shelf cell, from a compact retail palette
1359
+ const goods = ( k ) => {
1360
+
1361
+ const pick = k.mul( 6 );
1362
+ let c = color( 0x9e3d33 ); // red
1363
+ c = select( pick.greaterThan( 1 ), color( 0xb2802f ), c ); // amber
1364
+ c = select( pick.greaterThan( 2 ), color( 0x3d6b4f ), c ); // green
1365
+ c = select( pick.greaterThan( 3 ), color( 0x35578a ), c ); // blue
1366
+ c = select( pick.greaterThan( 4 ), color( 0xd6d0c4 ), c ); // white
1367
+ c = select( pick.greaterThan( 5 ), color( 0x2b2830 ), c ); // black
1368
+ return c;
1369
+
1370
+ };
1371
+
1372
+ // a stocked shelf unit over ( ax, ay ) in 0..1: a board at the foot of each band, goods
1373
+ // of per-cell colour / height / width standing on it, dark backing where stock thins out
1374
+ const shelfBoard = mix( color( 0x6b5a43 ), color( 0xcfccc4 ), step( 0.5, seed2 ) ); // wood or white metal, per shop
1375
+ const shelves = ( ax, ay, cols, salt ) => {
1376
+
1377
+ const bands = 4;
1378
+ const cellKey = ckey.add( uint( salt ) ).add( uint( floor( ax.mul( cols ) ) ).mul( uint( 197 ) ) ).add( uint( floor( ay.mul( bands ) ) ).mul( uint( 4099 ) ) );
1379
+ const ch = ihash( cellKey );
1380
+ const ch2 = ihash( cellKey.add( uint( 1 ) ) );
1381
+ const gx = fract( ax.mul( cols ) );
1382
+ const gy = fract( ay.mul( bands ) );
1383
+ const item = step( 0.08, gy ).mul( step( gy, mix( float( 0.4 ), float( 0.85 ), fract( ch2.mul( 5 ) ) ) ) )
1384
+ .mul( step( gx.sub( 0.5 ).abs(), mix( float( 0.26 ), float( 0.46 ), fract( ch2.mul( 13 ) ) ) ) )
1385
+ .mul( step( 0.15, ch2 ) ); // the odd cell sits empty
1386
+ const stocked = mix( color( 0x211e1b ), goods( ch ), item ); // dark backing behind the goods
1387
+ return mix( stocked, shelfBoard, step( gy, 0.08 ) );
1388
+
1389
+ };
1390
+
1391
+ // --- the shop shell -----------------------------------------------------
1392
+
1393
+ // light retail paint; boutiques take a muted brand colour on the back wall
1394
+ const wallCol = mix( color( 0xd8d2c6 ), color( 0xbfb9ae ), seed );
1395
+
1396
+ // floor: pale terrazzo tile with dark seams, or a checker for the odd deli / diner
1397
+ const tileSeam = step( 0.93, fract( q.x.mul( 8 ) ) ).max( step( 0.93, fract( q.z.mul( 10 ) ) ) );
1398
+ const terrazzo = mix( color( 0xb5afa2 ), color( 0x958f83 ), seed2 ).mul( tileSeam.mul( 0.35 ).oneMinus() );
1399
+ const checker = mix( color( 0x24262a ), color( 0xcfccc2 ), mod( floor( q.x.mul( 8 ) ).add( floor( q.z.mul( 10 ) ) ), 2 ) );
1400
+ const floorCol = select( hash( 5.7, 33.1, 2.9 ).greaterThan( 0.75 ), checker, terrazzo );
1401
+
1402
+ // ceiling: a suspended white grid whose recessed troffer panels carry the light
1403
+ const tx = fract( q.x.mul( 3 ) ).sub( 0.5 ).abs();
1404
+ const tz = fract( q.z.mul( 4 ) ).sub( 0.5 ).abs();
1405
+ const troffer = step( tx, 0.3 ).mul( step( tz, 0.15 ) );
1406
+ const ceilCol = mix( color( 0xe9e6df ), lightCol.mul( mix( float( 0.5 ), float( 6.0 ), lit ) ), troffer );
1407
+
1408
+ // back wall: a market is shelved wall to wall; a boutique hangs a framed poster
1409
+ // on its brand-painted wall
1410
+ const posterX = mix( float( 0.3 ), float( 0.7 ), seed );
1411
+ let showroom = mix( goods( seed2 ), wallCol, 0.45 );
1412
+ showroom = mix( showroom, color( 0xe8e4da ), rect( q.x, q.y, posterX, 0.62, 0.1, 0.14 ) ); // the mat
1413
+ showroom = mix( showroom, goods( hash( 3.1, 44.2, 7.7 ) ), rect( q.x, q.y, posterX, 0.62, 0.075, 0.1 ).mul( 0.85 ) ); // the artwork
1414
+ const backCol = select( market, shelves( q.x, q.y, roomSize.x.mul( 2.5 ), 31 ), showroom );
1415
+
1416
+ // side walls: markets shelve those too
1417
+ const sideCol = select( market, shelves( q.z, q.y, depth.mul( 2.5 ), 57 ), wallCol );
1418
+
1419
+ const shellCol = select( onBack, backCol, select( onCeil, ceilCol, select( onFloor, floorCol, sideCol ) ) );
1420
+
1421
+ // the same soft corner shading as interior()
1422
+ const aoBand = 0.15;
1423
+ const aoEdge = ( a ) => smoothstep( 0, aoBand, a ).mul( smoothstep( 0, aoBand, a.oneMinus() ) );
1424
+ const edgeAO = select( onBack, aoEdge( q.x ).mul( aoEdge( q.y ) ), select( onFloor.or( onCeil ), aoEdge( q.x ).mul( aoEdge( q.z ) ), aoEdge( q.y ).mul( aoEdge( q.z ) ) ) );
1425
+ const shellAO = mix( float( 0.72 ), float( 1.0 ), edgeAO );
1426
+
1427
+ // --- nearest surface: the shell, then any fitting that lies closer ------
1428
+
1429
+ let bestT = t;
1430
+ let bestCol = shellCol.mul( shellAO ).mul( falloffAt( hit.z ) );
1431
+ let bestEmit = float( 1 );
1432
+
1433
+ const boxHit = ( bMin, bMax ) => {
1434
+
1435
+ const ta = bMin.sub( origin ).div( dir );
1436
+ const tb = bMax.sub( origin ).div( dir );
1437
+ const lo = ta.min( tb ), hi = ta.max( tb );
1438
+ const tN = lo.x.max( lo.y ).max( lo.z );
1439
+ const p = origin.add( dir.mul( tN ) );
1440
+ return { tN, p, hit: hi.x.min( hi.y ).min( hi.z ).greaterThan( tN ).and( tN.greaterThan( 0 ) ), qb: p.sub( bMin ).div( bMax.sub( bMin ) ) };
1441
+
1442
+ };
1443
+
1444
+ const consider = ( h, tN, c, emit = 1 ) => {
1445
+
1446
+ const near = h.and( tN.lessThan( bestT ) ); bestCol = select( near, c, bestCol ); bestEmit = select( near, float( emit ), bestEmit ); bestT = select( near, tN, bestT );
1447
+
1448
+ };
1449
+
1450
+ const halfU = boxMax.x, floorY = boxMin.y, ceilY = boxMax.y, backZ = boxMax.z;
1451
+
1452
+ // the window display: a low platform just inside the glass, dressed with a few
1453
+ // pedestals, each topped by an item of merchandise
1454
+ const plat = boxHit( vec3( halfU.negate().add( 0.15 ), floorY, setback.add( 0.06 ) ), vec3( halfU.sub( 0.15 ), floorY.add( 0.4 ), setback.add( 0.95 ) ) );
1455
+ const platCol = select( plat.qb.y.greaterThan( 0.93 ), color( 0xd9d4c8 ), color( 0x35302a ) ); // a light top on a dark plinth
1456
+ consider( plat.hit, plat.tN, platCol.mul( falloffAt( plat.p.z ) ) );
1457
+
1458
+ for ( let i = 0; i < 3; i ++ ) {
1459
+
1460
+ const g = hash( 9.1 + i, 17.3, 40.7 );
1461
+ const g2 = hash( 4.7, 29.1 + i, 13.9 );
1462
+ const cx = halfU.mul( ( i - 1 ) * 0.62 );
1463
+ const h = mix( float( 0.5 ), float( 1.2 ), g );
1464
+ const w = mix( float( 0.16 ), float( 0.3 ), g2 );
1465
+ const ped = boxHit( vec3( cx.sub( w ), floorY.add( 0.4 ), setback.add( 0.25 ) ), vec3( cx.add( w ), floorY.add( 0.4 ).add( h ), setback.add( 0.25 ).add( w.mul( 2 ) ) ) );
1466
+ const pedCol = select( ped.qb.y.greaterThan( 0.6 ), goods( g ), color( 0xdad5cb ) ); // the item rides a light pedestal
1467
+ consider( ped.hit.and( g2.greaterThan( 0.15 ) ), ped.tN, pedCol.mul( falloffAt( ped.p.z ) ) );
1468
+
1469
+ }
1470
+
1471
+ // the sales counter, standing mid-shop toward one side
1472
+ const midZ = setback.add( depth.mul( 0.5 ) );
1473
+ const cCx = mix( halfU.negate().add( 0.7 ), halfU.sub( 0.7 ), step( 0.5, seed ) );
1474
+ const counter = boxHit( vec3( cCx.sub( 0.75 ), floorY, midZ ), vec3( cCx.add( 0.75 ), floorY.add( 1.0 ), midZ.add( 0.65 ) ) );
1475
+ const counterCol = mix( color( 0x4a4036 ), color( 0x2c333a ), seed2 ).mul( select( counter.qb.y.greaterThan( 0.92 ), float( 1.3 ), float( 0.85 ) ) );
1476
+ consider( counter.hit, counter.tN, counterCol.mul( falloffAt( counter.p.z ) ) );
1477
+
1478
+ // markets run a central gondola shelf down the aisle, stocked like the walls
1479
+ const gz0 = setback.add( 1.2 ), gz1 = backZ.sub( 1.2 );
1480
+ const gond = boxHit( vec3( - 0.45, floorY, gz0 ), vec3( 0.45, floorY.add( 1.5 ), gz1 ) );
1481
+ const gondCol = shelves( gond.p.z.sub( gz0 ).div( gz1.sub( gz0 ) ), gond.qb.y, 8, 91 );
1482
+ consider( gond.hit.and( market.greaterThan( 0.5 ) ), gond.tN, gondCol.mul( falloffAt( gond.p.z ) ) );
1483
+
1484
+ // some dark shops pull a steel roller grille down just inside the glass
1485
+ const grille = boxHit( vec3( halfU.negate(), floorY, setback ), vec3( halfU, ceilY, setback.add( 0.05 ) ) );
1486
+ const grilleCol = mix( color( 0x4c5158 ), color( 0x191b1e ), step( 0.62, fract( grille.p.y.mul( 7 ) ) ) ); // slats over shadowed gaps
1487
+ const closed = lit.oneMinus().mul( step( 0.45, hash( 15.9, 3.3, 27.5 ) ) );
1488
+ consider( grille.hit.and( closed.greaterThan( 0.5 ) ), grille.tN, grilleCol.mul( 0.8 ), 0 );
1489
+
1490
+ // a trading shop glows with its retail lighting; a closed one sits dim
1491
+ const warmth = mix( vec3( 1.0, 1.0, 1.0 ), lightCol, lit.mul( 0.6 ) );
1492
+ return vec4( bestCol.mul( warmth ).mul( mix( float( 0.45 ), float( 1.5 ), lit ) ), lit.mul( bestEmit ) );
1493
+
1494
+ } );
1495
+
1496
+ /**
1497
+ * The NYC masonry palette every tower is dressed from ( hex colours ): limestone-dominant
1498
+ * with terracotta accents. Shared by the single-tower example and {@link CityGenerator}'s
1499
+ * building material so both stay in sync.
1500
+ */
1501
+ const buildingPalette = [
1502
+ 0xa8553c, 0x9c4a34, // terracotta & red brick ( occasional accent )
1503
+ 0x8a6a52, 0x7d6450, // warm brick / brownstone ( muted )
1504
+ 0xc4a370, 0xb89a6f, 0xc2b183, // buff / tan
1505
+ 0xc6c0b2, 0xc6c0b2, 0xbdb7a8, 0xd1ccbe, 0xb4afa1, // limestone / pale dressed stone — the common default
1506
+ 0x9a988f, 0x8b8983, 0xa5a39a, // grey granite / concrete
1507
+ 0xdbd6cb, // pale glazed ( accent )
1508
+ 0x7c868d // steel / glass ( cool accent )
1509
+ ];
1510
+
1511
+ /** Picks one {@link buildingPalette} colour ( a hex number ) for a tower from its seed. */
1512
+ function pickBuildingColor( seed ) {
1513
+
1514
+ const h = Math.abs( Math.sin( seed * 12.9898 ) * 43758.5453 );
1515
+ return buildingPalette[ Math.floor( ( h - Math.floor( h ) ) * buildingPalette.length ) ];
1516
+
1517
+ }
1518
+
1519
+ // cheap value noise ( ~[ -1, 1 ] ), a lighter stand-in for gradient mx_noise on the
1520
+ // weathering terms; integer-hashed ( not fract(sin) ) to stay stable across drivers
1521
+ const valueNoise = /*@__PURE__*/ Fn( ( [ p ] ) => {
1522
+
1523
+ const i = floor( p );
1524
+ const f = fract( p );
1525
+ const u = f.mul( f ).mul( f.mul( - 2 ).add( 3 ) ); // 3f2 - 2f3 smooth interpolation
1526
+ const corner = ( ox, oy, oz ) => {
1527
+
1528
+ const c = i.add( vec3( ox, oy, oz ) );
1529
+ return ihash( uint( c.x.add( 1 << 20 ) ).mul( uint( 73856093 ) ).bitXor( uint( c.y.add( 1 << 20 ) ).mul( uint( 19349663 ) ) ).bitXor( uint( c.z.add( 1 << 20 ) ).mul( uint( 83492791 ) ) ) );
1530
+
1531
+ };
1532
+
1533
+ const x00 = mix( corner( 0, 0, 0 ), corner( 1, 0, 0 ), u.x );
1534
+ const x10 = mix( corner( 0, 1, 0 ), corner( 1, 1, 0 ), u.x );
1535
+ const x01 = mix( corner( 0, 0, 1 ), corner( 1, 0, 1 ), u.x );
1536
+ const x11 = mix( corner( 0, 1, 1 ), corner( 1, 1, 1 ), u.x );
1537
+ return mix( mix( x00, x10, u.y ), mix( x01, x11, u.y ), u.z ).mul( 2 ).sub( 1 );
1538
+
1539
+ } ).setLayout( { name: 'valueNoise', type: 'float', inputs: [ { name: 'p', type: 'vec3' } ] } );
1540
+
1541
+ // fractal ( fBm ) of valueNoise, octaves summed like mx_fractal_noise_float
1542
+ // ( amplitude halving, frequency doubling ); unrolled for a compile-time count
1543
+ const valueFractal = ( p, octaves ) => {
1544
+
1545
+ let sum = valueNoise( p );
1546
+ let amp = 0.5, freq = 2;
1547
+ for ( let o = 1; o < octaves; o ++ ) {
1548
+
1549
+ sum = sum.add( valueNoise( p.mul( freq ) ).mul( amp ) );
1550
+ amp *= 0.5;
1551
+ freq *= 2;
1552
+
1553
+ }
1554
+
1555
+ return sum;
1556
+
1557
+ };
1558
+
1559
+ /**
1560
+ * The facade material: a single MeshStandardNodeMaterial that reads the baked
1561
+ * per-vertex `partId` and reproduces every zone — procedural terracotta brickwork
1562
+ * on the walls and piers, smooth dressed stone on the window frames and ornament,
1563
+ * dark glazing, and grey AC units — all dressed with world-space
1564
+ * weathering. One material covers the whole building ( and a whole city ), which is
1565
+ * what makes it compute-rasterizer friendly. `buildingBase` is the tower's flat
1566
+ * masonry colour as a TSL node: pass a `uniform( Color )` for a single tower, or a
1567
+ * per-fragment palette pick for a city, so the same material dresses both.
1568
+ */
1569
+ function createSkyscraperMaterial( buildingBase = color( 0xc6c0b2 ) ) {
1570
+
1571
+ const soot = color( 0x4a4236 );
1572
+
1573
+ // broad weathering, all driven from world position so it reads consistently
1574
+ // across instanced and merged meshes: a slow tonal drift, a fine clay mottle,
1575
+ // and sooty vertical streaks that pool low down
1576
+
1577
+ const tone = varying( mx_fractal_noise_float( positionWorld.mul( 0.03 ), 2 ) ).mul( 0.18 ); // very low frequency: evaluate per-vertex and interpolate over the facade's fine tessellation
1578
+ const mottle = valueNoise( positionWorld.mul( 0.7 ) ).mul( 0.06 );
1579
+ const streak = mx_fractal_noise_float( vec3( positionWorld.x.mul( 1.5 ), positionWorld.y.mul( 0.04 ), positionWorld.z.mul( 1.5 ) ), 2 );
1580
+ const dirt = smoothstep( - 0.1, 0.45, streak ).mul( smoothstep( 210, 0, positionWorld.y ) ).mul( 0.6 );
1581
+
1582
+ // procedural terracotta brickwork in running bond, keyed off the BUILDING-LOCAL position
1583
+ // so the coursing anchors to each tower ( courses from its base, columns at its faces )
1584
+ // and lines up with the brick-snapped floor / bay dimensions. courses run up local Y;
1585
+ // the across-face axis is world XZ projected onto the face tangent, so brick width stays
1586
+ // constant on every face including the 45° chamfer. the geometry ( pre-bump ) normal is
1587
+ // used for the bond axis — otherwise colorNode pulls normal computation into its partId
1588
+ // branch and glass loses its env reflection.
1589
+
1590
+ const brickH = BRICK.height;
1591
+ const brickL = BRICK.length;
1592
+ const mortar = 0.010; // joint width, in metres
1593
+
1594
+ const nrm = normalWorldGeometry.abs();
1595
+ const across = positionLocal.x.mul( normalWorldGeometry.z ).sub( positionLocal.z.mul( normalWorldGeometry.x ) );
1596
+ const rowCoord = positionLocal.y.div( brickH );
1597
+ const courseRow = floor( rowCoord );
1598
+ const colCoord = across.div( brickL ).add( mod( courseRow, 2 ).mul( 0.5 ) ); // half-brick stagger per row
1599
+
1600
+ // anti-aliased mortar ( the "pristine grid" trick ): the drawn joint never falls below
1601
+ // the pixel footprint and its opacity fades to keep energy constant, so lines stay crisp
1602
+ // up close and dissolve far away instead of shimmering. the horizontal derivative comes
1603
+ // from continuous world X / Z ( weighted by the normal ), not fwidth( across ) which
1604
+ // would spike where the normal flips at pier edges.
1605
+ const mU = mortar / ( 2 * brickL );
1606
+ const mV = mortar / ( 2 * brickH );
1607
+ const ddU = nrm.z.mul( fwidth( positionWorld.x ) ).add( nrm.x.mul( fwidth( positionWorld.z ) ) ).div( brickL ).clamp( 1e-6, 0.5 );
1608
+ const ddV = fwidth( rowCoord ).clamp( 1e-6, 0.5 );
1609
+ const distU = float( 0.5 ).sub( fract( colCoord ).sub( 0.5 ).abs() );
1610
+ const distV = float( 0.5 ).sub( fract( rowCoord ).sub( 0.5 ).abs() );
1611
+ const drawU = ddU.max( mU );
1612
+ const drawV = ddV.max( mV );
1613
+ const lineU = smoothstep( drawU.add( ddU ), drawU.sub( ddU ), distU ).mul( float( mU ).div( drawU ).min( 1 ) );
1614
+ const lineV = smoothstep( drawV.add( ddV ), drawV.sub( ddV ), distV ).mul( float( mV ).div( drawV ).min( 1 ) );
1615
+ const wallFacing = smoothstep( 0.7, 0.45, nrm.y ); // brick only on vertical walls — not roofs, ledges, cornice tops
1616
+ const joint = lineU.max( lineV ).mul( wallFacing );
1617
+
1618
+ const brickKey = uint( courseRow.add( 1 << 16 ) ).mul( uint( 73856093 ) ).bitXor( uint( floor( colCoord ).add( 1 << 16 ) ).mul( uint( 19349663 ) ) ).toVar();
1619
+ const brickRnd = ihash( brickKey );
1620
+ const brickRnd2 = ihash( brickKey.add( uint( 1 ) ) ); // independent per-brick hash for hue
1621
+
1622
+ // soft brick relief for the bump: each brick is a gently domed mound falling to the
1623
+ // recessed mortar over a bevel ( distU / distV are the distance to the nearest column /
1624
+ // course line, 0 at the joint, 0.5 at the centre ), so bricks read rounded rather than
1625
+ // scratched. the bevel is widened to at least a screen pixel ( from the world-position
1626
+ // derivative, our stand-in for a mip LOD ) so the edge never goes sub-pixel and shimmers.
1627
+ const bevel = 0.008;
1628
+ const texel = fwidth( positionWorld ).length(); // on-screen size of a surface pixel — our hand-rolled LOD
1629
+ const lodBevel = texel.mul( 1.5 ).max( bevel );
1630
+ const brickFace = smoothstep( 0, lodBevel, distU.mul( brickL ) ).mul( smoothstep( 0, lodBevel, distV.mul( brickH ) ) ).mul( wallFacing );
1631
+ const reliefHeight = brickFace.mul( 0.003 );
1632
+ const rough = valueNoise( positionWorld.mul( 0.5 ) ).mul( 0.08 ).add( 0.82 ).add( joint.mul( 0.12 ) );
1633
+
1634
+ // the merged geometry carries a per-vertex partId; this material reads it and
1635
+ // branches to reproduce each zone — no per-part materials, compute-raster friendly
1636
+
1637
+ const partId = varying( attribute( 'partId', 'float' ) ).setInterpolation( InterpolationSamplingType.FLAT, InterpolationSamplingMode.EITHER ); // flat: a per-face id must not interpolate, or equal() below misses on the rounding
1638
+ const isGlass = partId.equal( GLASS );
1639
+ const isFrame = partId.equal( FRAME );
1640
+ const isOrnament = partId.equal( ORNAMENT );
1641
+ const isAC = partId.equal( AC );
1642
+ const isShopGlass = partId.equal( SHOPGLASS );
1643
+ const isStore = partId.equal( STORE );
1644
+ const isAwning = partId.equal( AWNING );
1645
+
1646
+ // stone zones: brick + weathering on the building's colour, lightened for
1647
+ // piers / ornament and darkened for window frames
1648
+ const lighten = select( partId.equal( PIER ), float( 0.12 ), select( isOrnament, float( 0.2 ), float( 0 ) ) );
1649
+ const perBrick = float( 1 ).add( tone ).add( mottle ).add( brickRnd.sub( 0.5 ).mul( 0.14 ) );
1650
+ // per-brick warm/cool shift ( red up / blue down, or vice-versa ) so individual
1651
+ // bricks read as slightly different fired tones, relative to the building's colour
1652
+ const warmCool = brickRnd2.sub( 0.5 ).mul( 0.14 );
1653
+ const brickShift = vec3( float( 1 ).add( warmCool ), float( 1 ), float( 1 ).sub( warmCool ) );
1654
+ const tint = mix( buildingBase, color( 0xffffff ), lighten ).mul( perBrick ).mul( brickShift );
1655
+ const masonry = mix( tint, tint.mul( 0.6 ), joint ); // recessed joints read darker
1656
+ // roofs / ledges show every blotch ( flat & light ), so horizontal surfaces get a gentler,
1657
+ // larger-scale grime instead of the wall's streaky soot — confined to those surfaces by a
1658
+ // branch ( roofMask > 0 ), so the fractal never runs on the vertical facade
1659
+ const roofMask = wallFacing.oneMinus();
1660
+ const roofGrime = select( roofMask.greaterThan( 0 ), smoothstep( 0.0, 0.55, valueFractal( positionWorld.mul( 0.025 ), 3 ) ).mul( 0.22 ), float( 0 ) );
1661
+ const stoneColor = mix( masonry, soot, mix( dirt, roofGrime, roofMask ) );
1662
+
1663
+ // glass: the interior-mapped room is the base colour; the smooth, low-roughness
1664
+ // surface still lets a faint sky reflection ride over it, and lit rooms glow ( emissive ).
1665
+ // shopfronts march their own retail interior ( select compiles to a branch, so only one
1666
+ // raymarch runs per fragment ). toVar so the result is shared by colour and emissive
1667
+ const room = select( isShopGlass, shopInterior(), interior() ).toVar();
1668
+
1669
+ // grimy glazing: the room shows through, but muted by a dusty film and dirt pooled
1670
+ // along the bottom of each pane, plus a baseline haze, so the panes read as old
1671
+ // glass rather than open holes. the streaks run down the facade ( world Y barely
1672
+ // scaled ); the pooled dirt uses the pane's own UV ( y = 0 at the sill ).
1673
+ const filmNoise = mx_fractal_noise_float( vec3( positionWorld.x.mul( 1.3 ), positionWorld.y.mul( 0.06 ), positionWorld.z.mul( 1.3 ) ), 2 );
1674
+ const dustStreak = smoothstep( - 0.15, 0.5, filmNoise ).mul( 0.45 );
1675
+ const pooled = smoothstep( 0.32, 0.0, uv().y ).mul( 0.4 );
1676
+ const grime = float( 0.64 ).add( dustStreak ).add( pooled ).clamp( 0, 0.95 ); // baseline haze so the panes read as dirty glass, not open holes
1677
+ const glassMottle = valueFractal( positionWorld.mul( 0.3 ), 2 ).mul( 0.5 ).add( 0.5 ); // shared by the upper dirty glass and the shop glazing, so the fractal runs once
1678
+ const dirtyGlass = mix( color( 0x13161a ), color( 0x232b31 ), glassMottle );
1679
+
1680
+ // dirt scatters the reflection too: rougher where grime pools at the sills, so the
1681
+ // panes don't all mirror the sun in unison
1682
+ const glassRough = float( 0.16 ).add( pooled.mul( 0.45 ) ).add( dustStreak.mul( 0.2 ) );
1683
+
1684
+ // window frames are smooth dressed stone, not brick
1685
+ const frameColor = buildingBase.mul( 0.55 );
1686
+
1687
+ // finials / ornament: smooth dressed stone ( lightened ), not brick
1688
+ const ornamentColor = mix( buildingBase, color( 0xffffff ), 0.22 ).mul( float( 1 ).add( tone ) );
1689
+ // window AC units: a louvered white-plastic box, grimier toward the base where it drips.
1690
+ // keyed off the box's own UVs ( acUv.y runs 0 → 1 up each vented side )
1691
+ const acUv = uv();
1692
+ const acVent = smoothstep( 0.65, 0.4, normalWorldGeometry.y.abs() ); // 1 on the vertical vented sides, 0 on the flat top
1693
+ const acDetail = smoothstep( 0.08, 0.015, texel ); // louvers fade out before a slat nears a pixel
1694
+ const acLouver = acVent.mul( acDetail );
1695
+
1696
+ // plastic shell: off-white, some units dingier / yellowed than others
1697
+ const acDinge = valueNoise( positionWorld.mul( 0.4 ) ).mul( 0.5 ).add( 0.5 ); // ~per-unit
1698
+ const acPaint = mix( color( 0xf2f1ec ), color( 0xcfccc2 ), acDinge ) // bright white → light dingy grey, both lighter than the wall
1699
+ .add( valueNoise( positionWorld.mul( 5 ) ).mul( 0.04 ) );
1700
+
1701
+ // a darker recessed grille panel inset into the lighter cabinet, with horizontal louvers
1702
+ // inside it ( the front vents ) — the white plastic reads as a thin border frame
1703
+ const acGrille = smoothstep( 0.06, 0.14, acUv.x ).mul( smoothstep( 0.94, 0.86, acUv.x ) )
1704
+ .mul( smoothstep( 0.12, 0.2, acUv.y ) ).mul( smoothstep( 0.96, 0.88, acUv.y ) ).mul( acLouver );
1705
+ const acSlats = fract( acUv.y.mul( 6 ) ); // bold louvers — reads at the unit's small on-screen size
1706
+ const acFin = mix( float( 0.82 ), float( 1.04 ), acSlats );
1707
+ const acBody = acPaint.mul( mix( float( 1 ), acFin.mul( 0.42 ), acGrille ) ); // cabinet stays light; recessed grille goes dark grey
1708
+
1709
+ // grey-brown condensate grime streaking the lower edge ( plastic doesn't rust ); dirtier units streak more
1710
+ const acStreak = valueFractal( vec3( positionWorld.x.mul( 6 ), positionWorld.y.mul( 0.5 ), positionWorld.z.mul( 6 ) ), 3 ).mul( 0.5 ).add( 0.5 );
1711
+ const acGrime = smoothstep( 0.4, 0.0, acUv.y ).mul( acStreak ).mul( acDinge.add( 0.3 ) );
1712
+ const acColor = mix( acBody, color( 0x6f685a ), acGrime.mul( 0.5 ) );
1713
+
1714
+ // recessed grille ( louver fins ) relief and a slightly rougher base
1715
+ const acRelief = acGrille.mul( acSlats.mul( 0.012 ).sub( 0.01 ) );
1716
+ const acRough = float( 0.52 ).add( acGrille.mul( 0.08 ) );
1717
+
1718
+ // --- storefronts --------------------------------------------------------
1719
+
1720
+ // display glazing: upper-floor and shop panes both show the raymarched room, the
1721
+ // shops behind cleaner, barely-filmed plate glass. the shared `room` toVar must be
1722
+ // referenced only once per output flow ( referencing it from two select branches
1723
+ // miscompiles the interior ), so select the room-free tint / backing / film here and
1724
+ // composite the room a single time below
1725
+ const shopFilm = float( 0.14 ).add( dustStreak.mul( 0.22 ) ); // shops are far cleaner than the grimy upper panes
1726
+ const glassTint = select( isShopGlass, color( 0xccd4cf ), color( 0xb6c6bf ) ); // shop daylight vs the upper soda-lime green
1727
+ const glassBack = select( isShopGlass, color( 0x161a1e ), dirtyGlass );
1728
+ const glassFilm = select( isShopGlass, shopFilm, grime );
1729
+ const glazingColor = mix( room.xyz.mul( glassTint ), glassBack, glassFilm );
1730
+ const glazingEmit = select( isShopGlass, float( 2 ), float( 2.2 ).mul( grime.mul( 0.6 ).oneMinus() ) ); // lit-room glow weight, kept a soft fill so signals and lamps read brighter
1731
+
1732
+ // bulkhead and signboard: a dark painted storefront frame, keyed off the building's colour
1733
+ const storeColor = mix( buildingBase.mul( 0.3 ), color( 0x24201c ), 0.5 );
1734
+
1735
+ // awning fabric, one canvas colour per shop, picked from a coarse street-cell hash
1736
+ const awnCell = floor( vec2( positionWorld.x, positionWorld.z ).mul( 0.2 ) );
1737
+ const awnPick = ihash( uint( awnCell.x.add( 1 << 16 ) ).mul( uint( 73856093 ) ).bitXor( uint( awnCell.y.add( 1 << 16 ) ).mul( uint( 19349663 ) ) ) ).mul( 5 );
1738
+ let awningColor = color( 0x6a2f2f ); // maroon
1739
+ awningColor = select( awnPick.greaterThan( 1 ), color( 0x244a32 ), awningColor ); // green
1740
+ awningColor = select( awnPick.greaterThan( 2 ), color( 0x22384f ), awningColor ); // navy
1741
+ awningColor = select( awnPick.greaterThan( 3 ), color( 0x5a5e58 ), awningColor ); // grey
1742
+ awningColor = select( awnPick.greaterThan( 4 ), color( 0x201f22 ), awningColor ); // black
1743
+
1744
+ const isGlazing = isGlass.or( isShopGlass ); // upper panes and shopfronts share the room compositing
1745
+
1746
+ const material = new MeshStandardNodeMaterial();
1747
+ material.colorNode = select( isGlazing, glazingColor, select( isStore, storeColor, select( isAwning, awningColor, select( isFrame, frameColor, select( isOrnament, ornamentColor, select( isAC, acColor, stoneColor ) ) ) ) ) );
1748
+ material.roughnessNode = select( isShopGlass, float( 0.14 ), select( isAwning, float( 0.85 ), select( isStore, float( 0.6 ), select( isGlass, glassRough, select( isOrnament, float( 0.8 ), select( isAC, acRough, rough ) ) ) ) ) ); // glass roughness rides on its grime, so dirty panes scatter the reflection
1749
+ material.metalnessNode = float( 0 ); // all dielectric — stone, glass, fabric and the plastic AC shells
1750
+ material.emissiveNode = select( isGlazing, room.xyz.mul( room.w ).mul( glazingEmit ), color( 0x000000 ) ); // lit rooms / shops glow through the panes
1751
+ material.normalNode = bumpNormal( select( isGlass.or( isFrame ).or( isOrnament ).or( isShopGlass ).or( isStore ).or( isAwning ), float( 0 ), select( isAC, acRelief, reliefHeight ) ) ); // glass / frames / ornament / storefronts stay flat; AC has its own louvers
1752
+
1753
+ return material;
1754
+
1755
+ }
1756
+
1757
+ export { SkyscraperGenerator, createSkyscraperMaterial, buildingPalette, pickBuildingColor };