@pinkaphant/kolmo 0.3.0 → 0.4.0

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 (393) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +36 -36
  3. package/bin/kolmo.mjs +11 -5
  4. package/dist/engine/causewayBridge.d.ts +14 -0
  5. package/dist/engine/causewayBridge.js +166 -0
  6. package/dist/engine/causewayBridge.js.map +1 -0
  7. package/dist/engine/index.d.ts +6 -4
  8. package/dist/engine/index.js +19 -12
  9. package/dist/engine/index.js.map +1 -0
  10. package/dist/engine/islandSettlementMesh.d.ts +26 -0
  11. package/dist/engine/islandSettlementMesh.js +166 -0
  12. package/dist/engine/islandSettlementMesh.js.map +1 -0
  13. package/dist/engine/kolmoActions.d.ts +23 -0
  14. package/dist/engine/kolmoActions.js +164 -0
  15. package/dist/engine/kolmoActions.js.map +1 -0
  16. package/dist/engine/kolmoActor.js +241 -206
  17. package/dist/engine/kolmoActor.js.map +1 -0
  18. package/dist/engine/kolmoFloatingOrigin.d.ts +17 -0
  19. package/dist/engine/kolmoFloatingOrigin.js +98 -0
  20. package/dist/engine/kolmoFloatingOrigin.js.map +1 -0
  21. package/dist/engine/kolmoGame.d.ts +27 -0
  22. package/dist/engine/kolmoGame.js +80 -0
  23. package/dist/engine/kolmoGame.js.map +1 -0
  24. package/dist/engine/kolmoHud.d.ts +23 -0
  25. package/dist/engine/kolmoHud.js +195 -0
  26. package/dist/engine/kolmoHud.js.map +1 -0
  27. package/dist/engine/kolmoInput.d.ts +1 -1
  28. package/dist/engine/kolmoInput.js +57 -30
  29. package/dist/engine/kolmoInput.js.map +1 -0
  30. package/dist/engine/kolmoIsland.d.ts +5 -10
  31. package/dist/engine/kolmoIsland.js +182 -250
  32. package/dist/engine/kolmoIsland.js.map +1 -0
  33. package/dist/engine/kolmoLongDrive.d.ts +3 -4
  34. package/dist/engine/kolmoLongDrive.js +139 -249
  35. package/dist/engine/kolmoLongDrive.js.map +1 -0
  36. package/dist/engine/kolmoPilotMesh.d.ts +2 -0
  37. package/dist/engine/kolmoPilotMesh.js +64 -0
  38. package/dist/engine/kolmoPilotMesh.js.map +1 -0
  39. package/dist/engine/kolmoProcedural.d.ts +13 -0
  40. package/dist/engine/kolmoProcedural.js +101 -0
  41. package/dist/engine/kolmoProcedural.js.map +1 -0
  42. package/dist/engine/kolmoRigs.d.ts +1 -1
  43. package/dist/engine/kolmoRigs.js +88 -47
  44. package/dist/engine/kolmoRigs.js.map +1 -0
  45. package/dist/engine/kolmoStore.d.ts +3 -101
  46. package/dist/engine/kolmoSurface.d.ts +2 -2
  47. package/dist/engine/kolmoSurface.js +150 -134
  48. package/dist/engine/kolmoSurface.js.map +1 -0
  49. package/dist/engine/kolmoTraits.d.ts +128 -0
  50. package/dist/engine/kolmoTraits.js +140 -0
  51. package/dist/engine/kolmoTraits.js.map +1 -0
  52. package/dist/engine/kolmoVehicle.d.ts +3 -33
  53. package/dist/engine/kolmoVehicle.js +66 -253
  54. package/dist/engine/kolmoVehicle.js.map +1 -0
  55. package/dist/engine/kolmoVehicleConfig.d.ts +54 -0
  56. package/dist/engine/kolmoVehicleConfig.js +80 -0
  57. package/dist/engine/kolmoVehicleConfig.js.map +1 -0
  58. package/dist/engine/kolmoVehicleDriver.d.ts +8 -13
  59. package/dist/engine/kolmoVehicleDriver.js +116 -42
  60. package/dist/engine/kolmoVehicleDriver.js.map +1 -0
  61. package/dist/engine/kolmoVehicleInner.d.ts +7 -0
  62. package/dist/engine/kolmoVehicleInner.js +261 -0
  63. package/dist/engine/kolmoVehicleInner.js.map +1 -0
  64. package/dist/engine/kolmoWorld.d.ts +6 -4
  65. package/dist/engine/kolmoWorld.js +134 -136
  66. package/dist/engine/kolmoWorld.js.map +1 -0
  67. package/dist/engine/longDriveKit.d.ts +5 -12
  68. package/dist/engine/longDriveKit.js +121 -233
  69. package/dist/engine/longDriveKit.js.map +1 -0
  70. package/dist/engine/longDriveRoadside.d.ts +16 -0
  71. package/dist/engine/longDriveRoadside.js +171 -0
  72. package/dist/engine/longDriveRoadside.js.map +1 -0
  73. package/dist/engine/macroCellBuilder.d.ts +34 -0
  74. package/dist/engine/macroCellBuilder.js +145 -0
  75. package/dist/engine/macroCellBuilder.js.map +1 -0
  76. package/dist/engine/mainlandMacroCell.d.ts +2 -2
  77. package/dist/engine/mainlandMacroCell.js +77 -165
  78. package/dist/engine/mainlandMacroCell.js.map +1 -0
  79. package/dist/engine/shiftedFixedBody.d.ts +1 -1
  80. package/dist/engine/shiftedFixedBody.js +55 -28
  81. package/dist/engine/shiftedFixedBody.js.map +1 -0
  82. package/dist/importer/ChopShopPanel.d.ts +10 -32
  83. package/dist/importer/ChopShopPanel.js +320 -470
  84. package/dist/importer/ChopShopPanel.js.map +1 -0
  85. package/dist/importer/DomainWorkshopPanel.d.ts +2 -1
  86. package/dist/importer/DomainWorkshopPanel.js +172 -242
  87. package/dist/importer/DomainWorkshopPanel.js.map +1 -0
  88. package/dist/importer/GateHudBar.d.ts +8 -3
  89. package/dist/importer/GateHudBar.js +289 -284
  90. package/dist/importer/GateHudBar.js.map +1 -0
  91. package/dist/importer/GlbImportGate.d.ts +2 -1
  92. package/dist/importer/GlbImportGate.js +252 -261
  93. package/dist/importer/GlbImportGate.js.map +1 -0
  94. package/dist/importer/ImperativeVehicleRig.d.ts +2 -2
  95. package/dist/importer/ImperativeVehicleRig.js +223 -284
  96. package/dist/importer/ImperativeVehicleRig.js.map +1 -0
  97. package/dist/importer/LiveDrivePads.d.ts +20 -0
  98. package/dist/importer/LiveDrivePads.js +169 -0
  99. package/dist/importer/LiveDrivePads.js.map +1 -0
  100. package/dist/importer/PaperShellDebrisRig.d.ts +25 -0
  101. package/dist/importer/PaperShellDebrisRig.js +143 -0
  102. package/dist/importer/PaperShellDebrisRig.js.map +1 -0
  103. package/dist/importer/R2VaultDrawer.d.ts +12 -0
  104. package/dist/importer/R2VaultDrawer.js +90 -0
  105. package/dist/importer/R2VaultDrawer.js.map +1 -0
  106. package/dist/importer/Step1CalibrationPlinth.d.ts +23 -15
  107. package/dist/importer/Step1CalibrationPlinth.js +180 -313
  108. package/dist/importer/Step1CalibrationPlinth.js.map +1 -0
  109. package/dist/importer/Step1ExplodedIslands.d.ts +31 -0
  110. package/dist/importer/Step1ExplodedIslands.js +144 -0
  111. package/dist/importer/Step1ExplodedIslands.js.map +1 -0
  112. package/dist/importer/Step2UniversalPad.d.ts +7 -14
  113. package/dist/importer/Step2UniversalPad.js +54 -197
  114. package/dist/importer/Step2UniversalPad.js.map +1 -0
  115. package/dist/importer/VfxEmitterPool.js +59 -86
  116. package/dist/importer/VfxEmitterPool.js.map +1 -0
  117. package/dist/importer/WheelRingHandles3D.d.ts +11 -0
  118. package/dist/importer/WheelRingHandles3D.js +318 -0
  119. package/dist/importer/WheelRingHandles3D.js.map +1 -0
  120. package/dist/importer/archLinerGeom.d.ts +2 -0
  121. package/dist/importer/archLinerGeom.js +51 -0
  122. package/dist/importer/archLinerGeom.js.map +1 -0
  123. package/dist/importer/{vehiclePanelAnim.d.ts → chopHingeHelpers.d.ts} +0 -10
  124. package/dist/importer/chopHingeHelpers.js +193 -0
  125. package/dist/importer/chopHingeHelpers.js.map +1 -0
  126. package/dist/importer/chopShopActions.d.ts +20 -32
  127. package/dist/importer/chopShopActions.js +138 -238
  128. package/dist/importer/chopShopActions.js.map +1 -0
  129. package/dist/importer/chopShopHandlers.d.ts +26 -0
  130. package/dist/importer/chopShopHandlers.js +276 -0
  131. package/dist/importer/chopShopHandlers.js.map +1 -0
  132. package/dist/importer/chopShopIoActions.d.ts +15 -0
  133. package/dist/importer/chopShopIoActions.js +137 -0
  134. package/dist/importer/chopShopIoActions.js.map +1 -0
  135. package/dist/importer/chopShopMcpAction.d.ts +18 -0
  136. package/dist/importer/chopShopMcpAction.js +58 -0
  137. package/dist/importer/chopShopMcpAction.js.map +1 -0
  138. package/dist/importer/cylinderBooleanSlice.d.ts +14 -0
  139. package/dist/importer/cylinderBooleanSlice.js +110 -0
  140. package/dist/importer/cylinderBooleanSlice.js.map +1 -0
  141. package/dist/importer/cylinderSliceMath.d.ts +14 -0
  142. package/dist/importer/cylinderSliceMath.js +251 -0
  143. package/dist/importer/cylinderSliceMath.js.map +1 -0
  144. package/dist/importer/fusedWheelDetect.d.ts +4 -0
  145. package/dist/importer/fusedWheelDetect.js +175 -0
  146. package/dist/importer/fusedWheelDetect.js.map +1 -0
  147. package/dist/importer/fusedWheelFit.d.ts +13 -0
  148. package/dist/importer/fusedWheelFit.js +138 -0
  149. package/dist/importer/fusedWheelFit.js.map +1 -0
  150. package/dist/importer/gateStore.d.ts +3 -6
  151. package/dist/importer/gateStore.js +36 -30
  152. package/dist/importer/gateStore.js.map +1 -0
  153. package/dist/importer/glbNormalizer.d.ts +1 -10
  154. package/dist/importer/glbNormalizer.js +120 -146
  155. package/dist/importer/glbNormalizer.js.map +1 -0
  156. package/dist/importer/importerWebMcp.d.ts +4 -3
  157. package/dist/importer/importerWebMcp.js +41 -339
  158. package/dist/importer/importerWebMcp.js.map +1 -0
  159. package/dist/importer/importerWebMcpTools.d.ts +2 -0
  160. package/dist/importer/importerWebMcpTools.js +340 -0
  161. package/dist/importer/importerWebMcpTools.js.map +1 -0
  162. package/dist/importer/index.d.ts +6 -4
  163. package/dist/importer/index.js +32 -25
  164. package/dist/importer/index.js.map +1 -0
  165. package/dist/importer/khrCarPlanHelpers.d.ts +28 -0
  166. package/dist/importer/khrCarPlanHelpers.js +221 -0
  167. package/dist/importer/khrCarPlanHelpers.js.map +1 -0
  168. package/dist/importer/khrCarPlanner.d.ts +7 -0
  169. package/dist/importer/khrCarPlanner.js +279 -0
  170. package/dist/importer/khrCarPlanner.js.map +1 -0
  171. package/dist/importer/khrCompiler.d.ts +4 -41
  172. package/dist/importer/khrCompiler.js +56 -673
  173. package/dist/importer/khrCompiler.js.map +1 -0
  174. package/dist/importer/khrCraftPropCompiler.d.ts +40 -0
  175. package/dist/importer/khrCraftPropCompiler.js +250 -0
  176. package/dist/importer/khrCraftPropCompiler.js.map +1 -0
  177. package/dist/importer/launcherBake.js +76 -39
  178. package/dist/importer/launcherBake.js.map +1 -0
  179. package/dist/importer/meshIslands.d.ts +4 -50
  180. package/dist/importer/meshIslands.js +84 -288
  181. package/dist/importer/meshIslands.js.map +1 -0
  182. package/dist/importer/meshSliceBuffers.d.ts +15 -0
  183. package/dist/importer/meshSliceBuffers.js +159 -0
  184. package/dist/importer/meshSliceBuffers.js.map +1 -0
  185. package/dist/importer/polygonEarClipYZ.d.ts +3 -0
  186. package/dist/importer/polygonEarClipYZ.js +67 -0
  187. package/dist/importer/polygonEarClipYZ.js.map +1 -0
  188. package/dist/importer/sceneSiNormalize.d.ts +19 -0
  189. package/dist/importer/sceneSiNormalize.js +138 -0
  190. package/dist/importer/sceneSiNormalize.js.map +1 -0
  191. package/dist/importer/starterScene.d.ts +3 -0
  192. package/dist/importer/starterScene.js +76 -0
  193. package/dist/importer/starterScene.js.map +1 -0
  194. package/dist/importer/surfaceCutter.d.ts +5 -25
  195. package/dist/importer/surfaceCutter.js +70 -334
  196. package/dist/importer/surfaceCutter.js.map +1 -0
  197. package/dist/importer/surfaceGeodesic.d.ts +7 -0
  198. package/dist/importer/surfaceGeodesic.js +130 -0
  199. package/dist/importer/surfaceGeodesic.js.map +1 -0
  200. package/dist/importer/surfaceLoopRefine.d.ts +6 -0
  201. package/dist/importer/surfaceLoopRefine.js +171 -0
  202. package/dist/importer/surfaceLoopRefine.js.map +1 -0
  203. package/dist/importer/surfacePeel.d.ts +11 -0
  204. package/dist/importer/surfacePeel.js +119 -0
  205. package/dist/importer/surfacePeel.js.map +1 -0
  206. package/dist/importer/surfaceTopology.d.ts +4 -19
  207. package/dist/importer/surfaceTopology.js +92 -160
  208. package/dist/importer/surfaceTopology.js.map +1 -0
  209. package/dist/importer/universalGateBake.d.ts +7 -9
  210. package/dist/importer/universalGateBake.js +104 -109
  211. package/dist/importer/universalGateBake.js.map +1 -0
  212. package/dist/importer/usdPhysicsSpecs.d.ts +3 -0
  213. package/dist/importer/usdPhysicsSpecs.js +245 -0
  214. package/dist/importer/usdPhysicsSpecs.js.map +1 -0
  215. package/dist/importer/usdTextParse.d.ts +12 -0
  216. package/dist/importer/usdTextParse.js +118 -0
  217. package/dist/importer/usdTextParse.js.map +1 -0
  218. package/dist/importer/usdToGlb.d.ts +3 -2
  219. package/dist/importer/usdToGlb.js +80 -292
  220. package/dist/importer/usdToGlb.js.map +1 -0
  221. package/dist/importer/useChopShopController.d.ts +51 -74
  222. package/dist/importer/useChopShopController.js +157 -453
  223. package/dist/importer/useChopShopController.js.map +1 -0
  224. package/dist/importer/useChopShopState.d.ts +103 -0
  225. package/dist/importer/useChopShopState.js +319 -0
  226. package/dist/importer/useChopShopState.js.map +1 -0
  227. package/dist/importer/useWasdKeyRef.d.ts +9 -0
  228. package/dist/importer/useWasdKeyRef.js +35 -0
  229. package/dist/importer/useWasdKeyRef.js.map +1 -0
  230. package/dist/importer/vehiclePartSplit.d.ts +33 -0
  231. package/dist/importer/vehiclePartSplit.js +178 -0
  232. package/dist/importer/vehiclePartSplit.js.map +1 -0
  233. package/dist/importer/wheelAxlePairing.d.ts +1 -3
  234. package/dist/importer/wheelAxlePairing.js +106 -119
  235. package/dist/importer/wheelAxlePairing.js.map +1 -0
  236. package/dist/importer/wheelCutterHelpers.d.ts +42 -0
  237. package/dist/importer/wheelCutterHelpers.js +178 -0
  238. package/dist/importer/wheelCutterHelpers.js.map +1 -0
  239. package/dist/importer/wheelRingHandleMath.d.ts +20 -0
  240. package/dist/importer/wheelRingHandleMath.js +66 -0
  241. package/dist/importer/wheelRingHandleMath.js.map +1 -0
  242. package/dist/index.d.ts +3 -2
  243. package/dist/index.js +90 -69
  244. package/dist/index.js.map +1 -0
  245. package/dist/junk/DestructibleTarget.d.ts +3 -3
  246. package/dist/junk/DestructibleTarget.js +177 -114
  247. package/dist/junk/DestructibleTarget.js.map +1 -0
  248. package/dist/junk/KolmoJunk.js +55 -44
  249. package/dist/junk/KolmoJunk.js.map +1 -0
  250. package/dist/junk/ShardPieces.d.ts +2 -1
  251. package/dist/junk/ShardPieces.js +80 -61
  252. package/dist/junk/ShardPieces.js.map +1 -0
  253. package/dist/junk/TargetDecals.d.ts +6 -15
  254. package/dist/junk/TargetDecals.js +66 -40
  255. package/dist/junk/TargetDecals.js.map +1 -0
  256. package/dist/junk/bvhShatter.d.ts +2 -6
  257. package/dist/junk/bvhShatter.js +89 -43
  258. package/dist/junk/bvhShatter.js.map +1 -0
  259. package/dist/junk/bvhTriCollector.d.ts +2 -6
  260. package/dist/junk/bvhTriCollector.js +111 -62
  261. package/dist/junk/bvhTriCollector.js.map +1 -0
  262. package/dist/junk/index.d.ts +2 -2
  263. package/dist/junk/index.js +11 -11
  264. package/dist/junk/index.js.map +1 -0
  265. package/dist/junk/junkGeometry.d.ts +5 -26
  266. package/dist/junk/junkGeometry.js +61 -43
  267. package/dist/junk/junkGeometry.js.map +1 -0
  268. package/dist/junk/junkImportSanitize.d.ts +4 -5
  269. package/dist/junk/junkImportSanitize.js +57 -37
  270. package/dist/junk/junkImportSanitize.js.map +1 -0
  271. package/dist/junk/junkImporter.d.ts +2 -13
  272. package/dist/junk/junkImporter.js +105 -76
  273. package/dist/junk/junkImporter.js.map +1 -0
  274. package/dist/junk/junkLabelCanvas.d.ts +1 -6
  275. package/dist/junk/junkLabelCanvas.js +147 -29
  276. package/dist/junk/junkLabelCanvas.js.map +1 -0
  277. package/dist/junk/junkLabels.d.ts +4 -26
  278. package/dist/junk/junkLabels.js +42 -28
  279. package/dist/junk/junkLabels.js.map +1 -0
  280. package/dist/junk/targetHelpers.d.ts +3 -4
  281. package/dist/junk/targetHelpers.js +121 -67
  282. package/dist/junk/targetHelpers.js.map +1 -0
  283. package/dist/junk/targetHitLogic.d.ts +8 -8
  284. package/dist/junk/targetHitLogic.js +131 -95
  285. package/dist/junk/targetHitLogic.js.map +1 -0
  286. package/dist/junk/useTargetAssets.d.ts +9 -14
  287. package/dist/junk/useTargetAssets.js +113 -85
  288. package/dist/junk/useTargetAssets.js.map +1 -0
  289. package/dist/physics/index.d.ts +1 -8
  290. package/dist/physics/index.js +80 -85
  291. package/dist/physics/index.js.map +1 -0
  292. package/dist/schema/kolmoSchema.d.ts +3 -64
  293. package/dist/schema/kolmoSchema.js +75 -149
  294. package/dist/schema/kolmoSchema.js.map +1 -0
  295. package/dist/schema/kolmoStamp.d.ts +6 -0
  296. package/dist/schema/kolmoStamp.js +71 -0
  297. package/dist/schema/kolmoStamp.js.map +1 -0
  298. package/dist/schema/kolmoTypes.d.ts +63 -0
  299. package/dist/schema/kolmoTypes.js +66 -0
  300. package/dist/schema/kolmoTypes.js.map +1 -0
  301. package/dist/shaders/celestialBackdrop.d.ts +2 -10
  302. package/dist/shaders/celestialBackdrop.js +128 -291
  303. package/dist/shaders/celestialBackdrop.js.map +1 -0
  304. package/dist/shaders/emitterShaders.d.ts +9 -0
  305. package/dist/shaders/emitterShaders.js +114 -0
  306. package/dist/shaders/emitterShaders.js.map +1 -0
  307. package/dist/shaders/index.d.ts +1 -1
  308. package/dist/shaders/index.js +12 -9
  309. package/dist/shaders/index.js.map +1 -0
  310. package/dist/shaders/plumeAndSparkle.d.ts +2 -4
  311. package/dist/shaders/plumeAndSparkle.js +152 -191
  312. package/dist/shaders/plumeAndSparkle.js.map +1 -0
  313. package/dist/shaders/ps2GlslShared.js +29 -2
  314. package/dist/shaders/ps2GlslShared.js.map +1 -0
  315. package/dist/shaders/ps2MaterialsTSL.js +132 -51
  316. package/dist/shaders/ps2MaterialsTSL.js.map +1 -0
  317. package/dist/shaders/ps2MaterialsWebGL.js +45 -28
  318. package/dist/shaders/ps2MaterialsWebGL.js.map +1 -0
  319. package/dist/shaders/ps2RoadWebGL.js +69 -32
  320. package/dist/shaders/ps2RoadWebGL.js.map +1 -0
  321. package/dist/shaders/ps2TerrainWebGL.js +107 -30
  322. package/dist/shaders/ps2TerrainWebGL.js.map +1 -0
  323. package/dist/shaders/ps2Textures.d.ts +1 -1
  324. package/dist/shaders/ps2Textures.js +116 -41
  325. package/dist/shaders/ps2Textures.js.map +1 -0
  326. package/dist/shaders/retroPalettes.d.ts +1 -1
  327. package/dist/shaders/retroPalettes.js +90 -57
  328. package/dist/shaders/retroPalettes.js.map +1 -0
  329. package/dist/shaders/retroShader.d.ts +2 -86
  330. package/dist/shaders/retroShader.js +65 -196
  331. package/dist/shaders/retroShader.js.map +1 -0
  332. package/dist/shaders/retroUniforms.d.ts +60 -0
  333. package/dist/shaders/retroUniforms.js +215 -0
  334. package/dist/shaders/retroUniforms.js.map +1 -0
  335. package/dist/shaders/skyboxShaders.d.ts +16 -0
  336. package/dist/shaders/skyboxShaders.js +266 -0
  337. package/dist/shaders/skyboxShaders.js.map +1 -0
  338. package/dist/shaders/tsl.d.ts +1 -1
  339. package/dist/shaders/tsl.js.map +1 -0
  340. package/dist/vite/index.js +39 -23
  341. package/dist/vite/index.js.map +1 -0
  342. package/dist/world/frontage.js +25 -21
  343. package/dist/world/frontage.js.map +1 -0
  344. package/dist/world/index.d.ts +4 -4
  345. package/dist/world/index.js +12 -11
  346. package/dist/world/index.js.map +1 -0
  347. package/dist/world/infiniteWorld2D.d.ts +0 -5
  348. package/dist/world/infiniteWorld2D.js +175 -200
  349. package/dist/world/infiniteWorld2D.js.map +1 -0
  350. package/dist/world/island.js +81 -166
  351. package/dist/world/island.js.map +1 -0
  352. package/dist/world/islandPathing.d.ts +6 -0
  353. package/dist/world/islandPathing.js +166 -0
  354. package/dist/world/islandPathing.js.map +1 -0
  355. package/dist/world/macroCellSchema.js +15 -8
  356. package/dist/world/macroCellSchema.js.map +1 -0
  357. package/dist/world/macroKnightAStar.js +140 -71
  358. package/dist/world/macroKnightAStar.js.map +1 -0
  359. package/dist/world/macroSettlementZones.d.ts +9 -0
  360. package/dist/world/macroSettlementZones.js +108 -0
  361. package/dist/world/macroSettlementZones.js.map +1 -0
  362. package/dist/world/random.js +50 -24
  363. package/dist/world/random.js.map +1 -0
  364. package/dist/world/road.js +152 -90
  365. package/dist/world/road.js.map +1 -0
  366. package/dist/world/roadRibbon.d.ts +4 -19
  367. package/dist/world/roadRibbon.js +129 -124
  368. package/dist/world/roadRibbon.js.map +1 -0
  369. package/dist/world/terrain.d.ts +1 -1
  370. package/dist/world/terrain.js +111 -65
  371. package/dist/world/terrain.js.map +1 -0
  372. package/dist/world/terrainGeometry.d.ts +14 -0
  373. package/dist/world/terrainGeometry.js +76 -0
  374. package/dist/world/terrainGeometry.js.map +1 -0
  375. package/dist/world/worldTypes.d.ts +3 -3
  376. package/dist/world/worldTypes.js +133 -67
  377. package/dist/world/worldTypes.js.map +1 -0
  378. package/docs/api-reference.md +187 -0
  379. package/package.json +58 -32
  380. package/dist/engine/kolmoStore.js +0 -247
  381. package/dist/importer/CabinPreviewRig.d.ts +0 -13
  382. package/dist/importer/CabinPreviewRig.js +0 -138
  383. package/dist/importer/CabinStepSection.d.ts +0 -17
  384. package/dist/importer/CabinStepSection.js +0 -222
  385. package/dist/importer/ImporterPlinthUikitTags.d.ts +0 -20
  386. package/dist/importer/ImporterPlinthUikitTags.js +0 -119
  387. package/dist/importer/cabinMeshBuilders.d.ts +0 -13
  388. package/dist/importer/cabinMeshBuilders.js +0 -104
  389. package/dist/importer/cabinMixamoRig.d.ts +0 -53
  390. package/dist/importer/cabinMixamoRig.js +0 -150
  391. package/dist/importer/chopShopUiComponents.d.ts +0 -22
  392. package/dist/importer/chopShopUiComponents.js +0 -91
  393. package/dist/importer/vehiclePanelAnim.js +0 -214
