create-threenative 0.2.18 → 0.2.20

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 (183) hide show
  1. package/agent-docs/references/capability-reference.md +212 -4
  2. package/agent-docs/references/kit-racing.md +4 -2
  3. package/agent-docs/references/performance-basics.md +2 -1
  4. package/agent-docs/references/terrain-authoring.md +21 -7
  5. package/agent-files/.agents/skills/prd-creator/SKILL.md +24 -0
  6. package/dist/index.js +255 -236
  7. package/dist/quality.d.ts +5 -1
  8. package/dist/quality.js +75 -6
  9. package/dist/terrain-kit.js +1 -1
  10. package/dist/threenative.js +6 -4
  11. package/dist/web-engine-post-effects.js +6 -0
  12. package/dist/web-engine-runtime.js +211 -36
  13. package/package.json +6 -6
  14. package/template-assets/assets/floor-fern-0.glb +0 -0
  15. package/template-assets/assets/floor-litter-0.glb +0 -0
  16. package/template-assets/assets/floor-log-0.glb +0 -0
  17. package/template-assets/assets/floor-log-1.glb +0 -0
  18. package/template-assets/assets/floor-stump-0.glb +0 -0
  19. package/template-assets/assets/floor-twig-0.glb +0 -0
  20. package/template-assets/quality/eslint.config.js +1 -1
  21. package/templates/action-rpg/package.json +7 -7
  22. package/templates/action-rpg/src/loot/drops.ts +3 -7
  23. package/templates/action-rpg/src/render/camera.ts +2 -2
  24. package/templates/action-rpg/src/render/clouds.ts +3 -1
  25. package/templates/action-rpg/src/render/materials.ts +3 -2
  26. package/templates/action-rpg/src/render/touch-controls.ts +7 -6
  27. package/templates/action-rpg/src/scenes/Play.ts +1 -15
  28. package/templates/adventure/AGENTS.md +3 -3
  29. package/templates/adventure/CLAUDE.md +3 -3
  30. package/templates/adventure/native-playtests/survives.playtest.json +12 -0
  31. package/templates/adventure/native-playtests/woodland-floor.playtest.json +61 -0
  32. package/templates/adventure/package.json +7 -7
  33. package/templates/adventure/playtests/grass.playtest.json +61 -0
  34. package/templates/adventure/playtests/performance.playtest.json +1 -1
  35. package/templates/adventure/playtests/survives.playtest.json +2 -2
  36. package/templates/adventure/playtests/woodland-floor.playtest.json +61 -0
  37. package/templates/adventure/src/entities/LockOn.ts +42 -4
  38. package/templates/adventure/src/entities/Warden.ts +4 -1
  39. package/templates/adventure/src/level/Vale.ts +241 -16
  40. package/templates/adventure/src/render/camera.ts +2 -2
  41. package/templates/adventure/src/render/foliage.ts +64 -20
  42. package/templates/adventure/src/render/grass.ts +325 -0
  43. package/templates/adventure/src/render/materials.ts +3 -2
  44. package/templates/adventure/src/render/palette.ts +3 -0
  45. package/templates/adventure/src/render/touch-controls.ts +4 -1
  46. package/templates/adventure/src/scenes/Play.ts +96 -1
  47. package/templates/collectathon/package.json +7 -7
  48. package/templates/collectathon/src/level/Course.ts +2 -7
  49. package/templates/collectathon/src/level/terrain.ts +2 -1
  50. package/templates/collectathon/src/render/camera.ts +2 -2
  51. package/templates/collectathon/src/render/ground.ts +4 -4
  52. package/templates/collectathon/src/render/hero.ts +1 -1
  53. package/templates/collectathon/src/render/materials.ts +0 -1
  54. package/templates/collectathon/src/render/sky.ts +4 -3
  55. package/templates/kart/package.json +6 -6
  56. package/templates/kart/src/entities/Kart.ts +2 -1
  57. package/templates/kart/src/render/course.ts +2 -1
  58. package/templates/kart/src/track/Course.ts +3 -1
  59. package/templates/minimal/package.json +6 -6
  60. package/templates/minimal/src/render/camera.ts +2 -2
  61. package/templates/minimal/src/render/clouds.ts +3 -1
  62. package/templates/minimal/src/render/materials.ts +3 -2
  63. package/templates/minimal/src/render/touch-controls.ts +7 -6
  64. package/templates/platformer/package.json +7 -7
  65. package/templates/platformer/playtests/collect.playtest.json +4 -1
  66. package/templates/platformer/src/level/Stage.ts +2 -6
  67. package/templates/platformer/src/scenes/Play.ts +2 -1
  68. package/templates/puzzle/package.json +7 -7
  69. package/templates/puzzle/src/entities/Warden.ts +3 -3
  70. package/templates/puzzle/src/render/camera.ts +2 -2
  71. package/templates/puzzle/src/render/touch-controls.ts +7 -6
  72. package/templates/racing/AGENTS.md +2 -2
  73. package/templates/racing/CLAUDE.md +2 -2
  74. package/templates/racing/CREDITS.md +29 -0
  75. package/templates/racing/assets/engine-loop.wav +0 -0
  76. package/templates/racing/assets/grass/Grass004_color.jpg +0 -0
  77. package/templates/racing/assets/grass/Grass004_normal.jpg +0 -0
  78. package/templates/racing/assets/grass/Grass004_roughness.jpg +0 -0
  79. package/templates/racing/assets/nitro-burst.wav +0 -0
  80. package/templates/racing/assets/tyre-squeal.wav +0 -0
  81. package/templates/racing/package.json +7 -7
  82. package/templates/racing/playtests/drift-natural.playtest.json +68 -0
  83. package/templates/racing/playtests/drift.playtest.json +100 -0
  84. package/templates/racing/playtests/hud.playtest.json +117 -0
  85. package/templates/racing/playtests/launch-pose.playtest.json +34 -0
  86. package/templates/racing/playtests/nitro.playtest.json +158 -0
  87. package/templates/racing/playtests/outcome.playtest.json +4 -4
  88. package/templates/racing/playtests/performance.playtest.json +1 -1
  89. package/templates/racing/playtests/steady-camera.playtest.json +88 -0
  90. package/templates/racing/src/audio/engine.ts +138 -0
  91. package/templates/racing/src/entities/CarBody.ts +83 -10
  92. package/templates/racing/src/entities/Drift.ts +243 -0
  93. package/templates/racing/src/entities/LineDriver.ts +2 -2
  94. package/templates/racing/src/entities/Nitro.ts +72 -0
  95. package/templates/racing/src/entities/RacingCar.ts +86 -21
  96. package/templates/racing/src/entities/Rival.ts +35 -21
  97. package/templates/racing/src/game.ts +6 -0
  98. package/templates/racing/src/gauges.ts +74 -0
  99. package/templates/racing/src/render/camera.ts +29 -4
  100. package/templates/racing/src/render/clouds.ts +3 -1
  101. package/templates/racing/src/render/effects.ts +244 -0
  102. package/templates/racing/src/render/materials.ts +43 -8
  103. package/templates/racing/src/render/shapes.ts +37 -0
  104. package/templates/racing/src/render/skids.ts +84 -0
  105. package/templates/racing/src/render/touch-controls.ts +10 -10
  106. package/templates/racing/src/scenes/Race.ts +277 -25
  107. package/templates/racing/src/state.ts +35 -0
  108. package/templates/racing/src/style.css +3 -0
  109. package/templates/racing/src/track/Track.ts +132 -58
  110. package/templates/racing/src/track/TrackSector.ts +19 -1
  111. package/templates/racing/src/track/circuit.ts +21 -15
  112. package/templates/racing/src/ui/GameUi.tsx +0 -2
  113. package/templates/racing/src/ui/Hud.tsx +417 -50
  114. package/templates/racing/threenative.config.ts +15 -0
  115. package/templates/racing/tools/make-racing-audio.mjs +388 -0
  116. package/templates/rain/package.json +6 -6
  117. package/templates/rain/src/render/noise-volume.ts +2 -1
  118. package/templates/rain/src/state.ts +3 -1
  119. package/templates/rain/src/ui/GameUi.tsx +1 -1
  120. package/templates/rain/src/ui/automation.ts +10 -8
  121. package/templates/rain/src/ui/tempest.ts +3 -4
  122. package/templates/rts/package.json +6 -6
  123. package/templates/rts/src/sim/terrain.ts +1 -0
  124. package/templates/rts/src/sim/types.ts +1 -0
  125. package/templates/runner/package.json +7 -7
  126. package/templates/runner/src/render/clouds.ts +3 -1
  127. package/templates/runner/src/render/materials.ts +3 -2
  128. package/templates/runner/src/render/touch-controls.ts +7 -6
  129. package/templates/runner/src/scenes/Run.ts +4 -9
  130. package/templates/sailing/package.json +7 -7
  131. package/templates/sailing/src/render/touch-controls.ts +7 -6
  132. package/templates/shooter/package.json +7 -7
  133. package/templates/shooter/src/render/clouds.ts +3 -1
  134. package/templates/snow/package.json +7 -7
  135. package/templates/snow/src/entities/Explorer.ts +6 -12
  136. package/templates/snow/src/render/bootPrint.ts +3 -1
  137. package/templates/snow/src/render/camera.ts +3 -2
  138. package/templates/snow/src/render/scenery.ts +3 -3
  139. package/templates/snow/src/render/touch-controls.ts +7 -6
  140. package/templates/snow/src/render/weather.ts +3 -5
  141. package/templates/snow/src/terrain.ts +2 -1
  142. package/templates/starter/native-playtests/render-chain.playtest.json +9 -9
  143. package/templates/starter/package.json +7 -7
  144. package/templates/starter/src/entities/Player.ts +10 -2
  145. package/templates/starter/src/render/camera.ts +2 -2
  146. package/templates/starter/src/render/clouds.ts +3 -1
  147. package/templates/starter/src/render/materials.ts +3 -2
  148. package/templates/starter/src/render/touch-controls.ts +7 -6
  149. package/templates/starter/src/scenes/Play.ts +1 -14
  150. package/templates/tower-defense/package.json +7 -7
  151. package/templates/tower-defense/src/render/shapes.ts +1 -2
  152. package/templates/tower-defense/src/scenes/Battle.ts +3 -8
  153. package/template-assets/terrain/alpine/assets.json +0 -12
  154. package/template-assets/terrain/alpine/bake.mjs +0 -6
  155. package/template-assets/terrain/alpine/credits.json +0 -164
  156. package/template-assets/terrain/alpine/heightmap.r16 +0 -0
  157. package/template-assets/terrain/alpine/recipe.json +0 -119
  158. package/template-assets/terrain/alpine/surface.json +0 -53
  159. package/template-assets/terrain/coastal/assets.json +0 -11
  160. package/template-assets/terrain/coastal/bake.mjs +0 -6
  161. package/template-assets/terrain/coastal/credits.json +0 -117
  162. package/template-assets/terrain/coastal/heightmap.r16 +0 -0
  163. package/template-assets/terrain/coastal/recipe.json +0 -113
  164. package/template-assets/terrain/coastal/surface.json +0 -41
  165. package/template-assets/terrain/desert/assets.json +0 -12
  166. package/template-assets/terrain/desert/bake.mjs +0 -6
  167. package/template-assets/terrain/desert/credits.json +0 -164
  168. package/template-assets/terrain/desert/heightmap.r16 +0 -0
  169. package/template-assets/terrain/desert/recipe.json +0 -108
  170. package/template-assets/terrain/desert/surface.json +0 -54
  171. package/template-assets/terrain/forest/assets.json +0 -65
  172. package/template-assets/terrain/forest/bake.mjs +0 -8
  173. package/template-assets/terrain/forest/credits.json +0 -225
  174. package/template-assets/terrain/forest/heightmap.r16 +0 -0
  175. package/template-assets/terrain/forest/recipe.json +0 -350
  176. package/template-assets/terrain/forest/surface.json +0 -79
  177. package/template-assets/terrain/tundra/assets.json +0 -12
  178. package/template-assets/terrain/tundra/bake.mjs +0 -6
  179. package/template-assets/terrain/tundra/credits.json +0 -164
  180. package/template-assets/terrain/tundra/heightmap.r16 +0 -0
  181. package/template-assets/terrain/tundra/recipe.json +0 -277
  182. package/template-assets/terrain/tundra/surface.json +0 -54
  183. package/templates/racing/src/ui/Menu.tsx +0 -7
