@3driseai/3drise-viewer 0.1.28 → 0.1.29

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 (684) hide show
  1. package/dist/animationsV2/ClipPlayer.d.ts.map +1 -1
  2. package/dist/animationsV2/ClipPlayer.js +13 -9
  3. package/dist/animationsV2/ClipsRuntime.d.ts +44 -3
  4. package/dist/animationsV2/ClipsRuntime.d.ts.map +1 -1
  5. package/dist/animationsV2/ClipsRuntime.js +173 -55
  6. package/dist/animationsV2/appliers.d.ts.map +1 -1
  7. package/dist/animationsV2/appliers.js +21 -5
  8. package/dist/animationsV2/index.d.ts +1 -1
  9. package/dist/animationsV2/index.d.ts.map +1 -1
  10. package/dist/animationsV2/normalize.d.ts.map +1 -1
  11. package/dist/animationsV2/normalize.js +7 -3
  12. package/dist/animationsV2/sequenceUtils.d.ts +44 -6
  13. package/dist/animationsV2/sequenceUtils.d.ts.map +1 -1
  14. package/dist/animationsV2/sequenceUtils.js +58 -12
  15. package/dist/animationsV2/types.d.ts +22 -12
  16. package/dist/animationsV2/types.d.ts.map +1 -1
  17. package/dist/api/sceneHandle.d.ts +35 -1
  18. package/dist/api/sceneHandle.d.ts.map +1 -1
  19. package/dist/api/sceneHandle.js +88 -17
  20. package/dist/components/AdvancedGrid.d.ts +1 -5
  21. package/dist/components/AdvancedGrid.d.ts.map +1 -1
  22. package/dist/components/AdvancedGrid.js +6 -35
  23. package/dist/components/AnimatedObject.d.ts.map +1 -1
  24. package/dist/components/AnimatedObject.js +9 -4
  25. package/dist/components/ApollonianGrid.d.ts +1 -1
  26. package/dist/components/ApollonianGrid.d.ts.map +1 -1
  27. package/dist/components/ApollonianGrid.js +3 -28
  28. package/dist/components/ChladniGrid.d.ts +1 -1
  29. package/dist/components/ChladniGrid.d.ts.map +1 -1
  30. package/dist/components/ChladniGrid.js +6 -35
  31. package/dist/components/CircuitGrid.d.ts +1 -1
  32. package/dist/components/CircuitGrid.d.ts.map +1 -1
  33. package/dist/components/CircuitGrid.js +6 -34
  34. package/dist/components/ConformalGrid.d.ts +1 -1
  35. package/dist/components/ConformalGrid.d.ts.map +1 -1
  36. package/dist/components/ConformalGrid.js +3 -34
  37. package/dist/components/ContourGrid.d.ts +1 -1
  38. package/dist/components/ContourGrid.d.ts.map +1 -1
  39. package/dist/components/ContourGrid.js +6 -34
  40. package/dist/components/CustomPrimitive.js +1 -1
  41. package/dist/components/EnvironmentObject.d.ts.map +1 -1
  42. package/dist/components/EnvironmentObject.js +9 -7
  43. package/dist/components/FlowNetGrid.d.ts +1 -1
  44. package/dist/components/FlowNetGrid.d.ts.map +1 -1
  45. package/dist/components/FlowNetGrid.js +6 -34
  46. package/dist/components/FractalGrid.d.ts +1 -1
  47. package/dist/components/FractalGrid.d.ts.map +1 -1
  48. package/dist/components/FractalGrid.js +6 -37
  49. package/dist/components/Galaxy.d.ts.map +1 -1
  50. package/dist/components/Galaxy.js +9 -23
  51. package/dist/components/GirihGrid.d.ts +1 -1
  52. package/dist/components/GirihGrid.d.ts.map +1 -1
  53. package/dist/components/GirihGrid.js +6 -35
  54. package/dist/components/GravWaveGrid.d.ts +1 -1
  55. package/dist/components/GravWaveGrid.d.ts.map +1 -1
  56. package/dist/components/GravWaveGrid.js +6 -35
  57. package/dist/components/HexGrid.d.ts +1 -5
  58. package/dist/components/HexGrid.d.ts.map +1 -1
  59. package/dist/components/HexGrid.js +6 -36
  60. package/dist/components/HilbertGrid.d.ts +1 -1
  61. package/dist/components/HilbertGrid.d.ts.map +1 -1
  62. package/dist/components/HilbertGrid.js +3 -30
  63. package/dist/components/HyperbolicGrid.d.ts +1 -1
  64. package/dist/components/HyperbolicGrid.d.ts.map +1 -1
  65. package/dist/components/HyperbolicGrid.js +6 -34
  66. package/dist/components/LandObject.d.ts +9 -0
  67. package/dist/components/LandObject.d.ts.map +1 -0
  68. package/dist/components/LandObject.js +15 -0
  69. package/dist/components/LensingGrid.d.ts +1 -1
  70. package/dist/components/LensingGrid.d.ts.map +1 -1
  71. package/dist/components/LensingGrid.js +3 -29
  72. package/dist/components/LightsManager.d.ts.map +1 -1
  73. package/dist/components/LightsManager.js +8 -0
  74. package/dist/components/ModelBoundary.d.ts +2 -0
  75. package/dist/components/ModelBoundary.d.ts.map +1 -1
  76. package/dist/components/ModelBoundary.js +3 -0
  77. package/dist/components/ModelPrimitive.d.ts.map +1 -1
  78. package/dist/components/ModelPrimitive.js +6 -0
  79. package/dist/components/MoireGrid.d.ts +1 -1
  80. package/dist/components/MoireGrid.d.ts.map +1 -1
  81. package/dist/components/MoireGrid.js +6 -35
  82. package/dist/components/MoonDisc.d.ts +11 -0
  83. package/dist/components/MoonDisc.d.ts.map +1 -0
  84. package/dist/components/MoonDisc.js +128 -0
  85. package/dist/components/ObjectNode.d.ts.map +1 -1
  86. package/dist/components/ObjectNode.js +15 -4
  87. package/dist/components/ObjectsRenderer.d.ts.map +1 -1
  88. package/dist/components/ObjectsRenderer.js +7 -5
  89. package/dist/components/OceanBuilder.d.ts.map +1 -1
  90. package/dist/components/OceanBuilder.js +2 -0
  91. package/dist/components/ParastichyGrid.d.ts +1 -1
  92. package/dist/components/ParastichyGrid.d.ts.map +1 -1
  93. package/dist/components/ParastichyGrid.js +3 -30
  94. package/dist/components/PhyllotaxisGrid.d.ts +1 -1
  95. package/dist/components/PhyllotaxisGrid.d.ts.map +1 -1
  96. package/dist/components/PhyllotaxisGrid.js +3 -32
  97. package/dist/components/ProjectLoader.d.ts +5 -3
  98. package/dist/components/ProjectLoader.d.ts.map +1 -1
  99. package/dist/components/ProjectLoader.js +6 -3
  100. package/dist/components/QuasiGrid.d.ts +1 -1
  101. package/dist/components/QuasiGrid.d.ts.map +1 -1
  102. package/dist/components/QuasiGrid.js +6 -33
  103. package/dist/components/RadarGrid.d.ts +1 -1
  104. package/dist/components/RadarGrid.d.ts.map +1 -1
  105. package/dist/components/RadarGrid.js +6 -34
  106. package/dist/components/ReactionDiffusionGrid.d.ts +1 -1
  107. package/dist/components/ReactionDiffusionGrid.d.ts.map +1 -1
  108. package/dist/components/ReactionDiffusionGrid.js +6 -35
  109. package/dist/components/SceneBuilder.d.ts +25 -3
  110. package/dist/components/SceneBuilder.d.ts.map +1 -1
  111. package/dist/components/SceneBuilder.js +68 -38
  112. package/dist/components/SkyController.d.ts +25 -1
  113. package/dist/components/SkyController.d.ts.map +1 -1
  114. package/dist/components/SkyController.js +189 -130
  115. package/dist/components/SkyMesh.d.ts.map +1 -1
  116. package/dist/components/SkyMesh.js +26 -1
  117. package/dist/components/SkyStars.d.ts +11 -0
  118. package/dist/components/SkyStars.d.ts.map +1 -0
  119. package/dist/components/SkyStars.js +187 -0
  120. package/dist/components/SkySystem.d.ts +3 -3
  121. package/dist/components/SkySystem.d.ts.map +1 -1
  122. package/dist/components/SkySystem.js +8 -2
  123. package/dist/components/Sun.d.ts +15 -1
  124. package/dist/components/Sun.d.ts.map +1 -1
  125. package/dist/components/Sun.js +64 -3
  126. package/dist/components/SunLight.d.ts +6 -1
  127. package/dist/components/SunLight.d.ts.map +1 -1
  128. package/dist/components/SunLight.js +96 -44
  129. package/dist/components/TerrainBuilder.d.ts.map +1 -1
  130. package/dist/components/TerrainBuilder.js +2 -0
  131. package/dist/components/TextGenerator.d.ts +9 -0
  132. package/dist/components/TextGenerator.d.ts.map +1 -0
  133. package/dist/components/TextGenerator.js +29 -0
  134. package/dist/components/TruchetGrid.d.ts +1 -1
  135. package/dist/components/TruchetGrid.d.ts.map +1 -1
  136. package/dist/components/TruchetGrid.js +3 -30
  137. package/dist/components/VoronoiGrid.d.ts +1 -1
  138. package/dist/components/VoronoiGrid.d.ts.map +1 -1
  139. package/dist/components/VoronoiGrid.js +6 -33
  140. package/dist/components/WallpaperGrid.d.ts +1 -1
  141. package/dist/components/WallpaperGrid.d.ts.map +1 -1
  142. package/dist/components/WallpaperGrid.js +6 -35
  143. package/dist/components/environment/Rain.d.ts +15 -0
  144. package/dist/components/environment/Rain.d.ts.map +1 -0
  145. package/dist/components/environment/Rain.js +110 -0
  146. package/dist/components/environment/Rainbow.d.ts +20 -0
  147. package/dist/components/environment/Rainbow.d.ts.map +1 -0
  148. package/dist/components/environment/Rainbow.js +974 -0
  149. package/dist/components/environment/Sandstorm.d.ts +20 -0
  150. package/dist/components/environment/Sandstorm.d.ts.map +1 -0
  151. package/dist/components/environment/Sandstorm.js +776 -0
  152. package/dist/components/environment/Snow.d.ts +20 -0
  153. package/dist/components/environment/Snow.d.ts.map +1 -0
  154. package/dist/components/environment/Snow.js +609 -0
  155. package/dist/components/environment/Thunderstorm.d.ts +20 -0
  156. package/dist/components/environment/Thunderstorm.d.ts.map +1 -0
  157. package/dist/components/environment/Thunderstorm.js +731 -0
  158. package/dist/components/environment/Tornado.d.ts +20 -0
  159. package/dist/components/environment/Tornado.d.ts.map +1 -0
  160. package/dist/components/environment/Tornado.js +762 -0
  161. package/dist/components/environment/index.d.ts +13 -0
  162. package/dist/components/environment/index.d.ts.map +1 -0
  163. package/dist/components/environment/index.js +7 -0
  164. package/dist/components/index.d.ts +10 -10
  165. package/dist/components/index.d.ts.map +1 -1
  166. package/dist/components/index.js +8 -6
  167. package/dist/components/land/LandPatch.d.ts +15 -0
  168. package/dist/components/land/LandPatch.d.ts.map +1 -0
  169. package/dist/components/land/LandPatch.js +170 -0
  170. package/dist/components/land/index.d.ts +3 -0
  171. package/dist/components/land/index.d.ts.map +1 -0
  172. package/dist/components/land/index.js +1 -0
  173. package/dist/components/space/Earth.d.ts +16 -0
  174. package/dist/components/space/Earth.d.ts.map +1 -0
  175. package/dist/components/space/Earth.js +75 -0
  176. package/dist/components/space/ShootingStar.d.ts +21 -0
  177. package/dist/components/space/ShootingStar.d.ts.map +1 -0
  178. package/dist/components/space/ShootingStar.js +101 -0
  179. package/dist/components/space/ShootingStars.d.ts +16 -0
  180. package/dist/components/space/ShootingStars.d.ts.map +1 -0
  181. package/dist/components/space/ShootingStars.js +71 -0
  182. package/dist/components/space/SolarSystem.d.ts +16 -0
  183. package/dist/components/space/SolarSystem.d.ts.map +1 -0
  184. package/dist/components/space/SolarSystem.js +141 -0
  185. package/dist/components/space/Stars.d.ts +20 -0
  186. package/dist/components/space/Stars.d.ts.map +1 -0
  187. package/dist/components/space/Stars.js +160 -0
  188. package/dist/components/space/index.d.ts +11 -0
  189. package/dist/components/space/index.d.ts.map +1 -0
  190. package/dist/components/space/index.js +8 -0
  191. package/dist/components/terrain/TerrainSurface.d.ts.map +1 -1
  192. package/dist/components/terrain/TerrainSurface.js +27 -3
  193. package/dist/components/terrain/types.d.ts +5 -1
  194. package/dist/components/terrain/types.d.ts.map +1 -1
  195. package/dist/components/text/BurnAwayText.d.ts +15 -0
  196. package/dist/components/text/BurnAwayText.d.ts.map +1 -0
  197. package/dist/components/text/BurnAwayText.js +4 -0
  198. package/dist/components/text/ChalkboardText.d.ts +15 -0
  199. package/dist/components/text/ChalkboardText.d.ts.map +1 -0
  200. package/dist/components/text/ChalkboardText.js +4 -0
  201. package/dist/components/text/ConstellationText.d.ts +15 -0
  202. package/dist/components/text/ConstellationText.d.ts.map +1 -0
  203. package/dist/components/text/ConstellationText.js +4 -0
  204. package/dist/components/text/EmbroideryText.d.ts +15 -0
  205. package/dist/components/text/EmbroideryText.d.ts.map +1 -0
  206. package/dist/components/text/EmbroideryText.js +4 -0
  207. package/dist/components/text/FourierSketchText.d.ts +15 -0
  208. package/dist/components/text/FourierSketchText.d.ts.map +1 -0
  209. package/dist/components/text/FourierSketchText.js +4 -0
  210. package/dist/components/text/FrostGrowthText.d.ts +15 -0
  211. package/dist/components/text/FrostGrowthText.d.ts.map +1 -0
  212. package/dist/components/text/FrostGrowthText.js +4 -0
  213. package/dist/components/text/HandwritingText.d.ts +15 -0
  214. package/dist/components/text/HandwritingText.d.ts.map +1 -0
  215. package/dist/components/text/HandwritingText.js +4 -0
  216. package/dist/components/text/InkBleedText.d.ts +15 -0
  217. package/dist/components/text/InkBleedText.d.ts.map +1 -0
  218. package/dist/components/text/InkBleedText.js +4 -0
  219. package/dist/components/text/LightPaintingText.d.ts +15 -0
  220. package/dist/components/text/LightPaintingText.d.ts.map +1 -0
  221. package/dist/components/text/LightPaintingText.js +4 -0
  222. package/dist/components/text/LiquidMetalText.d.ts +15 -0
  223. package/dist/components/text/LiquidMetalText.d.ts.map +1 -0
  224. package/dist/components/text/LiquidMetalText.js +4 -0
  225. package/dist/components/text/NeonTubeText.d.ts +15 -0
  226. package/dist/components/text/NeonTubeText.d.ts.map +1 -0
  227. package/dist/components/text/NeonTubeText.js +4 -0
  228. package/dist/components/text/PlasmaDischargeText.d.ts +15 -0
  229. package/dist/components/text/PlasmaDischargeText.d.ts.map +1 -0
  230. package/dist/components/text/PlasmaDischargeText.js +4 -0
  231. package/dist/components/text/TextObjectView.d.ts +12 -0
  232. package/dist/components/text/TextObjectView.d.ts.map +1 -0
  233. package/dist/components/text/TextObjectView.js +11 -0
  234. package/dist/components/text/engine/fieldkit.d.ts +24 -0
  235. package/dist/components/text/engine/fieldkit.d.ts.map +1 -0
  236. package/dist/components/text/engine/fieldkit.js +201 -0
  237. package/dist/components/text/engine/glyphs.d.ts +19 -0
  238. package/dist/components/text/engine/glyphs.d.ts.map +1 -0
  239. package/dist/components/text/engine/glyphs.js +269 -0
  240. package/dist/components/text/engine/looks/burnAway.d.ts +144 -0
  241. package/dist/components/text/engine/looks/burnAway.d.ts.map +1 -0
  242. package/dist/components/text/engine/looks/burnAway.js +593 -0
  243. package/dist/components/text/engine/looks/chalkboard.d.ts +135 -0
  244. package/dist/components/text/engine/looks/chalkboard.d.ts.map +1 -0
  245. package/dist/components/text/engine/looks/chalkboard.js +426 -0
  246. package/dist/components/text/engine/looks/constellation.d.ts +111 -0
  247. package/dist/components/text/engine/looks/constellation.d.ts.map +1 -0
  248. package/dist/components/text/engine/looks/constellation.js +496 -0
  249. package/dist/components/text/engine/looks/embroidery.d.ts +165 -0
  250. package/dist/components/text/engine/looks/embroidery.d.ts.map +1 -0
  251. package/dist/components/text/engine/looks/embroidery.js +645 -0
  252. package/dist/components/text/engine/looks/frostGrowth.d.ts +109 -0
  253. package/dist/components/text/engine/looks/frostGrowth.d.ts.map +1 -0
  254. package/dist/components/text/engine/looks/frostGrowth.js +727 -0
  255. package/dist/components/text/engine/looks/index.d.ts +2 -0
  256. package/dist/components/text/engine/looks/index.d.ts.map +1 -0
  257. package/dist/components/text/engine/looks/index.js +48 -0
  258. package/dist/components/text/engine/looks/inkBleed.d.ts +103 -0
  259. package/dist/components/text/engine/looks/inkBleed.d.ts.map +1 -0
  260. package/dist/components/text/engine/looks/inkBleed.js +590 -0
  261. package/dist/components/text/engine/looks/lightPainting.d.ts +132 -0
  262. package/dist/components/text/engine/looks/lightPainting.d.ts.map +1 -0
  263. package/dist/components/text/engine/looks/lightPainting.js +567 -0
  264. package/dist/components/text/engine/looks/liquidMetal.d.ts +135 -0
  265. package/dist/components/text/engine/looks/liquidMetal.d.ts.map +1 -0
  266. package/dist/components/text/engine/looks/liquidMetal.js +655 -0
  267. package/dist/components/text/engine/looks/plasmaDischarge.d.ts +126 -0
  268. package/dist/components/text/engine/looks/plasmaDischarge.d.ts.map +1 -0
  269. package/dist/components/text/engine/looks/plasmaDischarge.js +763 -0
  270. package/dist/components/text/engine/methods.d.ts +19 -0
  271. package/dist/components/text/engine/methods.d.ts.map +1 -0
  272. package/dist/components/text/engine/methods.js +126 -0
  273. package/dist/components/text/engine/playback.d.ts +40 -0
  274. package/dist/components/text/engine/playback.d.ts.map +1 -0
  275. package/dist/components/text/engine/playback.js +114 -0
  276. package/dist/components/text/engine/ribbon.d.ts +58 -0
  277. package/dist/components/text/engine/ribbon.d.ts.map +1 -0
  278. package/dist/components/text/engine/ribbon.js +250 -0
  279. package/dist/components/text/engine/variants.d.ts +159 -0
  280. package/dist/components/text/engine/variants.d.ts.map +1 -0
  281. package/dist/components/text/engine/variants.js +378 -0
  282. package/dist/components/text/fonts/architects-daughter.outline.d.ts +3 -0
  283. package/dist/components/text/fonts/architects-daughter.outline.d.ts.map +1 -0
  284. package/dist/components/text/fonts/architects-daughter.outline.js +4 -0
  285. package/dist/components/text/fonts/architects-daughter.strokes.d.ts +3 -0
  286. package/dist/components/text/fonts/architects-daughter.strokes.d.ts.map +1 -0
  287. package/dist/components/text/fonts/architects-daughter.strokes.js +4 -0
  288. package/dist/components/text/fonts/caveat.outline.d.ts +3 -0
  289. package/dist/components/text/fonts/caveat.outline.d.ts.map +1 -0
  290. package/dist/components/text/fonts/caveat.outline.js +4 -0
  291. package/dist/components/text/fonts/caveat.strokes.d.ts +3 -0
  292. package/dist/components/text/fonts/caveat.strokes.d.ts.map +1 -0
  293. package/dist/components/text/fonts/caveat.strokes.js +4 -0
  294. package/dist/components/text/fonts/courgette.outline.d.ts +3 -0
  295. package/dist/components/text/fonts/courgette.outline.d.ts.map +1 -0
  296. package/dist/components/text/fonts/courgette.outline.js +4 -0
  297. package/dist/components/text/fonts/courgette.strokes.d.ts +3 -0
  298. package/dist/components/text/fonts/courgette.strokes.d.ts.map +1 -0
  299. package/dist/components/text/fonts/courgette.strokes.js +4 -0
  300. package/dist/components/text/fonts/dancing-script.outline.d.ts +3 -0
  301. package/dist/components/text/fonts/dancing-script.outline.d.ts.map +1 -0
  302. package/dist/components/text/fonts/dancing-script.outline.js +4 -0
  303. package/dist/components/text/fonts/dancing-script.strokes.d.ts +3 -0
  304. package/dist/components/text/fonts/dancing-script.strokes.d.ts.map +1 -0
  305. package/dist/components/text/fonts/dancing-script.strokes.js +4 -0
  306. package/dist/components/text/fonts/gochi-hand.outline.d.ts +3 -0
  307. package/dist/components/text/fonts/gochi-hand.outline.d.ts.map +1 -0
  308. package/dist/components/text/fonts/gochi-hand.outline.js +4 -0
  309. package/dist/components/text/fonts/gochi-hand.strokes.d.ts +3 -0
  310. package/dist/components/text/fonts/gochi-hand.strokes.d.ts.map +1 -0
  311. package/dist/components/text/fonts/gochi-hand.strokes.js +4 -0
  312. package/dist/components/text/fonts/handlee.outline.d.ts +3 -0
  313. package/dist/components/text/fonts/handlee.outline.d.ts.map +1 -0
  314. package/dist/components/text/fonts/handlee.outline.js +4 -0
  315. package/dist/components/text/fonts/handlee.strokes.d.ts +3 -0
  316. package/dist/components/text/fonts/handlee.strokes.d.ts.map +1 -0
  317. package/dist/components/text/fonts/handlee.strokes.js +4 -0
  318. package/dist/components/text/fonts/index.d.ts +5 -0
  319. package/dist/components/text/fonts/index.d.ts.map +1 -0
  320. package/dist/components/text/fonts/index.js +44 -0
  321. package/dist/components/text/fonts/indie-flower.outline.d.ts +3 -0
  322. package/dist/components/text/fonts/indie-flower.outline.d.ts.map +1 -0
  323. package/dist/components/text/fonts/indie-flower.outline.js +4 -0
  324. package/dist/components/text/fonts/indie-flower.strokes.d.ts +3 -0
  325. package/dist/components/text/fonts/indie-flower.strokes.d.ts.map +1 -0
  326. package/dist/components/text/fonts/indie-flower.strokes.js +4 -0
  327. package/dist/components/text/fonts/kalam.outline.d.ts +3 -0
  328. package/dist/components/text/fonts/kalam.outline.d.ts.map +1 -0
  329. package/dist/components/text/fonts/kalam.outline.js +4 -0
  330. package/dist/components/text/fonts/kalam.strokes.d.ts +3 -0
  331. package/dist/components/text/fonts/kalam.strokes.d.ts.map +1 -0
  332. package/dist/components/text/fonts/kalam.strokes.js +4 -0
  333. package/dist/components/text/fonts/kaushan-script.outline.d.ts +3 -0
  334. package/dist/components/text/fonts/kaushan-script.outline.d.ts.map +1 -0
  335. package/dist/components/text/fonts/kaushan-script.outline.js +4 -0
  336. package/dist/components/text/fonts/kaushan-script.strokes.d.ts +3 -0
  337. package/dist/components/text/fonts/kaushan-script.strokes.d.ts.map +1 -0
  338. package/dist/components/text/fonts/kaushan-script.strokes.js +4 -0
  339. package/dist/components/text/fonts/mynerve.outline.d.ts +3 -0
  340. package/dist/components/text/fonts/mynerve.outline.d.ts.map +1 -0
  341. package/dist/components/text/fonts/mynerve.outline.js +4 -0
  342. package/dist/components/text/fonts/mynerve.strokes.d.ts +3 -0
  343. package/dist/components/text/fonts/mynerve.strokes.d.ts.map +1 -0
  344. package/dist/components/text/fonts/mynerve.strokes.js +4 -0
  345. package/dist/components/text/fonts/nanum-pen-script.outline.d.ts +3 -0
  346. package/dist/components/text/fonts/nanum-pen-script.outline.d.ts.map +1 -0
  347. package/dist/components/text/fonts/nanum-pen-script.outline.js +4 -0
  348. package/dist/components/text/fonts/nanum-pen-script.strokes.d.ts +3 -0
  349. package/dist/components/text/fonts/nanum-pen-script.strokes.d.ts.map +1 -0
  350. package/dist/components/text/fonts/nanum-pen-script.strokes.js +4 -0
  351. package/dist/components/text/fonts/pacifico.outline.d.ts +3 -0
  352. package/dist/components/text/fonts/pacifico.outline.d.ts.map +1 -0
  353. package/dist/components/text/fonts/pacifico.outline.js +4 -0
  354. package/dist/components/text/fonts/pacifico.strokes.d.ts +3 -0
  355. package/dist/components/text/fonts/pacifico.strokes.d.ts.map +1 -0
  356. package/dist/components/text/fonts/pacifico.strokes.js +4 -0
  357. package/dist/components/text/fonts/patrick-hand.outline.d.ts +3 -0
  358. package/dist/components/text/fonts/patrick-hand.outline.d.ts.map +1 -0
  359. package/dist/components/text/fonts/patrick-hand.outline.js +4 -0
  360. package/dist/components/text/fonts/patrick-hand.strokes.d.ts +3 -0
  361. package/dist/components/text/fonts/patrick-hand.strokes.d.ts.map +1 -0
  362. package/dist/components/text/fonts/patrick-hand.strokes.js +4 -0
  363. package/dist/components/text/fonts/poppins.outline.d.ts +3 -0
  364. package/dist/components/text/fonts/poppins.outline.d.ts.map +1 -0
  365. package/dist/components/text/fonts/poppins.outline.js +4 -0
  366. package/dist/components/text/fonts/poppins.strokes.d.ts +3 -0
  367. package/dist/components/text/fonts/poppins.strokes.d.ts.map +1 -0
  368. package/dist/components/text/fonts/poppins.strokes.js +4 -0
  369. package/dist/components/text/fonts/satisfy.outline.d.ts +3 -0
  370. package/dist/components/text/fonts/satisfy.outline.d.ts.map +1 -0
  371. package/dist/components/text/fonts/satisfy.outline.js +4 -0
  372. package/dist/components/text/fonts/satisfy.strokes.d.ts +3 -0
  373. package/dist/components/text/fonts/satisfy.strokes.d.ts.map +1 -0
  374. package/dist/components/text/fonts/satisfy.strokes.js +4 -0
  375. package/dist/components/text/fonts/sriracha.outline.d.ts +3 -0
  376. package/dist/components/text/fonts/sriracha.outline.d.ts.map +1 -0
  377. package/dist/components/text/fonts/sriracha.outline.js +4 -0
  378. package/dist/components/text/fonts/sriracha.strokes.d.ts +3 -0
  379. package/dist/components/text/fonts/sriracha.strokes.d.ts.map +1 -0
  380. package/dist/components/text/fonts/sriracha.strokes.js +4 -0
  381. package/dist/components/text/index.d.ts +27 -0
  382. package/dist/components/text/index.d.ts.map +1 -0
  383. package/dist/components/text/index.js +13 -0
  384. package/dist/components/text/useTextObject.d.ts +21 -0
  385. package/dist/components/text/useTextObject.d.ts.map +1 -0
  386. package/dist/components/text/useTextObject.js +118 -0
  387. package/dist/components/water/OceanSurface.d.ts.map +1 -1
  388. package/dist/components/water/OceanSurface.js +3 -1
  389. package/dist/components/water/WaterBody.d.ts.map +1 -1
  390. package/dist/components/water/WaterBody.js +3 -1
  391. package/dist/components/water/types.d.ts +5 -1
  392. package/dist/components/water/types.d.ts.map +1 -1
  393. package/dist/constants.d.ts.map +1 -1
  394. package/dist/constants.js +4 -0
  395. package/dist/hooks/index.d.ts +2 -0
  396. package/dist/hooks/index.d.ts.map +1 -1
  397. package/dist/hooks/index.js +1 -0
  398. package/dist/hooks/useCloudSun.d.ts +9 -4
  399. package/dist/hooks/useCloudSun.d.ts.map +1 -1
  400. package/dist/hooks/useCloudSun.js +17 -7
  401. package/dist/hooks/useConfigLive.d.ts +3 -2
  402. package/dist/hooks/useConfigLive.d.ts.map +1 -1
  403. package/dist/hooks/useContinuousEffects.d.ts.map +1 -1
  404. package/dist/hooks/useContinuousEffects.js +4 -10
  405. package/dist/hooks/useEnvironmentProbe.d.ts +3 -22
  406. package/dist/hooks/useEnvironmentProbe.d.ts.map +1 -1
  407. package/dist/hooks/useEnvironmentProbe.js +47 -8
  408. package/dist/hooks/useGridSurface.d.ts +3 -10
  409. package/dist/hooks/useGridSurface.d.ts.map +1 -1
  410. package/dist/hooks/useGridSurface.js +5 -31
  411. package/dist/hooks/useInteraction.d.ts.map +1 -1
  412. package/dist/hooks/useInteraction.js +19 -72
  413. package/dist/hooks/useLightConfig.d.ts +2 -1
  414. package/dist/hooks/useLightConfig.d.ts.map +1 -1
  415. package/dist/hooks/useOceanMaterial.d.ts +6 -2
  416. package/dist/hooks/useOceanMaterial.d.ts.map +1 -1
  417. package/dist/hooks/useOceanMaterial.js +37 -2
  418. package/dist/hooks/useSkyLive.d.ts +23 -0
  419. package/dist/hooks/useSkyLive.d.ts.map +1 -0
  420. package/dist/hooks/useSkyLive.js +30 -0
  421. package/dist/hooks/useSkyUniforms.d.ts.map +1 -1
  422. package/dist/hooks/useSkyUniforms.js +2 -10
  423. package/dist/hooks/useTerrainLive.d.ts +3 -1
  424. package/dist/hooks/useTerrainLive.d.ts.map +1 -1
  425. package/dist/hooks/useTerrainTextures.d.ts +38 -0
  426. package/dist/hooks/useTerrainTextures.d.ts.map +1 -0
  427. package/dist/hooks/useTerrainTextures.js +149 -0
  428. package/dist/index.d.ts +11 -2
  429. package/dist/index.d.ts.map +1 -1
  430. package/dist/index.js +8 -1
  431. package/dist/operations/catalogue/blastOff.d.ts +3 -0
  432. package/dist/operations/catalogue/blastOff.d.ts.map +1 -0
  433. package/dist/operations/catalogue/blastOff.js +118 -0
  434. package/dist/operations/catalogue/bounce.d.ts +3 -0
  435. package/dist/operations/catalogue/bounce.d.ts.map +1 -0
  436. package/dist/operations/catalogue/bounce.js +34 -0
  437. package/dist/operations/catalogue/curlSmoke.d.ts.map +1 -1
  438. package/dist/operations/catalogue/curlSmoke.js +3 -1
  439. package/dist/operations/catalogue/dissolve.d.ts.map +1 -1
  440. package/dist/operations/catalogue/dissolve.js +2 -1
  441. package/dist/operations/catalogue/driftUp.d.ts +3 -0
  442. package/dist/operations/catalogue/driftUp.d.ts.map +1 -0
  443. package/dist/operations/catalogue/driftUp.js +57 -0
  444. package/dist/operations/catalogue/emberAsh.d.ts.map +1 -1
  445. package/dist/operations/catalogue/emberAsh.js +2 -1
  446. package/dist/operations/catalogue/flip.d.ts.map +1 -1
  447. package/dist/operations/catalogue/flip.js +19 -9
  448. package/dist/operations/catalogue/float.d.ts +3 -0
  449. package/dist/operations/catalogue/float.d.ts.map +1 -0
  450. package/dist/operations/catalogue/float.js +39 -0
  451. package/dist/operations/catalogue/flyBy.d.ts +3 -0
  452. package/dist/operations/catalogue/flyBy.d.ts.map +1 -0
  453. package/dist/operations/catalogue/flyBy.js +79 -0
  454. package/dist/operations/catalogue/frost.d.ts.map +1 -1
  455. package/dist/operations/catalogue/frost.js +10 -3
  456. package/dist/operations/catalogue/grow.d.ts +3 -0
  457. package/dist/operations/catalogue/grow.d.ts.map +1 -0
  458. package/dist/operations/catalogue/grow.js +19 -0
  459. package/dist/operations/catalogue/hologram.d.ts.map +1 -1
  460. package/dist/operations/catalogue/hologram.js +11 -5
  461. package/dist/operations/catalogue/jelly.d.ts.map +1 -1
  462. package/dist/operations/catalogue/jelly.js +18 -8
  463. package/dist/operations/catalogue/knockAway.d.ts +3 -0
  464. package/dist/operations/catalogue/knockAway.d.ts.map +1 -0
  465. package/dist/operations/catalogue/knockAway.js +74 -0
  466. package/dist/operations/catalogue/leafFall.d.ts +3 -0
  467. package/dist/operations/catalogue/leafFall.d.ts.map +1 -0
  468. package/dist/operations/catalogue/leafFall.js +74 -0
  469. package/dist/operations/catalogue/lidarScan.d.ts.map +1 -1
  470. package/dist/operations/catalogue/lidarScan.js +4 -1
  471. package/dist/operations/catalogue/metalize.d.ts.map +1 -1
  472. package/dist/operations/catalogue/metalize.js +8 -2
  473. package/dist/operations/catalogue/motionTrail.d.ts +6 -0
  474. package/dist/operations/catalogue/motionTrail.d.ts.map +1 -0
  475. package/dist/operations/catalogue/motionTrail.js +221 -0
  476. package/dist/operations/catalogue/petrify.d.ts.map +1 -1
  477. package/dist/operations/catalogue/petrify.js +9 -3
  478. package/dist/operations/catalogue/physicalExit.d.ts +55 -0
  479. package/dist/operations/catalogue/physicalExit.d.ts.map +1 -0
  480. package/dist/operations/catalogue/physicalExit.js +165 -0
  481. package/dist/operations/catalogue/physicalHeld.d.ts +41 -0
  482. package/dist/operations/catalogue/physicalHeld.d.ts.map +1 -0
  483. package/dist/operations/catalogue/physicalHeld.js +78 -0
  484. package/dist/operations/catalogue/physicalMix.d.ts +45 -0
  485. package/dist/operations/catalogue/physicalMix.d.ts.map +1 -0
  486. package/dist/operations/catalogue/physicalMix.js +144 -0
  487. package/dist/operations/catalogue/pop.d.ts +3 -0
  488. package/dist/operations/catalogue/pop.d.ts.map +1 -0
  489. package/dist/operations/catalogue/pop.js +44 -0
  490. package/dist/operations/catalogue/print3d.d.ts.map +1 -1
  491. package/dist/operations/catalogue/print3d.js +5 -1
  492. package/dist/operations/catalogue/pulse.d.ts +3 -0
  493. package/dist/operations/catalogue/pulse.d.ts.map +1 -0
  494. package/dist/operations/catalogue/pulse.js +29 -0
  495. package/dist/operations/catalogue/restPose.d.ts +5 -7
  496. package/dist/operations/catalogue/restPose.d.ts.map +1 -1
  497. package/dist/operations/catalogue/restPose.js +18 -48
  498. package/dist/operations/catalogue/rotate.d.ts +3 -0
  499. package/dist/operations/catalogue/rotate.d.ts.map +1 -0
  500. package/dist/operations/catalogue/rotate.js +49 -0
  501. package/dist/operations/catalogue/shake.d.ts +3 -0
  502. package/dist/operations/catalogue/shake.d.ts.map +1 -0
  503. package/dist/operations/catalogue/shake.js +31 -0
  504. package/dist/operations/catalogue/shatter.d.ts.map +1 -1
  505. package/dist/operations/catalogue/shatter.js +5 -1
  506. package/dist/operations/catalogue/slam.d.ts +3 -0
  507. package/dist/operations/catalogue/slam.d.ts.map +1 -0
  508. package/dist/operations/catalogue/slam.js +89 -0
  509. package/dist/operations/catalogue/slingshot.d.ts +3 -0
  510. package/dist/operations/catalogue/slingshot.d.ts.map +1 -0
  511. package/dist/operations/catalogue/slingshot.js +88 -0
  512. package/dist/operations/catalogue/spin.d.ts.map +1 -1
  513. package/dist/operations/catalogue/spin.js +24 -13
  514. package/dist/operations/catalogue/sway.d.ts +3 -0
  515. package/dist/operations/catalogue/sway.d.ts.map +1 -0
  516. package/dist/operations/catalogue/sway.js +23 -0
  517. package/dist/operations/catalogue/swirl.d.ts.map +1 -1
  518. package/dist/operations/catalogue/swirl.js +6 -5
  519. package/dist/operations/catalogue/trailCore.d.ts +89 -0
  520. package/dist/operations/catalogue/trailCore.d.ts.map +1 -0
  521. package/dist/operations/catalogue/trailCore.js +190 -0
  522. package/dist/operations/catalogue/trailGhosts.d.ts +5 -0
  523. package/dist/operations/catalogue/trailGhosts.d.ts.map +1 -0
  524. package/dist/operations/catalogue/trailGhosts.js +179 -0
  525. package/dist/operations/catalogue/trailStampStyles.d.ts +11 -0
  526. package/dist/operations/catalogue/trailStampStyles.d.ts.map +1 -0
  527. package/dist/operations/catalogue/trailStampStyles.js +479 -0
  528. package/dist/operations/catalogue/trailStamps.d.ts +57 -0
  529. package/dist/operations/catalogue/trailStamps.d.ts.map +1 -0
  530. package/dist/operations/catalogue/trailStamps.js +349 -0
  531. package/dist/operations/catalogue/trailStreaks.d.ts +3 -0
  532. package/dist/operations/catalogue/trailStreaks.d.ts.map +1 -0
  533. package/dist/operations/catalogue/trailStreaks.js +147 -0
  534. package/dist/operations/catalogue/transitionField.d.ts +30 -0
  535. package/dist/operations/catalogue/transitionField.d.ts.map +1 -1
  536. package/dist/operations/catalogue/transitionField.js +21 -0
  537. package/dist/operations/catalogue/turnAway.d.ts +3 -0
  538. package/dist/operations/catalogue/turnAway.d.ts.map +1 -0
  539. package/dist/operations/catalogue/turnAway.js +54 -0
  540. package/dist/operations/catalogue/vortexDrain.d.ts +3 -0
  541. package/dist/operations/catalogue/vortexDrain.d.ts.map +1 -0
  542. package/dist/operations/catalogue/vortexDrain.js +68 -0
  543. package/dist/operations/catalogue/warp.d.ts +3 -0
  544. package/dist/operations/catalogue/warp.d.ts.map +1 -0
  545. package/dist/operations/catalogue/warp.js +73 -0
  546. package/dist/operations/catalogue/whoosh.d.ts +3 -0
  547. package/dist/operations/catalogue/whoosh.d.ts.map +1 -0
  548. package/dist/operations/catalogue/whoosh.js +84 -0
  549. package/dist/operations/catalogue/wobble.d.ts +3 -0
  550. package/dist/operations/catalogue/wobble.d.ts.map +1 -0
  551. package/dist/operations/catalogue/wobble.js +23 -0
  552. package/dist/operations/clipPreview.d.ts +3 -0
  553. package/dist/operations/clipPreview.d.ts.map +1 -0
  554. package/dist/operations/clipPreview.js +20 -0
  555. package/dist/operations/groupFanout.d.ts +96 -0
  556. package/dist/operations/groupFanout.d.ts.map +1 -0
  557. package/dist/operations/groupFanout.js +365 -0
  558. package/dist/operations/groups.d.ts +20 -0
  559. package/dist/operations/groups.d.ts.map +1 -0
  560. package/dist/operations/groups.js +66 -0
  561. package/dist/operations/index.d.ts +5 -2
  562. package/dist/operations/index.d.ts.map +1 -1
  563. package/dist/operations/index.js +5 -2
  564. package/dist/operations/objectEffects.d.ts +161 -6
  565. package/dist/operations/objectEffects.d.ts.map +1 -1
  566. package/dist/operations/objectEffects.js +1091 -17
  567. package/dist/operations/registry.d.ts.map +1 -1
  568. package/dist/operations/registry.js +24 -2
  569. package/dist/operations/runtime.d.ts +57 -2
  570. package/dist/operations/runtime.d.ts.map +1 -1
  571. package/dist/operations/runtime.js +161 -18
  572. package/dist/operations/types.d.ts +60 -3
  573. package/dist/operations/types.d.ts.map +1 -1
  574. package/dist/operations/types.js +5 -1
  575. package/dist/operations/useObjectEffectLayers.d.ts +2 -2
  576. package/dist/operations/useObjectEffectLayers.d.ts.map +1 -1
  577. package/dist/operations/useObjectEffectLayers.js +31 -10
  578. package/dist/operations/usePresentedVisibility.d.ts +10 -0
  579. package/dist/operations/usePresentedVisibility.d.ts.map +1 -0
  580. package/dist/operations/usePresentedVisibility.js +53 -0
  581. package/dist/presets/terrainBiomes.d.ts +67 -0
  582. package/dist/presets/terrainBiomes.d.ts.map +1 -0
  583. package/dist/presets/terrainBiomes.js +294 -0
  584. package/dist/presets/terrainPresets.d.ts +6 -0
  585. package/dist/presets/terrainPresets.d.ts.map +1 -1
  586. package/dist/presets/terrainPresets.js +26 -38
  587. package/dist/shaders/glsl/oceanCore.glsl.d.ts +2 -2
  588. package/dist/shaders/glsl/oceanCore.glsl.d.ts.map +1 -1
  589. package/dist/shaders/glsl/oceanCore.glsl.js +17 -0
  590. package/dist/shaders/glsl/surfaceCore.glsl.d.ts +21 -0
  591. package/dist/shaders/glsl/surfaceCore.glsl.d.ts.map +1 -0
  592. package/dist/shaders/glsl/surfaceCore.glsl.js +120 -0
  593. package/dist/shaders/glsl/terrainCore.glsl.d.ts +16 -3
  594. package/dist/shaders/glsl/terrainCore.glsl.d.ts.map +1 -1
  595. package/dist/shaders/glsl/terrainCore.glsl.js +266 -20
  596. package/dist/shaders/ocean/OceanSurfaceMaterial.d.ts +2 -0
  597. package/dist/shaders/ocean/OceanSurfaceMaterial.d.ts.map +1 -1
  598. package/dist/shaders/ocean/OceanSurfaceMaterial.js +3 -0
  599. package/dist/shaders/terrain/TerrainMaterial.d.ts +17 -0
  600. package/dist/shaders/terrain/TerrainMaterial.d.ts.map +1 -1
  601. package/dist/shaders/terrain/TerrainMaterial.js +107 -8
  602. package/dist/triggers/engine.d.ts +44 -0
  603. package/dist/triggers/engine.d.ts.map +1 -0
  604. package/dist/triggers/engine.js +165 -0
  605. package/dist/triggers/hosts/actions.d.ts +8 -0
  606. package/dist/triggers/hosts/actions.d.ts.map +1 -0
  607. package/dist/triggers/hosts/actions.js +22 -0
  608. package/dist/triggers/hosts/interactions.d.ts +6 -0
  609. package/dist/triggers/hosts/interactions.d.ts.map +1 -0
  610. package/dist/triggers/hosts/interactions.js +4 -0
  611. package/dist/triggers/hosts/timelineCues.d.ts +2 -0
  612. package/dist/triggers/hosts/timelineCues.d.ts.map +1 -0
  613. package/dist/triggers/hosts/timelineCues.js +22 -0
  614. package/dist/triggers/index.d.ts +13 -0
  615. package/dist/triggers/index.d.ts.map +1 -0
  616. package/dist/triggers/index.js +9 -0
  617. package/dist/triggers/kinds/action.d.ts +2 -0
  618. package/dist/triggers/kinds/action.d.ts.map +1 -0
  619. package/dist/triggers/kinds/action.js +31 -0
  620. package/dist/triggers/kinds/animations.d.ts +2 -0
  621. package/dist/triggers/kinds/animations.d.ts.map +1 -0
  622. package/dist/triggers/kinds/animations.js +75 -0
  623. package/dist/triggers/kinds/effects.d.ts +2 -0
  624. package/dist/triggers/kinds/effects.d.ts.map +1 -0
  625. package/dist/triggers/kinds/effects.js +27 -0
  626. package/dist/triggers/kinds/index.d.ts +4 -0
  627. package/dist/triggers/kinds/index.d.ts.map +1 -0
  628. package/dist/triggers/kinds/index.js +4 -0
  629. package/dist/triggers/log.d.ts +21 -0
  630. package/dist/triggers/log.d.ts.map +1 -0
  631. package/dist/triggers/log.js +43 -0
  632. package/dist/triggers/readiness.d.ts +40 -0
  633. package/dist/triggers/readiness.d.ts.map +1 -0
  634. package/dist/triggers/readiness.js +158 -0
  635. package/dist/triggers/registry.d.ts +41 -0
  636. package/dist/triggers/registry.d.ts.map +1 -0
  637. package/dist/triggers/registry.js +7 -0
  638. package/dist/types/gridConfigs.d.ts +18 -23
  639. package/dist/types/gridConfigs.d.ts.map +1 -1
  640. package/dist/ui/UiAnchorUpdater.d.ts +10 -0
  641. package/dist/ui/UiAnchorUpdater.d.ts.map +1 -0
  642. package/dist/ui/UiAnchorUpdater.js +111 -0
  643. package/dist/ui/UiLayers.d.ts +20 -0
  644. package/dist/ui/UiLayers.d.ts.map +1 -0
  645. package/dist/ui/UiLayers.js +57 -0
  646. package/dist/ui/index.d.ts +9 -0
  647. package/dist/ui/index.d.ts.map +1 -0
  648. package/dist/ui/index.js +6 -0
  649. package/dist/ui/uiAnchors.d.ts +21 -0
  650. package/dist/ui/uiAnchors.d.ts.map +1 -0
  651. package/dist/ui/uiAnchors.js +22 -0
  652. package/dist/ui/uiBaseStyles.d.ts +2 -0
  653. package/dist/ui/uiBaseStyles.d.ts.map +1 -0
  654. package/dist/ui/uiBaseStyles.js +100 -0
  655. package/dist/ui/uiBinder.d.ts +30 -0
  656. package/dist/ui/uiBinder.d.ts.map +1 -0
  657. package/dist/ui/uiBinder.js +344 -0
  658. package/dist/utils/configAnimations.d.ts.map +1 -1
  659. package/dist/utils/configAnimations.js +5 -1
  660. package/dist/utils/gridConfig.d.ts +1 -1
  661. package/dist/utils/gridConfig.d.ts.map +1 -1
  662. package/dist/utils/gridConfig.js +1 -1
  663. package/dist/utils/landPatch.d.ts +33 -0
  664. package/dist/utils/landPatch.d.ts.map +1 -0
  665. package/dist/utils/landPatch.js +114 -0
  666. package/dist/utils/renderedSky.d.ts +32 -0
  667. package/dist/utils/renderedSky.d.ts.map +1 -0
  668. package/dist/utils/renderedSky.js +57 -0
  669. package/dist/utils/skyMoon.d.ts +35 -0
  670. package/dist/utils/skyMoon.d.ts.map +1 -0
  671. package/dist/utils/skyMoon.js +41 -0
  672. package/dist/utils/terrainHeight.d.ts +4 -0
  673. package/dist/utils/terrainHeight.d.ts.map +1 -0
  674. package/dist/utils/terrainHeight.js +150 -0
  675. package/dist/utils/terrainTextureResolver.d.ts +18 -0
  676. package/dist/utils/terrainTextureResolver.d.ts.map +1 -0
  677. package/dist/utils/terrainTextureResolver.js +17 -0
  678. package/dist/utils/terrainUniforms.d.ts +17 -0
  679. package/dist/utils/terrainUniforms.d.ts.map +1 -1
  680. package/dist/utils/terrainUniforms.js +84 -0
  681. package/dist/utils/textureArrays.d.ts +29 -0
  682. package/dist/utils/textureArrays.d.ts.map +1 -0
  683. package/dist/utils/textureArrays.js +140 -0
  684. package/package.json +2 -2
