@oeave/bakery3 0.0.0-stage → 0.2.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 (86) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +562 -2
  3. package/dist/animation-B1h0Ryvj.d.ts +97 -0
  4. package/dist/bake/index.d.ts +369 -0
  5. package/dist/bake/index.js +9 -0
  6. package/dist/bake/index.js.map +1 -0
  7. package/dist/bake-DZ-CJR6f.d.ts +1364 -0
  8. package/dist/catalog/index.d.ts +100 -0
  9. package/dist/catalog/index.js +154 -0
  10. package/dist/catalog/index.js.map +1 -0
  11. package/dist/catalog.gen-BM-aNf7n.d.ts +733 -0
  12. package/dist/chunk-3G5QL4F4.js +145 -0
  13. package/dist/chunk-3G5QL4F4.js.map +1 -0
  14. package/dist/chunk-4E5VV4QY.js +12 -0
  15. package/dist/chunk-4E5VV4QY.js.map +1 -0
  16. package/dist/chunk-62M6XXNX.js +142 -0
  17. package/dist/chunk-62M6XXNX.js.map +1 -0
  18. package/dist/chunk-6FYI6AJM.js +1157 -0
  19. package/dist/chunk-6FYI6AJM.js.map +1 -0
  20. package/dist/chunk-6NYR73Y7.js +832 -0
  21. package/dist/chunk-6NYR73Y7.js.map +1 -0
  22. package/dist/chunk-APWUCEEB.js +118 -0
  23. package/dist/chunk-APWUCEEB.js.map +1 -0
  24. package/dist/chunk-HNMSWQU7.js +1709 -0
  25. package/dist/chunk-HNMSWQU7.js.map +1 -0
  26. package/dist/chunk-JFYUDERE.js +1412 -0
  27. package/dist/chunk-JFYUDERE.js.map +1 -0
  28. package/dist/chunk-KNUAOILG.js +551 -0
  29. package/dist/chunk-KNUAOILG.js.map +1 -0
  30. package/dist/chunk-KZLVTSBI.js +191 -0
  31. package/dist/chunk-KZLVTSBI.js.map +1 -0
  32. package/dist/chunk-LAKXC4WR.js +2028 -0
  33. package/dist/chunk-LAKXC4WR.js.map +1 -0
  34. package/dist/chunk-NXBAZGNB.js +1107 -0
  35. package/dist/chunk-NXBAZGNB.js.map +1 -0
  36. package/dist/chunk-QRCT5UGZ.js +3286 -0
  37. package/dist/chunk-QRCT5UGZ.js.map +1 -0
  38. package/dist/chunk-S4AJTLLN.js +23 -0
  39. package/dist/chunk-S4AJTLLN.js.map +1 -0
  40. package/dist/chunk-UWBP7B54.js +92 -0
  41. package/dist/chunk-UWBP7B54.js.map +1 -0
  42. package/dist/chunk-XK35ANPJ.js +346 -0
  43. package/dist/chunk-XK35ANPJ.js.map +1 -0
  44. package/dist/chunk-Z7IYVH22.js +4781 -0
  45. package/dist/chunk-Z7IYVH22.js.map +1 -0
  46. package/dist/chunk-ZEBVAIJJ.js +156 -0
  47. package/dist/chunk-ZEBVAIJJ.js.map +1 -0
  48. package/dist/devtools/index.d.ts +536 -0
  49. package/dist/devtools/index.js +15 -0
  50. package/dist/devtools/index.js.map +1 -0
  51. package/dist/environments/index.d.ts +93 -0
  52. package/dist/environments/index.js +382 -0
  53. package/dist/environments/index.js.map +1 -0
  54. package/dist/hotspots/index.d.ts +111 -0
  55. package/dist/hotspots/index.js +285 -0
  56. package/dist/hotspots/index.js.map +1 -0
  57. package/dist/index.d.ts +975 -0
  58. package/dist/index.js +15 -0
  59. package/dist/index.js.map +1 -0
  60. package/dist/node/index.cjs +5240 -0
  61. package/dist/node/index.cjs.map +1 -0
  62. package/dist/node/index.d.cts +4927 -0
  63. package/dist/node/index.d.ts +597 -0
  64. package/dist/node/index.js +1328 -0
  65. package/dist/node/index.js.map +1 -0
  66. package/dist/prepare-BtjY4G3q.d.ts +112 -0
  67. package/dist/presets/index.d.ts +562 -0
  68. package/dist/presets/index.js +14 -0
  69. package/dist/presets/index.js.map +1 -0
  70. package/dist/r3f/index.d.ts +159 -0
  71. package/dist/r3f/index.js +592 -0
  72. package/dist/r3f/index.js.map +1 -0
  73. package/dist/room-FS26KAPQ.js +9 -0
  74. package/dist/room-FS26KAPQ.js.map +1 -0
  75. package/dist/rooms.gen-DItzBR9k.d.ts +1462 -0
  76. package/dist/session-VCIQEO26.js +9 -0
  77. package/dist/session-VCIQEO26.js.map +1 -0
  78. package/dist/shapes/index.d.ts +222 -0
  79. package/dist/shapes/index.js +836 -0
  80. package/dist/shapes/index.js.map +1 -0
  81. package/dist/testRun-20OARnQr.d.ts +1139 -0
  82. package/dist/timeline-ChwgD7bT.d.ts +470 -0
  83. package/dist/tsl/index.d.ts +165 -0
  84. package/dist/tsl/index.js +310 -0
  85. package/dist/tsl/index.js.map +1 -0
  86. package/package.json +170 -4
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/presets/catalog.gen.ts"],"names":[],"mappings":";AAOO,IAAM,eAAA,GAAkB;AAqBxB,IAAM,gBAAA,GAAmB;AAAA,EAC9B,WAAA,EAAa;AAAA,IACX,OAAA,EAAS,iBAAA;AAAA,IACT,UAAA,EAAY,OAAA;AAAA,IACZ,aAAA,EAAe,mEAAA;AAAA,IACf,YAAA,EAAc,GAAA;AAAA,IACd,WAAA,EAAa,CAAA;AAAA,IACb,aAAA,EAAe,CAAA;AAAA,IACf,aAAA,EAAe,IAAA;AAAA,IACf,MAAA,EAAQ;AAAA,MACN,QAAA;AAAA,MACA,QAAA;AAAA,MACA,WAAA;AAAA,MACA,IAAA;AAAA,MACA;AAAA,KACF;AAAA,IACA,OAAA,EAAS;AAAA,MACP,QAAA,EAAU,YAAA;AAAA,MACV,QAAA,EAAU,YAAA;AAAA,MACV,WAAA,EAAa,eAAA;AAAA,MACb,IAAA,EAAM,QAAA;AAAA,MACN,QAAA,EAAU;AAAA,KACZ;AAAA,IACA,OAAA,EAAS;AAAA,MACP,IAAA;AAAA,MACA,IAAA;AAAA,MACA;AAAA;AACF,GACF;AAAA,EACA,cAAA,EAAgB;AAAA,IACd,OAAA,EAAS,oBAAA;AAAA,IACT,UAAA,EAAY,OAAA;AAAA,IACZ,aAAA,EAAe,qDAAA;AAAA,IACf,YAAA,EAAc,GAAA;AAAA,IACd,WAAA,EAAa,CAAA;AAAA,IACb,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e,qDAAA;AAAA,IACf,UAAA,EAAY,QAAA;AAAA,IACZ,cAAA,EAAgB,GAAA;AAAA,IAChB,eAAA,EAAiB,SAAA;AAAA,IACjB,SAAA,EAAW;AAAA,MACT,MAAA,EAAQ,2BAAA;AAAA,MACR,YAAA,EAAc;AAAA,KAChB;AAAA,IACA,QAAA,EAAU;AAAA,MACR,MAAA,EAAQ,2BAAA;AAAA,MACR,YAAA,EAAc;AAAA;AAChB,GACF;AAAA,EACA,iBAAA,EAAmB;AAAA,IACjB,OAAA,EAAS,iBAAA;AAAA,IACT,aAAA,EAAe,kDAAA;AAAA,IACf,UAAA,EAAY,QAAA;AAAA,IACZ,cAAA,EAAgB,GAAA;AAAA,IAChB,eAAA,EAAiB,kBAAA;AAAA,IACjB,SAAA,EAAW;AAAA,MACT,MAAA,EAAQ,wBAAA;AAAA,MACR,YAAA,EAAc;AAAA,KAChB;AAAA,IACA,QAAA,EAAU;AAAA,MACR,MAAA,EAAQ,wBAAA;AAAA,MACR,YAAA,EAAc;AAAA;AAChB;AAEJ","file":"chunk-6NYR73Y7.js","sourcesContent":["/**\n * Generated by the preset library's sync script. Do not edit.\n *\n * The catalog of presets served from the CDN: every material, pedestal and\n * environment the SDK can load, with its files and dimensions.\n */\n\nexport const PRESETS_VERSION = 1;\n\nexport type PresetMapName = 'albedo' | 'normal' | 'roughness' | 'ao' | 'height';\nexport type PresetTextureSize = '1k' | '2k' | '4k';\n\nexport type MaterialPresetInfo = {\n label: string;\n category: 'floor' | 'wall' | 'generic';\n description: string;\n /** Physical edge length, metres, of one texture tile. */\n tileMeters: number;\n metalness: number;\n normalScale: number;\n /** Metres of relief the height map's 0..1 spans. */\n heightScale: number;\n maps: readonly PresetMapName[];\n /** Filename for each map inside a material size directory. */\n files: Readonly<Record<PresetMapName, string>>;\n sizes: readonly PresetTextureSize[];\n};\n\nexport const MATERIAL_PRESETS = {\n \"oak_floor\": {\n \"label\": \"Oak Plank Floor\",\n \"category\": \"floor\",\n \"description\": \"Warm honey oak planks, satin lacquer, gentle per-plank variation.\",\n \"tileMeters\": 2.4,\n \"metalness\": 0,\n \"normalScale\": 1,\n \"heightScale\": 0.004,\n \"maps\": [\n \"albedo\",\n \"normal\",\n \"roughness\",\n \"ao\",\n \"height\"\n ],\n \"files\": {\n \"albedo\": \"albedo.png\",\n \"normal\": \"normal.png\",\n \"roughness\": \"roughness.png\",\n \"ao\": \"ao.png\",\n \"height\": \"height.png\"\n },\n \"sizes\": [\n \"4k\",\n \"2k\",\n \"1k\"\n ]\n },\n \"walnut_floor\": {\n \"label\": \"Walnut Plank Floor\",\n \"category\": \"floor\",\n \"description\": \"Dark oiled walnut boards with straight, fine grain.\",\n \"tileMeters\": 2.4,\n \"metalness\": 0,\n \"normalScale\": 1,\n \"heightScale\": 0.004,\n \"maps\": [\n \"albedo\",\n \"normal\",\n \"roughness\",\n \"ao\",\n \"height\"\n ],\n \"files\": {\n \"albedo\": \"albedo.png\",\n \"normal\": \"normal.png\",\n \"roughness\": \"roughness.png\",\n \"ao\": \"ao.png\",\n \"height\": \"height.png\"\n },\n \"sizes\": [\n \"4k\",\n \"2k\",\n \"1k\"\n ]\n },\n \"white_plaster\": {\n \"label\": \"White Plaster\",\n \"category\": \"wall\",\n \"description\": \"Hand-trowelled lime plaster, soft undulation with a fine tooth.\",\n \"tileMeters\": 1.5,\n \"metalness\": 0,\n \"normalScale\": 1,\n \"heightScale\": 0.005,\n \"maps\": [\n \"albedo\",\n \"normal\",\n \"roughness\",\n \"ao\",\n \"height\"\n ],\n \"files\": {\n \"albedo\": \"albedo.png\",\n \"normal\": \"normal.png\",\n \"roughness\": \"roughness.png\",\n \"ao\": \"ao.png\",\n \"height\": \"height.png\"\n },\n \"sizes\": [\n \"4k\",\n \"2k\",\n \"1k\"\n ]\n },\n \"matte_paint\": {\n \"label\": \"Matte Paint\",\n \"category\": \"wall\",\n \"description\": \"Near-white matte emulsion with a faint roller texture. Tint it with material.color.\",\n \"tileMeters\": 1.2,\n \"metalness\": 0,\n \"normalScale\": 0.6,\n \"heightScale\": 0.0012,\n \"maps\": [\n \"albedo\",\n \"normal\",\n \"roughness\",\n \"ao\",\n \"height\"\n ],\n \"files\": {\n \"albedo\": \"albedo.png\",\n \"normal\": \"normal.png\",\n \"roughness\": \"roughness.png\",\n \"ao\": \"ao.png\",\n \"height\": \"height.png\"\n },\n \"sizes\": [\n \"4k\",\n \"2k\",\n \"1k\"\n ]\n },\n \"polished_concrete\": {\n \"label\": \"Polished Concrete\",\n \"category\": \"floor\",\n \"description\": \"Grey power-trowelled concrete, soft mottling and sparse aggregate.\",\n \"tileMeters\": 3,\n \"metalness\": 0,\n \"normalScale\": 0.8,\n \"heightScale\": 0.002,\n \"maps\": [\n \"albedo\",\n \"normal\",\n \"roughness\",\n \"ao\",\n \"height\"\n ],\n \"files\": {\n \"albedo\": \"albedo.png\",\n \"normal\": \"normal.png\",\n \"roughness\": \"roughness.png\",\n \"ao\": \"ao.png\",\n \"height\": \"height.png\"\n },\n \"sizes\": [\n \"4k\",\n \"2k\",\n \"1k\"\n ]\n },\n \"carrara_marble\": {\n \"label\": \"Carrara Marble\",\n \"category\": \"generic\",\n \"description\": \"Polished white marble with soft grey feather veining.\",\n \"tileMeters\": 2,\n \"metalness\": 0,\n \"normalScale\": 0.5,\n \"heightScale\": 0.0008,\n \"maps\": [\n \"albedo\",\n \"normal\",\n \"roughness\",\n \"ao\",\n \"height\"\n ],\n \"files\": {\n \"albedo\": \"albedo.png\",\n \"normal\": \"normal.png\",\n \"roughness\": \"roughness.png\",\n \"ao\": \"ao.png\",\n \"height\": \"height.png\"\n },\n \"sizes\": [\n \"4k\",\n \"2k\",\n \"1k\"\n ]\n },\n \"terrazzo\": {\n \"label\": \"Terrazzo\",\n \"category\": \"floor\",\n \"description\": \"Cream cement ground with polished multi-tone stone chips.\",\n \"tileMeters\": 1.6,\n \"metalness\": 0,\n \"normalScale\": 0.6,\n \"heightScale\": 0.0012,\n \"maps\": [\n \"albedo\",\n \"normal\",\n \"roughness\",\n \"ao\",\n \"height\"\n ],\n \"files\": {\n \"albedo\": \"albedo.png\",\n \"normal\": \"normal.png\",\n \"roughness\": \"roughness.png\",\n \"ao\": \"ao.png\",\n \"height\": \"height.png\"\n },\n \"sizes\": [\n \"4k\",\n \"2k\",\n \"1k\"\n ]\n },\n \"travertine\": {\n \"label\": \"Travertine\",\n \"category\": \"generic\",\n \"description\": \"Honed beige travertine, layered banding and natural pitting.\",\n \"tileMeters\": 2,\n \"metalness\": 0,\n \"normalScale\": 1,\n \"heightScale\": 0.004,\n \"maps\": [\n \"albedo\",\n \"normal\",\n \"roughness\",\n \"ao\",\n \"height\"\n ],\n \"files\": {\n \"albedo\": \"albedo.png\",\n \"normal\": \"normal.png\",\n \"roughness\": \"roughness.png\",\n \"ao\": \"ao.png\",\n \"height\": \"height.png\"\n },\n \"sizes\": [\n \"4k\",\n \"2k\",\n \"1k\"\n ]\n },\n \"white_brick\": {\n \"label\": \"Painted Brick\",\n \"category\": \"wall\",\n \"description\": \"White-painted brick with recessed mortar joints.\",\n \"tileMeters\": 2,\n \"metalness\": 0,\n \"normalScale\": 1,\n \"heightScale\": 0.008,\n \"maps\": [\n \"albedo\",\n \"normal\",\n \"roughness\",\n \"ao\",\n \"height\"\n ],\n \"files\": {\n \"albedo\": \"albedo.png\",\n \"normal\": \"normal.png\",\n \"roughness\": \"roughness.png\",\n \"ao\": \"ao.png\",\n \"height\": \"height.png\"\n },\n \"sizes\": [\n \"4k\",\n \"2k\",\n \"1k\"\n ]\n },\n \"coated_pine\": {\n \"label\": \"Coated Pine\",\n \"category\": \"generic\",\n \"description\": \"Warm knotty pine with a glossy worn varnish.\",\n \"tileMeters\": 0.7,\n \"metalness\": 0,\n \"normalScale\": 1,\n \"heightScale\": 0.005,\n \"maps\": [\n \"albedo\",\n \"normal\",\n \"roughness\",\n \"ao\",\n \"height\"\n ],\n \"files\": {\n \"albedo\": \"albedo.jpg\",\n \"normal\": \"normal.png\",\n \"roughness\": \"arm.jpg\",\n \"ao\": \"arm.jpg\",\n \"height\": \"height.png\"\n },\n \"sizes\": [\n \"4k\",\n \"2k\",\n \"1k\"\n ]\n },\n \"laminate_floor\": {\n \"label\": \"Worn Laminate Floor\",\n \"category\": \"floor\",\n \"description\": \"Light oak laminate planks with scratches, stains and a soft gloss.\",\n \"tileMeters\": 2,\n \"metalness\": 0,\n \"normalScale\": 1,\n \"heightScale\": 0.006,\n \"maps\": [\n \"albedo\",\n \"normal\",\n \"roughness\",\n \"ao\",\n \"height\"\n ],\n \"files\": {\n \"albedo\": \"albedo.jpg\",\n \"normal\": \"normal.png\",\n \"roughness\": \"arm.jpg\",\n \"ao\": \"arm.jpg\",\n \"height\": \"height.png\"\n },\n \"sizes\": [\n \"4k\",\n \"2k\",\n \"1k\"\n ]\n },\n \"oak_veneer_05\": {\n \"label\": \"Oak Veneer\",\n \"category\": \"generic\",\n \"description\": \"Natural dark oak veneer with fine grain and a raw matte finish.\",\n \"tileMeters\": 1,\n \"metalness\": 0,\n \"normalScale\": 1,\n \"heightScale\": 0.002,\n \"maps\": [\n \"albedo\",\n \"normal\",\n \"roughness\",\n \"ao\",\n \"height\"\n ],\n \"files\": {\n \"albedo\": \"albedo.jpg\",\n \"normal\": \"normal.png\",\n \"roughness\": \"arm.jpg\",\n \"ao\": \"arm.jpg\",\n \"height\": \"height.png\"\n },\n \"sizes\": [\n \"4k\",\n \"2k\",\n \"1k\"\n ]\n },\n \"plank_flooring_04\": {\n \"label\": \"Dark Plank Flooring\",\n \"category\": \"floor\",\n \"description\": \"Dark varnished timber planks with narrow seams and satin sheen.\",\n \"tileMeters\": 2,\n \"metalness\": 0,\n \"normalScale\": 1,\n \"heightScale\": 0.006,\n \"maps\": [\n \"albedo\",\n \"normal\",\n \"roughness\",\n \"ao\",\n \"height\"\n ],\n \"files\": {\n \"albedo\": \"albedo.jpg\",\n \"normal\": \"normal.png\",\n \"roughness\": \"arm.jpg\",\n \"ao\": \"arm.jpg\",\n \"height\": \"height.png\"\n },\n \"sizes\": [\n \"4k\",\n \"2k\",\n \"1k\"\n ]\n },\n \"synthetic_wood\": {\n \"label\": \"Synthetic Wood Cladding\",\n \"category\": \"wall\",\n \"description\": \"Narrow brown wood-look boards with crisp grooves and a matte finish.\",\n \"tileMeters\": 2,\n \"metalness\": 0,\n \"normalScale\": 1,\n \"heightScale\": 0.006,\n \"maps\": [\n \"albedo\",\n \"normal\",\n \"roughness\",\n \"ao\",\n \"height\"\n ],\n \"files\": {\n \"albedo\": \"albedo.jpg\",\n \"normal\": \"normal.png\",\n \"roughness\": \"arm.jpg\",\n \"ao\": \"arm.jpg\",\n \"height\": \"height.png\"\n },\n \"sizes\": [\n \"4k\",\n \"2k\",\n \"1k\"\n ]\n },\n \"wooden_floor_02\": {\n \"label\": \"Warm Hardwood Floor\",\n \"category\": \"floor\",\n \"description\": \"Warm hardwood planks with visible grain, knots and satin sheen.\",\n \"tileMeters\": 1.9,\n \"metalness\": 0,\n \"normalScale\": 1,\n \"heightScale\": 0.006,\n \"maps\": [\n \"albedo\",\n \"normal\",\n \"roughness\",\n \"ao\",\n \"height\"\n ],\n \"files\": {\n \"albedo\": \"albedo.jpg\",\n \"normal\": \"normal.png\",\n \"roughness\": \"arm.jpg\",\n \"ao\": \"arm.jpg\",\n \"height\": \"height.png\"\n },\n \"sizes\": [\n \"4k\",\n \"2k\",\n \"1k\"\n ]\n }\n} as const;\n\nexport type MaterialPresetName = keyof typeof MATERIAL_PRESETS;\n\nexport type PedestalPresetInfo = {\n label: string;\n description: string;\n /** three.js axes, metres: x width, y height (up), z depth. */\n size: { readonly x: number; readonly y: number; readonly z: number };\n defaultMaterial: MaterialPresetName;\n};\n\nexport const PEDESTAL_PRESETS = {\n \"pedestal_block\": {\n \"label\": \"Block Pedestal\",\n \"description\": \"Clean rectangular plinth with softly bevelled edges.\",\n \"size\": {\n \"x\": 0.4,\n \"y\": 1,\n \"z\": 0.4\n },\n \"defaultMaterial\": \"carrara_marble\"\n },\n \"pedestal_plinth\": {\n \"label\": \"Low Plinth\",\n \"description\": \"Wide, low platform for larger pieces.\",\n \"size\": {\n \"x\": 0.9,\n \"y\": 0.3,\n \"z\": 0.9\n },\n \"defaultMaterial\": \"polished_concrete\"\n },\n \"pedestal_cylinder\": {\n \"label\": \"Cylinder Pedestal\",\n \"description\": \"Round column pedestal with bevelled rims.\",\n \"size\": {\n \"x\": 0.42,\n \"y\": 0.95,\n \"z\": 0.42\n },\n \"defaultMaterial\": \"travertine\"\n },\n \"pedestal_column\": {\n \"label\": \"Classical Column\",\n \"description\": \"Turned classical pedestal: stepped base, gently tapered shaft, moulded cap.\",\n \"size\": {\n \"x\": 0.45,\n \"y\": 1.05,\n \"z\": 0.45\n },\n \"defaultMaterial\": \"carrara_marble\"\n }\n} as const;\n\nexport type PedestalPresetName = keyof typeof PEDESTAL_PRESETS;\n\n/** The shelf a map sits on: a room in that lighting mode offers it; `studio` is for product probes. */\nexport type HdriPresetCategory = 'day' | 'golden' | 'overcast' | 'night' | 'studio';\n\nexport type HdriPresetInfo = {\n label: string;\n description: string;\n category: HdriPresetCategory;\n /** Metres the camera stood above the ground: the height a ground-projected dome is lifted by. */\n groundHeight: number;\n /**\n * W/m² its sky delivers to a plane facing up, as measured (the map clamped\n * so its own sun does not count). A room shows the map at its own\n * `skyIrradiance` divided by this, so a map shot darker than the room is\n * lit is not a dim poster outside the windows.\n */\n skyIrradiance: number;\n preview: { readonly file: string; readonly resolution: number };\n render: { readonly file: string; readonly resolution: number };\n};\n\nexport const HDRI_PRESETS = {\n \"pergola_walkway\": {\n \"label\": \"Pergola Walkway\",\n \"description\": \"A garden walkway under a vine-covered pergola, high sun, greenery on every side.\",\n \"category\": \"day\",\n \"groundHeight\": 1.6,\n \"skyIrradiance\": 1.7631801999999999,\n \"preview\": {\n \"file\": \"pergola_walkway_1k.hdr\",\n \"resolution\": 1024\n },\n \"render\": {\n \"file\": \"pergola_walkway_4k.exr\",\n \"resolution\": 4096\n }\n },\n \"sunny_country_road\": {\n \"label\": \"Sunny Country Road\",\n \"description\": \"A dirt road between fields under a high midday sun.\",\n \"category\": \"day\",\n \"groundHeight\": 1.6,\n \"skyIrradiance\": 1.0989418,\n \"preview\": {\n \"file\": \"sunny_country_road_1k.hdr\",\n \"resolution\": 1024\n },\n \"render\": {\n \"file\": \"sunny_country_road_4k.exr\",\n \"resolution\": 4096\n }\n },\n \"horn-koppe_spring\": {\n \"label\": \"Horn-Koppe Spring\",\n \"description\": \"Alpine meadow in spring, snow on the peaks, a high clear sun.\",\n \"category\": \"day\",\n \"groundHeight\": 1.6,\n \"skyIrradiance\": 1.4612264,\n \"preview\": {\n \"file\": \"horn-koppe_spring_1k.hdr\",\n \"resolution\": 1024\n },\n \"render\": {\n \"file\": \"horn-koppe_spring_4k.exr\",\n \"resolution\": 4096\n }\n },\n \"grasslands_sunset\": {\n \"label\": \"Grasslands Late Sun\",\n \"description\": \"Open grassland with the sun low but still white, a long afternoon.\",\n \"category\": \"day\",\n \"groundHeight\": 1.6,\n \"skyIrradiance\": 3.9029496,\n \"preview\": {\n \"file\": \"grasslands_sunset_1k.hdr\",\n \"resolution\": 1024\n },\n \"render\": {\n \"file\": \"grasslands_sunset_4k.exr\",\n \"resolution\": 4096\n }\n },\n \"je_gray_02\": {\n \"label\": \"Grey Park\",\n \"description\": \"A shaded park path, the sun low behind trees, a soft, cool day.\",\n \"category\": \"day\",\n \"groundHeight\": 1.6,\n \"skyIrradiance\": 0.21612759999999998,\n \"preview\": {\n \"file\": \"je_gray_02_1k.hdr\",\n \"resolution\": 1024\n },\n \"render\": {\n \"file\": \"je_gray_02_4k.exr\",\n \"resolution\": 4096\n }\n },\n \"qwantani_sunset\": {\n \"label\": \"Qwantani Sunset\",\n \"description\": \"Sunset over the veld: a warm horizon and a clear deep sky above.\",\n \"category\": \"golden\",\n \"groundHeight\": 1.6,\n \"skyIrradiance\": 2.3187784,\n \"preview\": {\n \"file\": \"qwantani_sunset_1k.hdr\",\n \"resolution\": 1024\n },\n \"render\": {\n \"file\": \"qwantani_sunset_4k.exr\",\n \"resolution\": 4096\n }\n },\n \"venice_sunset\": {\n \"label\": \"Venice Sunset\",\n \"description\": \"The lagoon at sunset, water and sky both gold.\",\n \"category\": \"golden\",\n \"groundHeight\": 1.6,\n \"skyIrradiance\": 2.1780174,\n \"preview\": {\n \"file\": \"venice_sunset_1k.hdr\",\n \"resolution\": 1024\n },\n \"render\": {\n \"file\": \"venice_sunset_4k.exr\",\n \"resolution\": 4096\n }\n },\n \"bambanani_sunset\": {\n \"label\": \"Bambanani Sunset\",\n \"description\": \"A township street at sunset, the sun red and low.\",\n \"category\": \"golden\",\n \"groundHeight\": 1.6,\n \"skyIrradiance\": 3.300283399999999,\n \"preview\": {\n \"file\": \"bambanani_sunset_1k.hdr\",\n \"resolution\": 1024\n },\n \"render\": {\n \"file\": \"bambanani_sunset_4k.exr\",\n \"resolution\": 4096\n }\n },\n \"umhlanga_sunrise\": {\n \"label\": \"Umhlanga Sunrise\",\n \"description\": \"Sunrise over the sea, the sun just clear of the horizon.\",\n \"category\": \"golden\",\n \"groundHeight\": 1.6,\n \"skyIrradiance\": 3.3150258000000004,\n \"preview\": {\n \"file\": \"umhlanga_sunrise_1k.hdr\",\n \"resolution\": 1024\n },\n \"render\": {\n \"file\": \"umhlanga_sunrise_4k.exr\",\n \"resolution\": 4096\n }\n },\n \"flamingo_pan\": {\n \"label\": \"Flamingo Pan\",\n \"description\": \"A salt pan at sunset, the sun on the horizon and a violet sky.\",\n \"category\": \"golden\",\n \"groundHeight\": 1.6,\n \"skyIrradiance\": 3.1940932,\n \"preview\": {\n \"file\": \"flamingo_pan_1k.hdr\",\n \"resolution\": 1024\n },\n \"render\": {\n \"file\": \"flamingo_pan_4k.exr\",\n \"resolution\": 4096\n }\n },\n \"minedump_flats\": {\n \"label\": \"Minedump Flats\",\n \"description\": \"Flat scrub at sunset under a hazy, dusty sky.\",\n \"category\": \"golden\",\n \"groundHeight\": 1.6,\n \"skyIrradiance\": 2.9883286,\n \"preview\": {\n \"file\": \"minedump_flats_1k.hdr\",\n \"resolution\": 1024\n },\n \"render\": {\n \"file\": \"minedump_flats_4k.exr\",\n \"resolution\": 4096\n }\n },\n \"sunset_fairway\": {\n \"label\": \"Sunset Fairway\",\n \"description\": \"A golf fairway at dusk, the sun already down and the sky lit from below.\",\n \"category\": \"golden\",\n \"groundHeight\": 1.6,\n \"skyIrradiance\": 2.7264117999999997,\n \"preview\": {\n \"file\": \"sunset_fairway_1k.hdr\",\n \"resolution\": 1024\n },\n \"render\": {\n \"file\": \"sunset_fairway_4k.exr\",\n \"resolution\": 4096\n }\n },\n \"the_sky_is_on_fire\": {\n \"label\": \"Sky on Fire\",\n \"description\": \"A blazing red-orange sunset over open country.\",\n \"category\": \"golden\",\n \"groundHeight\": 1.6,\n \"skyIrradiance\": 2.4784194,\n \"preview\": {\n \"file\": \"the_sky_is_on_fire_1k.hdr\",\n \"resolution\": 1024\n },\n \"render\": {\n \"file\": \"the_sky_is_on_fire_4k.exr\",\n \"resolution\": 4096\n }\n },\n \"dalkey_view\": {\n \"label\": \"Dalkey View\",\n \"description\": \"A coastal hillside under a bright overcast sky.\",\n \"category\": \"overcast\",\n \"groundHeight\": 1.6,\n \"skyIrradiance\": 4.501861400000001,\n \"preview\": {\n \"file\": \"dalkey_view_1k.hdr\",\n \"resolution\": 1024\n },\n \"render\": {\n \"file\": \"dalkey_view_4k.exr\",\n \"resolution\": 4096\n }\n },\n \"afrikaans_church_exterior\": {\n \"label\": \"Church Square\",\n \"description\": \"A quiet square under heavy cloud, a white church across it.\",\n \"category\": \"overcast\",\n \"groundHeight\": 1.6,\n \"skyIrradiance\": 4.194848599999999,\n \"preview\": {\n \"file\": \"afrikaans_church_exterior_1k.hdr\",\n \"resolution\": 1024\n },\n \"render\": {\n \"file\": \"afrikaans_church_exterior_4k.exr\",\n \"resolution\": 4096\n }\n },\n \"quarry_cloudy\": {\n \"label\": \"Cloudy Quarry\",\n \"description\": \"A stone quarry under an even grey sky.\",\n \"category\": \"overcast\",\n \"groundHeight\": 1.6,\n \"skyIrradiance\": 3.9304787999999995,\n \"preview\": {\n \"file\": \"quarry_cloudy_1k.hdr\",\n \"resolution\": 1024\n },\n \"render\": {\n \"file\": \"quarry_cloudy_4k.exr\",\n \"resolution\": 4096\n }\n },\n \"moonless_golf\": {\n \"label\": \"Moonless Golf Course\",\n \"description\": \"A moonless night over a golf course, a faint glow from the town.\",\n \"category\": \"night\",\n \"groundHeight\": 1.6,\n \"skyIrradiance\": 0.5007998,\n \"preview\": {\n \"file\": \"moonless_golf_1k.hdr\",\n \"resolution\": 1024\n },\n \"render\": {\n \"file\": \"moonless_golf_4k.exr\",\n \"resolution\": 4096\n }\n },\n \"preller_drive\": {\n \"label\": \"Preller Drive\",\n \"description\": \"A suburban street at night, sodium street lamps and dark trees.\",\n \"category\": \"night\",\n \"groundHeight\": 1.6,\n \"skyIrradiance\": 0.5283702,\n \"preview\": {\n \"file\": \"preller_drive_1k.hdr\",\n \"resolution\": 1024\n },\n \"render\": {\n \"file\": \"preller_drive_4k.exr\",\n \"resolution\": 4096\n }\n },\n \"satara_night\": {\n \"label\": \"Satara Night\",\n \"description\": \"A bush camp at night, a few lamps and a starry sky.\",\n \"category\": \"night\",\n \"groundHeight\": 1.6,\n \"skyIrradiance\": 0.25447,\n \"preview\": {\n \"file\": \"satara_night_1k.hdr\",\n \"resolution\": 1024\n },\n \"render\": {\n \"file\": \"satara_night_4k.exr\",\n \"resolution\": 4096\n }\n },\n \"ferndale_studio_11\": {\n \"label\": \"Ferndale Studio 11\",\n \"description\": \"High-contrast studio environment with broad soft sources.\",\n \"category\": \"studio\",\n \"groundHeight\": 1.2,\n \"skyIrradiance\": 1.2286402,\n \"preview\": {\n \"file\": \"ferndale_studio_11_1k.hdr\",\n \"resolution\": 1024\n },\n \"render\": {\n \"file\": \"ferndale_studio_11_4k.exr\",\n \"resolution\": 4096\n }\n },\n \"ferndale_studio_12\": {\n \"label\": \"Ferndale Studio 12\",\n \"description\": \"Balanced product studio with shaped highlights.\",\n \"category\": \"studio\",\n \"groundHeight\": 1.2,\n \"skyIrradiance\": 1.2324262000000001,\n \"preview\": {\n \"file\": \"ferndale_studio_12_1k.hdr\",\n \"resolution\": 1024\n },\n \"render\": {\n \"file\": \"ferndale_studio_12_4k.exr\",\n \"resolution\": 4096\n }\n },\n \"monochrome_studio_02\": {\n \"label\": \"Monochrome Studio 02\",\n \"description\": \"Neutral monochrome studio for material-focused renders.\",\n \"category\": \"studio\",\n \"groundHeight\": 1.2,\n \"skyIrradiance\": 0.9193722,\n \"preview\": {\n \"file\": \"monochrome_studio_02_1k.hdr\",\n \"resolution\": 1024\n },\n \"render\": {\n \"file\": \"monochrome_studio_02_4k.exr\",\n \"resolution\": 4096\n }\n },\n \"studio_kontrast_04\": {\n \"label\": \"Studio Kontrast 04\",\n \"description\": \"Directional studio contrast with crisp reflections.\",\n \"category\": \"studio\",\n \"groundHeight\": 1.2,\n \"skyIrradiance\": 2.9173432,\n \"preview\": {\n \"file\": \"studio_kontrast_04_1k.hdr\",\n \"resolution\": 1024\n },\n \"render\": {\n \"file\": \"studio_kontrast_04_4k.exr\",\n \"resolution\": 4096\n }\n },\n \"studio_small_03\": {\n \"label\": \"Small Studio 03\",\n \"description\": \"Compact studio environment with close softboxes.\",\n \"category\": \"studio\",\n \"groundHeight\": 1.2,\n \"skyIrradiance\": 13.877922599999998,\n \"preview\": {\n \"file\": \"studio_small_03_1k.hdr\",\n \"resolution\": 1024\n },\n \"render\": {\n \"file\": \"studio_small_03_4k.exr\",\n \"resolution\": 4096\n }\n }\n} as const;\n\nexport type HdriPresetName = keyof typeof HDRI_PRESETS;\n"]}
@@ -0,0 +1,118 @@
1
+ import { ROOM_PRESETS } from './chunk-LAKXC4WR.js';
2
+
3
+ // src/protocol/bake.ts
4
+ var MAX_BAKE_TEXELS = 32 * 1024 * 1024;
5
+ var MAX_BAKE_OBJECTS = 256;
6
+ var BAKE_TEXTURE_SIZES = [256, 512, 1024, 2048];
7
+ var BAKE_ATLAS_SIZES = [1024, 2048, 4096];
8
+ var MAX_BAKE_SIMPLIFY_TRIANGLES = 5e4;
9
+ var MAX_BAKE_SIMPLIFY = 32;
10
+ function presetRoomBakePath(name, lighting) {
11
+ return `rooms/${name}/bake/${lighting}/bundle.json`;
12
+ }
13
+
14
+ // src/presets/roomState.ts
15
+ function remembered(object) {
16
+ return object.userData?.bakery3Preset;
17
+ }
18
+ function roomPresetSpecOf(object) {
19
+ const state = remembered(object)?.roomPreset;
20
+ if (!state) return null;
21
+ object.updateMatrixWorld(true);
22
+ return { ...state, matrix: object.matrixWorld.toArray() };
23
+ }
24
+ function roomShownBaked(object) {
25
+ return remembered(object)?.shown === "baked";
26
+ }
27
+ function roomPresetFactsOf(object) {
28
+ return remembered(object)?.roomFacts ?? null;
29
+ }
30
+ function findPresetRooms(root) {
31
+ const found = [];
32
+ root.traverse((object) => {
33
+ if (remembered(object)?.roomPreset) found.push(object);
34
+ });
35
+ return found;
36
+ }
37
+ function roomPresetAssetsOf(object) {
38
+ return remembered(object)?.pictureAssets ?? [];
39
+ }
40
+
41
+ // src/presets/roomPrebake.ts
42
+ function roomPrebakeChanges(room) {
43
+ const changed = [];
44
+ if (room.surfaces) changed.push("its materials");
45
+ if (room.hdri !== void 0) changed.push("what is outside its windows");
46
+ if (room.pedestal !== void 0) changed.push("its stand");
47
+ return changed;
48
+ }
49
+ function roomIsPrebaked(name, lighting) {
50
+ const published = ROOM_PRESETS[name]?.prebaked ?? [];
51
+ return published.includes(lighting);
52
+ }
53
+ var handles = /* @__PURE__ */ new WeakMap();
54
+ function prebakedRoomsUnder(root) {
55
+ const found = [];
56
+ root.traverse((node) => {
57
+ const handle = handles.get(node);
58
+ if (handle) found.push({ group: node, handle });
59
+ });
60
+ return found;
61
+ }
62
+ function setPresetRoomPrebaked(room, on) {
63
+ handles.get(room)?.set(on);
64
+ }
65
+ async function applyRoomPrebake(group, spec, base, presetsVersion, sessionOptions = {}) {
66
+ if (!roomIsPrebaked(spec.name, spec.lighting) || roomPrebakeChanges(spec).length)
67
+ return null;
68
+ const url = `${base.replace(/\/$/, "")}/v${presetsVersion}/${presetRoomBakePath(spec.name, spec.lighting)}`;
69
+ try {
70
+ const response = await fetch(url);
71
+ if (!response.ok)
72
+ throw new Error(`${response.status} ${response.statusText}`);
73
+ const { room: _self, ...bundle } = await response.json();
74
+ const { createBakeSession } = await import('./session-VCIQEO26.js');
75
+ const session = createBakeSession({
76
+ ...sessionOptions,
77
+ scene: group,
78
+ probe: false,
79
+ presetBaseUrl: base
80
+ });
81
+ const generation = session.addGeneration(bundle, {
82
+ baseUrl: url,
83
+ label: "prebaked"
84
+ });
85
+ let wanted = true;
86
+ let suspended = 0;
87
+ const show = () => session.compare(!(wanted && suspended === 0));
88
+ handles.set(group, {
89
+ suspend() {
90
+ suspended++;
91
+ show();
92
+ },
93
+ resume() {
94
+ suspended = Math.max(0, suspended - 1);
95
+ show();
96
+ },
97
+ set(on) {
98
+ wanted = on;
99
+ show();
100
+ }
101
+ });
102
+ const report = await session.apply(generation);
103
+ show();
104
+ return {
105
+ applied: report.applied.length,
106
+ unmatched: report.unmatched.length
107
+ };
108
+ } catch (error) {
109
+ console.warn(
110
+ `[bakery3] The prebaked light for room "${spec.name}" (${spec.lighting}) did not load, so it is lit by its preview lights. ${error instanceof Error ? error.message : String(error)}`
111
+ );
112
+ return null;
113
+ }
114
+ }
115
+
116
+ export { BAKE_ATLAS_SIZES, BAKE_TEXTURE_SIZES, MAX_BAKE_OBJECTS, MAX_BAKE_SIMPLIFY, MAX_BAKE_SIMPLIFY_TRIANGLES, MAX_BAKE_TEXELS, applyRoomPrebake, findPresetRooms, prebakedRoomsUnder, roomIsPrebaked, roomPrebakeChanges, roomPresetAssetsOf, roomPresetFactsOf, roomPresetSpecOf, roomShownBaked, setPresetRoomPrebaked };
117
+ //# sourceMappingURL=chunk-APWUCEEB.js.map
118
+ //# sourceMappingURL=chunk-APWUCEEB.js.map
@@ -0,0 +1 @@
1
+ {"version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AA,IAAU,cAAc,CAAA,CAAE,CAAA;AAC/D,IAAA,OAAA,CAAQ,IAAI,KAAA,EAAO;AAAA,MACjB,OAAA,GAAU;AACR,QAAA,SAAA,EAAA;AACA,QAAA,IAAA,EAAK;AAAA,MACP,CAAA;AAAA,MACA,MAAA,GAAS;AACP,QAAA,SAAA,GAAY,IAAA,CAAK,GAAA,CAAI,CAAA,EAAG,SAAA,GAAY,CAAC,CAAA;AACrC,QAAA,IAAA,EAAK;AAAA,MACP,CAAA;AAAA,MACA,IAAI,EAAA,EAAI;AACN,QAAA,MAAA,GAAS,EAAA;AACT,QAAA,IAAA,EAAK;AAAA,MACP;AAAA,KACD,CAAA;AAED,IAAA,MAAM,MAAA,GAAS,MAAM,OAAA,CAAQ,KAAA,CAAM,UAAU,CAAA;AAE7C,IAAA,IAAA,EAAK;AACL,IAAA,OAAO;AAAA,MACL,OAAA,EAAS,OAAO,OAAA,CAAQ,MAAA;AAAA,MACxB,SAAA,EAAW,OAAO,SAAA,CAAU;AAAA,KAC9B;AAAA,EACF,SAAS,KAAA,EAAO;AACd,IAAA,OAAA,CAAQ,IAAA;AAAA,MACN,CAAA,uCAAA,EAA0C,IAAA,CAAK,IAAI,CAAA,GAAA,EAAM,IAAA,CAAK,QAAQ,CAAA,oDAAA,EACpE,KAAA,YAAiB,KAAA,GAAQ,KAAA,CAAM,OAAA,GAAU,MAAA,CAAO,KAAK,CACvD,CAAA;AAAA,KACF;AACA,IAAA,OAAO,IAAA;AAAA,EACT;AACF","file":"chunk-APWUCEEB.js","sourcesContent":["/**\n * Scene baking: path-traced lighting, returned to the live scene.\n *\n * A bake does not hand back a new scene. It returns one lightmap per object,\n * keyed by the same `objectId` the manifest uses everywhere, plus the second\n * UV set that lightmap needs. The SDK lays them on the meshes that are\n * already there and can take them off again. A portable GLB is available as\n * a download for taking the look elsewhere, never as the application format.\n *\n * A lightmap carries light only: diffuse irradiance (direct and indirect)\n * with the surface's own albedo left out. three.js multiplies `lightMap`\n * with the material's color and maps at shade time, so textures, colors and\n * roughness keep working and view-dependent effects (reflections, clearcoat,\n * custom shaders) keep running live on top. The portable GLB is the one\n * exception: a download has to stand on its own, so it bakes the finished\n * surface onto an unlit material.\n *\n * UV data comes back in the live geometry's own vertex numbering: usually as\n * two floats per existing vertex, applied in place; where the unwrap had to\n * split a vertex, as an explicit, reversible `topology` rebuild.\n */\n\n// ---------------------------------------------------------------------------\n// Versions and ceilings\n// ---------------------------------------------------------------------------\n\n/**\n * The bake pipeline's version, part of every bake cache key. Bumping it\n * re-addresses the bake cache, so a change to texel values or UV layouts is\n * never served from a cached bundle made before it.\n */\nexport const BAKE_VERSION = 14;\n\n/**\n * The reflection probe's size in pixels: width, height. Small on purpose: a\n * reflection of a room needs its light and its layout, not its texture\n * detail, and the file has to arrive before the product is looked at.\n */\nexport const BAKE_PROBE_SIZE = [512, 256] as const;\n\n/**\n * The portable GLB's own version, in the bake cache key only when\n * `deliverGlb` is set, so a change to the download alone does not throw away\n * cached lightmaps that did not change.\n */\nexport const BAKE_GLB_VERSION = 2;\n\n/**\n * The texel ceiling for one bake, enforced at estimate time before any GPU\n * time is bought. Texels drive a bake's cost the way frames drive a video's;\n * 32M texels is a full room at sensible resolutions.\n */\nexport const MAX_BAKE_TEXELS = 32 * 1024 * 1024;\n\n/**\n * The object-count ceiling for one bake job. A request past it is refused,\n * never sampled down.\n */\nexport const MAX_BAKE_OBJECTS = 256;\n\n// ---------------------------------------------------------------------------\n// The request\n// ---------------------------------------------------------------------------\n\n/**\n * How good a bake should be. The worker chooses sample counts and margins\n * from this, the way `QualityPreset` maps to `QualitySettings`.\n */\nexport type BakeQuality = 'preview' | 'standard' | 'high';\n\n/**\n * Samples per texel at each bake quality. The worker traces exactly this\n * many (adaptive sampling is off for a bake, so the cost is a straight\n * multiplication) and the estimate prices exactly this many, which is what\n * makes the quote match the charge. Lower than a still's pixel samples\n * because a diffuse-only bake converges faster: there is no specular lobe and\n * no caustic path, only irradiance.\n */\nexport const BAKE_SAMPLES: Record<BakeQuality, number> = {\n preview: 64,\n standard: 256,\n high: 1024,\n};\n\n/** The sides a lightmap or a stand-in texture may have, in texels. */\nexport const BAKE_TEXTURE_SIZES = [256, 512, 1024, 2048] as const;\nexport type BakeTextureSize = (typeof BAKE_TEXTURE_SIZES)[number];\n\n/** Atlas sides. 4096² is 16.8M texels, inside the texel ceiling on its own. */\nexport const BAKE_ATLAS_SIZES = [1024, 2048, 4096] as const;\nexport type BakeAtlasSize = (typeof BAKE_ATLAS_SIZES)[number];\n\n/**\n * One lightmap for every baked object, rather than one each.\n *\n * A room of sixty objects lit from sixty textures is sixty texture binds and\n * sixty downloads; lit from one atlas it is one of each, which is what an\n * interactive scene wants. The atlas holds the same texels the separate maps\n * would, and is priced as they are.\n *\n * Every object is baked into a square of its own: the side its world-space\n * surface earns, capped by `textureSize` and `sizes` as usual, times the\n * square root of its `weight`, rounded to a power of two. The squares are\n * laid into the map with no waste, and the map is filled: when the squares\n * would cover under a quarter of it every side doubles, and when they would\n * not fit the largest are halved until they do. So `textureSize`, `sizes`\n * and `weights` set relative shares, kept to within a power of two, and\n * `size` sets the texels there are to share.\n *\n * A hero product is `weights: { [heroId]: 4 }`: twice the side and four times\n * the area its surface alone would earn. Weights round to the nearest power\n * of two in side: 1.5 to 2.8 doubles it, 2.9 to 5.6 quadruples it.\n */\nexport type BakeAtlas = {\n size: BakeAtlasSize;\n /** Per-object density multipliers, keyed by objectId. Default 1. */\n weights?: Record<string, number>;\n};\n\n// ---------------------------------------------------------------------------\n// Simplifying: a stand-in for geometry the viewer does not need\n// ---------------------------------------------------------------------------\n\n/**\n * What a group of objects is replaced with in the baked scene.\n *\n * A lightmap keeps the developer's geometry and changes its light. That is\n * right for a product and wrong for a bookcase of forty books at the back of\n * the room: forty draw calls, forty lightmaps and forty unwraps to light\n * something the viewer reads as one lit shape. A stand-in is that one shape,\n * with the detail it lost baked on: the color of the surface it replaces, a\n * normal map for the relief it no longer has, and the irradiance traced at\n * the real surface. The real objects stay in the traced scene, so they still\n * cast their shadows and bounce their light onto everything else; they are\n * only absent from what is delivered.\n *\n * `'lowpoly'` the objects, shrink-wrapped into one skin and reduced to\n * `triangles`. The default.\n * `'box'` the box round them, turned about the vertical to fit.\n * Right for anything that reads as a box from where it is\n * seen: a bookcase, a cabinet, a radiator.\n * `'billboard'` one upright picture of them that turns to face the\n * camera. For a potted plant: half a million triangles of\n * leaves that no lightmap suits and no box resembles.\n * `{ objectId }` a mesh of the developer's own, in the captured scene and\n * hidden (so nothing traces it), used as the stand-in's\n * shape exactly as authored.\n * `'decimate'` one object, the same object with fewer triangles: its own\n * parts, silhouette, texture uvs and materials kept, reduced\n * to `triangles` by collapsing edges. For the product itself\n * (a 146k-triangle shoe), where a skin would melt laces and\n * eyelets together and a baked color would turn metal and\n * gloss into paint. Only its light is baked, in one pass at\n * the real surface; the stand-in wears the replaced object's\n * own materials at their own resolution. One entry per\n * object.\n */\nexport type BakeSimplifyTo =\n 'lowpoly' | 'box' | 'billboard' | 'decimate' | { objectId: string };\n\nexport type BakeSimplify = {\n /**\n * objectIds the stand-in replaces. They are not in `include`: a replaced\n * object gets no lightmap of its own, which is where the saving is.\n */\n objects: string[];\n to: BakeSimplifyTo;\n /** `'lowpoly'` only: the triangle budget. Default `BAKE_SIMPLIFY_TRIANGLES`. */\n triangles?: number;\n /** The stand-in's texture side. Default `textureSize`. */\n textureSize?: BakeTextureSize;\n};\n\nexport const BAKE_SIMPLIFY_TRIANGLES = 1500;\n/**\n * `'decimate'`'s default budget: close-up quality for a product, a tenth to\n * a fifth of what a scanned or vendor model usually carries.\n */\nexport const BAKE_DECIMATE_TRIANGLES = 20_000;\nexport const MAX_BAKE_SIMPLIFY_TRIANGLES = 50_000;\n/** Stand-ins one bake may build. Each is up to three traced passes. */\nexport const MAX_BAKE_SIMPLIFY = 32;\n\n/**\n * How many bake passes a stand-in costs: color, normal and light for a mesh,\n * one still for a billboard, one light pass for a decimated object. The\n * estimate multiplies by this.\n */\nexport function bakeSimplifyPasses(entry: Pick<BakeSimplify, 'to'>): number {\n return entry.to === 'billboard' || entry.to === 'decimate' ? 1 : 3;\n}\n\n// ---------------------------------------------------------------------------\n// The shadow a product casts on a room it did not light\n// ---------------------------------------------------------------------------\n\n/**\n * A plane under the baked objects carrying the difference they make to the\n * light on it, and nothing else.\n *\n * A preset room is the same room for every customer, so its lightmaps are a\n * library asset, baked once and served from the preset library\n * (`BakeBundle.room`). What that prebaked room cannot know is the product\n * standing in it: the contact shadow under a vase is what makes it look like\n * it is in the room rather than pasted over it.\n *\n * So the bake traces one small plane just above the floor twice, with the\n * product and its stand present and again with them hidden, and ships the\n * ratio: 1 where they changed nothing, darker where they blocked light. The\n * viewer lays it over the floor and multiplies. A ratio, not irradiance,\n * because it has to compose with a floor lightmap traced at another time and\n * another resolution.\n *\n * It only darkens. Light the product throws onto the floor (a red vase's\n * bounce) is in neither the prebaked room nor this plane; that is the\n * approximation this mode makes.\n */\nexport type BakeShadow = {\n /**\n * Scene units, Y-up: the plane's centre, on the surface it lies over.\n *\n * Absent is the usual case: the worker measures the footprint of whatever\n * casts, then finds the surface beneath with rays cast straight down and\n * the casters hidden. A plinth is often modelled a centimetre into the\n * floor, so the bottom of its bounds is inside the slab, where a plane\n * would be lit in neither trace.\n */\n center?: [number, number, number];\n /**\n * Metres. Absent takes the casters' footprint plus the room a shadow needs\n * to spread into.\n */\n width?: number;\n height?: number;\n /**\n * How far above the surface the plane sits, in metres. Small enough to\n * read as contact, large enough that nothing z-fights with the floor.\n */\n lift?: number;\n /** Texels a side. Default `BAKE_SHADOW_SIZE`. */\n textureSize?: BakeTextureSize;\n /**\n * objectIds whose shadow this is: hidden for the second trace. Absent\n * means every object the bake includes.\n */\n cast?: string[];\n /**\n * objectIds the plane is placed beneath and sized to cover. Absent means\n * the casters, which is the usual case.\n *\n * The two lists come apart when a product stands on something this bake is\n * lightmapping anyway. A vase on a plinth casts on the plinth's top, and\n * the plinth's own lightmap carries that. What the plinth must not do is\n * cast into this plane: the prebaked room was lit with the plinth standing\n * in it, so its shadow is already on that floor, and casting it again\n * would lay it down twice.\n *\n * So the plinth spans but does not cast. It is present in both traces and\n * divides out of the ratio exactly, leaving only what the vase adds; and\n * because it is hidden while the surface beneath is looked for, the plane\n * still lands on the floor rather than on the plinth's top.\n */\n spans?: string[];\n};\n\n/**\n * Where a room's prebaked lightmaps live, relative to the preset library.\n * Relative because the library has more than one home (the CDN, a local\n * directory, a worker's own mirror); each end joins the path to the library\n * it is using.\n */\nexport function presetRoomBakePath(name: string, lighting: string): string {\n return `rooms/${name}/bake/${lighting}/bundle.json`;\n}\n\n/**\n * A shadow plane's default resolution. Small on purpose: a contact shadow is\n * a soft, low-frequency thing over a metre or two of floor.\n */\nexport const BAKE_SHADOW_SIZE = 512;\n\n/**\n * What the bake produced for `BakeSettings.shadow`.\n *\n * `uri` is a ratio in 0..1 per channel, linear, one value per texel: what\n * fraction of the light still arrives with the product there. Lay the plane\n * at `center` + `lift` on its up axis, map this across it, and multiply.\n */\nexport type BakedShadow = {\n uri: string;\n format: 'exr' | 'png';\n size: number;\n center: [number, number, number];\n width: number;\n height: number;\n lift: number;\n /**\n * The darkest ratio in the map, for a panel and for a sanity check: a\n * shadow that came out 1.0 everywhere means nothing was cast.\n */\n darkest: number;\n};\n\n/**\n * What to bake and how well.\n *\n * `include` is explicit and authoritative: the SDK decides which objects can\n * take a lightmap (it can see the live materials; the worker cannot) and the\n * worker bakes exactly that list. An id the worker cannot find is a refusal\n * with the id and a fix, never a silent skip.\n */\nexport type BakeSettings = {\n quality: BakeQuality;\n /**\n * Per-object resolution ceiling. The worker may choose a smaller size for\n * a small object (by world-space surface area) so a screw does not cost\n * what a wall costs. It never chooses larger.\n */\n textureSize: BakeTextureSize;\n /** objectIds to bake, from the same id space as `RuntimeState`. */\n include: string[];\n /** Per-object override of `textureSize`, keyed by objectId. */\n sizes?: Record<string, BakeTextureSize>;\n /**\n * Bake every object into one shared lightmap of `atlas.size`² texels\n * instead of one texture each: see `BakeAtlas`. `textureSize` and `sizes`\n * then set each object's relative share of the map rather than its own\n * texture.\n */\n atlas?: BakeAtlas;\n /** Seam dilation in pixels. Default 4. */\n margin?: number;\n /**\n * Also produce the portable baked GLB: every baked object with an unlit\n * material (`KHR_materials_unlit`) whose one texture is the finished\n * surface (color, direct and bounced light, reflections as seen from\n * `view`, through the scene's tone curve). Loads anywhere with no lights\n * and no SDK. A second bake pass per object, so it roughly doubles GPU\n * time and is opt-in.\n */\n deliverGlb?: boolean;\n /**\n * Objects whose `uv1` is the developer's own layout, not one a previous\n * bake wrote. Present, the worker may use an object's own layout instead\n * of unwrapping it: its `uv1` when listed here, its texture `uv` when the\n * mesh is too fragmented or too dense to unwrap well. Either is used only\n * when it passes the worker's test (inside the unit square, no stacked\n * islands, enough texels an island, an even density), and the result says\n * so with `BakeUv` `channel`. Absent, every object is unwrapped.\n */\n existingUv?: { uv1: string[] };\n /**\n * Where the scene is looked at from, for seam placement only.\n *\n * The unwrap puts island boundaries on the side of each object that faces\n * away from this point, on its underside, or where it is hidden behind\n * other geometry, never across the surface this viewpoint sees. Nothing\n * about the lighting depends on it.\n *\n * It is not the manifest camera. The camera is excluded from the bake\n * cache key so that orbiting and baking again is free, and a seam layout\n * that followed the exact camera would make every orbit a re-cut. The SDK\n * sends the camera quantized (`quantizeBakeView`): direction in 30° steps,\n * distance in octaves around the baked objects, so nearby viewpoints share\n * a bake and only a real change of side re-cuts.\n *\n * Absent: seams prefer the underside and hard edges alone.\n */\n view?: BakeView;\n /**\n * Where the reflection probe is taken, and what is hidden from it.\n *\n * Every bake delivers one. The lightmap replaces a baked surface's\n * diffuse, but the objects the bake is for (the product kept live on its\n * plinth, so it can turn and change finish) still reflect the scene's own\n * environment map, which in a baked room is not the room. The probe is the\n * room as seen from where those objects stand, with those objects hidden\n * so they do not reflect themselves, and the SDK puts it on their\n * materials as `envMap`.\n *\n * The SDK decides both fields: the objects it hides are the ones that\n * could have been baked and were deliberately left out. An object that\n * cannot take a lightmap at all (a glass sphere, an instanced hedge) is\n * scenery and stays in the map, so the product reflects the glass beside\n * it. Absent, the worker takes the probe from the center of the baked\n * objects and hides nothing.\n */\n probe?: BakeProbe;\n /**\n * Groups of objects to deliver as a stand-in rather than light as they\n * are: see `BakeSimplify`. In request order; stand-in `n` of the bundle is\n * entry `n` here.\n */\n simplify?: BakeSimplify[];\n /**\n * Trace a shadow plane under the baked objects: see `BakeShadow`. What a\n * bake of a product standing in a prebaked room needs, and the only part\n * of that room the bake has to pay for.\n */\n shadow?: BakeShadow;\n /**\n * How a preset room in the scene is lit.\n *\n * `'full'` (the default) bakes the room's own surfaces along with\n * everything else.\n *\n * `'preset'` says the room is unmodified, so its lightmaps are a library\n * asset and this bake covers only what the library cannot know: the\n * product, the stand it is on, and the shadow it casts. The SDK only asks\n * for it when the room really is unmodified, and the worker records which\n * room the result stands on (`BakeBundle.room`).\n */\n room?: 'full' | 'preset';\n};\n\n/** A viewpoint, in the scene's own (Y-up, meters) coordinates. */\nexport type BakeView = {\n position: [number, number, number];\n};\n\n/** The reflection probe's request: where, and what not to see. */\nexport type BakeProbe = {\n /** Scene units, Y-up: the center of the objects the probe is for. */\n position: [number, number, number];\n /** objectIds hidden from the probe: the objects it will be applied to. */\n hide: string[];\n};\n\n/**\n * A manifest plus what to bake from it: the bake request body. The manifest\n * is the ordinary capture, camera included but unused by the bake itself, so\n * two captures that differ only by viewpoint hit the same bake cache entry.\n */\nexport type BakeSpec = {\n manifest: import('./manifest.js').SceneManifest;\n bake: BakeSettings;\n advanced?: { timeoutSeconds?: number };\n /**\n * Triangles in the objects `bake.include` names, for the quote only.\n *\n * The estimate has two triangle terms: syncing the whole scene (priced from\n * the manifest's own count) and unwrapping the objects being baked (priced\n * from this). Without it the unwrap term is priced against the whole\n * scene, which over-quotes a partial bake of a big room. The SDK sends it;\n * a request without it is quoted the higher way.\n *\n * Deliberately not inside `bake`: that object is the bake cache key, and a\n * number that only moves a price must not move what is cached.\n */\n bakedTriangles?: number;\n /**\n * Hard ceiling in USD, refused at estimate time. The same contract as\n * `RenderSpec.maxCost`.\n */\n maxCost?: number;\n metadata?: Record<string, unknown>;\n idempotencyKey?: string;\n};\n\n// ---------------------------------------------------------------------------\n// The result\n// ---------------------------------------------------------------------------\n\n/**\n * The second UV set for one object, in the live geometry's own vertex order.\n *\n * `values` alone: `2 * vertexCount` floats, writable straight into a `uv1`\n * BufferAttribute on the existing geometry. The common case, and the one\n * that leaves the developer's geometry object untouched.\n *\n * `topology`: the unwrap needed vertex splits. `vertexSource[i]` names the\n * original vertex that new vertex `i` was copied from, so every original\n * attribute (custom ones included) can be gathered through it and nothing\n * the developer authored is lost in the rebuild. `index` is the new triangle\n * list over the new vertices.\n */\nexport type BakeUv =\n | { values: number[] }\n | {\n topology: {\n vertexSource: number[];\n index: number[];\n values: number[];\n };\n }\n /**\n * The lightmap is laid on a uv set the mesh already has: `0` is its\n * texture uv (three's `uv`, glTF `TEXCOORD_0`), `1` its second set (`uv1`,\n * `TEXCOORD_1`). Nothing is shipped and nothing is rebuilt: the SDK points\n * the lightmap at that attribute (`texture.channel`). Such a lightmap is\n * written in the glTF orientation (v = 0 at the top), the one the\n * attribute is in; every unwrap the worker ships itself is bottom-up.\n * Only sent to an SDK that asked for it (`BakeSettings.existingUv`).\n */\n | { channel: 0 | 1 };\n\n/**\n * One baked object. `uri` is resolved against the bundle's own location: a\n * relative path on disk, an absolute URL from a server.\n */\nexport type BakedObject = {\n objectId: string;\n /** The object's name at capture time, for humans reading a bundle. */\n name?: string;\n /** HDR diffuse irradiance (direct + indirect, no albedo), linear. */\n lightmap: { uri: string; format: 'exr' | 'png'; size: number };\n /** Small LDR thumbnail for pickers and panels. */\n preview?: { uri: string };\n uv: BakeUv;\n /**\n * How the surface was cut, measured by the worker, so a panel can say\n * \"2 islands, seams out of view\" and mean it.\n *\n * `cut: 'hidden'` is the viewpoint-aware layout; `'angle'` is the plain\n * angle-limited fallback, used when the hidden-seam layout failed its\n * checks for this object (the job log says so too). `seamsInView` is the\n * fraction of seam length across smooth surface whose both sides face\n * `BakeSettings.view`; 0 is the goal. Seams on creases are not counted,\n * because they do not show.\n */\n layout?: {\n islands: number;\n seamsInView?: number;\n /**\n * `'uv0'`/`'uv1'`: the object's own uv set, chosen over an unwrap\n * because it passed the worker's layout test.\n */\n cut: 'hidden' | 'angle' | 'uv0' | 'uv1';\n };\n /**\n * In an atlas bake: the fraction of the shared map this object's islands\n * cover, which is what its budget and weight actually bought it.\n */\n atlasShare?: number;\n};\n\n/**\n * One stand-in, ready to be put in the scene: see `BakeSimplify`.\n *\n * A mesh carries its geometry inline, in the scene's own coordinates (world\n * space, Y-up, meters), because it is a few hundred vertices and a loader\n * for it would weigh more than it does. `uv` is the one unwrap every map\n * uses. `tangent` (xyzw) is the frame the normal map was baked in; a viewer\n * that derives tangents from uv derivatives instead will be close, not\n * exact. `color` is an sRGB PNG and `normal` a linear one, both the right\n * way up for an ordinary image loader (`flipY` on); `lightmap` follows the\n * lightmap contract above.\n *\n * A billboard is an upright rectangle `width` by `height` centered on\n * `center`, to be turned about the vertical to face the camera, and `map` is\n * linear radiance with alpha: the objects as traced from `BakeSettings.view`'s\n * side, lit by the whole scene, with everything else cut away. It goes\n * through the viewer's own tone mapping like everything around it.\n */\nexport type BakedProxy =\n | {\n kind: 'mesh';\n /** Index into `settings.simplify`. */\n index: number;\n replaces: string[];\n name?: string;\n geometry: {\n position: number[];\n normal: number[];\n uv: number[];\n tangent?: number[];\n index: number[];\n };\n color: { uri: string };\n normal: { uri: string };\n lightmap: { uri: string; format: 'exr'; size: number };\n /** The replaced surfaces' roughness and metalness, area weighted. */\n roughness: number;\n metalness: number;\n layout?: BakedObject['layout'];\n }\n | {\n /** `to: 'decimate'`: the replaced object with fewer triangles. */\n kind: 'decimated';\n index: number;\n /** The one object it replaces, whose materials it wears. */\n replaces: [string];\n name?: string;\n /**\n * In the scene's frame, like a mesh stand-in's. `uv` is the object's\n * own texture uv, carried through the decimation, in the glTF\n * orientation its texture maps expect; `uv1` is present when the\n * lightmap needed an unwrap of its own. `groups` are its material\n * slots, in the order of the replaced mesh's materials.\n */\n geometry: {\n position: number[];\n normal: number[];\n uv: number[];\n uv1?: number[];\n /** Its vertex colors (glTF COLOR_0), linear RGB, when it had them. */\n color?: number[];\n index: number[];\n groups?: Array<{ start: number; count: number; materialIndex: number }>;\n };\n lightmap: { uri: string; format: 'exr'; size: number };\n /** The uv set the lightmap reads: 0 is `uv`, 1 is `uv1`. */\n lightmapChannel: 0 | 1;\n triangles: { from: number; to: number };\n layout?: BakedObject['layout'];\n }\n | {\n kind: 'billboard';\n index: number;\n replaces: string[];\n name?: string;\n center: [number, number, number];\n width: number;\n height: number;\n map: { uri: string; format: 'exr'; width: number; height: number };\n };\n\n/**\n * An object the bake did not produce, with the reason and the fix, per\n * object: \"the bake finished\" must never quietly mean \"except for the glass\n * and the instanced chairs\".\n */\nexport type BakeSkip = {\n objectId: string;\n name?: string;\n code: string;\n message: string;\n why?: string;\n fix?: string;\n /**\n * The object was baked; this is a complaint about how well.\n *\n * An ordinary entry here means a lightmap was not made and the object is\n * still lit the way it was. A `warning` means one was made and is worse\n * than it should be. `BakeCoarseUnwrap` is the case: a surface whose\n * geometry is far finer than the map it earns cuts into more islands than\n * the map has room for, and the result is padding with a little light in\n * it.\n */\n warning?: true;\n};\n\n/**\n * Everything one bake produced. The bundle file is written last, so an\n * interrupted bake never looks finished.\n */\nexport type BakeBundle = {\n bundleVersion: 1;\n /** The `BAKE_VERSION` that produced this. */\n bakeVersion: number;\n settings: BakeSettings;\n objects: BakedObject[];\n skipped: BakeSkip[];\n /**\n * When `settings.atlas` was set: the one lightmap every object's\n * `lightmap.uri` names, so a loader can fetch it once and share it. Each\n * object's `uv` is already in the atlas's space.\n */\n atlas?: {\n uri: string;\n format: 'exr' | 'png';\n size: number;\n preview?: { uri: string };\n /** Fraction of the map's texels some island maps to: packing efficiency. */\n coverage?: number;\n };\n /**\n * The stand-ins `settings.simplify` asked for. One that could not be built\n * is in `skipped` under the id `simplify[n]`, and the objects it would have\n * replaced are left as they were.\n */\n proxies?: BakedProxy[];\n /** The shadow plane `settings.shadow` asked for. */\n shadow?: BakedShadow;\n /**\n * The prebaked room this bake stands its objects in: an unmodified preset\n * room whose own lightmaps are a library asset, not something this bake\n * paid for. The SDK fetches that bundle and applies it underneath this\n * one. Absent from an ordinary bake, which lights everything it covers.\n */\n room?: {\n /** The preset and the lighting it was baked under. */\n name: string;\n lighting: string;\n /**\n * The published room's build hash, which is what makes the prebake this\n * room and not a later edit of it.\n */\n build: string;\n /** Where the prebaked bundle is, on the preset library. */\n uri: string;\n };\n /** The portable unlit GLB, when `deliverGlb` was set. */\n glb?: { uri: string };\n /**\n * The reflection probe: a linear HDR equirectangular map of the scene from\n * `position`, in three's own equirect convention (load it, set\n * `EquirectangularReflectionMapping`, and it is an `envMap`). `hidden` are\n * the objects it was taken without, which are the ones to put it on.\n */\n probe?: {\n uri: string;\n format: 'exr';\n width: number;\n height: number;\n position: [number, number, number];\n hidden: string[];\n /**\n * The probe as an LDR picture, for a panel, a drawer or a figure: the\n * same map through `exposure` (chosen by the worker to put its mean at\n * middle gray), Reinhard and sRGB. A label on the file, not something to\n * light with.\n */\n preview?: { uri: string; exposure?: number };\n };\n stats?: {\n texels: number;\n gpuSeconds?: number;\n /**\n * Where those seconds went, by step (`scene`, `probe`, `unwrap`,\n * `trace`, `repair`, `denoise`, `export`, `standIns`), summed over the\n * objects.\n */\n seconds?: Record<string, number>;\n };\n};\n\n/**\n * A bundle without its uv arrays and stand-in geometry: what a job result\n * carries once the files are in storage. The arrays are the bulk of a bundle\n * (a dense room's are megabytes) and belong in `bundle.json`, which the SDK\n * reads from storage.\n */\nexport type BakeBundleSummary = Omit<BakeBundle, 'objects' | 'proxies'> & {\n objects: Array<Omit<BakedObject, 'uv'>>;\n /** Stand-ins without their geometry, for the same reason. */\n proxies?: Array<DistributiveOmit<BakedProxy, 'geometry'>>;\n};\n\ntype DistributiveOmit<T, K extends PropertyKey> = T extends unknown\n ? Omit<T, K>\n : never;\n\nexport function stripBundleUvs(bundle: BakeBundle): BakeBundleSummary {\n const { proxies, ...rest } = bundle;\n return {\n ...rest,\n objects: bundle.objects.map(({ uv: _uv, ...object }) => object),\n ...(proxies\n ? {\n proxies: proxies.map((proxy) => {\n if (proxy.kind === 'billboard') return proxy;\n const { geometry: _geometry, ...summary } = proxy;\n return summary;\n }),\n }\n : {}),\n };\n}\n\n/**\n * The files a bake writes, predicted from its settings.\n *\n * The worker uploads on presigned PUTs, one per file name, and a name has to\n * be signed before the bake runs. So the set is fixed here, from the request\n * alone, and the worker writes exactly these names. Objects are numbered in\n * include order, skipping nothing: object `n` is the n-th one that baked, so\n * a skipped object shifts the numbering down and the signatures for the\n * highest numbers go unused.\n */\nexport const BAKE_SHADOW_FILE = 'shadow.exr';\n\nexport function bakeUploadNames(\n settings: Pick<\n BakeSettings,\n 'include' | 'atlas' | 'deliverGlb' | 'simplify' | 'shadow'\n >,\n): string[] {\n const names = ['bundle.json'];\n if (settings.atlas) {\n names.push('atlas.exr', 'preview_atlas.png');\n } else {\n for (let n = 0; n < settings.include.length; n++) {\n names.push(`lm_${n}.exr`, `preview_${n}.png`);\n }\n }\n // Stand-ins are numbered by their place in the request, not by which of\n // them succeeded: a stand-in has no neighbors whose numbering it shifts.\n (settings.simplify ?? []).forEach((entry, n) =>\n names.push(...bakeProxyFileNames(entry, n)),\n );\n if (settings.shadow) names.push(BAKE_SHADOW_FILE);\n if (settings.deliverGlb) names.push('baked.glb');\n // Every bake delivers a reflection probe: see `BakeSettings.probe`.\n names.push('probe.exr', 'preview_probe.png');\n return names;\n}\n\n/** The files stand-in `n` writes. */\nexport function bakeProxyFileNames(\n entry: Pick<BakeSimplify, 'to'>,\n n: number,\n): string[] {\n if (entry.to === 'billboard') return [`proxy_${n}_billboard.exr`];\n if (entry.to === 'decimate') return [`proxy_${n}_light.exr`];\n return [\n `proxy_${n}_color.png`,\n `proxy_${n}_normal.png`,\n `proxy_${n}_light.exr`,\n ];\n}\n\n/**\n * Texels the shadow plane asks for. It is traced twice (with the product and\n * without), so it is counted twice.\n */\nexport function bakeShadowTexels(\n settings: Pick<BakeSettings, 'shadow'>,\n): number {\n if (!settings.shadow) return 0;\n const side = settings.shadow.textureSize ?? BAKE_SHADOW_SIZE;\n return 2 * side * side;\n}\n\n/**\n * Texels the stand-ins ask for: one map's worth each. The color and normal\n * passes are a sample apiece and are priced as bake passes, not as texels.\n */\nexport function bakeSimplifyTexels(\n settings: Pick<BakeSettings, 'textureSize' | 'simplify'>,\n): number {\n return (settings.simplify ?? []).reduce((sum, entry) => {\n const size = entry.textureSize ?? settings.textureSize;\n return sum + size * size;\n }, 0);\n}\n\n/** Content type for a bake file, by name. */\nexport function bakeFileContentType(name: string): string {\n if (name.endsWith('.exr')) return 'image/x-exr';\n if (name.endsWith('.png')) return 'image/png';\n if (name.endsWith('.glb')) return 'model/gltf-binary';\n if (name.endsWith('.json')) return 'application/json';\n return 'application/octet-stream';\n}\n","/**\n * What a preset room group remembers about itself, and how to read it back.\n *\n * Its own module because the capture reads it on every render, and the\n * capture must not import the room builder to do so: the builder pulls\n * GLTFLoader, GroundedSkybox and the whole room catalog out of three/addons,\n * and an app that never stands a product in a room should neither bundle them\n * nor need a three new enough to have them.\n */\n\nimport type { Object3D } from 'three';\nimport type { RoomPresetSpec } from '../protocol/index.js';\n\n/** A room's choices, as they travel in the manifest, without its placement. */\nexport type PresetRoomState = Omit<RoomPresetSpec, 'matrix'>;\n\n/** What the compatibility report says about a room, copied from its catalog entry when it is built. */\nexport type PresetRoomFacts = {\n label: string;\n triangles: number;\n /** How many meshes the published room draws, for a room shown baked: its baked file has them joined. */\n objects?: number;\n};\n\n/** A picture the developer hung, hashed and kept so the capture can upload it. */\nexport type PresetRoomAsset = {\n hash: string;\n contentType: string;\n data: ArrayBuffer;\n name: string;\n};\n\ntype Remembered = {\n roomPreset?: PresetRoomState;\n roomFacts?: PresetRoomFacts;\n pictureAssets?: PresetRoomAsset[];\n /** `'baked'` when the page shows the room's baked file instead of the stand-in. */\n shown?: 'baked';\n};\n\nfunction remembered(object: Object3D): Remembered | undefined {\n return object.userData?.bakery3Preset as Remembered | undefined;\n}\n\n/** The record the capture writes for a room group, or null for any other object. */\nexport function roomPresetSpecOf(object: Object3D): RoomPresetSpec | null {\n const state = remembered(object)?.roomPreset;\n if (!state) return null;\n object.updateMatrixWorld(true);\n return { ...state, matrix: object.matrixWorld.toArray() };\n}\n\n/**\n * Whether the page is showing this room's BAKED file: one GLB with its light\n * in it, none of which is ever captured, over a real stand. Its light is\n * already there, so a bake into it covers the product, the stand and the\n * shadow, and nothing fetches library lightmaps for it.\n */\nexport function roomShownBaked(object: Object3D): boolean {\n return remembered(object)?.shown === 'baked';\n}\n\n/** The label and preview size a room group was built with, when it recorded them. */\nexport function roomPresetFactsOf(object: Object3D): PresetRoomFacts | null {\n return remembered(object)?.roomFacts ?? null;\n}\n\n/** The room preset groups under `root`. Usually one; more than one is a capture error. */\nexport function findPresetRooms(root: Object3D): Object3D[] {\n const found: Object3D[] = [];\n root.traverse((object) => {\n if (remembered(object)?.roomPreset) found.push(object);\n });\n return found;\n}\n\n/**\n * The images the developer hung in this room, as bytes to upload.\n *\n * A plain render sends none of a room's geometry (the render worker rebuilds\n * it from the published definition), so a picture of the developer's own is\n * the one thing about a room that has to travel as an asset. Its hash is in\n * the record; these are the bytes behind it.\n */\nexport function roomPresetAssetsOf(object: Object3D): PresetRoomAsset[] {\n return remembered(object)?.pictureAssets ?? [];\n}\n","/**\n * A preset room lit by its own library lightmaps, the moment it is added.\n *\n * A room that has been prebaked under a lighting mode (`ROOM_PRESETS[name]\n * .prebaked`) has its light on the preset CDN already: the same bundle a\n * product bake in `room: 'preset'` mode stands on. `createPresetRoom` applies\n * it to the stand-in through a bake session of the room's own, so the\n * viewport shows traced bounce and contact shadows before anyone bakes\n * anything, and costs nothing but the download.\n *\n * Two sessions, one set of materials. A developer's own bake session covers\n * the whole scene, room included, and a bundle that stands its product in a\n * preset room lays the same room lightmaps down again under its own. Two\n * patches on one material would each record the other's edit as the thing to\n * restore. So the room's patch is registered here, and a session about to\n * light any of the room's objects suspends it first and resumes it after its\n * own patch is gone: always nested, never interleaved.\n *\n * Only an unmodified room is lit this way, by the same rule the bake uses\n * (`roomPrebakeChanges`): the library's light is a photograph of one\n * arrangement, and another floor or another view outside is another light.\n */\n\nimport type { Object3D } from 'three';\nimport type { BakeSessionOptions } from '../bake/session.js';\nimport {\n presetRoomBakePath,\n type BakeBundle,\n type RoomPresetSpec,\n} from '../protocol/index.js';\nimport { ROOM_PRESETS, type RoomPresetName } from './rooms.gen.js';\n\ntype RoomChoices = Pick<\n RoomPresetSpec,\n 'name' | 'lighting' | 'surfaces' | 'hdri' | 'pedestal'\n>;\n\n/** What a modified room has changed, in the developer's words. Empty means\n * the library's light is this room's light. */\nexport function roomPrebakeChanges(room: RoomChoices): string[] {\n const changed: string[] = [];\n if (room.surfaces) changed.push('its materials');\n if (room.hdri !== undefined) changed.push('what is outside its windows');\n if (room.pedestal !== undefined) changed.push('its stand');\n return changed;\n}\n\n/** Whether the library holds lightmaps for this room under this mode. */\nexport function roomIsPrebaked(name: string, lighting: string): boolean {\n const published: readonly string[] =\n ROOM_PRESETS[name as RoomPresetName]?.prebaked ?? [];\n return published.includes(lighting);\n}\n\n/** What `createPresetRoom` resolves `userData.prebaked` to. */\nexport type PresetRoomPrebake = {\n /** Room surfaces that took their lightmap. */\n applied: number;\n /** Surfaces the library lit that found no mesh here: a stand-in that\n * changed since the prebake. */\n unmatched: number;\n};\n\ntype Handle = {\n suspend(): void;\n resume(): void;\n set(on: boolean): void;\n};\n\nconst handles = new WeakMap<Object3D, Handle>();\n\n/** The room groups under `root` that carry library lightmaps. */\nexport function prebakedRoomsUnder(\n root: Object3D,\n): Array<{ group: Object3D; handle: Handle }> {\n const found: Array<{ group: Object3D; handle: Handle }> = [];\n root.traverse((node) => {\n const handle = handles.get(node);\n if (handle) found.push({ group: node, handle });\n });\n return found;\n}\n\n/**\n * Show or hide a preset room's library lightmaps. Off, the room is lit by its\n * stand-in lights alone, exactly as it was created; on puts them back. A room\n * that was never prebaked is left as it is.\n */\nexport function setPresetRoomPrebaked(room: Object3D, on: boolean): void {\n handles.get(room)?.set(on);\n}\n\n/**\n * Fetch the room's library bundle and apply it to `group` in a session of\n * its own. Resolves `null` when the room has nothing published for this mode\n * or has been changed; never rejects, because a room without its prebake is\n * still a room, lit by its stand-in lights as it always was.\n */\nexport async function applyRoomPrebake(\n group: Object3D,\n spec: RoomChoices,\n base: string,\n presetsVersion: number,\n /** For tests: a texture factory that does not decode EXRs. */\n sessionOptions: Pick<BakeSessionOptions, 'textureFactory'> = {},\n): Promise<PresetRoomPrebake | null> {\n if (\n !roomIsPrebaked(spec.name, spec.lighting) ||\n roomPrebakeChanges(spec).length\n )\n return null;\n const url = `${base.replace(/\\/$/, '')}/v${presetsVersion}/${presetRoomBakePath(spec.name, spec.lighting)}`;\n try {\n const response = await fetch(url);\n if (!response.ok)\n throw new Error(`${response.status} ${response.statusText}`);\n // The library bundle names itself as its own room; applied here it is the\n // room, so that field would only send the session to fetch it twice.\n const { room: _self, ...bundle } = (await response.json()) as BakeBundle;\n // Its own chunk: the session pulls EXRLoader, which a page that shows no\n // prebaked room should not download.\n const { createBakeSession } = await import('../bake/session.js');\n const session = createBakeSession({\n ...sessionOptions,\n scene: group,\n probe: false,\n presetBaseUrl: base,\n });\n const generation = session.addGeneration(bundle, {\n baseUrl: url,\n label: 'prebaked',\n });\n\n let wanted = true;\n let suspended = 0;\n const show = () => session.compare(!(wanted && suspended === 0));\n handles.set(group, {\n suspend() {\n suspended++;\n show();\n },\n resume() {\n suspended = Math.max(0, suspended - 1);\n show();\n },\n set(on) {\n wanted = on;\n show();\n },\n });\n\n const report = await session.apply(generation);\n // A developer's bake may have suspended the room while this loaded.\n show();\n return {\n applied: report.applied.length,\n unmatched: report.unmatched.length,\n };\n } catch (error) {\n console.warn(\n `[bakery3] The prebaked light for room \"${spec.name}\" (${spec.lighting}) did not load, so it is lit by its preview lights. ${\n error instanceof Error ? error.message : String(error)\n }`,\n );\n return null;\n }\n}\n"]}