@@ -8581,6 +8581,15 @@ var catalog_default = {
8581
8581
  status: {
8582
8582
  kind: "supported"
8583
8583
  }
8584
+ },
8585
+ {
8586
+ name: "alphaToCoverage",
8587
+ type: "boolean",
8588
+ mutable: true,
8589
+ lifetime: "owned",
8590
+ status: {
8591
+ kind: "supported"
8592
+ }
8584
8593
  }
8585
8594
  ],
8586
8595
  methods: [
@@ -11373,8 +11382,7 @@ var catalog_default = {
11373
11382
  mutable: true,
11374
11383
  lifetime: "owned",
11375
11384
  status: {
11376
- kind: "partial",
11377
- gaps: ["native-not-bound"]
11385
+ kind: "supported"
11378
11386
  }
11379
11387
  },
11380
11388
  {
@@ -12478,6 +12486,24 @@ var catalog_default = {
12478
12486
  status: {
12479
12487
  kind: "supported"
12480
12488
  }
12489
+ },
12490
+ {
12491
+ name: "maskShadowNode",
12492
+ type: "Node | null",
12493
+ mutable: true,
12494
+ lifetime: "owned",
12495
+ status: {
12496
+ kind: "supported"
12497
+ }
12498
+ },
12499
+ {
12500
+ name: "alphaToCoverage",
12501
+ type: "boolean",
12502
+ mutable: true,
12503
+ lifetime: "owned",
12504
+ status: {
12505
+ kind: "supported"
12506
+ }
12481
12507
  }
12482
12508
  ],
12483
12509
  methods: [
@@ -12614,8 +12640,7 @@ var catalog_default = {
12614
12640
  mutable: true,
12615
12641
  lifetime: "owned",
12616
12642
  status: {
12617
- kind: "partial",
12618
- gaps: ["native-not-bound"]
12643
+ kind: "supported"
12619
12644
  }
12620
12645
  },
12621
12646
  {
@@ -14031,6 +14056,24 @@ var catalog_default = {
14031
14056
  status: {
14032
14057
  kind: "supported"
14033
14058
  }
14059
+ },
14060
+ {
14061
+ name: "maskShadowNode",
14062
+ type: "Node | null",
14063
+ mutable: true,
14064
+ lifetime: "owned",
14065
+ status: {
14066
+ kind: "supported"
14067
+ }
14068
+ },
14069
+ {
14070
+ name: "alphaToCoverage",
14071
+ type: "boolean",
14072
+ mutable: true,
14073
+ lifetime: "owned",
14074
+ status: {
14075
+ kind: "supported"
14076
+ }
14034
14077
  }
14035
14078
  ],
14036
14079
  methods: [
@@ -14758,6 +14801,24 @@ var catalog_default = {
14758
14801
  status: {
14759
14802
  kind: "supported"
14760
14803
  }
14804
+ },
14805
+ {
14806
+ name: "maskShadowNode",
14807
+ type: "Node | null",
14808
+ mutable: true,
14809
+ lifetime: "owned",
14810
+ status: {
14811
+ kind: "supported"
14812
+ }
14813
+ },
14814
+ {
14815
+ name: "alphaToCoverage",
14816
+ type: "boolean",
14817
+ mutable: true,
14818
+ lifetime: "owned",
14819
+ status: {
14820
+ kind: "supported"
14821
+ }
14761
14822
  }
14762
14823
  ],
14763
14824
  methods: [
@@ -18536,6 +18597,15 @@ var catalog_default = {
18536
18597
  status: {
18537
18598
  kind: "supported"
18538
18599
  }
18600
+ },
18601
+ {
18602
+ name: "alphaToCoverage",
18603
+ type: "boolean",
18604
+ mutable: true,
18605
+ lifetime: "owned",
18606
+ status: {
18607
+ kind: "supported"
18608
+ }
18539
18609
  }
18540
18610
  ],
18541
18611
  methods: [
@@ -21938,6 +22008,15 @@ var catalog_default = {
21938
22008
  status: {
21939
22009
  kind: "supported"
21940
22010
  }
22011
+ },
22012
+ {
22013
+ name: "alphaToCoverage",
22014
+ type: "boolean",
22015
+ mutable: true,
22016
+ lifetime: "owned",
22017
+ status: {
22018
+ kind: "supported"
22019
+ }
21941
22020
  }
21942
22021
  ],
21943
22022
  methods: [
@@ -28988,6 +29067,15 @@ var catalog_default = {
28988
29067
  status: {
28989
29068
  kind: "supported"
28990
29069
  }
29070
+ },
29071
+ {
29072
+ name: "alphaToCoverage",
29073
+ type: "boolean",
29074
+ mutable: true,
29075
+ lifetime: "owned",
29076
+ status: {
29077
+ kind: "supported"
29078
+ }
28991
29079
  }
28992
29080
  ],
28993
29081
  methods: [
@@ -29398,6 +29486,15 @@ var catalog_default = {
29398
29486
  status: {
29399
29487
  kind: "supported"
29400
29488
  }
29489
+ },
29490
+ {
29491
+ name: "alphaToCoverage",
29492
+ type: "boolean",
29493
+ mutable: true,
29494
+ lifetime: "owned",
29495
+ status: {
29496
+ kind: "supported"
29497
+ }
29401
29498
  }
29402
29499
  ],
29403
29500
  methods: [
@@ -35948,6 +36045,7 @@ var native_registry_default = {
35948
36045
  getters: [
35949
36046
  "alphaHash",
35950
36047
  "alphaTest",
36048
+ "alphaToCoverage",
35951
36049
  "blendDst",
35952
36050
  "blendDstAlpha",
35953
36051
  "blendEquation",
@@ -35983,6 +36081,7 @@ var native_registry_default = {
35983
36081
  setters: [
35984
36082
  "alphaHash",
35985
36083
  "alphaTest",
36084
+ "alphaToCoverage",
35986
36085
  "blendDst",
35987
36086
  "blendDstAlpha",
35988
36087
  "blendEquation",
@@ -36764,6 +36863,7 @@ var native_registry_default = {
36764
36863
  getters: [
36765
36864
  "alphaHash",
36766
36865
  "alphaTest",
36866
+ "alphaToCoverage",
36767
36867
  "blendDst",
36768
36868
  "blendDstAlpha",
36769
36869
  "blendEquation",
@@ -36799,6 +36899,7 @@ var native_registry_default = {
36799
36899
  setters: [
36800
36900
  "alphaHash",
36801
36901
  "alphaTest",
36902
+ "alphaToCoverage",
36802
36903
  "blendDst",
36803
36904
  "blendDstAlpha",
36804
36905
  "blendEquation",
@@ -36852,6 +36953,7 @@ var native_registry_default = {
36852
36953
  "alphaHash",
36853
36954
  "alphaTest",
36854
36955
  "alphaTestNode",
36956
+ "alphaToCoverage",
36855
36957
  "aoNode",
36856
36958
  "blendDst",
36857
36959
  "blendDstAlpha",
@@ -36878,6 +36980,7 @@ var native_registry_default = {
36878
36980
  "irradianceNode",
36879
36981
  "lightsNode",
36880
36982
  "maskNode",
36983
+ "maskShadowNode",
36881
36984
  "maxPositionOffset",
36882
36985
  "metalnessNode",
36883
36986
  "mrtNode",
@@ -36905,6 +37008,7 @@ var native_registry_default = {
36905
37008
  "alphaHash",
36906
37009
  "alphaTest",
36907
37010
  "alphaTestNode",
37011
+ "alphaToCoverage",
36908
37012
  "aoNode",
36909
37013
  "blendDst",
36910
37014
  "blendDstAlpha",
@@ -36932,6 +37036,7 @@ var native_registry_default = {
36932
37036
  "lightsNode",
36933
37037
  "map",
36934
37038
  "maskNode",
37039
+ "maskShadowNode",
36935
37040
  "maxPositionOffset",
36936
37041
  "metalnessNode",
36937
37042
  "mrtNode",
@@ -36974,6 +37079,7 @@ var native_registry_default = {
36974
37079
  getters: [
36975
37080
  "alphaHash",
36976
37081
  "alphaTest",
37082
+ "alphaToCoverage",
36977
37083
  "blendDst",
36978
37084
  "blendDstAlpha",
36979
37085
  "blendEquation",
@@ -37015,6 +37121,7 @@ var native_registry_default = {
37015
37121
  setters: [
37016
37122
  "alphaHash",
37017
37123
  "alphaTest",
37124
+ "alphaToCoverage",
37018
37125
  "blendDst",
37019
37126
  "blendDstAlpha",
37020
37127
  "blendEquation",
@@ -37077,6 +37184,7 @@ var native_registry_default = {
37077
37184
  getters: [
37078
37185
  "alphaHash",
37079
37186
  "alphaTest",
37187
+ "alphaToCoverage",
37080
37188
  "blendDst",
37081
37189
  "blendDstAlpha",
37082
37190
  "blendEquation",
@@ -37122,6 +37230,7 @@ var native_registry_default = {
37122
37230
  setters: [
37123
37231
  "alphaHash",
37124
37232
  "alphaTest",
37233
+ "alphaToCoverage",
37125
37234
  "blendDst",
37126
37235
  "blendDstAlpha",
37127
37236
  "blendEquation",
@@ -37197,6 +37306,7 @@ var native_registry_default = {
37197
37306
  getters: [
37198
37307
  "alphaHash",
37199
37308
  "alphaTest",
37309
+ "alphaToCoverage",
37200
37310
  "anisotropy",
37201
37311
  "aoMapIntensity",
37202
37312
  "blendDst",
@@ -37256,6 +37366,7 @@ var native_registry_default = {
37256
37366
  setters: [
37257
37367
  "alphaHash",
37258
37368
  "alphaTest",
37369
+ "alphaToCoverage",
37259
37370
  "anisotropy",
37260
37371
  "aoMap",
37261
37372
  "aoMapIntensity",
@@ -37370,6 +37481,7 @@ var native_registry_default = {
37370
37481
  "alphaHash",
37371
37482
  "alphaTest",
37372
37483
  "alphaTestNode",
37484
+ "alphaToCoverage",
37373
37485
  "anisotropy",
37374
37486
  "aoMapIntensity",
37375
37487
  "aoNode",
@@ -37410,6 +37522,7 @@ var native_registry_default = {
37410
37522
  "irradianceNode",
37411
37523
  "lightsNode",
37412
37524
  "maskNode",
37525
+ "maskShadowNode",
37413
37526
  "maxPositionOffset",
37414
37527
  "metalness",
37415
37528
  "metalnessNode",
@@ -37447,6 +37560,7 @@ var native_registry_default = {
37447
37560
  "alphaHash",
37448
37561
  "alphaTest",
37449
37562
  "alphaTestNode",
37563
+ "alphaToCoverage",
37450
37564
  "anisotropy",
37451
37565
  "aoMap",
37452
37566
  "aoMapIntensity",
@@ -37497,6 +37611,7 @@ var native_registry_default = {
37497
37611
  "lightsNode",
37498
37612
  "map",
37499
37613
  "maskNode",
37614
+ "maskShadowNode",
37500
37615
  "maxPositionOffset",
37501
37616
  "metalness",
37502
37617
  "metalnessMap",
@@ -37577,6 +37692,7 @@ var native_registry_default = {
37577
37692
  getters: [
37578
37693
  "alphaHash",
37579
37694
  "alphaTest",
37695
+ "alphaToCoverage",
37580
37696
  "aoMapIntensity",
37581
37697
  "blendDst",
37582
37698
  "blendDstAlpha",
@@ -37624,6 +37740,7 @@ var native_registry_default = {
37624
37740
  setters: [
37625
37741
  "alphaHash",
37626
37742
  "alphaTest",
37743
+ "alphaToCoverage",
37627
37744
  "aoMap",
37628
37745
  "aoMapIntensity",
37629
37746
  "blendDst",
@@ -37712,6 +37829,7 @@ var native_registry_default = {
37712
37829
  "alphaHash",
37713
37830
  "alphaTest",
37714
37831
  "alphaTestNode",
37832
+ "alphaToCoverage",
37715
37833
  "aoMapIntensity",
37716
37834
  "aoNode",
37717
37835
  "blendDst",
@@ -37746,6 +37864,7 @@ var native_registry_default = {
37746
37864
  "irradianceNode",
37747
37865
  "lightsNode",
37748
37866
  "maskNode",
37867
+ "maskShadowNode",
37749
37868
  "maxPositionOffset",
37750
37869
  "metalness",
37751
37870
  "metalnessNode",
@@ -37777,6 +37896,7 @@ var native_registry_default = {
37777
37896
  "alphaHash",
37778
37897
  "alphaTest",
37779
37898
  "alphaTestNode",
37899
+ "alphaToCoverage",
37780
37900
  "aoMap",
37781
37901
  "aoMapIntensity",
37782
37902
  "aoNode",
@@ -37817,6 +37937,7 @@ var native_registry_default = {
37817
37937
  "lightsNode",
37818
37938
  "map",
37819
37939
  "maskNode",
37940
+ "maskShadowNode",
37820
37941
  "maxPositionOffset",
37821
37942
  "metalness",
37822
37943
  "metalnessMap",
@@ -37882,6 +38003,7 @@ var native_registry_default = {
37882
38003
  "alphaHash",
37883
38004
  "alphaTest",
37884
38005
  "alphaTestNode",
38006
+ "alphaToCoverage",
37885
38007
  "aoNode",
37886
38008
  "blendDst",
37887
38009
  "blendDstAlpha",
@@ -37904,6 +38026,7 @@ var native_registry_default = {
37904
38026
  "irradianceNode",
37905
38027
  "lightsNode",
37906
38028
  "maskNode",
38029
+ "maskShadowNode",
37907
38030
  "maxPositionOffset",
37908
38031
  "mrtNode",
37909
38032
  "name",
@@ -37929,6 +38052,7 @@ var native_registry_default = {
37929
38052
  "alphaHash",
37930
38053
  "alphaTest",
37931
38054
  "alphaTestNode",
38055
+ "alphaToCoverage",
37932
38056
  "aoNode",
37933
38057
  "blendDst",
37934
38058
  "blendDstAlpha",
@@ -37950,6 +38074,7 @@ var native_registry_default = {
37950
38074
  "irradianceNode",
37951
38075
  "lightsNode",
37952
38076
  "maskNode",
38077
+ "maskShadowNode",
37953
38078
  "maxPositionOffset",
37954
38079
  "mrtNode",
37955
38080
  "name",
@@ -39398,6 +39523,7 @@ var native_registry_default = {
39398
39523
  getters: [
39399
39524
  "alphaHash",
39400
39525
  "alphaTest",
39526
+ "alphaToCoverage",
39401
39527
  "blendDst",
39402
39528
  "blendDstAlpha",
39403
39529
  "blendEquation",
@@ -39435,6 +39561,7 @@ var native_registry_default = {
39435
39561
  setters: [
39436
39562
  "alphaHash",
39437
39563
  "alphaTest",
39564
+ "alphaToCoverage",
39438
39565
  "blendDst",
39439
39566
  "blendDstAlpha",
39440
39567
  "blendEquation",
@@ -41169,6 +41296,7 @@ var native_registry_default = {
41169
41296
  getters: [
41170
41297
  "alphaHash",
41171
41298
  "alphaTest",
41299
+ "alphaToCoverage",
41172
41300
  "blendDst",
41173
41301
  "blendDstAlpha",
41174
41302
  "blendEquation",
@@ -41206,6 +41334,7 @@ var native_registry_default = {
41206
41334
  setters: [
41207
41335
  "alphaHash",
41208
41336
  "alphaTest",
41337
+ "alphaToCoverage",
41209
41338
  "blendDst",
41210
41339
  "blendDstAlpha",
41211
41340
  "blendEquation",
@@ -41261,6 +41390,7 @@ var native_registry_default = {
41261
41390
  "alphaHash",
41262
41391
  "alphaTest",
41263
41392
  "alphaTestNode",
41393
+ "alphaToCoverage",
41264
41394
  "aoNode",
41265
41395
  "blendDst",
41266
41396
  "blendDstAlpha",
@@ -41287,6 +41417,7 @@ var native_registry_default = {
41287
41417
  "irradianceNode",
41288
41418
  "lightsNode",
41289
41419
  "maskNode",
41420
+ "maskShadowNode",
41290
41421
  "maxPositionOffset",
41291
41422
  "metalnessNode",
41292
41423
  "mrtNode",
@@ -41318,6 +41449,7 @@ var native_registry_default = {
41318
41449
  "alphaHash",
41319
41450
  "alphaTest",
41320
41451
  "alphaTestNode",
41452
+ "alphaToCoverage",
41321
41453
  "aoNode",
41322
41454
  "blendDst",
41323
41455
  "blendDstAlpha",
@@ -41345,6 +41477,7 @@ var native_registry_default = {
41345
41477
  "lightsNode",
41346
41478
  "map",
41347
41479
  "maskNode",
41480
+ "maskShadowNode",
41348
41481
  "maxPositionOffset",
41349
41482
  "metalnessNode",
41350
41483
  "mrtNode",
@@ -43275,6 +43408,15 @@ function packedRef(ref) {
43275
43408
  function isRef(value) {
43276
43409
  return typeof value === "object" && value !== null && "key" in value && "type" in value;
43277
43410
  }
43411
+ function heapFor(abi, end) {
43412
+ if (end <= abi.HEAPU8.byteLength) return abi.HEAPU8;
43413
+ const buffer = abi.wasmMemory?.buffer;
43414
+ if (buffer !== void 0 && buffer.byteLength > abi.HEAPU8.byteLength && typeof SharedArrayBuffer !== "undefined" && buffer instanceof SharedArrayBuffer) {
43415
+ abi.HEAPU8 = new Uint8Array(buffer);
43416
+ abi.HEAPF64 = new Float64Array(buffer);
43417
+ }
43418
+ return abi.HEAPU8;
43419
+ }
43278
43420
  var HANDLE = 12;
43279
43421
  var VALUE = 56;
43280
43422
  var KIND = {
@@ -43513,7 +43655,7 @@ function tslOf(abi, context, h) {
43513
43655
  const out = abi._malloc(size) >>> 0;
43514
43656
  try {
43515
43657
  if (readStorageTake(id, out, size) === 1)
43516
- return abi.HEAPU8.slice(out, out + size).buffer;
43658
+ return heapFor(abi, out + size).slice(out, out + size).buffer;
43517
43659
  } finally {
43518
43660
  abi._free(out);
43519
43661
  }
@@ -43546,7 +43688,7 @@ function tslOf(abi, context, h) {
43546
43688
  candidateAt = abi._malloc(candidateRoom * 12) >>> 0;
43547
43689
  candidatesWritten = 0;
43548
43690
  }
43549
- const ids = h.view();
43691
+ const ids = h.view(candidateAt + candidateRoom * 12);
43550
43692
  for (; candidatesWritten < candidates.length; candidatesWritten += 1)
43551
43693
  ids.setBigUint64(
43552
43694
  candidateAt + candidatesWritten * 8,
@@ -44812,7 +44954,7 @@ function defineValueViews(host) {
44812
44954
  const peek = runtime.readByte;
44813
44955
  if (read === void 0 || write === void 0) return;
44814
44956
  const heap = runtime.heapF64;
44815
- const lane = heap ? (address) => heap()[address / 8] : (address) => read(address, 1);
44957
+ const lane = heap ? (address) => heap(address + 8)[address / 8] : (address) => read(address, 1);
44816
44958
  if (name === "Quaternion" && binding.fields !== void 0) {
44817
44959
  const offsets = ["x", "y", "z", "w"].map((key) => binding.fields?.[key]?.[0] ?? 0);
44818
44960
  ["_x", "_y", "_z", "_w"].forEach((key, index) => {
@@ -44942,7 +45084,7 @@ function defineValueViews(host) {
44942
45084
  const [offset = 0, count = 0] = binding.fields.elements;
44943
45085
  const mirrors = /* @__PURE__ */ new WeakMap();
44944
45086
  const refresh = heap ? (address, values) => {
44945
- const memory = heap();
45087
+ const memory = heap(address + count * 8);
44946
45088
  for (let i = 0, at = address / 8; i < count; i++) values[i] = memory[at + i];
44947
45089
  } : (address, values) => {
44948
45090
  const memory = read(address, count);
@@ -44953,7 +45095,7 @@ function defineValueViews(host) {
44953
45095
  configurable: true,
44954
45096
  get() {
44955
45097
  const address = addressOf(this) + offset;
44956
- const memory = heap?.();
45098
+ const memory = heap?.(address + count * 8);
44957
45099
  if (typeof SharedArrayBuffer !== "undefined" && memory?.buffer instanceof SharedArrayBuffer) {
44958
45100
  let view = shared.get(this);
44959
45101
  if (view === void 0) {
@@ -45820,20 +45962,24 @@ function createWasmRuntime(abi) {
45820
45962
  let heapBytes = heap.byteLength;
45821
45963
  let dataView = new DataView(heap.buffer);
45822
45964
  let words = new Uint32Array(heap.buffer);
45823
- const grown = () => {
45824
- debug?.add("wasmGrowthEvents", 1, "bridge");
45825
- debug?.add("wasmGrowthBytes", Math.max(0, abi.HEAPU8.byteLength - heapBytes), "memory");
45826
- heap = abi.HEAPU8;
45965
+ const grown = (end) => {
45966
+ const before = heapBytes;
45967
+ heap = heapFor(abi, end);
45827
45968
  heapBytes = heap.byteLength;
45828
45969
  dataView = new DataView(heap.buffer);
45829
45970
  words = new Uint32Array(heap.buffer);
45971
+ debug?.add("wasmGrowthEvents", 1, "bridge");
45972
+ debug?.add("wasmGrowthBytes", Math.max(0, heapBytes - before), "memory");
45973
+ };
45974
+ const reach = (end) => {
45975
+ if (end > heapBytes) grown(end);
45830
45976
  };
45831
- const view = () => {
45832
- if (abi.HEAPU8 !== heap) grown();
45977
+ const view = (end = 0) => {
45978
+ if (end > heapBytes || abi.HEAPU8 !== heap) grown(end);
45833
45979
  return dataView;
45834
45980
  };
45835
- const wordView = () => {
45836
- if (abi.HEAPU8 !== heap) grown();
45981
+ const wordView = (end = 0) => {
45982
+ if (end > heapBytes || abi.HEAPU8 !== heap) grown(end);
45837
45983
  return words;
45838
45984
  };
45839
45985
  const arenaSize = 64 * 1024;
@@ -45853,7 +45999,7 @@ function createWasmRuntime(abi) {
45853
45999
  debug?.add("bridgeOverflowAllocations", 1, "bridge");
45854
46000
  debug?.add("bridgeOverflowBytes", aligned, "bridge");
45855
46001
  }
45856
- const w = wordView();
46002
+ const w = wordView(pointer + aligned);
45857
46003
  if (aligned > 64) heap.fill(0, pointer, pointer + aligned);
45858
46004
  else for (let at = pointer >>> 2, end = pointer + aligned >>> 2; at < end; at++) w[at] = 0;
45859
46005
  return pointer;
@@ -45995,7 +46141,7 @@ function createWasmRuntime(abi) {
45995
46141
  return pointer;
45996
46142
  };
45997
46143
  const readValue = (pointer) => {
45998
- const v = view();
46144
+ const v = view(pointer + VALUE);
45999
46145
  switch (v.getUint32(pointer, true)) {
46000
46146
  case KIND.undefined:
46001
46147
  return void 0;
@@ -46029,9 +46175,9 @@ function createWasmRuntime(abi) {
46029
46175
  }
46030
46176
  case KIND.numbers: {
46031
46177
  const at = v.getUint32(pointer + 48, true) / 8;
46032
- return Array.from(
46033
- abi.HEAPF64.subarray(at, at + Number(v.getBigUint64(pointer + 40, true)))
46034
- );
46178
+ const count = Number(v.getBigUint64(pointer + 40, true));
46179
+ reach((at + count) * 8);
46180
+ return Array.from(abi.HEAPF64.subarray(at, at + count));
46035
46181
  }
46036
46182
  default:
46037
46183
  return null;
@@ -46082,6 +46228,7 @@ function createWasmRuntime(abi) {
46082
46228
  const Typed = SCALARS[scalar2 ?? -1];
46083
46229
  if (Typed === void 0)
46084
46230
  throw new TypeError(`TN_NATIVE_UNSUPPORTED array: scalar ${String(scalar2)}`);
46231
+ reach((address ?? 0) + (count ?? 0) * Typed.BYTES_PER_ELEMENT);
46085
46232
  return use(new Typed(abi.HEAPU8.buffer, address ?? 0, count ?? 0));
46086
46233
  } finally {
46087
46234
  abi._tnw_attribute_view_release?.(lease);
@@ -46177,16 +46324,25 @@ function createWasmRuntime(abi) {
46177
46324
  batch.status[i] = after.getFloat64(status + i * 8, true);
46178
46325
  });
46179
46326
  },
46180
- readByte: (address) => abi.HEAPU8[address],
46181
- readWord: (address) => view().getUint32(address, true),
46327
+ readByte: (address) => {
46328
+ reach(address + 1);
46329
+ return abi.HEAPU8[address];
46330
+ },
46331
+ readWord: (address) => view(address + 4).getUint32(address, true),
46182
46332
  writeDouble: (address, value) => {
46333
+ reach(address + 8);
46183
46334
  abi.HEAPF64[address / 8] = value;
46184
46335
  },
46185
46336
  writeByte: (address, value) => {
46337
+ reach(address + 1);
46186
46338
  abi.HEAPU8[address] = value;
46187
46339
  },
46188
- heapF64: () => abi.HEAPF64,
46340
+ heapF64: (end) => {
46341
+ reach(end);
46342
+ return abi.HEAPF64;
46343
+ },
46189
46344
  readDoubles: (address, count) => {
46345
+ reach(address + count * 8);
46190
46346
  const at = address / 8;
46191
46347
  return count === 1 ? abi.HEAPF64[at] : Array.from(abi.HEAPF64.subarray(at, at + count));
46192
46348
  },
@@ -46970,8 +47126,9 @@ function defineBrowserClasses(registry, source, catalog) {
46970
47126
  value(other) {
46971
47127
  if (other === null || typeof other !== "object" || Object.getPrototypeOf(other) !== prototype)
46972
47128
  return engineCopy.call(this, other);
46973
- const from = (addressOf(other) + offset) / 8;
46974
- heapF64().copyWithin((addressOf(this) + offset) / 8, from, from + count);
47129
+ const to = addressOf(this) + offset;
47130
+ const from = addressOf(other) + offset;
47131
+ heapF64(Math.max(to, from) + count * 8).copyWithin(to / 8, from / 8, from / 8 + count);
46975
47132
  return this;
46976
47133
  }
46977
47134
  },
@@ -46981,9 +47138,9 @@ function defineBrowserClasses(registry, source, catalog) {
46981
47138
  value(other) {
46982
47139
  if (other === null || typeof other !== "object" || Object.getPrototypeOf(other) !== prototype)
46983
47140
  return engineEquals.call(this, other);
46984
- const heap = heapF64();
46985
47141
  const a = (addressOf(this) + offset) / 8;
46986
47142
  const b = (addressOf(other) + offset) / 8;
47143
+ const heap = heapF64((Math.max(a, b) + count) * 8);
46987
47144
  for (let i = 0; i < count; i++) if (heap[a + i] !== heap[b + i]) return false;
46988
47145
  return true;
46989
47146
  }
@@ -47776,8 +47933,7 @@ var WEB_FRAME_FIELD = {
47776
47933
  firstWorldFrameDrawn: 86,
47777
47934
  textureCompressionBc: 87,
47778
47935
  virtualShadowPendingLevels: 88,
47779
- frameSnapshot: 89
47780
- };
47936
+ frameSnapshot: 89};
47781
47937
 
47782
47938
  // ../three-native/src/gpu-stages.ts
47783
47939
  var GPU_STAGES = ["SSGI"];
@@ -49602,7 +49758,7 @@ function defineWebRenderer(module, Color2, beforeRender = () => {
49602
49758
  if (ref === void 0)
49603
49759
  throw new TypeError(`TN_WASM_RENDER: the ${what} is not an engine object.`);
49604
49760
  const { w0, w1, w2 } = packedRef(ref);
49605
- const view = new DataView(module.HEAPU8.buffer);
49761
+ const view = new DataView(heapFor(module, handles + offset + 12).buffer);
49606
49762
  view.setUint32(handles + offset, w0, true);
49607
49763
  view.setUint32(handles + offset + 4, w1, true);
49608
49764
  view.setUint32(handles + offset + 8, w2, true);
@@ -49844,9 +50000,7 @@ function defineWebRenderer(module, Color2, beforeRender = () => {
49844
50000
  throw new Error(
49845
50001
  `TN_WASM_ABI_MISMATCH: this facade speaks web host ABI ${WEB_HOST_ABI}, the engine ${engine ?? "none (older than ABI 2)"}: install create-threenative and @threenative/runtime-native from one build`
49846
50002
  );
49847
- started = this.domElement;
49848
50003
  module.specialHTMLTargets[CANVAS_TARGET] = this.domElement;
49849
- handles = module._malloc(36) >>> 0;
49850
50004
  const selector = string(CANVAS_TARGET);
49851
50005
  try {
49852
50006
  check(
@@ -49855,6 +50009,8 @@ function defineWebRenderer(module, Color2, beforeRender = () => {
49855
50009
  } finally {
49856
50010
  module._free(selector);
49857
50011
  }
50012
+ started = this.domElement;
50013
+ handles = module._malloc(36) >>> 0;
49858
50014
  } else {
49859
50015
  tsl?.setPost(null);
49860
50016
  tsl?.setToneMapping?.(null);
@@ -49884,7 +50040,10 @@ function defineWebRenderer(module, Color2, beforeRender = () => {
49884
50040
  );
49885
50041
  }
49886
50042
  return this;
49887
- })();
50043
+ })().catch((error) => {
50044
+ this.dispose();
50045
+ throw error;
50046
+ });
49888
50047
  return this.#initialized;
49889
50048
  }
49890
50049
  #drawWidth() {
@@ -50440,7 +50599,7 @@ function defineWebRenderer(module, Color2, beforeRender = () => {
50440
50599
  for (; ; ) {
50441
50600
  module._tnw_web_poll();
50442
50601
  const status = module._tnw_web_read_target_take(id, out, size);
50443
- if (status === 1) return module.HEAPU8.slice(out, out + size);
50602
+ if (status === 1) return heapFor(module, out + size).slice(out, out + size);
50444
50603
  if (status < 0)
50445
50604
  throw new Error(
50446
50605
  module._tnw_web_poll() === FAILED ? `TN_WASM_READ_TARGET: the read failed: ${module.UTF8ToString(module._tnw_web_error())}` : "TN_WASM_READ_TARGET: the read failed"
@@ -50493,7 +50652,9 @@ function defineWebRenderer(module, Color2, beforeRender = () => {
50493
50652
  module._tnw_web_poll();
50494
50653
  const status = module._tnw_web_read_target_take(id, out, bytes);
50495
50654
  if (status === 1)
50496
- return new Float32Array(module.HEAPU8.slice(out, out + bytes).buffer);
50655
+ return new Float32Array(
50656
+ heapFor(module, out + bytes).slice(out, out + bytes).buffer
50657
+ );
50497
50658
  if (status < 0) throw new Error("TN_REFLECTION_CAPTURE_READ");
50498
50659
  await new Promise((resolve) => setTimeout(resolve, 0));
50499
50660
  }
@@ -50690,6 +50851,7 @@ var STANDARD_ATTRIBUTES = [
50690
50851
  "skinIndex",
50691
50852
  "skinWeight"
50692
50853
  ];
50854
+ var undefinedOnMissing = /* @__PURE__ */ new WeakSet();
50693
50855
  function defineGeometrySurface(BufferGeometry, geometries) {
50694
50856
  const attributeViews = /* @__PURE__ */ new WeakMap();
50695
50857
  for (const geometry of [BufferGeometry, ...geometries]) {
@@ -50716,6 +50878,19 @@ function defineGeometrySurface(BufferGeometry, geometries) {
50716
50878
  return JSON.parse(groups.get?.call(this)).map(({ start, count, materialIndex }) => ({ start, count, materialIndex }));
50717
50879
  }
50718
50880
  });
50881
+ const read = prototype.getAttribute;
50882
+ if (typeof read === "function" && !undefinedOnMissing.has(read)) {
50883
+ const answer = function(name) {
50884
+ return read.call(this, name) ?? void 0;
50885
+ };
50886
+ undefinedOnMissing.add(answer);
50887
+ Object.defineProperty(prototype, "getAttribute", {
50888
+ configurable: true,
50889
+ enumerable: false,
50890
+ value: answer,
50891
+ writable: true
50892
+ });
50893
+ }
50719
50894
  Object.defineProperty(prototype, "attributes", {
50720
50895
  configurable: true,
50721
50896
  get() {