@@ -0,0 +1,215 @@
1
+ import { PALETTE_CRUNCHY_16, PALETTE_CRUNCHY_64, RETRO_COLOR_MODES, applyRetroFilteringToMaterial, applyRetroTextureFiltering, buildPaletteLutData, computeRetroDpr, getColorQuantVector, getPaletteLutTexture } from "./retroPalettes.js";
2
+ import * as THREE from "three";
3
+ // src/shaders/retroUniforms.ts
4
+ var PS1_SNAP_RESOLUTION = new THREE.Vector2(320, 180);
5
+ var RETRO_UNIFORMS = {
6
+ uPs1Grid: { value: PS1_SNAP_RESOLUTION },
7
+ uDitherMix: { value: .62 },
8
+ uSnapStrength: { value: 0 },
9
+ uDitherScale: { value: 2 },
10
+ uColorQuant: { value: getColorQuantVector("rgb555") },
11
+ uPaletteLut: { value: getPaletteLutTexture("fallback") },
12
+ uAffineStrength: { value: 0 },
13
+ uGouraudStrength: { value: 0 },
14
+ uN64FilterStrength: { value: 0 },
15
+ uN64TexSize: { value: 256 }
16
+ };
17
+ function getRetroShaderUniforms() {
18
+ return {
19
+ uPs1Grid: RETRO_UNIFORMS.uPs1Grid,
20
+ uDitherMix: RETRO_UNIFORMS.uDitherMix,
21
+ uSnapStrength: RETRO_UNIFORMS.uSnapStrength,
22
+ uDitherScale: RETRO_UNIFORMS.uDitherScale,
23
+ uColorQuant: RETRO_UNIFORMS.uColorQuant,
24
+ uPaletteLut: RETRO_UNIFORMS.uPaletteLut,
25
+ uAffineStrength: RETRO_UNIFORMS.uAffineStrength,
26
+ uGouraudStrength: RETRO_UNIFORMS.uGouraudStrength,
27
+ uN64FilterStrength: RETRO_UNIFORMS.uN64FilterStrength,
28
+ uN64TexSize: RETRO_UNIFORMS.uN64TexSize
29
+ };
30
+ }
31
+ var RETRO_PRESETS = [
32
+ {
33
+ id: "dreamcast",
34
+ label: "Nu-School Dreamcast",
35
+ renderScale: .67,
36
+ ditherAmount: .62,
37
+ pixelSnapAmount: 0,
38
+ colorMode: "rgb555",
39
+ ditherScale: 2,
40
+ affineAmount: 0,
41
+ gouraudAmount: 0,
42
+ n64FilterAmount: 0,
43
+ fogEnabled: false
44
+ },
45
+ {
46
+ id: "n64-emu-1080p",
47
+ label: "N64 Emu 1080p ('08)",
48
+ renderScale: 1,
49
+ ditherAmount: .32,
50
+ pixelSnapAmount: 0,
51
+ colorMode: "rgb555",
52
+ ditherScale: 1,
53
+ affineAmount: 0,
54
+ gouraudAmount: .9,
55
+ n64FilterAmount: 1,
56
+ fogEnabled: false
57
+ },
58
+ {
59
+ id: "n64-psx-hybrid",
60
+ label: "N64 Bouba × PSX Kiki",
61
+ renderScale: .56,
62
+ ditherAmount: .78,
63
+ pixelSnapAmount: .55,
64
+ colorMode: "rgb555",
65
+ ditherScale: 2,
66
+ affineAmount: 0,
67
+ gouraudAmount: .65,
68
+ n64FilterAmount: 1,
69
+ fogEnabled: false
70
+ },
71
+ {
72
+ id: "psx-plus",
73
+ label: "PSX++ Pixel Snap",
74
+ renderScale: .5,
75
+ ditherAmount: .85,
76
+ pixelSnapAmount: .68,
77
+ colorMode: "rgb555",
78
+ ditherScale: 2,
79
+ affineAmount: 0,
80
+ gouraudAmount: .45,
81
+ n64FilterAmount: 0,
82
+ fogEnabled: false
83
+ },
84
+ {
85
+ id: "ps2-shinobi",
86
+ label: "PS2 Shinobi",
87
+ renderScale: .58,
88
+ ditherAmount: .8,
89
+ pixelSnapAmount: 0,
90
+ colorMode: "rgb555",
91
+ ditherScale: 2,
92
+ affineAmount: 0,
93
+ gouraudAmount: .28,
94
+ n64FilterAmount: 0,
95
+ fogEnabled: false
96
+ },
97
+ {
98
+ id: "n64-ultra",
99
+ label: "N64 3-Point RDP",
100
+ renderScale: .5,
101
+ ditherAmount: .55,
102
+ pixelSnapAmount: 0,
103
+ colorMode: "rgb555",
104
+ ditherScale: 2,
105
+ affineAmount: 0,
106
+ gouraudAmount: .85,
107
+ n64FilterAmount: 1,
108
+ fogEnabled: false
109
+ },
110
+ {
111
+ id: "dsi-crisp",
112
+ label: "DSi Crisp",
113
+ renderScale: .5,
114
+ ditherAmount: .88,
115
+ pixelSnapAmount: .35,
116
+ colorMode: "rgb444",
117
+ ditherScale: 2,
118
+ affineAmount: 0,
119
+ gouraudAmount: .2,
120
+ n64FilterAmount: 0,
121
+ fogEnabled: false
122
+ },
123
+ {
124
+ id: "psx-chonk",
125
+ label: "PSX Full Chonk",
126
+ renderScale: .33,
127
+ ditherAmount: 1,
128
+ pixelSnapAmount: 1,
129
+ colorMode: "rgb555",
130
+ ditherScale: 2.5,
131
+ affineAmount: 0,
132
+ gouraudAmount: .65,
133
+ n64FilterAmount: 0,
134
+ fogEnabled: false
135
+ },
136
+ {
137
+ id: "psx-raw-1995",
138
+ label: "PSX 1995 Raw Affine",
139
+ renderScale: .33,
140
+ ditherAmount: 1,
141
+ pixelSnapAmount: 1,
142
+ colorMode: "rgb555",
143
+ ditherScale: 2.5,
144
+ affineAmount: 1,
145
+ gouraudAmount: 1,
146
+ n64FilterAmount: 0,
147
+ fogEnabled: false
148
+ },
149
+ {
150
+ id: "clean-hd",
151
+ label: "HD Remaster 1:1",
152
+ renderScale: 1,
153
+ ditherAmount: 0,
154
+ pixelSnapAmount: 0,
155
+ colorMode: "off",
156
+ ditherScale: 1,
157
+ affineAmount: 0,
158
+ gouraudAmount: 0,
159
+ n64FilterAmount: 0,
160
+ fogEnabled: false
161
+ }
162
+ ];
163
+ var RETRO_DREAMCAST = RETRO_PRESETS[0];
164
+ var RETRO_PSX_PLUS = RETRO_PRESETS[3];
165
+ var RETRO_PS2_SHINOBI = RETRO_PRESETS[4];
166
+ var RETRO_CLEAN_HD = RETRO_PRESETS[9];
167
+ function getRetroPreset(id) {
168
+ if (typeof id === "object") return id;
169
+ return RETRO_PRESETS.find((p) => p.id === id) ?? RETRO_PRESETS[0];
170
+ }
171
+ var vpWidth = 1280;
172
+ var vpHeight = 720;
173
+ var vpDpr = 1;
174
+ var curRenderScale = .67;
175
+ var curDitherScale = 2;
176
+ function recomputeSnapGrid() {
177
+ RETRO_UNIFORMS.uDitherScale.value = Math.max(1, Math.round(curDitherScale * vpDpr));
178
+ const t = THREE.MathUtils.clamp((curRenderScale - .33) / .67, 0, 1);
179
+ const snap = RETRO_UNIFORMS.uSnapStrength.value;
180
+ const targetLines = (180 + t * 180) * (1.18 - snap * .46);
181
+ const div = Math.max(1, Math.round(vpHeight / Math.max(90, targetLines)));
182
+ const gx = vpWidth / (2 * div), gy = vpHeight / (2 * div);
183
+ const minAxis = Math.min(gx, gy);
184
+ const boost = minAxis > 0 && minAxis < 45 ? 45 / minAxis : 1;
185
+ PS1_SNAP_RESOLUTION.set(Math.max(1, Math.round(gx * boost)), Math.max(1, Math.round(gy * boost)));
186
+ }
187
+ function syncRetroUniforms(presetOrDither, pixelSnapAmount = 0, renderScale = .67, colorMode, ditherScale, affineAmount, gouraudAmount, n64FilterAmount) {
188
+ if (typeof presetOrDither === "string" || typeof presetOrDither === "object") {
189
+ const preset = getRetroPreset(presetOrDither);
190
+ syncRetroUniforms(preset.ditherAmount, preset.pixelSnapAmount, preset.renderScale, preset.colorMode, preset.ditherScale, preset.affineAmount, preset.gouraudAmount, preset.n64FilterAmount);
191
+ return preset;
192
+ }
193
+ if (Number.isFinite(presetOrDither)) RETRO_UNIFORMS.uDitherMix.value = THREE.MathUtils.clamp(presetOrDither, 0, 1);
194
+ if (Number.isFinite(pixelSnapAmount)) RETRO_UNIFORMS.uSnapStrength.value = THREE.MathUtils.clamp(pixelSnapAmount, 0, 1);
195
+ if (Number.isFinite(renderScale)) curRenderScale = THREE.MathUtils.clamp(renderScale, .33, 1);
196
+ if (colorMode) {
197
+ getColorQuantVector(colorMode, RETRO_UNIFORMS.uColorQuant.value);
198
+ RETRO_UNIFORMS.uPaletteLut.value = getPaletteLutTexture(colorMode === "crunchy16" || colorMode === "crunchy64" ? colorMode : "fallback");
199
+ }
200
+ if (typeof ditherScale === "number" && Number.isFinite(ditherScale)) curDitherScale = THREE.MathUtils.clamp(ditherScale, .5, 6);
201
+ if (typeof affineAmount === "number" && Number.isFinite(affineAmount)) RETRO_UNIFORMS.uAffineStrength.value = THREE.MathUtils.clamp(affineAmount, 0, 1);
202
+ if (typeof gouraudAmount === "number" && Number.isFinite(gouraudAmount)) RETRO_UNIFORMS.uGouraudStrength.value = THREE.MathUtils.clamp(gouraudAmount, 0, 1);
203
+ if (typeof n64FilterAmount === "number" && Number.isFinite(n64FilterAmount)) RETRO_UNIFORMS.uN64FilterStrength.value = THREE.MathUtils.clamp(n64FilterAmount, 0, 1);
204
+ recomputeSnapGrid();
205
+ }
206
+ function syncRetroViewport(fbW, fbH, effectiveDpr) {
207
+ if (!Number.isFinite(fbW) || !Number.isFinite(fbH) || fbW <= 0 || fbH <= 0) return;
208
+ vpWidth = fbW;
209
+ vpHeight = fbH;
210
+ if (Number.isFinite(effectiveDpr) && effectiveDpr > 0) vpDpr = effectiveDpr;
211
+ recomputeSnapGrid();
212
+ }
213
+ export { PALETTE_CRUNCHY_16, PALETTE_CRUNCHY_64, PS1_SNAP_RESOLUTION, RETRO_CLEAN_HD, RETRO_COLOR_MODES, RETRO_DREAMCAST, RETRO_PRESETS, RETRO_PS2_SHINOBI, RETRO_PSX_PLUS, RETRO_UNIFORMS, applyRetroFilteringToMaterial, applyRetroTextureFiltering, buildPaletteLutData, computeRetroDpr, getColorQuantVector, getPaletteLutTexture, getRetroPreset, getRetroShaderUniforms, syncRetroUniforms, syncRetroViewport };
214
+
215
+ //# sourceMappingURL=retroUniforms.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"retroUniforms.js","names":[],"sources":["../../src/shaders/retroUniforms.ts"],"sourcesContent":["import * as THREE from \"three\";\nimport {\n PALETTE_CRUNCHY_16,\n PALETTE_CRUNCHY_64,\n RETRO_COLOR_MODES,\n applyRetroFilteringToMaterial,\n applyRetroTextureFiltering,\n buildPaletteLutData,\n computeRetroDpr,\n getColorQuantVector,\n getPaletteLutTexture,\n type RetroColorMode,\n type RetroColorModeSpec,\n type RetroTextureOptions,\n} from \"./retroPalettes.js\";\n\nexport {\n PALETTE_CRUNCHY_16,\n PALETTE_CRUNCHY_64,\n RETRO_COLOR_MODES,\n applyRetroFilteringToMaterial,\n applyRetroTextureFiltering,\n buildPaletteLutData,\n computeRetroDpr,\n getColorQuantVector,\n getPaletteLutTexture,\n type RetroColorMode,\n type RetroColorModeSpec,\n type RetroTextureOptions,\n};\n\nexport const PS1_SNAP_RESOLUTION = new THREE.Vector2(320, 180);\n\nexport const RETRO_UNIFORMS = {\n uPs1Grid: { value: PS1_SNAP_RESOLUTION },\n uDitherMix: { value: 0.62 },\n uSnapStrength: { value: 0 },\n uDitherScale: { value: 2 },\n uColorQuant: { value: getColorQuantVector(\"rgb555\") },\n uPaletteLut: { value: getPaletteLutTexture(\"fallback\") },\n uAffineStrength: { value: 0 },\n uGouraudStrength: { value: 0 },\n uN64FilterStrength: { value: 0 },\n uN64TexSize: { value: 256 },\n};\n\nexport function getRetroShaderUniforms(): typeof RETRO_UNIFORMS {\n return {\n uPs1Grid: RETRO_UNIFORMS.uPs1Grid,\n uDitherMix: RETRO_UNIFORMS.uDitherMix,\n uSnapStrength: RETRO_UNIFORMS.uSnapStrength,\n uDitherScale: RETRO_UNIFORMS.uDitherScale,\n uColorQuant: RETRO_UNIFORMS.uColorQuant,\n uPaletteLut: RETRO_UNIFORMS.uPaletteLut,\n uAffineStrength: RETRO_UNIFORMS.uAffineStrength,\n uGouraudStrength: RETRO_UNIFORMS.uGouraudStrength,\n uN64FilterStrength: RETRO_UNIFORMS.uN64FilterStrength,\n uN64TexSize: RETRO_UNIFORMS.uN64TexSize,\n };\n}\n\nexport type RetroPresetId =\n | \"dreamcast\"\n | \"n64-emu-1080p\"\n | \"n64-psx-hybrid\"\n | \"psx-plus\"\n | \"ps2-shinobi\"\n | \"n64-ultra\"\n | \"dsi-crisp\"\n | \"psx-chonk\"\n | \"psx-raw-1995\"\n | \"clean-hd\";\n\nexport interface RetroPreset {\n id: RetroPresetId;\n label: string;\n renderScale: number;\n ditherAmount: number;\n pixelSnapAmount: number;\n colorMode: RetroColorMode;\n ditherScale: number;\n affineAmount: number;\n gouraudAmount: number;\n n64FilterAmount: number;\n fogEnabled: boolean;\n}\n\nexport const RETRO_PRESETS: readonly RetroPreset[] = [\n { id: \"dreamcast\", label: \"Nu-School Dreamcast\", renderScale: 0.67, ditherAmount: 0.62, pixelSnapAmount: 0, colorMode: \"rgb555\", ditherScale: 2, affineAmount: 0, gouraudAmount: 0, n64FilterAmount: 0, fogEnabled: false },\n { id: \"n64-emu-1080p\", label: \"N64 Emu 1080p ('08)\", renderScale: 1, ditherAmount: 0.32, pixelSnapAmount: 0, colorMode: \"rgb555\", ditherScale: 1, affineAmount: 0, gouraudAmount: 0.9, n64FilterAmount: 1, fogEnabled: false },\n { id: \"n64-psx-hybrid\", label: \"N64 Bouba × PSX Kiki\", renderScale: 0.56, ditherAmount: 0.78, pixelSnapAmount: 0.55, colorMode: \"rgb555\", ditherScale: 2, affineAmount: 0, gouraudAmount: 0.65, n64FilterAmount: 1, fogEnabled: false },\n { id: \"psx-plus\", label: \"PSX++ Pixel Snap\", renderScale: 0.5, ditherAmount: 0.85, pixelSnapAmount: 0.68, colorMode: \"rgb555\", ditherScale: 2, affineAmount: 0, gouraudAmount: 0.45, n64FilterAmount: 0, fogEnabled: false },\n { id: \"ps2-shinobi\", label: \"PS2 Shinobi\", renderScale: 0.58, ditherAmount: 0.8, pixelSnapAmount: 0, colorMode: \"rgb555\", ditherScale: 2, affineAmount: 0, gouraudAmount: 0.28, n64FilterAmount: 0, fogEnabled: false },\n { id: \"n64-ultra\", label: \"N64 3-Point RDP\", renderScale: 0.5, ditherAmount: 0.55, pixelSnapAmount: 0, colorMode: \"rgb555\", ditherScale: 2, affineAmount: 0, gouraudAmount: 0.85, n64FilterAmount: 1, fogEnabled: false },\n { id: \"dsi-crisp\", label: \"DSi Crisp\", renderScale: 0.5, ditherAmount: 0.88, pixelSnapAmount: 0.35, colorMode: \"rgb444\", ditherScale: 2, affineAmount: 0, gouraudAmount: 0.2, n64FilterAmount: 0, fogEnabled: false },\n { id: \"psx-chonk\", label: \"PSX Full Chonk\", renderScale: 0.33, ditherAmount: 1, pixelSnapAmount: 1, colorMode: \"rgb555\", ditherScale: 2.5, affineAmount: 0, gouraudAmount: 0.65, n64FilterAmount: 0, fogEnabled: false },\n { id: \"psx-raw-1995\", label: \"PSX 1995 Raw Affine\", renderScale: 0.33, ditherAmount: 1, pixelSnapAmount: 1, colorMode: \"rgb555\", ditherScale: 2.5, affineAmount: 1, gouraudAmount: 1, n64FilterAmount: 0, fogEnabled: false },\n { id: \"clean-hd\", label: \"HD Remaster 1:1\", renderScale: 1, ditherAmount: 0, pixelSnapAmount: 0, colorMode: \"off\", ditherScale: 1, affineAmount: 0, gouraudAmount: 0, n64FilterAmount: 0, fogEnabled: false },\n];\n\nexport const RETRO_DREAMCAST: RetroPreset = RETRO_PRESETS[0];\nexport const RETRO_PSX_PLUS: RetroPreset = RETRO_PRESETS[3];\nexport const RETRO_PS2_SHINOBI: RetroPreset = RETRO_PRESETS[4];\nexport const RETRO_CLEAN_HD: RetroPreset = RETRO_PRESETS[9];\n\nexport function getRetroPreset(id: RetroPreset | RetroPresetId): RetroPreset {\n if (typeof id === \"object\") return id;\n return RETRO_PRESETS.find((p) => p.id === id) ?? RETRO_PRESETS[0];\n}\n\nlet vpWidth = 1280, vpHeight = 720, vpDpr = 1, curRenderScale = 0.67, curDitherScale = 2;\n\nfunction recomputeSnapGrid(): void {\n RETRO_UNIFORMS.uDitherScale.value = Math.max(1, Math.round(curDitherScale * vpDpr));\n const t = THREE.MathUtils.clamp((curRenderScale - 0.33) / 0.67, 0, 1);\n const snap = RETRO_UNIFORMS.uSnapStrength.value;\n const targetLines = (180 + t * 180) * (1.18 - snap * 0.46);\n const div = Math.max(1, Math.round(vpHeight / Math.max(90, targetLines)));\n const gx = vpWidth / (2 * div), gy = vpHeight / (2 * div);\n const minAxis = Math.min(gx, gy);\n const boost = minAxis > 0 && minAxis < 45 ? 45 / minAxis : 1;\n PS1_SNAP_RESOLUTION.set(Math.max(1, Math.round(gx * boost)), Math.max(1, Math.round(gy * boost)));\n}\n\nexport function syncRetroUniforms(preset: RetroPreset | RetroPresetId): RetroPreset;\nexport function syncRetroUniforms(\n ditherAmount: number, pixelSnapAmount?: number, renderScale?: number, colorMode?: RetroColorMode,\n ditherScale?: number, affineAmount?: number, gouraudAmount?: number, n64FilterAmount?: number,\n): void;\nexport function syncRetroUniforms(\n presetOrDither: RetroPreset | RetroPresetId | number, pixelSnapAmount = 0, renderScale = 0.67, colorMode?: RetroColorMode,\n ditherScale?: number, affineAmount?: number, gouraudAmount?: number, n64FilterAmount?: number,\n): RetroPreset | void {\n if (typeof presetOrDither === \"string\" || typeof presetOrDither === \"object\") {\n const preset = getRetroPreset(presetOrDither);\n syncRetroUniforms(\n preset.ditherAmount, preset.pixelSnapAmount, preset.renderScale, preset.colorMode,\n preset.ditherScale, preset.affineAmount, preset.gouraudAmount, preset.n64FilterAmount,\n );\n return preset;\n }\n if (Number.isFinite(presetOrDither)) RETRO_UNIFORMS.uDitherMix.value = THREE.MathUtils.clamp(presetOrDither, 0, 1);\n if (Number.isFinite(pixelSnapAmount)) RETRO_UNIFORMS.uSnapStrength.value = THREE.MathUtils.clamp(pixelSnapAmount, 0, 1);\n if (Number.isFinite(renderScale)) curRenderScale = THREE.MathUtils.clamp(renderScale, 0.33, 1);\n if (colorMode) {\n getColorQuantVector(colorMode, RETRO_UNIFORMS.uColorQuant.value);\n RETRO_UNIFORMS.uPaletteLut.value = getPaletteLutTexture(colorMode === \"crunchy16\" || colorMode === \"crunchy64\" ? colorMode : \"fallback\");\n }\n if (typeof ditherScale === \"number\" && Number.isFinite(ditherScale)) curDitherScale = THREE.MathUtils.clamp(ditherScale, 0.5, 6);\n if (typeof affineAmount === \"number\" && Number.isFinite(affineAmount)) RETRO_UNIFORMS.uAffineStrength.value = THREE.MathUtils.clamp(affineAmount, 0, 1);\n if (typeof gouraudAmount === \"number\" && Number.isFinite(gouraudAmount)) RETRO_UNIFORMS.uGouraudStrength.value = THREE.MathUtils.clamp(gouraudAmount, 0, 1);\n if (typeof n64FilterAmount === \"number\" && Number.isFinite(n64FilterAmount)) RETRO_UNIFORMS.uN64FilterStrength.value = THREE.MathUtils.clamp(n64FilterAmount, 0, 1);\n recomputeSnapGrid();\n}\n\nexport function syncRetroViewport(fbW: number, fbH: number, effectiveDpr: number): void {\n if (!Number.isFinite(fbW) || !Number.isFinite(fbH) || fbW <= 0 || fbH <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,IAAI,OAAO,SAAS,eAAe,GAAG,eAAe,cAAc,QAAQ,MAAM,UAAU,MAAM,iBAAiB,GAAG,CAAC;CACtH,IAAI,OAAO,SAAS,WAAW,GAAG,iBAAiB,MAAM,UAAU,MAAM,aAAa,KAAM,CAAC;CAC7F,IAAI,WAAW;EACX,oBAAoB,WAAW,eAAe,YAAY,KAAK;EAC/D,eAAe,YAAY,QAAQ,qBAAqB,cAAc,eAAe,cAAc,cAAc,YAAY,UAAU;CAC3I;CACA,IAAI,OAAO,gBAAgB,YAAY,OAAO,SAAS,WAAW,GAAG,iBAAiB,MAAM,UAAU,MAAM,aAAa,IAAK,CAAC;CAC/H,IAAI,OAAO,iBAAiB,YAAY,OAAO,SAAS,YAAY,GAAG,eAAe,gBAAgB,QAAQ,MAAM,UAAU,MAAM,cAAc,GAAG,CAAC;CACtJ,IAAI,OAAO,kBAAkB,YAAY,OAAO,SAAS,aAAa,GAAG,eAAe,iBAAiB,QAAQ,MAAM,UAAU,MAAM,eAAe,GAAG,CAAC;CAC1J,IAAI,OAAO,oBAAoB,YAAY,OAAO,SAAS,eAAe,GAAG,eAAe,mBAAmB,QAAQ,MAAM,UAAU,MAAM,iBAAiB,GAAG,CAAC;CAClK,kBAAkB;AACtB;AAEA,SAAgB,kBAAkB,KAAa,KAAa,cAA4B;CACpF,IAAI,CAAC,OAAO,SAAS,GAAG,KAAK,CAAC,OAAO,SAAS,GAAG,KAAK,OAAO,KAAK,OAAO,GAAG;CAC5E,UAAU;CACV,WAAW;CACX,IAAI,OAAO,SAAS,YAAY,KAAK,eAAe,GAAG,QAAQ;CAC/D,kBAAkB;AACtB"}
@@ -0,0 +1,16 @@
1
+ import React from "react";
2
+ import * as THREE from "three";
3
+ export declare const KEY_SUN_DIRECTION: THREE.Vector3;
4
+ export declare const RING_MOONLET_COUNT = 72;
5
+ export declare const ATMO_VERT = "\n uniform vec2 uPs1Grid; uniform float uSnapStrength; varying vec3 vNormalWorld, vWorldPos;\n void main() {\n vec4 wp = modelMatrix * vec4(position, 1.0); vWorldPos = wp.xyz; vNormalWorld = normalize(mat3(modelMatrix) * normal);\n vec4 clip = projectionMatrix * viewMatrix * wp;\n if (uSnapStrength > 0.001 && clip.w > 0.001) {\n vec4 snapped = clip; snapped.xyz = clip.xyz / clip.w;\n vec2 safeGrid = max(uPs1Grid * mix(2.5, 1.0, clamp(uSnapStrength, 0.0, 1.0)), vec2(1.0));\n snapped.xy = floor(safeGrid * snapped.xy + 0.5) / safeGrid; snapped.xyz *= clip.w; clip = snapped;\n }\n gl_Position = clip;\n }\n";
6
+ export declare const ATMO_FRAG = "\n uniform vec3 uSunDir, uColor; uniform float uDitherMix; varying vec3 vNormalWorld, vWorldPos;\n \nuniform float uDitherScale; uniform vec4 uColorQuant; uniform sampler2D uPaletteLut;\n\nvec3 ps1SrgbToLinear(vec3 s) { vec3 a = clamp(s, 0.0, 1.0); return a * (a * (a * 0.305306011 + 0.682171111) + 0.012522878); }\nvec3 ps1LinearToSrgb(vec3 l) { return max(1.055 * pow(clamp(l, 0.0, 1.0), vec3(0.416666667)) - 0.055, vec3(0.0)); }\nfloat ps1Bayer2(vec2 c) { return (c.y < 0.5) ? (c.x < 0.5 ? 0.0 : 2.0) : (c.x < 0.5 ? 3.0 : 1.0); }\nfloat ps1Bayer4x4(vec2 p) { vec2 f = floor(p); return (ps1Bayer2(mod(f, 2.0)) * 4.0 + ps1Bayer2(mod(floor(f * 0.5), 2.0)) + 0.5) / 16.0; }\nfloat ps1Bayer8x8(vec2 p) { vec2 f = floor(p); return (ps1Bayer2(mod(f, 2.0)) * 16.0 + ps1Bayer2(mod(floor(f * 0.5), 2.0)) * 4.0 + ps1Bayer2(mod(floor(f * 0.25), 2.0)) + 0.5) / 64.0; }\nvec3 ps1QuantizeRGB555Mix(vec3 col, vec2 fragCoord, float mixAmt) {\n if (mixAmt <= 0.001) return col;\n vec3 srgb = clamp(col, 0.0, 1.0); float bayer = ps1Bayer4x4(fragCoord * 0.5);\n vec3 c0 = floor(srgb * 31.0) / 31.0, c1 = min(c0 + 1.0 / 31.0, vec3(1.0));\n vec3 l0 = ps1SrgbToLinear(c0), l1 = ps1SrgbToLinear(c1);\n vec3 t = clamp((ps1SrgbToLinear(srgb) - l0) / max(l1 - l0, vec3(1e-5)), 0.0, 1.0);\n return mix(c0, c1, step(vec3(mix(0.5, bayer, clamp(mixAmt, 0.0, 1.0))), t));\n}\nvec3 ps1QuantizeRGB555(vec3 col, vec2 fragCoord) { return ps1QuantizeRGB555Mix(col, fragCoord, 1.0); }\n\nfloat ps1BayerDither(vec2 fragCoord) { return ps1Bayer4x4(fragCoord / max(uDitherScale, 0.5)); }\nvec3 ps1SamplePaletteLut(vec3 srgb) {\n vec3 c = clamp(srgb, 0.0, 1.0);\n return texture2D(uPaletteLut, vec2((floor(c.b * 31.0 + 0.5) * 32.0 + floor(c.r * 31.0 + 0.5) + 0.5) / 1024.0, (floor(c.g * 31.0 + 0.5) + 0.5) / 32.0)).rgb;\n}\nvec3 ps1QuantizeRetro(vec3 col, vec2 fragCoord, float ditherSpread) {\n if (uColorQuant.w < 0.5) return col;\n vec3 srgb = clamp(col, 0.0, 1.0); float bayer = ps1Bayer4x4(fragCoord / max(uDitherScale, 0.5)), spread = clamp(ditherSpread, 0.0, 1.0);\n if (uColorQuant.w > 1.5) return ps1SamplePaletteLut(ps1LinearToSrgb(clamp(ps1SrgbToLinear(srgb) + (bayer - 0.5) * (uColorQuant.y * spread), 0.0, 1.0)));\n vec3 levels = max(uColorQuant.rgb, vec3(1.0)), c0 = floor(srgb * levels) / levels, c1 = min(c0 + 1.0 / levels, vec3(1.0));\n vec3 l0 = ps1SrgbToLinear(c0), l1 = ps1SrgbToLinear(c1);\n vec3 t = clamp((ps1SrgbToLinear(srgb) - l0) / max(l1 - l0, vec3(1e-5)), 0.0, 1.0);\n return mix(c0, c1, step(vec3(mix(0.5, bayer, spread)), t));\n}\nvec4 ps1SampleN64ThreePoint(sampler2D tex, vec2 uv, float texSize, float mixStrength) {\n vec4 nearestSample = texture2D(tex, uv);\n if (mixStrength <= 0.001) return nearestSample;\n #if __VERSION__ >= 300\n vec2 ts = max(vec2(textureSize(tex, 0)), vec2(16.0));\n #else\n vec2 ts = vec2(max(16.0, texSize));\n #endif\n vec2 p = uv * ts - 0.5, i = floor(p), f = p - i, inv = 1.0 / ts;\n vec4 c10 = texture2D(tex, (i + vec2(1.5, 0.5)) * inv), c01 = texture2D(tex, (i + vec2(0.5, 1.5)) * inv);\n vec4 n64Col;\n if (f.x + f.y < 1.0) { vec4 c00 = texture2D(tex, (i + vec2(0.5, 0.5)) * inv); n64Col = c00 + f.x * (c10 - c00) + f.y * (c01 - c00); }\n else { vec4 c11 = texture2D(tex, (i + vec2(1.5, 1.5)) * inv); n64Col = c11 + (1.0 - f.y) * (c10 - c11) + (1.0 - f.x) * (c01 - c11); }\n return mix(nearestSample, n64Col, clamp(mixStrength, 0.0, 1.0));\n}\nfloat ps1ProcTexelHash(vec2 cell) { return fract(sin(dot(cell, vec2(127.1, 311.7))) * 43758.5453); }\nfloat ps1ProcN64ThreePoint(vec2 uv, float mixStrength) {\n vec2 p = uv * 8.0 - 0.5, i = floor(p), f = p - i;\n float nearestVal = ps1ProcTexelHash(floor(uv * 8.0));\n if (mixStrength <= 0.001) return nearestVal;\n float c10 = ps1ProcTexelHash(i + vec2(1.0, 0.0)), c01 = ps1ProcTexelHash(i + vec2(0.0, 1.0)), n64Val;\n if (f.x + f.y < 1.0) { float c00 = ps1ProcTexelHash(i); n64Val = c00 + f.x * (c10 - c00) + f.y * (c01 - c00); }\n else { float c11 = ps1ProcTexelHash(i + vec2(1.0, 1.0)); n64Val = c11 + (1.0 - f.y) * (c10 - c11) + (1.0 - f.x) * (c01 - c11); }\n return mix(nearestVal, n64Val, clamp(mixStrength, 0.0, 1.0));\n}\n\n void main() {\n vec3 viewDir = normalize(cameraPosition - vWorldPos);\n float rim = pow(1.0 - max(0.0, dot(viewDir, vNormalWorld)), 2.6), nl = dot(vNormalWorld, normalize(uSunDir));\n float sunLit = mix(smoothstep(-0.3, 0.7, nl), step(-0.25, nl), uDitherMix) * 0.72 + 0.28, alpha = rim * sunLit;\n if (alpha < (ps1BayerDither(gl_FragCoord.xy) * 0.65 + 0.14) * uDitherMix) discard;\n vec3 col = ps1QuantizeRetro(ps1LinearToSrgb(uColor * (0.8 + sunLit * 0.55)), gl_FragCoord.xy, uDitherMix);\n gl_FragColor = vec4(col, mix(alpha * 0.85, 0.75, uDitherMix));\n }\n";
7
+ export interface KolmoSkyboxProps {
8
+ sunDirection?: [number, number, number];
9
+ }
10
+ export declare function KolmoSkybox({ sunDirection }: KolmoSkyboxProps): React.JSX.Element;
11
+ export declare function createPlanetTextures(): {
12
+ planetMap: THREE.DataTexture;
13
+ ringMap: THREE.DataTexture;
14
+ };
15
+ export declare function buildMoonletGeo(): THREE.BufferGeometry;
16
+ export declare function populateMoonletMatrices(inst: THREE.InstancedMesh, innerR: number, outerR: number): void;
@@ -0,0 +1,266 @@
1
+ import { RETRO_UNIFORMS } from "./retroUniforms.js";
2
+ import { GLSL_BAYER_RGB555, GLSL_RETRO_QUANTIZE } from "./retroShader.js";
3
+ import { useEffect, useMemo, useRef } from "react";
4
+ import * as THREE from "three";
5
+ import { useFrame } from "@react-three/fiber";
6
+ import { Stars } from "@react-three/drei";
7
+ import { jsx, jsxs } from "react/jsx-runtime";
8
+ // src/shaders/skyboxShaders.tsx
9
+ var KEY_SUN_DIRECTION = new THREE.Vector3(-.62, .42, -.66).normalize();
10
+ var RING_MOONLET_COUNT = 72;
11
+ var SKYBOX_VERT = "varying vec3 vDir; void main() { vDir = normalize(position); gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0); }";
12
+ var SKYBOX_FRAG = `
13
+ uniform float uTime, uDitherMix; uniform vec3 uSunDir; varying vec3 vDir;
14
+ ${GLSL_BAYER_RGB555}
15
+ float hash(vec3 p) { p = fract(p * 0.3183099 + 0.1) * 17.0; return fract(p.x * p.y * p.z * (p.x + p.y + p.z)); }
16
+ float noise(vec3 x) {
17
+ vec3 i = floor(x), f = fract(x);
18
+ return mix(
19
+ mix(mix(hash(i + vec3(0,0,0)), hash(i + vec3(1,0,0)), f.x), mix(hash(i + vec3(0,1,0)), hash(i + vec3(1,1,0)), f.x), f.y),
20
+ mix(mix(hash(i + vec3(0,0,1)), hash(i + vec3(1,0,1)), f.x), mix(hash(i + vec3(0,1,1)), hash(i + vec3(1,1,1)), f.x), f.y), f.z
21
+ );
22
+ }
23
+ float fbm(vec3 p) { float v = 0.0, a = 0.55; for (int i = 0; i < 3; i++) { v += a * noise(p); p = p * 2.05 + vec3(13.1, 7.7, 5.3); a *= 0.48; } return v; }
24
+ void main() {
25
+ vec3 dir = normalize(vDir);
26
+ float horizon = exp(-abs(dir.y + dir.x * 0.18) * 3.0);
27
+ vec3 col = mix(mix(vec3(0.015, 0.02, 0.055), vec3(0.02, 0.03, 0.08), dir.y * 0.5 + 0.5), vec3(0.08, 0.16, 0.27), horizon * 0.9);
28
+ float n1 = fbm(dir * 2.8 + vec3(0.0, uTime * 0.003, 0.0)), n2 = fbm(dir * 5.0 - vec3(uTime * 0.002, 0.0, 1.4));
29
+ float rawMask = clamp((n1 * 0.72 + n2 * 0.34 - 0.44) * 2.4, 0.0, 1.0) * (0.35 + horizon * 0.85);
30
+ float cloudMask = mix(rawMask, floor(rawMask * 5.0) / 5.0, uDitherMix);
31
+ float sunDot = max(0.0, dot(dir, normalize(uSunDir)));
32
+ vec3 tint = mix(vec3(0.06, 0.38, 0.50), vec3(0.28, 0.12, 0.40), mix(n2, step(0.52, n2), uDitherMix));
33
+ col += mix(tint, vec3(0.62, 0.26, 0.14), pow(sunDot, 2.0) * 0.9) * cloudMask * 0.85;
34
+ float corona = mix(pow(sunDot, 12.0), floor(pow(sunDot, 12.0) * 6.0) / 6.0, uDitherMix);
35
+ col += vec3(0.95, 0.55, 0.22) * corona * 0.65 + vec3(1.0, 0.90, 0.68) * step(0.9965, sunDot) * 1.1;
36
+ float s = hash(floor(dir * 165.0));
37
+ if (s > 0.995) col += mix(vec3(0.74, 0.90, 1.0), vec3(1.0, 0.86, 0.68), step(0.5, fract(s * 91.3))) * 0.95;
38
+ gl_FragColor = vec4(ps1QuantizeRGB555Mix(col, gl_FragCoord.xy, uDitherMix), 1.0);
39
+ }
40
+ `;
41
+ var ATMO_VERT = `
42
+ uniform vec2 uPs1Grid; uniform float uSnapStrength; varying vec3 vNormalWorld, vWorldPos;
43
+ void main() {
44
+ vec4 wp = modelMatrix * vec4(position, 1.0); vWorldPos = wp.xyz; vNormalWorld = normalize(mat3(modelMatrix) * normal);
45
+ vec4 clip = projectionMatrix * viewMatrix * wp;
46
+ if (uSnapStrength > 0.001 && clip.w > 0.001) {
47
+ vec4 snapped = clip; snapped.xyz = clip.xyz / clip.w;
48
+ vec2 safeGrid = max(uPs1Grid * mix(2.5, 1.0, clamp(uSnapStrength, 0.0, 1.0)), vec2(1.0));
49
+ snapped.xy = floor(safeGrid * snapped.xy + 0.5) / safeGrid; snapped.xyz *= clip.w; clip = snapped;
50
+ }
51
+ gl_Position = clip;
52
+ }
53
+ `;
54
+ var ATMO_FRAG = `
55
+ uniform vec3 uSunDir, uColor; uniform float uDitherMix; varying vec3 vNormalWorld, vWorldPos;
56
+ ${GLSL_RETRO_QUANTIZE}
57
+ void main() {
58
+ vec3 viewDir = normalize(cameraPosition - vWorldPos);
59
+ float rim = pow(1.0 - max(0.0, dot(viewDir, vNormalWorld)), 2.6), nl = dot(vNormalWorld, normalize(uSunDir));
60
+ float sunLit = mix(smoothstep(-0.3, 0.7, nl), step(-0.25, nl), uDitherMix) * 0.72 + 0.28, alpha = rim * sunLit;
61
+ if (alpha < (ps1BayerDither(gl_FragCoord.xy) * 0.65 + 0.14) * uDitherMix) discard;
62
+ vec3 col = ps1QuantizeRetro(ps1LinearToSrgb(uColor * (0.8 + sunLit * 0.55)), gl_FragCoord.xy, uDitherMix);
63
+ gl_FragColor = vec4(col, mix(alpha * 0.85, 0.75, uDitherMix));
64
+ }
65
+ `;
66
+ function KolmoSkybox({ sunDirection }) {
67
+ const matRef = useRef(null);
68
+ const groupRef = useRef(null);
69
+ const uniforms = useMemo(() => ({
70
+ uTime: { value: 0 },
71
+ uSunDir: { value: KEY_SUN_DIRECTION.clone() },
72
+ uDitherMix: RETRO_UNIFORMS.uDitherMix
73
+ }), []);
74
+ useEffect(() => {
75
+ if (sunDirection) uniforms.uSunDir.value.set(sunDirection[0], sunDirection[1], sunDirection[2]).normalize();
76
+ else uniforms.uSunDir.value.copy(KEY_SUN_DIRECTION);
77
+ }, [
78
+ sunDirection?.[0],
79
+ sunDirection?.[1],
80
+ sunDirection?.[2],
81
+ uniforms
82
+ ]);
83
+ useFrame((state, delta) => {
84
+ if (matRef.current) matRef.current.uniforms.uTime.value += Math.min(delta, .05);
85
+ if (groupRef.current) groupRef.current.position.copy(state.camera.position);
86
+ });
87
+ return /* @__PURE__ */ jsxs("group", {
88
+ ref: groupRef,
89
+ children: [/* @__PURE__ */ jsxs("mesh", {
90
+ renderOrder: -10,
91
+ frustumCulled: false,
92
+ children: [/* @__PURE__ */ jsx("icosahedronGeometry", { args: [3800, 2] }), /* @__PURE__ */ jsx("shaderMaterial", {
93
+ ref: matRef,
94
+ uniforms,
95
+ vertexShader: SKYBOX_VERT,
96
+ fragmentShader: SKYBOX_FRAG,
97
+ side: THREE.BackSide,
98
+ depthWrite: false
99
+ })]
100
+ }), /* @__PURE__ */ jsx(Stars, {
101
+ radius: 190,
102
+ depth: 130,
103
+ count: 2600,
104
+ factor: 4.5,
105
+ saturation: .35,
106
+ fade: false,
107
+ speed: .18
108
+ })]
109
+ });
110
+ }
111
+ var BAYER_4X4 = [
112
+ [
113
+ 0,
114
+ 8,
115
+ 2,
116
+ 10
117
+ ],
118
+ [
119
+ 12,
120
+ 4,
121
+ 14,
122
+ 6
123
+ ],
124
+ [
125
+ 3,
126
+ 11,
127
+ 1,
128
+ 9
129
+ ],
130
+ [
131
+ 15,
132
+ 7,
133
+ 13,
134
+ 5
135
+ ]
136
+ ];
137
+ var BANDS = [
138
+ [
139
+ 14,
140
+ 30,
141
+ 56
142
+ ],
143
+ [
144
+ 24,
145
+ 58,
146
+ 92
147
+ ],
148
+ [
149
+ 42,
150
+ 98,
151
+ 126
152
+ ],
153
+ [
154
+ 76,
155
+ 134,
156
+ 152
157
+ ],
158
+ [
159
+ 186,
160
+ 128,
161
+ 86
162
+ ],
163
+ [
164
+ 232,
165
+ 160,
166
+ 94
167
+ ],
168
+ [
169
+ 172,
170
+ 108,
171
+ 74
172
+ ],
173
+ [
174
+ 68,
175
+ 108,
176
+ 136
177
+ ],
178
+ [
179
+ 34,
180
+ 62,
181
+ 96
182
+ ],
183
+ [
184
+ 16,
185
+ 28,
186
+ 50
187
+ ]
188
+ ];
189
+ var quant8 = (v) => Math.min(255, Math.round(Math.max(0, Math.min(255, v)) / 8.225) * 8);
190
+ function createPlanetTextures() {
191
+ const pData = /* @__PURE__ */ new Uint8Array(131072);
192
+ for (let y = 0; y < 128; y++) for (let x = 0; x < 256; x++) {
193
+ const wave = Math.sin(x / 256 * Math.PI * 8 + y * .16) * 2.8 + Math.cos(x / 256 * Math.PI * 16 - y * .24) * 1.4;
194
+ const t = THREE.MathUtils.clamp((y + wave) / 128 * (BANDS.length - 1), 0, BANDS.length - 1.001);
195
+ const lo = Math.floor(t);
196
+ let [r, g, b] = t - lo > BAYER_4X4[y & 3][x & 3] / 16 ? BANDS[lo + 1] : BANDS[lo];
197
+ const sx = (x - 92.16) / 24, sy = (y - 71.68) / 11, spot = Math.hypot(sx, sy);
198
+ if (spot < 1) {
199
+ const w = (1 - spot) * (.65 + (Math.sin(spot * 10 - Math.atan2(sy, sx) * 2) * .5 + .5) * .35);
200
+ r = r * (1 - w) + 244 * w;
201
+ g = g * (1 - w) + 148 * w;
202
+ b = b * (1 - w) + 74 * w;
203
+ }
204
+ const grain = ((x * 19 + y * 29 & 15) - 8) * 1.1, idx = (y * 256 + x) * 4;
205
+ pData[idx] = quant8(r + grain);
206
+ pData[idx + 1] = quant8(g + grain);
207
+ pData[idx + 2] = quant8(b + grain);
208
+ pData[idx + 3] = 255;
209
+ }
210
+ const planetMap = new THREE.DataTexture(pData, 256, 128, THREE.RGBAFormat);
211
+ planetMap.colorSpace = THREE.SRGBColorSpace;
212
+ planetMap.wrapS = THREE.RepeatWrapping;
213
+ planetMap.minFilter = THREE.NearestFilter;
214
+ planetMap.magFilter = THREE.NearestFilter;
215
+ planetMap.needsUpdate = true;
216
+ const rData = /* @__PURE__ */ new Uint8Array(1024);
217
+ for (let x = 0; x < 256; x++) {
218
+ const u = x / 255, gap = Math.abs(u - .44) < .048 || Math.abs(u - .78) < .024 ? 0 : 1;
219
+ const a = (.62 + .38 * Math.sin(u * 78)) * Math.sin(u * Math.PI) * gap, idx = x * 4;
220
+ rData[idx] = quant8(168 + 68 * Math.sin(u * 11 + .4));
221
+ rData[idx + 1] = quant8(186 + 44 * Math.cos(u * 16));
222
+ rData[idx + 2] = quant8(204 + 42 * Math.sin(u * 13 + 1.8));
223
+ rData[idx + 3] = a > .14 ? Math.round(Math.min(.92, Math.round(a * 8) / 8) * 255) : 0;
224
+ }
225
+ const ringMap = new THREE.DataTexture(rData, 256, 1, THREE.RGBAFormat);
226
+ ringMap.colorSpace = THREE.SRGBColorSpace;
227
+ ringMap.minFilter = THREE.NearestFilter;
228
+ ringMap.magFilter = THREE.NearestFilter;
229
+ ringMap.needsUpdate = true;
230
+ return {
231
+ planetMap,
232
+ ringMap
233
+ };
234
+ }
235
+ function buildMoonletGeo() {
236
+ const raw = new THREE.DodecahedronGeometry(1, 0);
237
+ const geo = raw.index ? raw.toNonIndexed() : raw.clone();
238
+ raw.dispose();
239
+ const pos = geo.attributes.position, cols = new Float32Array(pos.count * 3);
240
+ for (let i = 0; i < pos.count; i++) {
241
+ const shade = .48 + i * 17 % 10 * .032;
242
+ cols[i * 3] = shade * .92;
243
+ cols[i * 3 + 1] = shade * .96;
244
+ cols[i * 3 + 2] = shade;
245
+ }
246
+ geo.setAttribute("color", new THREE.BufferAttribute(cols, 3));
247
+ geo.computeVertexNormals();
248
+ return geo;
249
+ }
250
+ function populateMoonletMatrices(inst, innerR, outerR) {
251
+ const dummy = new THREE.Object3D();
252
+ for (let i = 0; i < 72; i++) {
253
+ const ang = i / 72 * Math.PI * 2 + i % 5 * .08;
254
+ const rad = THREE.MathUtils.lerp(innerR + 18, outerR - 18, i * 37 % 100 / 100);
255
+ const z = (i * 19 % 100 / 100 - .5) * 18, s = 4.5 + i * 13 % 100 / 100 * 14.5;
256
+ dummy.position.set(Math.cos(ang) * rad, Math.sin(ang) * rad, z);
257
+ dummy.rotation.set(i * .7, i * 1.1, i * .4);
258
+ dummy.scale.set(s * 1.2, s * .8, s);
259
+ dummy.updateMatrix();
260
+ inst.setMatrixAt(i, dummy.matrix);
261
+ }
262
+ inst.instanceMatrix.needsUpdate = true;
263
+ }
264
+ export { ATMO_FRAG, ATMO_VERT, KEY_SUN_DIRECTION, KolmoSkybox, RING_MOONLET_COUNT, buildMoonletGeo, createPlanetTextures, populateMoonletMatrices };
265
+
266
+ //# sourceMappingURL=skyboxShaders.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skyboxShaders.js","names":[],"sources":["../../src/shaders/skyboxShaders.tsx"],"sourcesContent":["import React, { useEffect, useMemo, useRef } from \"react\";\nimport { useFrame } from \"@react-three/fiber\";\nimport { Stars } from \"@react-three/drei\";\nimport * as THREE from \"three\";\nimport { GLSL_BAYER_RGB555, GLSL_RETRO_QUANTIZE, RETRO_UNIFORMS } from \"./retroShader.js\";\n\nexport const KEY_SUN_DIRECTION = new THREE.Vector3(-0.62, 0.42, -0.66).normalize();\nexport const RING_MOONLET_COUNT = 72;\n\nconst SKYBOX_VERT = \"varying vec3 vDir; void main() { vDir = normalize(position); gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0); }\";\nconst SKYBOX_FRAG = `\n uniform float uTime, uDitherMix; uniform vec3 uSunDir; varying vec3 vDir;\n ${GLSL_BAYER_RGB555}\n float hash(vec3 p) { p = fract(p * 0.3183099 + 0.1) * 17.0; return fract(p.x * p.y * p.z * (p.x + p.y + p.z)); }\n float noise(vec3 x) {\n vec3 i = floor(x), f = fract(x);\n return mix(\n mix(mix(hash(i + vec3(0,0,0)), hash(i + vec3(1,0,0)), f.x), mix(hash(i + vec3(0,1,0)), hash(i + vec3(1,1,0)), f.x), f.y),\n mix(mix(hash(i + vec3(0,0,1)), hash(i + vec3(1,0,1)), f.x), mix(hash(i + vec3(0,1,1)), hash(i + vec3(1,1,1)), f.x), f.y), f.z\n );\n }\n float fbm(vec3 p) { float v = 0.0, a = 0.55; for (int i = 0; i < 3; i++) { v += a * noise(p); p = p * 2.05 + vec3(13.1, 7.7, 5.3); a *= 0.48; } return v; }\n void main() {\n vec3 dir = normalize(vDir);\n float horizon = exp(-abs(dir.y + dir.x * 0.18) * 3.0);\n vec3 col = mix(mix(vec3(0.015, 0.02, 0.055), vec3(0.02, 0.03, 0.08), dir.y * 0.5 + 0.5), vec3(0.08, 0.16, 0.27), horizon * 0.9);\n float n1 = fbm(dir * 2.8 + vec3(0.0, uTime * 0.003, 0.0)), n2 = fbm(dir * 5.0 - vec3(uTime * 0.002, 0.0, 1.4));\n float rawMask = clamp((n1 * 0.72 + n2 * 0.34 - 0.44) * 2.4, 0.0, 1.0) * (0.35 + horizon * 0.85);\n float cloudMask = mix(rawMask, floor(rawMask * 5.0) / 5.0, uDitherMix);\n float sunDot = max(0.0, dot(dir, normalize(uSunDir)));\n vec3 tint = mix(vec3(0.06, 0.38, 0.50), vec3(0.28, 0.12, 0.40), mix(n2, step(0.52, n2), uDitherMix));\n col += mix(tint, vec3(0.62, 0.26, 0.14), pow(sunDot, 2.0) * 0.9) * cloudMask * 0.85;\n float corona = mix(pow(sunDot, 12.0), floor(pow(sunDot, 12.0) * 6.0) / 6.0, uDitherMix);\n col += vec3(0.95, 0.55, 0.22) * corona * 0.65 + vec3(1.0, 0.90, 0.68) * step(0.9965, sunDot) * 1.1;\n float s = hash(floor(dir * 165.0));\n if (s > 0.995) col += mix(vec3(0.74, 0.90, 1.0), vec3(1.0, 0.86, 0.68), step(0.5, fract(s * 91.3))) * 0.95;\n gl_FragColor = vec4(ps1QuantizeRGB555Mix(col, gl_FragCoord.xy, uDitherMix), 1.0);\n }\n`;\n\nexport const ATMO_VERT = `\n uniform vec2 uPs1Grid; uniform float uSnapStrength; varying vec3 vNormalWorld, vWorldPos;\n void main() {\n vec4 wp = modelMatrix * vec4(position, 1.0); vWorldPos = wp.xyz; vNormalWorld = normalize(mat3(modelMatrix) * normal);\n vec4 clip = projectionMatrix * viewMatrix * wp;\n if (uSnapStrength > 0.001 && clip.w > 0.001) {\n vec4 snapped = clip; snapped.xyz = clip.xyz / clip.w;\n vec2 safeGrid = max(uPs1Grid * mix(2.5, 1.0, clamp(uSnapStrength, 0.0, 1.0)), vec2(1.0));\n snapped.xy = floor(safeGrid * snapped.xy + 0.5) / safeGrid; snapped.xyz *= clip.w; clip = snapped;\n }\n gl_Position = clip;\n }\n`;\n\nexport const ATMO_FRAG = `\n uniform vec3 uSunDir, uColor; uniform float uDitherMix; varying vec3 vNormalWorld, vWorldPos;\n ${GLSL_RETRO_QUANTIZE}\n void main() {\n vec3 viewDir = normalize(cameraPosition - vWorldPos);\n float rim = pow(1.0 - max(0.0, dot(viewDir, vNormalWorld)), 2.6), nl = dot(vNormalWorld, normalize(uSunDir));\n float sunLit = mix(smoothstep(-0.3, 0.7, nl), step(-0.25, nl), uDitherMix) * 0.72 + 0.28, alpha = rim * sunLit;\n if (alpha < (ps1BayerDither(gl_FragCoord.xy) * 0.65 + 0.14) * uDitherMix) discard;\n vec3 col = ps1QuantizeRetro(ps1LinearToSrgb(uColor * (0.8 + sunLit * 0.55)), gl_FragCoord.xy, uDitherMix);\n gl_FragColor = vec4(col, mix(alpha * 0.85, 0.75, uDitherMix));\n }\n`;\n\nexport interface KolmoSkyboxProps {\n sunDirection?: [number, number, number];\n}\n\nexport function KolmoSkybox({ sunDirection }: KolmoSkyboxProps): React.JSX.Element {\n const matRef = useRef<THREE.ShaderMaterial | null>(null);\n const groupRef = useRef<THREE.Group | null>(null);\n const uniforms = useMemo(\n () => ({ uTime: { value: 0 }, uSunDir: { value: KEY_SUN_DIRECTION.clone() }, uDitherMix: RETRO_UNIFORMS.uDitherMix }),\n [],\n );\n\n useEffect(() => {\n if (sunDirection) uniforms.uSunDir.value.set(sunDirection[0], sunDirection[1], sunDirection[2]).normalize();\n else uniforms.uSunDir.value.copy(KEY_SUN_DIRECTION);\n }, [sunDirection?.[0], sunDirection?.[1], sunDirection?.[2], uniforms]);\n\n useFrame((state, delta) => {\n if (matRef.current) matRef.current.uniforms.uTime.value += Math.min(delta, 0.05);\n if (groupRef.current) groupRef.current.position.copy(state.camera.position);\n });\n\n return (\n <group ref={groupRef}>\n <mesh renderOrder={-10} frustumCulled={false}>\n <icosahedronGeometry args={[3800, 2]} />\n <shaderMaterial ref={matRef} uniforms={uniforms} vertexShader={SKYBOX_VERT} fragmentShader={SKYBOX_FRAG} side={THREE.BackSide} depthWrite={false} />\n </mesh>\n <Stars radius={190} depth={130} count={2600} factor={4.5} saturation={0.35} fade={false} speed={0.18} />\n </group>\n );\n}\n\nconst BAYER_4X4 = [[0, 8, 2, 10], [12, 4, 14, 6], [3, 11, 1, 9], [15, 7, 13, 5]];\nconst BANDS: [number, number, number][] = [\n [14, 30, 56], [24, 58, 92], [42, 98, 126], [76, 134, 152], [186, 128, 86],\n [232, 160, 94], [172, 108, 74], [68, 108, 136], [34, 62, 96], [16, 28, 50],\n];\nconst quant8 = (v: number) => Math.min(255, Math.round(Math.max(0, Math.min(255, v)) / 8.225) * 8);\n\nexport function createPlanetTextures(): { planetMap: THREE.DataTexture; ringMap: THREE.DataTexture } {\n const pData = new Uint8Array(256 * 128 * 4);\n for (let y = 0; y < 128; y++) {\n for (let x = 0; x < 256; x++) {\n const wave = Math.sin((x / 256) * Math.PI * 8 + y * 0.16) * 2.8 + Math.cos((x / 256) * Math.PI * 16 - y * 0.24) * 1.4;\n const t = THREE.MathUtils.clamp(((y + wave) / 128) * (BANDS.length - 1), 0, BANDS.length - 1.001);\n const lo = Math.floor(t);\n let [r, g, b] = t - lo > BAYER_4X4[y & 3][x & 3] / 16 ? BANDS[lo + 1] : BANDS[lo];\n const sx = (x - 92.16) / 24, sy = (y - 71.68) / 11, spot = Math.hypot(sx, sy);\n if (spot < 1) {\n const w = (1 - spot) * (0.65 + (Math.sin(spot * 10 - Math.atan2(sy, sx) * 2) * 0.5 + 0.5) * 0.35);\n r = r * (1 - w) + 244 * w; g = g * (1 - w) + 148 * w; b = b * (1 - w) + 74 * w;\n }\n const grain = (((x * 19 + y * 29) & 15) - 8) * 1.1, idx = (y * 256 + x) * 4;\n pData[idx] = quant8(r + grain); pData[idx + 1] = quant8(g + grain); pData[idx + 2] = quant8(b + grain); pData[idx + 3] = 255;\n }\n }\n const planetMap = new THREE.DataTexture(pData, 256, 128, THREE.RGBAFormat);\n planetMap.colorSpace = THREE.SRGBColorSpace;\n planetMap.wrapS = THREE.RepeatWrapping;\n planetMap.minFilter = THREE.NearestFilter;\n planetMap.magFilter = THREE.NearestFilter;\n planetMap.needsUpdate = true;\n\n const rData = new Uint8Array(256 * 4);\n for (let x = 0; x < 256; x++) {\n const u = x / 255, gap = Math.abs(u - 0.44) < 0.048 || Math.abs(u - 0.78) < 0.024 ? 0 : 1;\n const a = (0.62 + 0.38 * Math.sin(u * 78)) * Math.sin(u * Math.PI) * gap, idx = x * 4;\n rData[idx] = quant8(168 + 68 * Math.sin(u * 11 + 0.4));\n rData[idx + 1] = quant8(186 + 44 * Math.cos(u * 16));\n rData[idx + 2] = quant8(204 + 42 * Math.sin(u * 13 + 1.8));\n rData[idx + 3] = a > 0.14 ? Math.round(Math.min(0.92, Math.round(a * 8) / 8) * 255) : 0;\n }\n const ringMap = new THREE.DataTexture(rData, 256, 1, THREE.RGBAFormat);\n ringMap.colorSpace = THREE.SRGBColorSpace;\n ringMap.minFilter = THREE.NearestFilter;\n ringMap.magFilter = THREE.NearestFilter;\n ringMap.needsUpdate = true;\n return { planetMap, ringMap };\n}\n\nexport function buildMoonletGeo(): THREE.BufferGeometry {\n const raw = new THREE.DodecahedronGeometry(1, 0);\n const geo = raw.index ? raw.toNonIndexed() : raw.clone();\n raw.dispose();\n const pos = geo.attributes.position, cols = new Float32Array(pos.count * 3);\n for (let i = 0; i < pos.count; i++) {\n const shade = 0.48 + ((i * 17) % 10) * 0.032;\n cols[i * 3] = shade * 0.92; cols[i * 3 + 1] = shade * 0.96; cols[i * 3 + 2] = shade;\n }\n geo.setAttribute(\"color\", new THREE.BufferAttribute(cols, 3));\n geo.computeVertexNormals();\n return geo;\n}\n\nexport function populateMoonletMatrices(inst: THREE.InstancedMesh, innerR: number, outerR: number): void {\n const dummy = new THREE.Object3D();\n for (let i = 0; i < RING_MOONLET_COUNT; i++) {\n const ang = (i / RING_MOONLET_COUNT) * Math.PI * 2 + (i % 5) * 0.08;\n const rad = THREE.MathUtils.lerp(innerR + 18, outerR - 18, ((i * 37) % 100) / 100);\n const z = (((i * 19) % 100) / 100 - 0.5) * 18, s = 4.5 + (((i * 13) % 100) / 100) * 14.5;\n dummy.position.set(Math.cos(ang) * rad, Math.sin(ang) * rad, z);\n dummy.rotation.set(i * 0.7, i * 1.1, i * 0.4);\n dummy.scale.set(s * 1.2, s * 0.8, s);\n dummy.updateMatrix();\n inst.setMatrixAt(i, dummy.matrix);\n }\n inst.instanceMatrix.needsUpdate = true;\n}\n"],"mappings":";;;;;;;;AAMA,IAAa,oBAAoB,IAAI,MAAM,QAAQ,MAAO,KAAM,IAAK,CAAC,CAAC,UAAU;AACjF,IAAa,qBAAqB;AAElC,IAAM,cAAc;AACpB,IAAM,cAAc;;IAEhB,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BtB,IAAa,YAAY;;;;;;;;;;;;;AAczB,IAAa,YAAY;;IAErB,oBAAoB;;;;;;;;;;AAexB,SAA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,MAAM,IAAI,IAAI,KAAK,IAAI,IAAK,CAAC;EACnC,MAAM,aAAa;EACnB,KAAK,YAAY,GAAG,MAAM,MAAM;CACpC;CACA,KAAK,eAAe,cAAc;AACtC"}
@@ -1 +1 @@
1
- export { createPS2RoadMaterialTSL, createPS2TerrainMaterialTSL, } from "./ps2MaterialsTSL.js";
1
+ export { createPS2RoadMaterialTSL, createPS2TerrainMaterialTSL } from "./ps2MaterialsTSL.js";
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tsl.js","sources":["../../src/shaders/tsl.ts"],"mappings":""}