@@ -7,11 +7,10 @@ const mountainPresets = [
7
7
  terrainType: 'mountains',
8
8
  description: 'Sharp granite ridges above a snow line, glaciated valleys between them. The default mountain.',
9
9
  tags: ['snow', 'sharp', 'high', 'granite'],
10
+ biome: 'Alpine meadow',
10
11
  settings: {
11
12
  elevation: 1700, featureSize: 3800, octaves: 9, gain: 0.5,
12
13
  ridgeSharpness: 0.68, warpStrength: 0.3, erosion: 0.75,
13
- peakLevel: 0.7, peakBlend: 0.1, peakSlopeFalloff: 1.6,
14
- lowColor: '#3c4a33', midColor: '#5b5a44', rockColor: '#6d6659', peakColor: '#f2f5fa',
15
14
  slopeRockStart: 0.3, slopeRockEnd: 0.55,
16
15
  aerialPerspective: 0.00005,
17
16
  },
@@ -21,11 +20,10 @@ const mountainPresets = [
21
20
  terrainType: 'mountains',
22
21
  description: 'The approach rather than the summit: broad shoulders, forest colours, no snow.',
23
22
  tags: ['low', 'green', 'gentle', 'approach'],
23
+ biome: 'Green hills',
24
24
  settings: {
25
25
  elevation: 520, featureSize: 2400, octaves: 8, gain: 0.47,
26
26
  ridgeSharpness: 0.4, warpStrength: 0.38, erosion: 0.6,
27
- peakLevel: 0.92, peakBlend: 0.15,
28
- lowColor: '#37461f', midColor: '#4c5730', rockColor: '#75695a', peakColor: '#8b9166',
29
27
  slopeRockStart: 0.42, slopeRockEnd: 0.7,
30
28
  aerialPerspective: 0.00009,
31
29
  },
@@ -35,13 +33,11 @@ const mountainPresets = [
35
33
  terrainType: 'mountains',
36
34
  description: 'Steep, dark and young. Little erosion, so the flanks stay smooth and the ridges stay raw.',
37
35
  tags: ['dark', 'basalt', 'steep', 'ash'],
36
+ biome: 'Volcanic',
38
37
  settings: {
39
38
  elevation: 1300, featureSize: 3000, octaves: 8, gain: 0.54,
40
39
  ridgeSharpness: 0.5, warpStrength: 0.16, erosion: 0.25,
41
- peakLevel: 0.86, peakBlend: 0.06, peakSlopeFalloff: 2.2,
42
- lowColor: '#2a2622', midColor: '#3a342e', rockColor: '#4a423a', peakColor: '#d8d4cc',
43
40
  slopeRockStart: 0.22, slopeRockEnd: 0.45,
44
- macroVariation: 0.34, roughness: 0.94, specular: 0.02,
45
41
  },
46
42
  },
47
43
  {
@@ -49,12 +45,11 @@ const mountainPresets = [
49
45
  terrainType: 'mountains',
50
46
  description: 'Pale limestone spires with banded walls. Strata on, sharpened hard.',
51
47
  tags: ['limestone', 'towers', 'strata', 'pale'],
48
+ biome: 'Alpine meadow',
52
49
  settings: {
53
50
  elevation: 1250, featureSize: 2600, octaves: 9, gain: 0.55,
54
51
  ridgeSharpness: 0.82, warpStrength: 0.22, erosion: 0.5,
55
52
  terraces: 22, terraceSharpness: 0.85,
56
- peakLevel: 0.74, peakBlend: 0.08,
57
- lowColor: '#4a5238', midColor: '#7d7867', rockColor: '#b3ab9a', peakColor: '#eef0f4',
58
53
  slopeRockStart: 0.22, slopeRockEnd: 0.42,
59
54
  },
60
55
  },
@@ -63,13 +58,12 @@ const mountainPresets = [
63
58
  terrainType: 'mountains',
64
59
  description: 'Old, worn and wide. Erosion near maximum flattens the floors and leaves the ridges as fins.',
65
60
  tags: ['old', 'worn', 'moorland', 'wide'],
61
+ biome: 'Moorland',
66
62
  settings: {
67
63
  elevation: 800, featureSize: 5000, octaves: 10, gain: 0.44,
68
64
  ridgeSharpness: 0.55, warpStrength: 0.46, erosion: 0.95,
69
- peakLevel: 0.88, peakBlend: 0.22,
70
- lowColor: '#454a2e', midColor: '#5e5a3d', rockColor: '#726a5c', peakColor: '#9aa07c',
71
65
  slopeRockStart: 0.4, slopeRockEnd: 0.68,
72
- macroVariation: 0.34, aerialPerspective: 0.00007,
66
+ aerialPerspective: 0.00007,
73
67
  },
74
68
  },
75
69
  ];
@@ -82,11 +76,11 @@ const dunePresets = [
82
76
  terrainType: 'dunes',
83
77
  description: 'A full sand sea: tall transverse dunes, crest after crest to the horizon.',
84
78
  tags: ['sahara', 'tall', 'transverse', 'sand sea'],
79
+ biome: 'Desert sand',
85
80
  settings: {
86
81
  elevation: 180, featureSize: 5200, duneWavelength: 420, duneAsymmetry: 0.7,
87
82
  octaves: 6, gain: 0.44, warpStrength: 0.22,
88
- lowColor: '#b08a53', midColor: '#dcb87e', peakColor: '#f4e2bc',
89
- specular: 0.18, bounce: 0.6,
83
+ bounce: 0.6,
90
84
  },
91
85
  },
92
86
  {
@@ -94,11 +88,10 @@ const dunePresets = [
94
88
  terrainType: 'dunes',
95
89
  description: 'Isolated crescent dunes on a hard desert floor. Low, widely spaced, strong slip faces.',
96
90
  tags: ['crescent', 'sparse', 'low', 'hardpan'],
91
+ biome: 'Desert sand',
97
92
  settings: {
98
93
  elevation: 70, featureSize: 2800, duneWavelength: 260, duneAsymmetry: 0.88,
99
94
  octaves: 6, gain: 0.38, warpStrength: 0.3,
100
- lowColor: '#9c8360', midColor: '#c8a878', peakColor: '#e8d2a8',
101
- macroVariation: 0.2, specular: 0.14,
102
95
  },
103
96
  },
104
97
  {
@@ -106,11 +99,11 @@ const dunePresets = [
106
99
  terrainType: 'dunes',
107
100
  description: 'Low marram-held ridges behind a beach. Damp sand, so more sheen and cooler colour.',
108
101
  tags: ['coast', 'low', 'damp', 'beach'],
102
+ biome: 'Desert sand',
109
103
  settings: {
110
104
  elevation: 34, featureSize: 1600, duneWavelength: 120, duneAsymmetry: 0.5,
111
105
  octaves: 7, gain: 0.46, warpStrength: 0.4, ridgeSharpness: 0.1,
112
- lowColor: '#a99b7c', midColor: '#cfc3a3', peakColor: '#e6dcc4',
113
- roughness: 0.42, specular: 0.3, detailSize: 2.2, detailStrength: 0.4,
106
+ detailSize: 2.2, detailStrength: 0.4,
114
107
  aerialPerspective: 0.00011,
115
108
  },
116
109
  },
@@ -119,11 +112,10 @@ const dunePresets = [
119
112
  terrainType: 'dunes',
120
113
  description: 'Iron-stained linear dunes: long parallel ridges rather than a crescent field.',
121
114
  tags: ['red', 'linear', 'outback', 'iron'],
115
+ biome: 'Red rock',
122
116
  settings: {
123
117
  elevation: 120, featureSize: 8000, duneWavelength: 520, duneAsymmetry: 0.4,
124
118
  octaves: 5, gain: 0.4, warpStrength: 0.1,
125
- lowColor: '#8c3f22', midColor: '#c06334', rockColor: '#9c5029', peakColor: '#e09a5c',
126
- macroVariation: 0.24, specular: 0.1,
127
119
  },
128
120
  },
129
121
  {
@@ -131,12 +123,11 @@ const dunePresets = [
131
123
  terrainType: 'dunes',
132
124
  description: 'Almost nothing: a bright pan with the faintest relief. The reference for a flat, huge horizon.',
133
125
  tags: ['flat', 'bright', 'playa', 'minimal'],
126
+ biome: 'Salt flat',
134
127
  settings: {
135
128
  elevation: 6, featureSize: 12000, duneWavelength: 900, duneAsymmetry: 0.1,
136
129
  octaves: 5, gain: 0.42, warpStrength: 0.5, ridgeSharpness: 0,
137
- lowColor: '#cfc9bc', midColor: '#e8e4da', peakColor: '#f8f6f1',
138
130
  slopeRockStart: 0.8, slopeRockEnd: 0.95,
139
- macroVariation: 0.16, roughness: 0.4, specular: 0.22,
140
131
  aerialPerspective: 0.00013,
141
132
  },
142
133
  },
@@ -150,10 +141,10 @@ const hillPresets = [
150
141
  terrainType: 'hills',
151
142
  description: 'Soft chalk hills under grass. Wide, rounded and calm — the friendly default.',
152
143
  tags: ['grass', 'rounded', 'calm', 'pastoral'],
144
+ biome: 'Green hills',
153
145
  settings: {
154
146
  elevation: 160, featureSize: 3000, octaves: 8, gain: 0.45,
155
147
  ridgeSharpness: 0.02, warpStrength: 0.34, erosion: 0.4,
156
- lowColor: '#3f5326', midColor: '#5b6b3c', peakColor: '#93a06a',
157
148
  },
158
149
  },
159
150
  {
@@ -161,11 +152,11 @@ const hillPresets = [
161
152
  terrainType: 'hills',
162
153
  description: 'Almost flat, very wide. Dry grass to the horizon with barely a fold in it.',
163
154
  tags: ['flat', 'dry', 'wide', 'grassland'],
155
+ biome: 'Dry grassland',
164
156
  settings: {
165
157
  elevation: 55, featureSize: 9000, octaves: 7, gain: 0.42,
166
158
  ridgeSharpness: 0, warpStrength: 0.45, erosion: 0.35,
167
- lowColor: '#6b6836', midColor: '#8a8047', peakColor: '#a89a63',
168
- macroVariation: 0.36, aerialPerspective: 0.0001,
159
+ aerialPerspective: 0.0001,
169
160
  },
170
161
  },
171
162
  {
@@ -173,12 +164,12 @@ const hillPresets = [
173
164
  terrainType: 'hills',
174
165
  description: 'Peat and heather over rough ground: darker, coarser and more broken than downland.',
175
166
  tags: ['heather', 'peat', 'rough', 'dark'],
167
+ biome: 'Moorland',
176
168
  settings: {
177
169
  elevation: 280, featureSize: 3400, octaves: 9, gain: 0.5,
178
170
  ridgeSharpness: 0.18, warpStrength: 0.28, erosion: 0.62,
179
- lowColor: '#3a3626', midColor: '#4f4630', rockColor: '#6b6455', peakColor: '#6e6444',
180
171
  slopeRockStart: 0.42, slopeRockEnd: 0.68,
181
- macroVariation: 0.4, detailStrength: 0.65,
172
+ detailStrength: 0.65,
182
173
  },
183
174
  },
184
175
  {
@@ -186,11 +177,10 @@ const hillPresets = [
186
177
  terrainType: 'hills',
187
178
  description: 'A single broad valley with soft shoulders. Heavy erosion gives it a real floor to stand on.',
188
179
  tags: ['valley', 'green', 'floor', 'soft'],
180
+ biome: 'Green hills',
189
181
  settings: {
190
182
  elevation: 220, featureSize: 5200, octaves: 8, gain: 0.43,
191
183
  ridgeSharpness: 0.08, warpStrength: 0.5, erosion: 0.88,
192
- lowColor: '#445a24', midColor: '#5d6f36', peakColor: '#8fa15f',
193
- macroVariation: 0.3,
194
184
  },
195
185
  },
196
186
  {
@@ -198,12 +188,11 @@ const hillPresets = [
198
188
  terrainType: 'hills',
199
189
  description: 'Low frozen ground with snow settling in the hollows rather than on the tops.',
200
190
  tags: ['cold', 'snow', 'low', 'arctic'],
191
+ biome: 'Tundra',
201
192
  settings: {
202
193
  elevation: 130, featureSize: 4200, octaves: 8, gain: 0.44,
203
194
  ridgeSharpness: 0.05, warpStrength: 0.36, erosion: 0.5,
204
- lowColor: '#8e9299', midColor: '#6d6f66', rockColor: '#5f5d58', peakColor: '#eaf0f6',
205
- peakLevel: 0.5, peakBlend: 0.28, peakSlopeFalloff: 0.8,
206
- roughness: 0.6, specular: 0.12, ambient: 1.2,
195
+ ambient: 1.2,
207
196
  },
208
197
  },
209
198
  ];
@@ -216,10 +205,10 @@ const canyonPresets = [
216
205
  terrainType: 'canyon',
217
206
  description: 'Banded sandstone walls above a branching network of washes. The default canyon.',
218
207
  tags: ['sandstone', 'red', 'strata', 'network'],
208
+ biome: 'Red rock',
219
209
  settings: {
220
210
  elevation: 700, featureSize: 2800, plateau: 0.55, valleyDepth: 0.8, valleyWidth: 0.22,
221
211
  terraces: 14, terraceSharpness: 0.72, erosion: 0.85,
222
- lowColor: '#7a4a30', midColor: '#a4643c', rockColor: '#c07a4a', peakColor: '#d9a877',
223
212
  },
224
213
  },
225
214
  {
@@ -227,10 +216,10 @@ const canyonPresets = [
227
216
  terrainType: 'canyon',
228
217
  description: 'A narrow deep cut in an almost flat plateau. Incision at its narrowest and deepest.',
229
218
  tags: ['narrow', 'deep', 'slot', 'antelope'],
219
+ biome: 'Red rock',
230
220
  settings: {
231
221
  elevation: 420, featureSize: 3200, plateau: 0.85, valleyDepth: 1.25, valleyWidth: 0.07,
232
222
  terraces: 20, terraceSharpness: 0.9, erosion: 0.7, octaves: 9,
233
- lowColor: '#6b3a22', midColor: '#a35a2c', rockColor: '#cf8348', peakColor: '#c9a06a',
234
223
  shadowSoftness: 5,
235
224
  },
236
225
  },
@@ -239,10 +228,10 @@ const canyonPresets = [
239
228
  terrainType: 'canyon',
240
229
  description: 'Flat-topped tables standing above a wide desert floor, cut well apart from each other.',
241
230
  tags: ['mesa', 'butte', 'flat top', 'monument'],
231
+ biome: 'Red rock',
242
232
  settings: {
243
233
  elevation: 620, featureSize: 4200, plateau: 0.95, valleyDepth: 1.1, valleyWidth: 0.55,
244
234
  terraces: 10, terraceSharpness: 0.95, erosion: 0.9, ridgeSharpness: 0.2,
245
- lowColor: '#8a5a3a', midColor: '#b0703f', rockColor: '#c9834c', peakColor: '#e0b184',
246
235
  slopeRockStart: 0.2, slopeRockEnd: 0.38,
247
236
  aerialPerspective: 0.00007,
248
237
  },
@@ -252,11 +241,10 @@ const canyonPresets = [
252
241
  terrainType: 'canyon',
253
242
  description: 'Densely dissected, chaotic and low. Almost all wall and almost no floor.',
254
243
  tags: ['dissected', 'chaotic', 'low', 'clay'],
244
+ biome: 'Red rock',
255
245
  settings: {
256
246
  elevation: 240, featureSize: 1800, plateau: 0.4, valleyDepth: 0.9, valleyWidth: 0.42,
257
247
  terraces: 26, terraceSharpness: 0.6, erosion: 0.55, octaves: 10, ridgeSharpness: 0.45,
258
- lowColor: '#6e6252', midColor: '#94836a', rockColor: '#ab9a80', peakColor: '#c9bda4',
259
- macroVariation: 0.34,
260
248
  },
261
249
  },
262
250
  {
@@ -264,10 +252,10 @@ const canyonPresets = [
264
252
  terrainType: 'canyon',
265
253
  description: 'One enormous incision across a high plateau, layered from rim to river. Built for the horizon.',
266
254
  tags: ['huge', 'layered', 'rim', 'grand'],
255
+ biome: 'Red rock',
267
256
  settings: {
268
257
  elevation: 1600, featureSize: 9000, plateau: 0.75, valleyDepth: 1.35, valleyWidth: 0.3,
269
258
  terraces: 30, terraceSharpness: 0.8, erosion: 0.92, octaves: 10,
270
- lowColor: '#6a4130', midColor: '#9a5f3c', rockColor: '#bd7c4e', peakColor: '#d4ab80',
271
259
  aerialPerspective: 0.00007,
272
260
  },
273
261
  },
@@ -42,9 +42,9 @@
42
42
  /** Hard cap on the wave table. The loop is bounded by it because GLSL ES 1.00
43
43
  * requires a constant bound; `u_waveCount` breaks out early. */
44
44
  export declare const MAX_WAVES = 32;
45
- export declare const oceanUniforms = "\n#define MAX_WAVES 32\n\n// Per component: (dirX, dirZ, amplitude, wavenumber k).\nuniform vec4 u_waveA[MAX_WAVES];\n// Per component: (angular frequency w, phase, steepness Q, wavelength).\nuniform vec4 u_waveB[MAX_WAVES];\nuniform float u_waveCount;\n\nuniform float u_time;\nuniform float u_waterLevel;\nuniform float u_choppiness;\nuniform float u_amplitudeScale;\n\n// Half-extent of a placed body, and the width of its rim taper. Both zero on the\n// world host, which is what switches the taper off - a sea has no rim.\nuniform vec2 u_bodyHalf;\nuniform float u_edgeFade;\n\nuniform vec3 u_deepColor;\nuniform vec3 u_shallowColor;\nuniform vec3 u_foamColor;\nuniform vec3 u_sssColor;\nuniform float u_absorption;\nuniform float u_clarity;\nuniform float u_roughness;\nuniform float u_specular;\nuniform float u_sssStrength;\nuniform float u_detailStrength;\nuniform float u_detailScale; // 1 / detailSize\nuniform float u_detailFade; // 1 / detailFadeDistance\n// World size of one pixel at one unit of distance: 2*tan(fov/2) / viewportHeight.\n// What turns a distance into a screen-space footprint, which is the only thing\n// that decides whether a ripple is a shape or a shimmer.\nuniform float u_pixelScale;\nuniform float u_foamAmount;\nuniform float u_foamDecay;\nuniform float u_foamScale; // 1 / foamSize\nuniform float u_ambientScale;\nuniform float u_fogDensity;\nuniform float u_exposure;\nuniform float u_curvature;\nuniform float u_receiveShadows;\n\n// Filled by applySunUniforms and applyTerrainAmbient, exactly as on the terrain\n// material - one atmosphere for the sky, the clouds, the ground and the water.\nuniform vec3 u_skyAmbient;\nuniform vec3 u_groundAmbient;\n";
45
+ export declare const oceanUniforms = "\n#define MAX_WAVES 32\n\n// Per component: (dirX, dirZ, amplitude, wavenumber k).\nuniform vec4 u_waveA[MAX_WAVES];\n// Per component: (angular frequency w, phase, steepness Q, wavelength).\nuniform vec4 u_waveB[MAX_WAVES];\nuniform float u_waveCount;\n\nuniform float u_time;\nuniform float u_waterLevel;\nuniform float u_choppiness;\nuniform float u_amplitudeScale;\n\n// Half-extent of a placed body, and the width of its rim taper. Both zero on the\n// world host, which is what switches the taper off - a sea has no rim.\nuniform vec2 u_bodyHalf;\nuniform float u_edgeFade;\n\nuniform vec3 u_deepColor;\nuniform vec3 u_shallowColor;\nuniform vec3 u_foamColor;\nuniform vec3 u_sssColor;\nuniform float u_absorption;\nuniform float u_clarity;\nuniform float u_roughness;\nuniform float u_specular;\nuniform float u_sssStrength;\nuniform float u_detailStrength;\nuniform float u_detailScale; // 1 / detailSize\nuniform float u_detailFade; // 1 / detailFadeDistance\n// World size of one pixel at one unit of distance: 2*tan(fov/2) / viewportHeight.\n// What turns a distance into a screen-space footprint, which is the only thing\n// that decides whether a ripple is a shape or a shimmer.\nuniform float u_pixelScale;\nuniform float u_foamAmount;\nuniform float u_foamDecay;\nuniform float u_foamScale; // 1 / foamSize\nuniform float u_ambientScale;\nuniform float u_fogDensity;\nuniform float u_exposure;\nuniform float u_curvature;\nuniform float u_receiveShadows;\n\n// Filled by applySunUniforms and applyTerrainAmbient, exactly as on the terrain\n// material - one atmosphere for the sky, the clouds, the ground and the water.\nuniform vec3 u_skyAmbient;\nuniform vec3 u_groundAmbient;\n\n// Moonlight (useOceanMaterial, from the same moon as the key light and the\n// moon disc). u_moonColor already carries strength: black by day, so the moon\n// terms below cost two dot products and add nothing.\nuniform vec3 u_moonDir;\nuniform vec3 u_moonColor;\n";
46
46
  export declare const oceanWaves = "\n/**\n * One trochoidal component, accumulated.\n *\n * Gerstner displaces along the direction of travel as well as vertically:\n *\n * x' = x + d * Q * A * sin(theta)\n * y = A * cos(theta)\n * theta = k * dot(d, x) + w * t + phase\n *\n * Q is what peaks the crests and flattens the troughs. It also compresses the\n * horizontal map near a crest, and where that compression turns the map\n * degenerate the wave is breaking - which is where the foam is. That falls out\n * of the same derivatives, for free, so foam here is measured rather than faked.\n *\n * Everything is differentiated in closed form. A central difference would need\n * four more evaluations of the whole sum for the normal alone; this is the same\n * decision, and the same 13x, that the terrain height field made.\n */\nvoid oceanWaveSum(\n vec2 p, float cellLod, float amp,\n out vec3 disp, // displacement from the flat plane, world units\n out vec3 nrm, // analytic surface normal\n out float jacobian, // det of the horizontal map. < 1 compresses, < 0 folds\n out float relHeight // vertical displacement in standard deviations of the surface\n){\n disp = vec3(0.0);\n jacobian = 0.0;\n relHeight = 0.0;\n\n // Horizontal derivatives of the horizontal displacement, and of the height.\n float dXdx = 0.0, dXdz = 0.0, dZdx = 0.0, dZdz = 0.0;\n float dYdx = 0.0, dYdz = 0.0;\n float totalSq = 0.0;\n\n for (int i = 0; i < MAX_WAVES; i++) {\n if (float(i) >= u_waveCount) break;\n\n vec4 a = u_waveA[i];\n vec4 b = u_waveB[i];\n vec2 d = a.xy;\n float A = a.z * amp;\n float k = a.w;\n float w = b.x;\n float phase = b.y;\n float Q = b.z;\n float wl = b.w;\n\n // Per-ring wave LOD. A component of wavelength L cannot be represented on a\n // cell coarser than about L/4 - sampled there it aliases into crawling\n // noise, which is what a naive clipmap ocean looks like at the horizon. So\n // it fades out as the cell approaches its wavelength.\n //\n // cellLod is aCell * (1 + aMorph), the same morphing LOD the terrain uses,\n // which is what makes the two sides of a ring seam agree: the outer edge of\n // ring l evaluates at exactly ring l+1's cell size, so both sides fade the\n // same components by the same amount and the surface is continuous across\n // the boundary.\n float lod = 1.0 - smoothstep(wl * 0.25, wl * 0.75, cellLod);\n A *= lod;\n\n float theta = k * dot(d, p) + w * u_time + phase;\n float S = sin(theta);\n float C = cos(theta);\n\n float QA = Q * A;\n\n disp.x += d.x * QA * S;\n disp.z += d.y * QA * S;\n disp.y += A * C;\n totalSq += A * A;\n\n float kQA = k * QA;\n dXdx += d.x * d.x * kQA * C;\n dXdz += d.x * d.y * kQA * C;\n dZdx += d.y * d.x * kQA * C;\n dZdz += d.y * d.y * kQA * C;\n\n float kA = k * A;\n dYdx -= d.x * kA * S;\n dYdz -= d.y * kA * S;\n }\n\n // Tangent frame of the displaced surface. Taking the cross product rather than\n // the usual closed-form shortcut costs three multiplies and stays correct when\n // choppiness is high, where the shortcut - which assumes the horizontal map is\n // near-identity - visibly tilts the crests the wrong way.\n vec3 tx = vec3(1.0 + dXdx, dYdx, dZdx);\n vec3 tz = vec3(dXdz, dYdz, 1.0 + dZdz);\n nrm = normalize(cross(tz, tx));\n\n jacobian = (1.0 + dXdx) * (1.0 + dZdz) - dXdz * dZdx;\n\n // Height in standard deviations of the surface, NOT as a fraction of the\n // summed amplitudes. Dividing by the sum is the obvious thing and it is wrong\n // by a factor of sqrt(2N): random-phase components almost never align, so the\n // surface only ever reaches a fraction of that sum, and everything keyed on\n // relative height - the foam's crest gate, the subsurface term - was being\n // multiplied by ~0.15 and silently doing nothing. A storm with whitecaps\n // turned up had no foam at all, which is how this was found.\n //\n // sigma is the RMS surface elevation, so this is roughly -3..3 with the usual\n // excursion at +-1, and a threshold expressed in it means what it looks like.\n relHeight = disp.y / max(sqrt(totalSq * 0.5), 1e-4);\n}\n\n/** Rim taper for a placed body: displacement to zero at the edge, so the\n * boundary is still water rather than a sawn-off cliff of it. Returns 1 on the\n * world host, where u_bodyHalf is zero. */\nfloat oceanEdgeMask(vec2 local){\n if (u_bodyHalf.x <= 0.0) return 1.0;\n vec2 t = abs(local) / max(u_bodyHalf, vec2(1e-3));\n float e = max(t.x, t.y);\n float band = max(u_edgeFade, 1e-3);\n return 1.0 - smoothstep(1.0 - band, 1.0, e);\n}\n";
47
- export declare const oceanShade = "\n/** Arithmetic hash. Never the fract(sin(dot())) one: four hashes per octave of\n * two sines each was most of the terrain frame budget before it was replaced,\n * and every noise tutorial online still teaches the expensive version. */\nvec2 oHash(vec2 p){\n vec3 p3 = fract(vec3(p.xyx) * vec3(0.1031, 0.1030, 0.0973));\n p3 += dot(p3, p3.yzx + 33.33);\n return fract((p3.xx + p3.yz) * p3.zy) * 2.0 - 1.0;\n}\n\n/** Gradient noise with its derivative, so a detail normal costs one evaluation\n * instead of three. */\nvec3 oNoised(vec2 x){\n vec2 i = floor(x);\n vec2 f = fract(x);\n vec2 u = f * f * (3.0 - 2.0 * f);\n vec2 du = 6.0 * f * (1.0 - f);\n\n vec2 ga = oHash(i + vec2(0.0, 0.0));\n vec2 gb = oHash(i + vec2(1.0, 0.0));\n vec2 gc = oHash(i + vec2(0.0, 1.0));\n vec2 gd = oHash(i + vec2(1.0, 1.0));\n\n float va = dot(ga, f - vec2(0.0, 0.0));\n float vb = dot(gb, f - vec2(1.0, 0.0));\n float vc = dot(gc, f - vec2(0.0, 1.0));\n float vd = dot(gd, f - vec2(1.0, 1.0));\n\n float v = va + u.x * (vb - va) + u.y * (vc - va) + u.x * u.y * (va - vb - vc + vd);\n vec2 g = ga + u.x * (gb - ga) + u.y * (gc - ga) + u.x * u.y * (ga - gb - gc + gd)\n + du * (u.yx * (va - vb - vc + vd) + vec2(vb, vc) - va);\n return vec3(v, g);\n}\n\n/**\n * Ripple below the mesh.\n *\n * This is not decoration: the per-ring LOD in oceanWaveSum deletes every\n * component shorter than the cell, and near the camera that is most of the\n * high-frequency energy in the sea. Putting it back as a normal perturbation is\n * cheaper than carrying it in geometry and, past a few metres, indistinguishable\n * - a ripple two pixels across is a normal, not a shape.\n *\n * Two octaves drifting in opposite directions, because one drifting field reads\n * as a texture being dragged across the water.\n */\nfloat oceanDetailFade(float dist){\n // Two fades, and the second is the one that matters. Distance alone is not\n // what makes a ripple alias - a screen-space footprint is. A two-metre ripple\n // is a shape at fifty metres and sub-pixel noise at two thousand, and which of\n // those it is depends on the field of view and the resolution, not on the\n // distance. Fading on the footprint means the same water looks right in a\n // wide shot and a telephoto one.\n float footprint = dist * u_pixelScale;\n float size = 1.0 / max(u_detailScale, 1e-4);\n float screen = 1.0 - smoothstep(size * 0.35, size * 1.4, footprint);\n return exp(-dist * u_detailFade) * screen;\n}\n\nvec3 oceanDetailNormal(vec3 n, vec3 wp, float fade){\n float amt = u_detailStrength * fade;\n if (amt <= 0.001) return n;\n\n vec2 p = wp.xz * u_detailScale;\n vec2 drift = vec2(u_time * 0.06, u_time * 0.043);\n\n vec3 a = oNoised(p + drift);\n vec3 b = oNoised(p * 2.17 - drift * 1.6);\n vec2 g = a.yz + b.yz * 0.5;\n\n // Perturb in the surface plane, so a steep wave face keeps its own orientation\n // and only gains texture.\n vec3 t = normalize(cross(vec3(0.0, 1.0, 0.0), n) + vec3(1e-5, 0.0, 0.0));\n vec3 bt = cross(n, t);\n // 0.12, not 0.4. The gradient of the noise is order 1, so the constant IS the\n // maximum slope the ripple adds: at 0.4 the default strength tilts the normal\n // by twelve degrees, and at grazing angles - which is most of an ocean - a\n // twelve degree tilt swings the Fresnel term between reflecting the sky and\n // not. The whole surface then boils with white speckle, which is exactly what\n // it did. Sub-metre ripple on open water is a few degrees of slope.\n return normalize(n - (t * g.x + bt * g.y) * amt * 0.12);\n}\n\n/**\n * Whitecaps, from the Jacobian of the horizontal map.\n *\n * Where the determinant falls toward zero the surface is folding into itself,\n * which is physically what a breaking crest is. It is the same quantity an FFT\n * ocean reads off its displacement cascade, and a Gerstner sum hands it over for\n * nothing, so foam is measured here rather than paint over the crests.\n *\n * u_foamDecay is a stand-in for a real accumulation buffer: it widens the\n * threshold on the trailing side, so foam persists behind the crest instead of\n * flickering on and off with it. The honest version writes into a persistent\n * target and advects it - deferred with the FFT phase.\n */\nfloat oceanFoam(float jacobian, float relHeight, vec3 wp){\n float compress = saturate(1.0 - jacobian);\n\n // Thresholds are calibrated against the compression the wave table actually\n // produces, which is a much narrower range than it looks: at the defaults the\n // Jacobian sits just above zero at the sharpest crest and near 1 everywhere\n // else. A threshold picked by eye either foams the whole sea or none of it.\n float thr = mix(0.85, 0.15, saturate(u_foamAmount * 0.6));\n float sharp = smoothstep(thr, thr + 0.15, compress);\n float trail = smoothstep(thr * 0.55, thr + 0.4, compress);\n float f = mix(sharp, max(sharp, trail), saturate(u_foamDecay));\n\n // Foam belongs on and just behind the crest, never in the trough.\n f *= smoothstep(-0.15, 0.45, relHeight);\n\n // Break it up, or it reads as a decal following the wave.\n vec2 q = wp.xz * u_foamScale;\n float n = oNoised(q + vec2(u_time * 0.05, -u_time * 0.03)).x * 0.5 + 0.5;\n n = mix(n, 1.0, 0.35);\n return saturate(f * n * u_foamAmount);\n}\n\n/**\n * The water shading.\n *\n * Reflection is the whole story above a few degrees of grazing - most of what\n * you see looking at the sea is the sky - so the Fresnel split, the sky radiance\n * and the aerial perspective all have to come from the same atmosphere the sky\n * itself is drawn with, or the water is obviously pasted onto the scene. That is\n * skyRadiance from cloudCore, driven by applySunUniforms off the same\n * useCloudSun state as the clouds and the terrain.\n */\nvec3 oceanLight(\n vec3 wp, vec3 n, vec3 viewDir, // viewDir points FROM the camera TO the surface\n float foam, float relHeight, float shadow, float depthFactor,\n float roughnessBoost, // specular antialiasing, see the caller\n vec3 reflectionColor\n){\n vec3 V = -viewDir;\n vec3 L = normalize(u_sunDir);\n float NdotL = max(dot(n, L), 0.0);\n vec3 sun = u_sunColor * u_sunIntensity * shadow;\n\n // Reflection. Bending the reflected ray back above the horizon is a cheat, and\n // the alternative is worse: at grazing angles a wave face routinely reflects\n // just below the horizon, and sampling the sky's ground term there puts a band\n // of dirt across the brightest part of the water.\n vec3 R = reflect(viewDir, n);\n R.y = max(R.y, 0.015);\n vec3 sky = length(reflectionColor) > 0.0 ? reflectionColor : skyRadiance(R);\n\n // Prefilter the reflection by the same roughness the specular lobe uses.\n // Without this the specular is filtered and the reflection is not, and on\n // water that is the wrong half: reflection is most of what you see, and a\n // mirror sampled through a noisy normal aliases exactly as hard as a highlight\n // does. u_skyAmbient is already the hemispheric average of this sky, so it is\n // the infinitely-rough end of the same lobe and costs nothing to mix toward.\n float rough = clamp(u_roughness + roughnessBoost, 0.01, 1.0);\n sky = mix(sky, u_skyAmbient * 0.6, saturate(rough * 2.2));\n\n float fres = 0.02 + 0.98 * pow(1.0 - saturate(dot(V, n)), 5.0);\n\n // Body colour. depthFactor is 1 in open water and ramps to 0 as the bottom\n // comes up; until the refraction grab exists it is 1 everywhere.\n vec3 body = mix(u_shallowColor, u_deepColor, saturate(depthFactor));\n body = mix(body, u_shallowColor, u_clarity * 0.35);\n vec3 bodyLit = body * (u_skyAmbient * u_ambientScale * 0.22 + sun * (0.25 + 0.55 * NdotL));\n\n // Subsurface. A wave lit from behind glows through its own crest, and the\n // effect is strongest where the surface is steep and thin - so it keys off the\n // wave's own height rather than off thickness we do not have.\n float back = pow(saturate(dot(V, -L) * 0.5 + 0.5), 3.0);\n float thin = saturate(relHeight * 1.4);\n vec3 sss = u_sssColor * u_sssStrength * back * thin * u_sunColor * u_sunIntensity * (0.35 + 0.65 * shadow);\n\n // GGX. The glitter path from the horizon to the camera is most of what says\n // \"water\" at distance, and it is a specular lobe on a normal that is moving -\n // which is why the detail normal matters as much as the mesh does.\n // Water is nearly smooth, which is exactly what makes it alias: a specular\n // lobe this tight flips between nothing and a blown-out highlight across one\n // pixel, and a sea of them boils. The fix is not a softer sea - it is to widen\n // the lobe by however much the normal varies inside the pixel, so the energy\n // is kept and the flicker is not. roughnessBoost carries that in, and the\n // reflection above is filtered by the same number.\n float a = max(rough * rough, 2e-4);\n vec3 h = normalize(L + V);\n float ndh = max(dot(n, h), 0.0);\n float denom = ndh * ndh * (a * a - 1.0) + 1.0;\n float ggx = (a * a) / (PI * denom * denom);\n vec3 spec = sun * ggx * u_specular * fres;\n\n vec3 col = mix(bodyLit + sss, sky, fres) + spec;\n\n // Foam is a rough dielectric, so it takes the sky and the sun diffusely and\n // kills the reflection under it.\n vec3 foamLit = u_foamColor * (u_skyAmbient * u_ambientScale * 0.5 + sun * (0.3 + 0.7 * NdotL));\n col = mix(col, foamLit, saturate(foam));\n\n return col;\n}\n\n/** Fade into the sky the water is seen through. Same term as the terrain's,\n * and it needs to be stronger here: an ocean runs to the horizon in every\n * direction, so it is the only thing stopping the far field reading as a\n * painted plane. */\nvec3 oceanAerial(vec3 col, vec3 rd, float dist){\n float f = 1.0 - exp(-u_fogDensity * dist);\n if (f < 0.002) return col;\n return mix(col, skyRadiance(rd), f);\n}\n";
47
+ export declare const oceanShade = "\n/** Arithmetic hash. Never the fract(sin(dot())) one: four hashes per octave of\n * two sines each was most of the terrain frame budget before it was replaced,\n * and every noise tutorial online still teaches the expensive version. */\nvec2 oHash(vec2 p){\n vec3 p3 = fract(vec3(p.xyx) * vec3(0.1031, 0.1030, 0.0973));\n p3 += dot(p3, p3.yzx + 33.33);\n return fract((p3.xx + p3.yz) * p3.zy) * 2.0 - 1.0;\n}\n\n/** Gradient noise with its derivative, so a detail normal costs one evaluation\n * instead of three. */\nvec3 oNoised(vec2 x){\n vec2 i = floor(x);\n vec2 f = fract(x);\n vec2 u = f * f * (3.0 - 2.0 * f);\n vec2 du = 6.0 * f * (1.0 - f);\n\n vec2 ga = oHash(i + vec2(0.0, 0.0));\n vec2 gb = oHash(i + vec2(1.0, 0.0));\n vec2 gc = oHash(i + vec2(0.0, 1.0));\n vec2 gd = oHash(i + vec2(1.0, 1.0));\n\n float va = dot(ga, f - vec2(0.0, 0.0));\n float vb = dot(gb, f - vec2(1.0, 0.0));\n float vc = dot(gc, f - vec2(0.0, 1.0));\n float vd = dot(gd, f - vec2(1.0, 1.0));\n\n float v = va + u.x * (vb - va) + u.y * (vc - va) + u.x * u.y * (va - vb - vc + vd);\n vec2 g = ga + u.x * (gb - ga) + u.y * (gc - ga) + u.x * u.y * (ga - gb - gc + gd)\n + du * (u.yx * (va - vb - vc + vd) + vec2(vb, vc) - va);\n return vec3(v, g);\n}\n\n/**\n * Ripple below the mesh.\n *\n * This is not decoration: the per-ring LOD in oceanWaveSum deletes every\n * component shorter than the cell, and near the camera that is most of the\n * high-frequency energy in the sea. Putting it back as a normal perturbation is\n * cheaper than carrying it in geometry and, past a few metres, indistinguishable\n * - a ripple two pixels across is a normal, not a shape.\n *\n * Two octaves drifting in opposite directions, because one drifting field reads\n * as a texture being dragged across the water.\n */\nfloat oceanDetailFade(float dist){\n // Two fades, and the second is the one that matters. Distance alone is not\n // what makes a ripple alias - a screen-space footprint is. A two-metre ripple\n // is a shape at fifty metres and sub-pixel noise at two thousand, and which of\n // those it is depends on the field of view and the resolution, not on the\n // distance. Fading on the footprint means the same water looks right in a\n // wide shot and a telephoto one.\n float footprint = dist * u_pixelScale;\n float size = 1.0 / max(u_detailScale, 1e-4);\n float screen = 1.0 - smoothstep(size * 0.35, size * 1.4, footprint);\n return exp(-dist * u_detailFade) * screen;\n}\n\nvec3 oceanDetailNormal(vec3 n, vec3 wp, float fade){\n float amt = u_detailStrength * fade;\n if (amt <= 0.001) return n;\n\n vec2 p = wp.xz * u_detailScale;\n vec2 drift = vec2(u_time * 0.06, u_time * 0.043);\n\n vec3 a = oNoised(p + drift);\n vec3 b = oNoised(p * 2.17 - drift * 1.6);\n vec2 g = a.yz + b.yz * 0.5;\n\n // Perturb in the surface plane, so a steep wave face keeps its own orientation\n // and only gains texture.\n vec3 t = normalize(cross(vec3(0.0, 1.0, 0.0), n) + vec3(1e-5, 0.0, 0.0));\n vec3 bt = cross(n, t);\n // 0.12, not 0.4. The gradient of the noise is order 1, so the constant IS the\n // maximum slope the ripple adds: at 0.4 the default strength tilts the normal\n // by twelve degrees, and at grazing angles - which is most of an ocean - a\n // twelve degree tilt swings the Fresnel term between reflecting the sky and\n // not. The whole surface then boils with white speckle, which is exactly what\n // it did. Sub-metre ripple on open water is a few degrees of slope.\n return normalize(n - (t * g.x + bt * g.y) * amt * 0.12);\n}\n\n/**\n * Whitecaps, from the Jacobian of the horizontal map.\n *\n * Where the determinant falls toward zero the surface is folding into itself,\n * which is physically what a breaking crest is. It is the same quantity an FFT\n * ocean reads off its displacement cascade, and a Gerstner sum hands it over for\n * nothing, so foam is measured here rather than paint over the crests.\n *\n * u_foamDecay is a stand-in for a real accumulation buffer: it widens the\n * threshold on the trailing side, so foam persists behind the crest instead of\n * flickering on and off with it. The honest version writes into a persistent\n * target and advects it - deferred with the FFT phase.\n */\nfloat oceanFoam(float jacobian, float relHeight, vec3 wp){\n float compress = saturate(1.0 - jacobian);\n\n // Thresholds are calibrated against the compression the wave table actually\n // produces, which is a much narrower range than it looks: at the defaults the\n // Jacobian sits just above zero at the sharpest crest and near 1 everywhere\n // else. A threshold picked by eye either foams the whole sea or none of it.\n float thr = mix(0.85, 0.15, saturate(u_foamAmount * 0.6));\n float sharp = smoothstep(thr, thr + 0.15, compress);\n float trail = smoothstep(thr * 0.55, thr + 0.4, compress);\n float f = mix(sharp, max(sharp, trail), saturate(u_foamDecay));\n\n // Foam belongs on and just behind the crest, never in the trough.\n f *= smoothstep(-0.15, 0.45, relHeight);\n\n // Break it up, or it reads as a decal following the wave.\n vec2 q = wp.xz * u_foamScale;\n float n = oNoised(q + vec2(u_time * 0.05, -u_time * 0.03)).x * 0.5 + 0.5;\n n = mix(n, 1.0, 0.35);\n return saturate(f * n * u_foamAmount);\n}\n\n/**\n * The water shading.\n *\n * Reflection is the whole story above a few degrees of grazing - most of what\n * you see looking at the sea is the sky - so the Fresnel split, the sky radiance\n * and the aerial perspective all have to come from the same atmosphere the sky\n * itself is drawn with, or the water is obviously pasted onto the scene. That is\n * skyRadiance from cloudCore, driven by applySunUniforms off the same\n * useCloudSun state as the clouds and the terrain.\n */\nvec3 oceanLight(\n vec3 wp, vec3 n, vec3 viewDir, // viewDir points FROM the camera TO the surface\n float foam, float relHeight, float shadow, float depthFactor,\n float roughnessBoost, // specular antialiasing, see the caller\n vec3 reflectionColor\n){\n vec3 V = -viewDir;\n vec3 L = normalize(u_sunDir);\n float NdotL = max(dot(n, L), 0.0);\n vec3 sun = u_sunColor * u_sunIntensity * shadow;\n\n // Reflection. Bending the reflected ray back above the horizon is a cheat, and\n // the alternative is worse: at grazing angles a wave face routinely reflects\n // just below the horizon, and sampling the sky's ground term there puts a band\n // of dirt across the brightest part of the water.\n vec3 R = reflect(viewDir, n);\n R.y = max(R.y, 0.015);\n vec3 sky = length(reflectionColor) > 0.0 ? reflectionColor : skyRadiance(R);\n\n // Prefilter the reflection by the same roughness the specular lobe uses.\n // Without this the specular is filtered and the reflection is not, and on\n // water that is the wrong half: reflection is most of what you see, and a\n // mirror sampled through a noisy normal aliases exactly as hard as a highlight\n // does. u_skyAmbient is already the hemispheric average of this sky, so it is\n // the infinitely-rough end of the same lobe and costs nothing to mix toward.\n float rough = clamp(u_roughness + roughnessBoost, 0.01, 1.0);\n sky = mix(sky, u_skyAmbient * 0.6, saturate(rough * 2.2));\n\n float fres = 0.02 + 0.98 * pow(1.0 - saturate(dot(V, n)), 5.0);\n\n // Body colour. depthFactor is 1 in open water and ramps to 0 as the bottom\n // comes up; until the refraction grab exists it is 1 everywhere.\n vec3 body = mix(u_shallowColor, u_deepColor, saturate(depthFactor));\n body = mix(body, u_shallowColor, u_clarity * 0.35);\n vec3 bodyLit = body * (u_skyAmbient * u_ambientScale * 0.22 + sun * (0.25 + 0.55 * NdotL));\n\n // Subsurface. A wave lit from behind glows through its own crest, and the\n // effect is strongest where the surface is steep and thin - so it keys off the\n // wave's own height rather than off thickness we do not have.\n float back = pow(saturate(dot(V, -L) * 0.5 + 0.5), 3.0);\n float thin = saturate(relHeight * 1.4);\n vec3 sss = u_sssColor * u_sssStrength * back * thin * u_sunColor * u_sunIntensity * (0.35 + 0.65 * shadow);\n\n // GGX. The glitter path from the horizon to the camera is most of what says\n // \"water\" at distance, and it is a specular lobe on a normal that is moving -\n // which is why the detail normal matters as much as the mesh does.\n // Water is nearly smooth, which is exactly what makes it alias: a specular\n // lobe this tight flips between nothing and a blown-out highlight across one\n // pixel, and a sea of them boils. The fix is not a softer sea - it is to widen\n // the lobe by however much the normal varies inside the pixel, so the energy\n // is kept and the flicker is not. roughnessBoost carries that in, and the\n // reflection above is filtered by the same number.\n float a = max(rough * rough, 2e-4);\n vec3 h = normalize(L + V);\n float ndh = max(dot(n, h), 0.0);\n float denom = ndh * ndh * (a * a - 1.0) + 1.0;\n float ggx = (a * a) / (PI * denom * denom);\n vec3 spec = sun * ggx * u_specular * fres;\n\n // The moon: its own glitter path down the water toward the camera, and a\n // little light on the body. Same lobe, same filtering, so the path breaks up\n // on the waves exactly as the sun's does. Below the horizon u_moonColor is 0.\n vec3 Lm = normalize(u_moonDir);\n vec3 hm = normalize(Lm + V);\n float ndhm = max(dot(n, hm), 0.0);\n float denomM = ndhm * ndhm * (a * a - 1.0) + 1.0;\n float ggxM = (a * a) / (PI * denomM * denomM);\n spec += u_moonColor * ggxM * u_specular * fres;\n bodyLit += body * u_moonColor * (0.25 + 0.55 * max(dot(n, Lm), 0.0));\n\n vec3 col = mix(bodyLit + sss, sky, fres) + spec;\n\n // Foam is a rough dielectric, so it takes the sky and the sun diffusely and\n // kills the reflection under it.\n vec3 foamLit = u_foamColor * (u_skyAmbient * u_ambientScale * 0.5 + sun * (0.3 + 0.7 * NdotL));\n col = mix(col, foamLit, saturate(foam));\n\n return col;\n}\n\n/** Fade into the sky the water is seen through. Same term as the terrain's,\n * and it needs to be stronger here: an ocean runs to the horizon in every\n * direction, so it is the only thing stopping the far field reading as a\n * painted plane. */\nvec3 oceanAerial(vec3 col, vec3 rd, float dist){\n float f = 1.0 - exp(-u_fogDensity * dist);\n if (f < 0.002) return col;\n return mix(col, skyRadiance(rd), f);\n}\n";
48
48
  /** Height field only — what a vertex stage needs. */
49
49
  export declare const oceanField: string;
50
50
  /** The whole model. */
@@ -1 +1 @@
1
- {"version":3,"file":"oceanCore.glsl.d.ts","sourceRoot":"","sources":["../../../src/shaders/glsl/oceanCore.glsl.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAEH;iEACiE;AACjE,eAAO,MAAM,SAAS,KAAK,CAAC;AAE5B,eAAO,MAAM,aAAa,+rDAgDzB,CAAC;AAEF,eAAO,MAAM,UAAU,gjJAoHtB,CAAC;AAEF,eAAO,MAAM,UAAU,woTA8MtB,CAAC;AAEF,qDAAqD;AACrD,eAAO,MAAM,UAAU,QAAyC,CAAC;AAEjE,uBAAuB;AACvB,eAAO,MAAM,SAAS,QAAqD,CAAC"}
1
+ {"version":3,"file":"oceanCore.glsl.d.ts","sourceRoot":"","sources":["../../../src/shaders/glsl/oceanCore.glsl.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAEH;iEACiE;AACjE,eAAO,MAAM,SAAS,KAAK,CAAC;AAE5B,eAAO,MAAM,aAAa,28DAsDzB,CAAC;AAEF,eAAO,MAAM,UAAU,gjJAoHtB,CAAC;AAEF,eAAO,MAAM,UAAU,ssUAyNtB,CAAC;AAEF,qDAAqD;AACrD,eAAO,MAAM,UAAU,QAAyC,CAAC;AAEjE,uBAAuB;AACvB,eAAO,MAAM,SAAS,QAAqD,CAAC"}
@@ -90,6 +90,12 @@ uniform float u_receiveShadows;
90
90
  // material - one atmosphere for the sky, the clouds, the ground and the water.
91
91
  uniform vec3 u_skyAmbient;
92
92
  uniform vec3 u_groundAmbient;
93
+
94
+ // Moonlight (useOceanMaterial, from the same moon as the key light and the
95
+ // moon disc). u_moonColor already carries strength: black by day, so the moon
96
+ // terms below cost two dot products and add nothing.
97
+ uniform vec3 u_moonDir;
98
+ uniform vec3 u_moonColor;
93
99
  `;
94
100
  export const oceanWaves = /* glsl */ `
95
101
  /**
@@ -395,6 +401,17 @@ vec3 oceanLight(
395
401
  float ggx = (a * a) / (PI * denom * denom);
396
402
  vec3 spec = sun * ggx * u_specular * fres;
397
403
 
404
+ // The moon: its own glitter path down the water toward the camera, and a
405
+ // little light on the body. Same lobe, same filtering, so the path breaks up
406
+ // on the waves exactly as the sun's does. Below the horizon u_moonColor is 0.
407
+ vec3 Lm = normalize(u_moonDir);
408
+ vec3 hm = normalize(Lm + V);
409
+ float ndhm = max(dot(n, hm), 0.0);
410
+ float denomM = ndhm * ndhm * (a * a - 1.0) + 1.0;
411
+ float ggxM = (a * a) / (PI * denomM * denomM);
412
+ spec += u_moonColor * ggxM * u_specular * fres;
413
+ bodyLit += body * u_moonColor * (0.25 + 0.55 * max(dot(n, Lm), 0.0));
414
+
398
415
  vec3 col = mix(bodyLit + sss, sky, fres) + spec;
399
416
 
400
417
  // Foam is a rough dielectric, so it takes the sky and the sun diffusely and
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Surface sampling for splat-textured ground — texture arrays, stochastic tiling,
3
+ * height blending inputs and normal blending.
4
+ *
5
+ * Taken from the landscape module (`landscapeCore.glsl.ts`), where every piece of
6
+ * it was debugged by rendering. It is the terrain's now; the landscape keeps its
7
+ * own copy until it is retired. Everything is `sf`-prefixed so it can sit beside
8
+ * three's `<common>` and the terrain chunks.
9
+ *
10
+ * Needs GLSL ES 3.0 (`sampler2DArray`, `textureGrad`). three r163+ compiles every
11
+ * non-raw ShaderMaterial as `#version 300 es` with a `texture2D -> texture`
12
+ * define, so this works with no `glslVersion` override — and setting one would
13
+ * remove the `gl_FragColor` alias the terrain fragment writes to.
14
+ *
15
+ * Single exit and initialised results throughout: ANGLE on Windows rewrites early
16
+ * returns, and D3D then warns X4000 about the function's own result.
17
+ *
18
+ * A backtick inside this template literal terminates the string.
19
+ */
20
+ export declare const surfaceSampling = "\n// Arithmetic hash. Never fract(sin(dot(...))).\nvec2 sfHash2(vec2 p) {\n vec3 p3 = fract(vec3(p.xyx) * vec3(0.1031, 0.1030, 0.0973));\n p3 += dot(p3, p3.yzx + 33.33);\n return fract((p3.xx + p3.yz) * p3.zy);\n}\n\n// Stochastic cell size, in texture tiles. A cell wants to be a tile or two across\n// so it randomises PATCHES; a third of a tile (the bare 3.4641 constant on tiled\n// UVs) goes sub-pixel almost at once and the repeat grid comes straight back.\n#define SF_CELL_TILES 1.5\n\nvoid sfTriGrid(vec2 uv, out vec3 w, out vec2 v1, out vec2 v2, out vec2 v3) {\n w = vec3(0.0);\n v1 = vec2(0.0);\n v2 = vec2(0.0);\n v3 = vec2(0.0);\n vec2 skewed = mat2(1.0, 0.0, -0.57735027, 1.15470054) * (uv * (3.4641016 / SF_CELL_TILES));\n vec2 base = floor(skewed);\n vec3 t = vec3(fract(skewed), 0.0);\n t.z = 1.0 - t.x - t.y;\n if (t.z > 0.0) {\n w = vec3(t.z, t.y, t.x);\n v1 = base;\n v2 = base + vec2(0.0, 1.0);\n v3 = base + vec2(1.0, 0.0);\n } else {\n w = vec3(-t.z, 1.0 - t.y, 1.0 - t.x);\n v1 = base + vec2(1.0, 1.0);\n v2 = base + vec2(1.0, 0.0);\n v3 = base + vec2(0.0, 1.0);\n }\n}\n\n/**\n * One layer of an array, tiled without a visible repeat grid: three taps at\n * hashed offsets, weighted by the barycentric position in a triangle cell, with a\n * variance-preserving blend (a plain weighted sum washes contrast toward the\n * mean). mean is the layer's mean in the space the sampler returns.\n *\n * The UV gradients are passed in, not taken here. Which layer a pixel samples is\n * decided per pixel, so this is called from non-uniform control flow, where\n * dFdx / dFdy are undefined. The caller takes the derivatives of the world\n * position once, at the top of main, and scales them by the layer's tiling.\n *\n * THE FOOTPRINT FADE IS NOT OPTIONAL. Once a cell is about a pixel the three taps\n * land in unrelated parts of the texture, the correction amplifies the\n * difference, and the far field becomes black speckle that looks exactly like\n * shadow acne. Past the fade this is a plain mip-mapped sample.\n */\nvec4 sfSample(sampler2DArray tex, vec2 uv, vec2 dx, vec2 dy, float layer, vec4 mean) {\n vec4 result = vec4(0.0);\n float footprint = max(length(dx), length(dy)) * (3.4641016 / SF_CELL_TILES);\n float fade = smoothstep(0.45, 1.10, footprint);\n if (fade > 0.995) {\n result = textureGrad(tex, vec3(uv, layer), dx, dy);\n } else {\n vec3 w;\n vec2 v1, v2, v3;\n sfTriGrid(uv, w, v1, v2, v3);\n vec4 c1 = textureGrad(tex, vec3(uv + sfHash2(v1), layer), dx, dy);\n vec4 c2 = textureGrad(tex, vec3(uv + sfHash2(v2), layer), dx, dy);\n vec4 c3 = textureGrad(tex, vec3(uv + sfHash2(v3), layer), dx, dy);\n vec4 d = w.x * (c1 - mean) + w.y * (c2 - mean) + w.z * (c3 - mean);\n result = clamp(mean + d * inversesqrt(max(dot(w, w), 1e-4)), 0.0, 1.0);\n if (fade >= 0.005) {\n result = mix(result, textureGrad(tex, vec3(uv, layer), dx, dy), fade);\n }\n }\n return result;\n}\n\n/** Tangent-space normal from an RGB texel, XY scaled by strength. */\nvec3 sfUnpackNormal(vec3 rgb, float strength) {\n vec3 t = rgb * 2.0 - 1.0;\n t.xy *= strength;\n return t;\n}\n\n/**\n * Whiteout blend of a tangent-space normal onto a world normal n, for a texture\n * projected from above (uv = world xz / tile). Tangent +x is world +x and\n * tangent +y is world +z, which is the mapping a top-down projection gives.\n * Returns an UNnormalised world normal so several layers can be summed and\n * normalised once.\n */\nvec3 sfWhiteoutTop(vec3 n, vec3 t) {\n return vec3(t.x + n.x, abs(t.z) * n.y, t.y + n.z);\n}\n\n/** The same for side projections, used by the biplanar rock layer.\n * X plane: uv = world zy. Z plane: uv = world xy. */\nvec3 sfWhiteoutX(vec3 n, vec3 t) {\n vec3 r = vec3(t.xy + n.zy, abs(t.z) * n.x);\n return r.zyx;\n}\nvec3 sfWhiteoutZ(vec3 n, vec3 t) {\n return vec3(t.xy + n.xy, abs(t.z) * n.z);\n}\n";
21
+ //# sourceMappingURL=surfaceCore.glsl.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"surfaceCore.glsl.d.ts","sourceRoot":"","sources":["../../../src/shaders/glsl/surfaceCore.glsl.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,eAAe,s2HAoG3B,CAAA"}
@@ -0,0 +1,120 @@
1
+ /**
2
+ * Surface sampling for splat-textured ground — texture arrays, stochastic tiling,
3
+ * height blending inputs and normal blending.
4
+ *
5
+ * Taken from the landscape module (`landscapeCore.glsl.ts`), where every piece of
6
+ * it was debugged by rendering. It is the terrain's now; the landscape keeps its
7
+ * own copy until it is retired. Everything is `sf`-prefixed so it can sit beside
8
+ * three's `<common>` and the terrain chunks.
9
+ *
10
+ * Needs GLSL ES 3.0 (`sampler2DArray`, `textureGrad`). three r163+ compiles every
11
+ * non-raw ShaderMaterial as `#version 300 es` with a `texture2D -> texture`
12
+ * define, so this works with no `glslVersion` override — and setting one would
13
+ * remove the `gl_FragColor` alias the terrain fragment writes to.
14
+ *
15
+ * Single exit and initialised results throughout: ANGLE on Windows rewrites early
16
+ * returns, and D3D then warns X4000 about the function's own result.
17
+ *
18
+ * A backtick inside this template literal terminates the string.
19
+ */
20
+ export const surfaceSampling = /* glsl */ `
21
+ // Arithmetic hash. Never fract(sin(dot(...))).
22
+ vec2 sfHash2(vec2 p) {
23
+ vec3 p3 = fract(vec3(p.xyx) * vec3(0.1031, 0.1030, 0.0973));
24
+ p3 += dot(p3, p3.yzx + 33.33);
25
+ return fract((p3.xx + p3.yz) * p3.zy);
26
+ }
27
+
28
+ // Stochastic cell size, in texture tiles. A cell wants to be a tile or two across
29
+ // so it randomises PATCHES; a third of a tile (the bare 3.4641 constant on tiled
30
+ // UVs) goes sub-pixel almost at once and the repeat grid comes straight back.
31
+ #define SF_CELL_TILES 1.5
32
+
33
+ void sfTriGrid(vec2 uv, out vec3 w, out vec2 v1, out vec2 v2, out vec2 v3) {
34
+ w = vec3(0.0);
35
+ v1 = vec2(0.0);
36
+ v2 = vec2(0.0);
37
+ v3 = vec2(0.0);
38
+ vec2 skewed = mat2(1.0, 0.0, -0.57735027, 1.15470054) * (uv * (3.4641016 / SF_CELL_TILES));
39
+ vec2 base = floor(skewed);
40
+ vec3 t = vec3(fract(skewed), 0.0);
41
+ t.z = 1.0 - t.x - t.y;
42
+ if (t.z > 0.0) {
43
+ w = vec3(t.z, t.y, t.x);
44
+ v1 = base;
45
+ v2 = base + vec2(0.0, 1.0);
46
+ v3 = base + vec2(1.0, 0.0);
47
+ } else {
48
+ w = vec3(-t.z, 1.0 - t.y, 1.0 - t.x);
49
+ v1 = base + vec2(1.0, 1.0);
50
+ v2 = base + vec2(1.0, 0.0);
51
+ v3 = base + vec2(0.0, 1.0);
52
+ }
53
+ }
54
+
55
+ /**
56
+ * One layer of an array, tiled without a visible repeat grid: three taps at
57
+ * hashed offsets, weighted by the barycentric position in a triangle cell, with a
58
+ * variance-preserving blend (a plain weighted sum washes contrast toward the
59
+ * mean). mean is the layer's mean in the space the sampler returns.
60
+ *
61
+ * The UV gradients are passed in, not taken here. Which layer a pixel samples is
62
+ * decided per pixel, so this is called from non-uniform control flow, where
63
+ * dFdx / dFdy are undefined. The caller takes the derivatives of the world
64
+ * position once, at the top of main, and scales them by the layer's tiling.
65
+ *
66
+ * THE FOOTPRINT FADE IS NOT OPTIONAL. Once a cell is about a pixel the three taps
67
+ * land in unrelated parts of the texture, the correction amplifies the
68
+ * difference, and the far field becomes black speckle that looks exactly like
69
+ * shadow acne. Past the fade this is a plain mip-mapped sample.
70
+ */
71
+ vec4 sfSample(sampler2DArray tex, vec2 uv, vec2 dx, vec2 dy, float layer, vec4 mean) {
72
+ vec4 result = vec4(0.0);
73
+ float footprint = max(length(dx), length(dy)) * (3.4641016 / SF_CELL_TILES);
74
+ float fade = smoothstep(0.45, 1.10, footprint);
75
+ if (fade > 0.995) {
76
+ result = textureGrad(tex, vec3(uv, layer), dx, dy);
77
+ } else {
78
+ vec3 w;
79
+ vec2 v1, v2, v3;
80
+ sfTriGrid(uv, w, v1, v2, v3);
81
+ vec4 c1 = textureGrad(tex, vec3(uv + sfHash2(v1), layer), dx, dy);
82
+ vec4 c2 = textureGrad(tex, vec3(uv + sfHash2(v2), layer), dx, dy);
83
+ vec4 c3 = textureGrad(tex, vec3(uv + sfHash2(v3), layer), dx, dy);
84
+ vec4 d = w.x * (c1 - mean) + w.y * (c2 - mean) + w.z * (c3 - mean);
85
+ result = clamp(mean + d * inversesqrt(max(dot(w, w), 1e-4)), 0.0, 1.0);
86
+ if (fade >= 0.005) {
87
+ result = mix(result, textureGrad(tex, vec3(uv, layer), dx, dy), fade);
88
+ }
89
+ }
90
+ return result;
91
+ }
92
+
93
+ /** Tangent-space normal from an RGB texel, XY scaled by strength. */
94
+ vec3 sfUnpackNormal(vec3 rgb, float strength) {
95
+ vec3 t = rgb * 2.0 - 1.0;
96
+ t.xy *= strength;
97
+ return t;
98
+ }
99
+
100
+ /**
101
+ * Whiteout blend of a tangent-space normal onto a world normal n, for a texture
102
+ * projected from above (uv = world xz / tile). Tangent +x is world +x and
103
+ * tangent +y is world +z, which is the mapping a top-down projection gives.
104
+ * Returns an UNnormalised world normal so several layers can be summed and
105
+ * normalised once.
106
+ */
107
+ vec3 sfWhiteoutTop(vec3 n, vec3 t) {
108
+ return vec3(t.x + n.x, abs(t.z) * n.y, t.y + n.z);
109
+ }
110
+
111
+ /** The same for side projections, used by the biplanar rock layer.
112
+ * X plane: uv = world zy. Z plane: uv = world xy. */
113
+ vec3 sfWhiteoutX(vec3 n, vec3 t) {
114
+ vec3 r = vec3(t.xy + n.zy, abs(t.z) * n.x);
115
+ return r.zyx;
116
+ }
117
+ vec3 sfWhiteoutZ(vec3 n, vec3 t) {
118
+ return vec3(t.xy + n.xy, abs(t.z) * n.z);
119
+ }
120
+ `;