@hology/core 0.0.120 → 0.0.122

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 (164) hide show
  1. package/dist/config/project-config.js +1 -1
  2. package/dist/controllers/base-game-controller.js +1 -1
  3. package/dist/csm.js +1 -1
  4. package/dist/effects/particles/examples.js +1 -1
  5. package/dist/effects/particles/particle-system-config.js +1 -1
  6. package/dist/effects/vfx/behaviours.js +1 -1
  7. package/dist/effects/vfx/index.js +1 -1
  8. package/dist/effects/vfx/initializsers.js +1 -1
  9. package/dist/effects/vfx/rates.js +1 -1
  10. package/dist/effects/vfx/stretched-sprite.js +1 -1
  11. package/dist/effects/vfx/trail-renderer.js +1 -1
  12. package/dist/effects/vfx/vfx-actor.js +1 -1
  13. package/dist/effects/vfx/vfx-asset.js +1 -1
  14. package/dist/effects/vfx/vfx-collision-behaviour.js +1 -1
  15. package/dist/effects/vfx/vfx-defs.js +1 -1
  16. package/dist/effects/vfx/vfx-materializer.js +1 -1
  17. package/dist/effects/vfx/vfx-old-materializer.js +1 -1
  18. package/dist/effects/vfx/vfx-param.js +1 -1
  19. package/dist/effects/vfx/vfx-renderers.js +1 -1
  20. package/dist/effects/vfx/vfx-service.js +1 -1
  21. package/dist/effects/vfx/zones.js +1 -1
  22. package/dist/game-component/component-decorators.js +1 -1
  23. package/dist/game-component/game-component.js +1 -1
  24. package/dist/gameplay/actors/actor.js +1 -1
  25. package/dist/gameplay/actors/builtin/camera-actor.js +1 -1
  26. package/dist/gameplay/actors/builtin/components/character/character-animation.js +1 -1
  27. package/dist/gameplay/actors/builtin/components/character/character-movement.js +1 -1
  28. package/dist/gameplay/actors/builtin/components/character/modes.js +1 -1
  29. package/dist/gameplay/actors/builtin/components/mesh-component.js +1 -1
  30. package/dist/gameplay/actors/builtin/components/scene-component.js +1 -1
  31. package/dist/gameplay/actors/builtin/components/volume-editor-component.js +1 -1
  32. package/dist/gameplay/actors/builtin/index.js +1 -1
  33. package/dist/gameplay/actors/builtin/navmesh-actor.js +1 -1
  34. package/dist/gameplay/actors/builtin/positional-audio-actor.js +1 -1
  35. package/dist/gameplay/actors/builtin/post-process-volume-actor.js +1 -1
  36. package/dist/gameplay/actors/builtin/spawn-point.js +1 -1
  37. package/dist/gameplay/actors/builtin/trigger-volume.js +1 -1
  38. package/dist/gameplay/actors/camera/camera-component.js +1 -1
  39. package/dist/gameplay/actors/camera/third-person-camera-component.js +1 -1
  40. package/dist/gameplay/actors/component.js +1 -1
  41. package/dist/gameplay/actors/factory.js +1 -1
  42. package/dist/gameplay/actors/index.js +1 -1
  43. package/dist/gameplay/actors/internal/component-init.js +1 -1
  44. package/dist/gameplay/actors/internal/container-map.js +1 -1
  45. package/dist/gameplay/ai/behavior-tree/bt.js +1 -1
  46. package/dist/gameplay/ai/behavior-tree/move.js +1 -1
  47. package/dist/gameplay/ai/build-tile.js +1 -1
  48. package/dist/gameplay/ai/dynamic-tiled-navmesh.js +1 -1
  49. package/dist/gameplay/ai/dynamic-tiled-navmesh.worker.js +1 -1
  50. package/dist/gameplay/ai/index.js +1 -1
  51. package/dist/gameplay/ai/navigation.js +1 -1
  52. package/dist/gameplay/animation/anim-sm.js +1 -1
  53. package/dist/gameplay/animation/root-motion.js +1 -1
  54. package/dist/gameplay/env.js +1 -1
  55. package/dist/gameplay/index.js +1 -1
  56. package/dist/gameplay/initiate.d.ts +9 -0
  57. package/dist/gameplay/initiate.d.ts.map +1 -1
  58. package/dist/gameplay/initiate.js +2 -2
  59. package/dist/gameplay/inject.js +1 -1
  60. package/dist/gameplay/input/index.js +1 -1
  61. package/dist/gameplay/input/input-service.js +1 -1
  62. package/dist/gameplay/input/input.js +1 -1
  63. package/dist/gameplay/input/keybind.js +1 -1
  64. package/dist/gameplay/polyfill.js +1 -1
  65. package/dist/gameplay/services/asset-loader.js +1 -1
  66. package/dist/gameplay/services/physics/abstract-physics-system.js +1 -1
  67. package/dist/gameplay/services/physics/collision-contact.js +1 -1
  68. package/dist/gameplay/services/physics/physics-system.js +1 -1
  69. package/dist/gameplay/services/pointer-events.js +1 -1
  70. package/dist/gameplay/services/render.js +1 -1
  71. package/dist/gameplay/services/shader-provider.js +1 -1
  72. package/dist/gameplay/services/world.js +1 -1
  73. package/dist/index.js +1 -1
  74. package/dist/rendering/color-pass.d.ts.map +1 -1
  75. package/dist/rendering/color-pass.js +2 -2
  76. package/dist/rendering/shader-override.js +1 -1
  77. package/dist/rendering/tone-mapping.js +1 -1
  78. package/dist/rendering.d.ts +3 -0
  79. package/dist/rendering.d.ts.map +1 -1
  80. package/dist/rendering.js +2 -2
  81. package/dist/scene/asset-resource-loader.js +1 -1
  82. package/dist/scene/assets-provider.js +1 -1
  83. package/dist/scene/bootstrap.d.ts +5 -1
  84. package/dist/scene/bootstrap.d.ts.map +1 -1
  85. package/dist/scene/bootstrap.js +2 -2
  86. package/dist/scene/collision/collision-shape-import.js +1 -1
  87. package/dist/scene/collision/collision-shape.js +1 -1
  88. package/dist/scene/landscape/landscape-manager.js +1 -1
  89. package/dist/scene/landscape/landscape.js +1 -1
  90. package/dist/scene/landscape/utils.js +1 -1
  91. package/dist/scene/materializer.d.ts +3 -1
  92. package/dist/scene/materializer.d.ts.map +1 -1
  93. package/dist/scene/materializer.js +2 -2
  94. package/dist/scene/materials/grass-foliage.js +1 -1
  95. package/dist/scene/materials/grass.js +1 -1
  96. package/dist/scene/materials/utils/material-painting.js +1 -1
  97. package/dist/scene/materials/utils/noise.glsl.js +1 -1
  98. package/dist/scene/materials/water.js +1 -1
  99. package/dist/scene/model.d.ts +11 -0
  100. package/dist/scene/model.d.ts.map +1 -1
  101. package/dist/scene/model.js +2 -2
  102. package/dist/scene/objects/prefab.js +1 -1
  103. package/dist/scene/objects/ramp-geometry.js +1 -1
  104. package/dist/scene/objects/shapes.js +1 -1
  105. package/dist/scene/objects/stairs-geometry.js +1 -1
  106. package/dist/scene/runtime-asset-service.js +1 -1
  107. package/dist/scene/runtime-backend-service.js +1 -1
  108. package/dist/scene/runtime-bundled-backend-service.js +1 -1
  109. package/dist/scene/scene-data-service.js +1 -1
  110. package/dist/scene/sky.js +1 -1
  111. package/dist/scene/storage/storage.js +1 -1
  112. package/dist/shader/builtin/decal-standard-shader.js +1 -1
  113. package/dist/shader/builtin/decal-unlit-shader.js +1 -1
  114. package/dist/shader/builtin/index.js +1 -1
  115. package/dist/shader/builtin/lambert-shader.js +1 -1
  116. package/dist/shader/builtin/landscape-composite-shader.js +1 -1
  117. package/dist/shader/builtin/landscape-shader.js +1 -1
  118. package/dist/shader/builtin/standard-shader.js +1 -1
  119. package/dist/shader/builtin/unlit-shader.js +1 -1
  120. package/dist/shader/decal-shader.js +1 -1
  121. package/dist/shader/index.js +1 -1
  122. package/dist/shader/parameter.js +1 -1
  123. package/dist/shader/shader.js +1 -1
  124. package/dist/shader/sprite-shader.js +1 -1
  125. package/dist/shader/trail-shader.js +1 -1
  126. package/dist/shader-nodes/bulge.js +1 -1
  127. package/dist/shader-nodes/decal.js +1 -1
  128. package/dist/shader-nodes/depth.js +1 -1
  129. package/dist/shader-nodes/effects.js +1 -1
  130. package/dist/shader-nodes/glsl-node.js +1 -1
  131. package/dist/shader-nodes/index.js +1 -1
  132. package/dist/shader-nodes/landscape.js +1 -1
  133. package/dist/shader-nodes/layers.js +1 -1
  134. package/dist/shader-nodes/math.js +1 -1
  135. package/dist/shader-nodes/particle.js +1 -1
  136. package/dist/shader-nodes/scene-sample.js +1 -1
  137. package/dist/shader-nodes/shapes.js +1 -1
  138. package/dist/shader-nodes/texture-sequence.js +1 -1
  139. package/dist/shader-nodes/time.js +1 -1
  140. package/dist/shader-nodes/voronoi.js +1 -1
  141. package/dist/test/injection.test.js +1 -1
  142. package/dist/utils/async.js +1 -1
  143. package/dist/utils/buffer.js +1 -1
  144. package/dist/utils/collections.js +1 -1
  145. package/dist/utils/curve.js +1 -1
  146. package/dist/utils/files.js +1 -1
  147. package/dist/utils/materials.js +1 -1
  148. package/dist/utils/math.js +1 -1
  149. package/dist/utils/mesh.js +1 -1
  150. package/dist/utils/polyfill.js +1 -1
  151. package/dist/utils/three/depth-pass.js +1 -1
  152. package/dist/utils/three/gpu-stats-panel.js +1 -1
  153. package/dist/utils/three/line-sphere.js +1 -1
  154. package/dist/utils/three/outline-pass.js +1 -1
  155. package/dist/utils/three/positional-audio-helper.js +1 -1
  156. package/dist/utils/three/stats.js +1 -1
  157. package/dist/utils/three/transform-controls.js +1 -1
  158. package/dist/utils/three/traverse.js +1 -1
  159. package/dist/utils/type.js +1 -1
  160. package/dist/utils/uuid.js +1 -1
  161. package/dist/utils/voxel-bitset.js +1 -1
  162. package/dist/worker/index.js +1 -1
  163. package/package.json +2 -2
  164. package/tsconfig.tsbuildinfo +1 -1
@@ -1,4 +1,4 @@
1
1
  export const noiseChunk="\n// Some useful functions\nvec3 mod289(vec3 x) { return x - floor(x * (1.0 / 289.0)) * 289.0; }\nvec2 mod289(vec2 x) { return x - floor(x * (1.0 / 289.0)) * 289.0; }\nvec3 permute(vec3 x) { return mod289(((x*34.0)+1.0)*x); }\n\n//\n// Description : GLSL 2D simplex noise function\n// Author : Ian McEwan, Ashima Arts\n// Maintainer : ijm\n// Lastmod : 20110822 (ijm)\n// License :\n// Copyright (C) 2011 Ashima Arts. All rights reserved.\n// Distributed under the MIT License. See LICENSE file.\n// https://github.com/ashima/webgl-noise\n//\nfloat snoise(vec2 v) {\n\n // Precompute values for skewed triangular grid\n const vec4 C = vec4(0.211324865405187,\n // (3.0-sqrt(3.0))/6.0\n 0.366025403784439,\n // 0.5*(sqrt(3.0)-1.0)\n -0.577350269189626,\n // -1.0 + 2.0 * C.x\n 0.024390243902439);\n // 1.0 / 41.0\n\n // First corner (x0)\n vec2 i = floor(v + dot(v, C.yy));\n vec2 x0 = v - i + dot(i, C.xx);\n\n // Other two corners (x1, x2)\n vec2 i1 = vec2(0.0);\n i1 = (x0.x > x0.y)? vec2(1.0, 0.0):vec2(0.0, 1.0);\n vec2 x1 = x0.xy + C.xx - i1;\n vec2 x2 = x0.xy + C.zz;\n\n // Do some permutations to avoid\n // truncation effects in permutation\n i = mod289(i);\n vec3 p = permute(\n permute( i.y + vec3(0.0, i1.y, 1.0))\n + i.x + vec3(0.0, i1.x, 1.0 ));\n\n vec3 m = max(0.5 - vec3(\n dot(x0,x0),\n dot(x1,x1),\n dot(x2,x2)\n ), 0.0);\n\n m = m*m ;\n m = m*m ;\n\n // Gradients:\n // 41 pts uniformly over a line, mapped onto a diamond\n // The ring size 17*17 = 289 is close to a multiple\n // of 41 (41*7 = 287)\n\n vec3 x = 2.0 * fract(p * C.www) - 1.0;\n vec3 h = abs(x) - 0.5;\n vec3 ox = floor(x + 0.5);\n vec3 a0 = x - ox;\n\n // Normalise gradients implicitly by scaling m\n // Approximation of: m *= inversesqrt(a0*a0 + h*h);\n m *= 1.79284291400159 - 0.85373472095314 * (a0*a0+h*h);\n\n // Compute final noise value at P\n vec3 g = vec3(0.0);\n g.x = a0.x * x0.x + h.x * x0.y;\n g.yz = a0.yz * vec2(x1.x,x2.x) + h.yz * vec2(x1.y,x2.y);\n return 130.0 * dot(m, g);\n}\n";/*
2
- * Copyright (©) 2023. All rights reserved.
2
+ * Copyright (©) 2025 Hology Interactive AB. All rights reserved.
3
3
  * See the LICENSE.md file for details.
4
4
  */
@@ -1,4 +1,4 @@
1
1
  import*as e from"three";import{Color as n,DoubleSide as r,PerspectiveCamera as t}from"three";export function createWaterMaterial(a,o){const i=(new e.TextureLoader).load("https://i.imgur.com/hOIsXiZ.png"),l=(new e.TextureLoader).load("assets/images/shaders/water_normal_map.jpg");l.wrapS=e.MirroredRepeatWrapping,l.wrapT=e.MirroredRepeatWrapping;const m={time:{value:0},threshold:{value:.1},tDudv:{value:null},tDepth:{value:null},cameraNear:{value:0},cameraFar:{value:0},resolution:{value:new e.Vector2},foamColor:{value:new e.Color},waterColor:{value:new e.Color},normalMap:{value:null}};i.wrapS=i.wrapT=e.RepeatWrapping;var c=!!o.renderer.extensions.get("WEBGL_depth_texture"),s=new e.ShaderMaterial({defines:{DEPTH_PACKING:!0===c?0:1,ORTHOGRAPHIC_CAMERA:0},uniforms:e.UniformsUtils.merge([e.UniformsLib.fog,m]),transparent:!0,vertexShader:"\n #include <fog_pars_vertex>\n\n varying vec2 vUv;\n\n void main() {\n\n \tvUv = uv;\n\n \t#include <begin_vertex>\n \t#include <project_vertex>\n \t#include <fog_vertex>\n\n }",fragmentShader:"\n #include <common>\n #include <packing>\n #include <fog_pars_fragment>\n\n varying vec2 vUv;\n uniform sampler2D tDepth;\n uniform sampler2D tDudv;\n uniform vec3 waterColor;\n uniform vec3 foamColor;\n uniform float cameraNear;\n uniform float cameraFar;\n uniform float time;\n uniform float threshold;\n uniform vec2 resolution;\n uniform sampler2D normalMap;\n\n float getDepth( const in vec2 screenPosition ) {\n #if DEPTH_PACKING == 1\n return unpackRGBAToDepth( texture2D( tDepth, screenPosition ) );\n #else\n return texture2D( tDepth, screenPosition ).x;\n #endif\n }\n\n float getViewZ( const in float depth ) {\n #if ORTHOGRAPHIC_CAMERA == 1\n return orthographicDepthToViewZ( depth, cameraNear, cameraFar );\n #else\n return perspectiveDepthToViewZ( depth, cameraNear, cameraFar );\n #endif\n }\n\n void main() {\n\n vec2 screenUV = gl_FragCoord.xy / resolution;\n\n float fragmentLinearEyeDepth = getViewZ( gl_FragCoord.z );\n float linearEyeDepth = getViewZ( getDepth( screenUV ) );\n\n float diff = saturate(fragmentLinearEyeDepth - linearEyeDepth);\n // Increase foam length by negating more\n //float diff = saturate(fragmentLinearEyeDepth - linearEyeDepth - 5.0);\n\n vec2 displacement = texture2D( tDudv, ( vUv * 2.0 ) - time * 0.01 ).rb;\n displacement = ( ( displacement * 2.0 ) - 1.0 ) * 1.0;\n diff += displacement.x*0.3; // How much of the texture to apply\n/*\n if (diff < 0.4 * ((sin(time*.5)*1.5+2.0)/5.0) && diff > 0.1 * ((sin(time*.5)*1.5+2.0)/5.0)) {\n diff = 1.0; \n // This illustrates how one can create stripes of foam so it does not start at the short\n }*/\n\n float depth = (linearEyeDepth - fragmentLinearEyeDepth) / linearEyeDepth;\n vec3 waterDiffuse = mix( foamColor, mix(vec3(0.2, 0.3, 0.7), waterColor, 1.0 - depth), step( 0.9*((sin(time*.5)*2.0+3.0)/5.0), diff ) );\n gl_FragColor.a = 0.8-clamp(depth, 0.3, 0.8)/3.0;\n\n\n // This light direction is hard coded but should be coming from the directional lights\n vec3 lightDirection = normalize(vec3(0.5, -1.0, -0.6) * -1.0);\n vec2 waterCoord = vUv;\n // Create some randomnes when picking coordinates.\n waterCoord.x *= 1.5 - cos(time) * 0.02;\n waterCoord.y *= 1.5 - sin(time+5.0) * 0.01;\n vec3 wNormal = texture2D(normalMap, waterCoord).rgb;\n float dotNL = clamp(dot(wNormal, lightDirection), 0.0, 1.0);\n vec3 irradience = dotNL * vec3(1.0);\n\n gl_FragColor.rgb = waterDiffuse * 0.2 + waterDiffuse * irradience * 1.3;\n\n //gl_FragColor.rgb = irradience;//texture2D(normalMap, vUv * 2.0).rgb;\n //gl_FragColor.a = 1.0;\n\n\n //vec4 foam = vec4(foamColor, 1.0);\n //vec4 murky = vec4(0.2, 0.3, 0.7, 0.9);\n //vec4 water = vec4(waterColor, 0.5);\n //gl_FragColor = mix(foam, mix(murky, water, 1.0 - depth), step( 0.9*((sin(time*.5)*2.0+3.0)/5.0), diff ) );\n\n #include <tonemapping_fragment>\n #include <encodings_fragment>\n #include <fog_fragment>\n\n }",fog:!0,side:r,blendSrc:e.OneMinusSrcColorFactor,blendDst:e.SrcColorFactor});s.uniforms.cameraNear.value=o.camera instanceof t?o.camera.near:1,s.uniforms.cameraFar.value=o.camera instanceof t?o.camera.far:500,s.uniforms.foamColor.value.set(new n(16777215)),s.uniforms.waterColor.value.set(a.color??new n(2084067)),s.uniforms.resolution.value.set(o.container.clientWidth*o.renderer.getPixelRatio(),o.container.clientHeight*o.renderer.getPixelRatio()),s.uniforms.tDudv.value=i,s.uniforms.tDepth.value=!0===c?o.depthRenderTarget.depthTexture:o.depthRenderTarget.texture,s.uniforms.normalMap.value=l;let f=0;return o.onLoop((e=>{f+=e,s.uniforms.threshold.value=.5,s.uniforms.time.value=f,s.uniforms.resolution.value.set(o.container.clientWidth*o.renderer.getPixelRatio(),o.container.clientHeight*o.renderer.getPixelRatio())})),s.userData.water=!0,s}/*
2
- * Copyright (©) 2023. All rights reserved.
2
+ * Copyright (©) 2025 Hology Interactive AB. All rights reserved.
3
3
  * See the LICENSE.md file for details.
4
4
  */
@@ -7,6 +7,16 @@ import { VfxAssetData } from '../effects/vfx/vfx-asset.js';
7
7
  export type AssetType = 'mesh' | 'material' | 'shape' | 'particles' | 'light' | 'texture' | 'actor' | 'audio' | 'prefab' | 'vfx';
8
8
  export type ShapeType = LibraryShapeType | 'landscape';
9
9
  export type LightType = 'point' | 'directional' | 'ambient';
10
+ /**
11
+ * The detail is used to determine what objects to place in a scene.
12
+ * When loading a scene, you can decide what to include.
13
+ * Meshes with a tier above what you select will not even be loaded.
14
+ */
15
+ export declare enum DetailTier {
16
+ low = 0,
17
+ medium = 1,
18
+ high = 2
19
+ }
10
20
  export declare enum SerializedParamType {
11
21
  FloatNode = 0,
12
22
  Number = 1,
@@ -73,6 +83,7 @@ export type Asset = {
73
83
  bloom?: boolean;
74
84
  };
75
85
  mesh?: {
86
+ detailTier?: DetailTier;
76
87
  rescale?: number;
77
88
  collisions?: {
78
89
  shapeType?: CollisionShapeType;
@@ -1 +1 @@
1
- {"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../src/scene/model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAClF,OAAO,EAAE,oBAAoB,EAAE,MAAM,gDAAgD,CAAC;AACtF,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,OAA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;AAC9L,MAAM,MAAM,kBAAkB,GAAG;IAC/B,OAAO,EAAE,MAAM,CAAA;IACf,WAAW,EAAE,OAAO,CAAA;IAGpB,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,EAAE,OAAO,CAAA;IAGpB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CACvB,CAAA;AAED,MAAM,MAAM,OAAO,GAAG,MAAM,CAAA;AAE5B,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,UAAU,EAAE,OAAO,CAAA;CACpB;AAED,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,MAAM,SAAS,GAAG;IACtB,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,WAAW,EAAE,CAAA;IACnB,OAAO,EAAE,MAAM,CAAA;CAChB,GAAG,WAAW,CAAA;AAEf,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;CAChB"}
@@ -1,4 +1,4 @@
1
- export var SerializedParamType;!function(e){e[e.FloatNode=0]="FloatNode",e[e.Number=1]="Number",e[e.Texture=2]="Texture",e[e.Sampler2DNode=3]="Sampler2DNode",e[e.Boolean=4]="Boolean",e[e.BooleanNode=5]="BooleanNode",e[e.Vector2=6]="Vector2",e[e.Vec2Node=7]="Vec2Node",e[e.Vector3=8]="Vector3",e[e.Vec3Node=9]="Vec3Node",e[e.Color=10]="Color",e[e.RgbNode=11]="RgbNode",e[e.String=12]="String",e[e.BaseActor=13]="BaseActor",e[e.Euler=14]="Euler",e[e.Object3D=15]="Object3D",e[e.Material=16]="Material",e[e.AudioBuffer=17]="AudioBuffer",e[e.Vector4=18]="Vector4",e[e.Vec4Node=19]="Vec4Node",e[e.VisualEffect=20]="VisualEffect",e[e.Array=21]="Array",e[e.Curve=22]="Curve"}(SerializedParamType||(SerializedParamType={}));/*
2
- * Copyright (©) 2023. All rights reserved.
1
+ export var DetailTier;!function(e){e[e.low=0]="low",e[e.medium=1]="medium",e[e.high=2]="high"}(DetailTier||(DetailTier={}));export var SerializedParamType;!function(e){e[e.FloatNode=0]="FloatNode",e[e.Number=1]="Number",e[e.Texture=2]="Texture",e[e.Sampler2DNode=3]="Sampler2DNode",e[e.Boolean=4]="Boolean",e[e.BooleanNode=5]="BooleanNode",e[e.Vector2=6]="Vector2",e[e.Vec2Node=7]="Vec2Node",e[e.Vector3=8]="Vector3",e[e.Vec3Node=9]="Vec3Node",e[e.Color=10]="Color",e[e.RgbNode=11]="RgbNode",e[e.String=12]="String",e[e.BaseActor=13]="BaseActor",e[e.Euler=14]="Euler",e[e.Object3D=15]="Object3D",e[e.Material=16]="Material",e[e.AudioBuffer=17]="AudioBuffer",e[e.Vector4=18]="Vector4",e[e.Vec4Node=19]="Vec4Node",e[e.VisualEffect=20]="VisualEffect",e[e.Array=21]="Array",e[e.Curve=22]="Curve"}(SerializedParamType||(SerializedParamType={}));/*
2
+ * Copyright (©) 2025 Hology Interactive AB. All rights reserved.
3
3
  * See the LICENSE.md file for details.
4
4
  */
@@ -1,4 +1,4 @@
1
1
  export class Prefab{constructor(s){this.asset=s}}export class PrefabInstance{}/*
2
- * Copyright (©) 2023. All rights reserved.
2
+ * Copyright (©) 2025 Hology Interactive AB. All rights reserved.
3
3
  * See the LICENSE.md file for details.
4
4
  */
@@ -1,4 +1,4 @@
1
1
  import{BufferAttribute as e,BufferGeometry as t}from"three";import*as r from"three/examples/jsm/utils/BufferGeometryUtils.js";export function rampGeometry(){const n=new t;return n.setAttribute("position",new e(o,3)),n.computeVertexNormals(),r.mergeVertices(n)}const o=function(){let e=new Float32Array([0,1,1,1,1,1,1,0,0,0,0,0,0,1,1,1,0,0,1,0,0,1,0,1,0,0,1,0,0,1,0,0,0,1,0,0,1,1,1,1,0,1,1,0,0,0,0,1,0,1,1,0,0,0,1,0,1,0,1,1,0,0,1,1,1,1,0,1,1,1,0,1]);for(let t=0;t<e.length;t+=3)e[t]-=.5,e[t+2]-=.5;return e}();/*
2
- * Copyright (©) 2023. All rights reserved.
2
+ * Copyright (©) 2025 Hology Interactive AB. All rights reserved.
3
3
  * See the LICENSE.md file for details.
4
4
  */
@@ -1,4 +1,4 @@
1
1
  import{BoxCollisionShape as e,CapsuleCollisionShape as t,ConeCollisionShape as r,ConvexPolyhedronCollisionShape as s,CylinderCollisionShape as n,PlaneCollisionShape as i,SphereCollisionShape as o,TrimeshCollisionShape as a}from"../collision/collision-shape.js";import{BoxGeometry as m,PlaneGeometry as h,Vector3 as l,CylinderGeometry as c,SphereGeometry as g,Euler as p,TorusGeometry as u,ConeGeometry as d,CircleGeometry as w,CapsuleGeometry as y}from"three";import{rampGeometry as S}from"./ramp-geometry.js";import{RoundedBoxGeometry as f}from"three/examples/jsm/geometries/RoundedBoxGeometry.js";import{TextGeometry as x}from"three/examples/jsm/geometries/TextGeometry.js";import{Font as b}from"three/examples/jsm/loaders/FontLoader.js";import*as j from"three/examples/fonts/helvetiker_regular.typeface.json";import{createSpiralStairsGeometry as L,createStairsGeometry as z}from"./stairs-geometry.js";function E(e){return{type:"number",default:e}}function k(e){return{type:"number",default:e,float:!0}}function v(e){return{type:"boolean",default:e}}function B(e,t){const r={};for(let s in t)null==e[s]?r[s]=t[s].default:r[s]=e[s];return r}const G={box:{geometry:()=>new m(1,1,1),collision:()=>new e(new l(1,1,1))},ramp:{geometry:()=>S(),collision:()=>new s(S())},plane:new class{constructor(){this.parameters={widthSegments:E(1),heightSegments:E(1)}}geometry(e={}){const t=B(e,this.parameters);return new h(1,1,t.widthSegments,t.heightSegments)}collision(e={}){return new i(1,1)}},cylinder:new class{constructor(){this.parameters={radialSegments:E(12),heightSegments:E(1),openEnded:v(!1)}}geometry(e={}){const t=B(e,this.parameters);return new c(.5,.5,1,t.radialSegments,t.heightSegments,t.openEnded)}collision(e={}){const t=B(e,this.parameters);return new n(.5,.5,1,t.radialSegments,new p(0,1,0))}},sphere:new class{constructor(){this.parameters={withSegments:E(12),heightSegments:E(12)}}geometry(e={}){const t=B(e,this.parameters);return new g(.5,t.withSegments,t.heightSegments)}collision(){return new o(.5)}},torus:new class{constructor(){this.parameters={radius:k(1),tube:k(.3),radialSegments:E(16),tubularSegments:E(50)}}geometry(e={}){const t=B(e,this.parameters);return new u(t.radius,t.tube,t.radialSegments,t.tubularSegments)}collision(e={}){return new a(this.geometry(e))}},cone:new class{constructor(){this.parameters={radialSegments:E(12),heightSegments:E(1),openEnded:v(!1)}}geometry(e={}){const t=B(e,this.parameters);return new d(.5,1,t.radialSegments,t.heightSegments)}collision(e={}){return new r(1,.5)}},circle:new class{constructor(){this.parameters={segments:E(32)}}geometry(e={}){const t=B(e,this.parameters);return new w(.5,t.segments)}collision(e={}){return new a(this.geometry(e))}},capsule:new class{constructor(){this.parameters={radius:k(.5),length:k(1),capSegments:E(8),radialSegments:E(32)}}geometry(e={}){const t=B(e,this.parameters);return new y(t.radius,t.length,t.capSegments,t.radialSegments)}collision(e={}){const r=B(e,this.parameters);return new t(r.length,r.radius)}},roundedBox:new class{constructor(){this.parameters={width:k(1),height:k(1),depth:k(1),segments:E(4),radius:k(.1)}}geometry(e={}){const t=B(e,this.parameters);return new f(t.width,t.height,t.depth,t.segments,t.radius)}collision(t={}){const r=B(t,this.parameters);return new e(new l(r.width,r.height,r.depth))}},text:new class{constructor(){var e;this.parameters={text:(e="Text",{type:"string",default:e}),size:k(1),depth:k(.2)}}geometry(e={}){const t=B(e,this.parameters);return new x(t.text,{font:new b(j),size:t.size,height:t.depth})}collision(e={}){return B(e,this.parameters).text.trim().length,null}},stairs:new class{constructor(){this.parameters={floating:v(!1),width:k(1),height:k(.25),depth:k(.25),steps:E(4)}}geometry(e={}){const t=B(e,this.parameters);return z(t.floating,t.steps,t.depth,t.height,t.width)}collision(e={}){return new a(this.geometry(e))}},stairsSpiral:new class{constructor(){this.parameters={floating:v(!1),width:k(1),height:k(.25),steps:E(4),degrees:E(90),radius:k(.2),flipped:v(!1)}}geometry(e={}){const t=B(e,this.parameters);return L(t.floating,t.steps,t.height,t.width,t.degrees,t.radius,t.flipped)}collision(e={}){return new a(this.geometry(e))}}};export const ShapeLibrary=G;export const ShapeLibraryKeys=Object.keys(ShapeLibrary);/*
2
- * Copyright (©) 2023. All rights reserved.
2
+ * Copyright (©) 2025 Hology Interactive AB. All rights reserved.
3
3
  * See the LICENSE.md file for details.
4
4
  */
@@ -1,4 +1,4 @@
1
1
  import*as t from"three";export function createSpiralStairsGeometry(e,o,r,s,n,a,l){const c=[];for(let i=0;i<o;i++){let f=i*r;const u=t.MathUtils.degToRad(Math.abs(n)),h=i/o,m=(i+1)/o,p=Math.cos(h*u)*a,M=Math.cos(h*u)*(a+s),b=Math.cos(m*u)*a,x=Math.cos(m*u)*(a+s),g=Math.sin(h*u)*a,w=Math.sin(h*u)*(a+s),y=Math.sin(m*u)*a,A=Math.sin(m*u)*(a+s);let B;if(e)B=[p,f,g,M,f,w,p,f+r,g,M,f+r,w,b,f,y,x,f,A,b,f+r,y,x,f+r,A];else{const t=0;B=[p,f,g,M,f,w,p,f+r,g,M,f+r,w,b,t,y,x,t,A,b,t+r*(i+1),y,x,t+r*(i+1),A,p,t,g,M,t,w]}const G=0,N=[G,G+2,G+1,G+1,G+2,G+3,G,G+4,G+2,G+2,G+4,G+6,G+5,G+1,G+3,G+5,G+3,G+7,...e||i===o-1?[G+6,G+4,G+5,G+6,G+5,G+7]:[],G+3,G+2,G+6,G+7,G+3,G+6,...!e&&i>0?[G,G+8,G+4,G+5,G+9,G+1]:[],...e?[G,G+1,G+4,G+1,G+5,G+4]:[G+8,G+9,G+4,G+9,G+5,G+4]];if(l)for(let t=0;t<N.length;t+=3){let e=N[t];N[t]=N[t+2],N[t+2]=e}for(let t=0;t<N.length;t++)c.push(B[3*N[t]],B[3*N[t]+1],B[3*N[t]+2])}const i=new t.BufferGeometry;return i.setAttribute("position",new t.Float32BufferAttribute(c,3)),i.computeVertexNormals(),l&&(i.scale(-1,1,1),i.computeVertexNormals()),i}export function createStairsGeometry(e,o,r,s,n){const a=[];for(let t=0;t<o;t++){let l=0,c=t*s;const i=t*r;let f;if(e)f=[l,c+0*s,i,l+n,c+0*s,i,l,c+s,i,l+n,c+s,i,l,c+0*s,i+r,l+n,c+0*s,i+r,l,c+s,i+r,l+n,c+s,i+r];else{const e=0;f=[l,c,i,l+n,c,i,l,c+s,i,l+n,c+s,i,l,e,i+r,l+n,e,i+r,l,e+s*(t+1),i+r,l+n,e+s*(t+1),i+r,l,e,i,l+n,e,i]}const u=0,h=[u,u+2,u+1,u+1,u+2,u+3,u,u+4,u+2,u+2,u+4,u+6,u+5,u+1,u+3,u+5,u+3,u+7,...e||t===o-1?[u+6,u+4,u+5,u+6,u+5,u+7]:[],...!e&&t>0?[u,u+8,u+4,u+5,u+9,u+1]:[],u+3,u+2,u+6,u+7,u+3,u+6,...e?[u,u+1,u+4,u+1,u+5,u+4]:[u+8,u+9,u+4,u+9,u+5,u+4]];for(let t=0;t<h.length;t++)a.push(f[3*h[t]],f[3*h[t]+1],f[3*h[t]+2])}const l=new t.BufferGeometry;return l.setAttribute("position",new t.Float32BufferAttribute(a,3)),l.computeVertexNormals(),l}/*
2
- * Copyright (©) 2023. All rights reserved.
2
+ * Copyright (©) 2025 Hology Interactive AB. All rights reserved.
3
3
  * See the LICENSE.md file for details.
4
4
  */
@@ -1,4 +1,4 @@
1
1
  import{Subject as s}from"rxjs";export class RuntimeAssetsService{constructor(t){this.backend=t,this.assets=new Map,this.loaded=!1,this.onCreate=new s,this.onDelete=new s,this.onUpdate=new s}async getAssets(){if(!this.loaded){const s=await this.backend.getAssets();for(const t of s)this.assets.set(t.id,t)}return Array.from(this.assets.values())}async getAsset(s){return this.assets.get(s)??async function(s,e){t.has(s)||t.set(s,e(s));return t.get(s)}(s,(()=>this.backend.getAsset(s)))}}const t=new Map;/*
2
- * Copyright (©) 2023. All rights reserved.
2
+ * Copyright (©) 2025 Hology Interactive AB. All rights reserved.
3
3
  * See the LICENSE.md file for details.
4
4
  */
@@ -1,4 +1,4 @@
1
1
  import{ObjectStorage as e}from"./storage/storage.js";export class LegacyRuntimeBackendService{constructor(t){this.sceneStorage=new e("scene"),this.sceneBlobStorage=new e("scene-blob"),this.assetStorage=new e("asset"),this.sceneStorage.setBasePath(t),this.sceneBlobStorage.setBasePath(t),this.assetStorage.setBasePath(t)}getAssets(){return this.assetStorage.getAll()}getAsset(e){return this.assetStorage.get(e)}getScenes(){return this.sceneStorage.getAll()}getScene(e){return this.sceneStorage.get(e)}async getSceneData(e){const t=await this.sceneBlobStorage.get(e);return null==t?null:"string"==typeof t.data?JSON.parse(t.data):t.data}}/*
2
- * Copyright (©) 2023. All rights reserved.
2
+ * Copyright (©) 2025 Hology Interactive AB. All rights reserved.
3
3
  * See the LICENSE.md file for details.
4
4
  */
@@ -1,4 +1,4 @@
1
1
  export class RuntimeBundledBackendService{constructor(){this.assets=new Map,this.scenes=new Map,this.sceneBlobs=new Map}getAssets(){return Promise.resolve(Array.from(this.assets.values()))}getAsset(e){return Promise.resolve(this.assets.get(e))}getScenes(){return Promise.resolve(Array.from(this.scenes.values()))}getScene(e){return Promise.resolve(this.scenes.get(e))}async getSceneData(e){const s=this.sceneBlobs.get(e);return"string"==typeof s.data?JSON.parse(s.data):s.data}static tryCreate(){}async preloadData(){const e=await(await fetch("hology_data.json")).json()??{};for(const s of e.asset??[])this.assets.set(s.id,s);for(const s of e.scene??[])this.scenes.set(s.id,s),this.scenes.set(s.name,s);for(const s of e["scene-blob"]??[])this.sceneBlobs.set(s.id,s)}}/*
2
- * Copyright (©) 2023. All rights reserved.
2
+ * Copyright (©) 2025 Hology Interactive AB. All rights reserved.
3
3
  * See the LICENSE.md file for details.
4
4
  */
@@ -1,4 +1,4 @@
1
1
  import{BehaviorSubject as e}from"rxjs";import{Matrix4 as t,Vector3 as s,Quaternion as i,Euler as n,NoToneMapping as o}from"three";export class SceneDataService{constructor(){this.objects=[],this.callbacks=[],this.createCallbacks=[],this.removeCallbacks=[],this.objectChange=new e([])}initiate(e){this.objects=e??[],this.objectChange.next(this.objects)}createDefaultObjects(){this.objects.some((e=>"global_fog"===e.type))||this.objects.unshift(createInitialFog());this.objects.some((e=>"sky"===e.type))||this.objects.unshift(createInitialSky())}removeOnUpdateCallback(e){this.callbacks.splice(this.callbacks.indexOf(e),1)}onCreate(e){this.createCallbacks.push(e)}onUpdate(e){this.callbacks.push(e)}onRemove(e){this.removeCallbacks.push(e)}getObjects(){return this.objects}getObjectsRecursive(){const e=[],t=this.objects.slice();for(;t.length>0;){const s=t.pop();e.push(s),null!=s.children&&t.push(...s.children)}return e}addObject(e,t=!1){this.objects.push(e),this.createCallbacks.forEach((s=>s(e,t))),this.objectChange.next(this.objects)}updateObject(e,t=!1){const s=this.findObjectById(e.id);s?(Object.assign(s,e),this.callbacks.forEach((s=>s(e,t)))):this.addObject(e),this.objectChange.next(this.objects)}findObjectById(e){const t=[...this.objects];for(;t.length>0;){const s=t.pop();if(s.id===e)return s;s.children&&t.push(...s.children)}}findAncestorsById(e){const t=this.findParentById(e);return null==t?[]:[t,...this.findAncestorsById(t.id)]}findParentById(e){return this._findParentById(e,this.objects)}_findParentById(e,t,s=null){return t.some((t=>t.id===e))?s:t.filter((e=>null!=e.children)).map((t=>this._findParentById(e,t.children,t))).find((e=>null!=e))}updateParent(e,o){const r=this.findParentById(e.id);{const c=null!=o?this.getMatrixWorld(o).invert():(new t).identity();null!=r&&c.multiply(this.getMatrixWorld(r));const l=this.getLocalMatrix(e),a=c.multiply(l),h=new s,d=new i,b=new s;a.decompose(h,d,b),e.position=h.toArray(),e.rotation=(new n).setFromQuaternion(d).toArray(),e.scale=b.toArray()}this.removeRecursive(e.id,r?.children??this.objects),null!=r?r.children=r.children.slice():this.objects=this.objects.slice(),null!=o?(o.children??(o.children=[]),o.children.push(e),o.children=o.children.slice()):(this.objects.push(e),this.objects=this.objects.slice()),this.objectChange.next(this.objects),this.callbacks.forEach((t=>t(e,!1)))}getMatrixWorld(e){const t=this.findAncestorsById(e.id).reverse();t.push(e);const s=this.getLocalMatrix(t.shift());for(const e of t){const t=this.getLocalMatrix(e);s.multiply(t)}return s}getLocalMatrix(e){const o=new t,r=(new s).fromArray(e.position),c=(new i).setFromEuler((new n).fromArray(e.rotation)),l=(new s).fromArray(e.scale);return o.compose(r,c,l),o}removeObjectById(e,t=!1){const s=this.findObjectById(e);this.removeObject(s,t)}removeObject(e,t=!1){this.removeRecursive(e.id,this.objects),this.removeCallbacks.forEach((s=>s(e,t))),this.objectChange.next([...this.objects])}removeRecursive(e,t){const s=t.findIndex((t=>t.id===e));if(s>-1)t.splice(s,1);else for(const s of t)null!=s.children&&this.removeRecursive(e,s.children??[])}save(){}serialize(){return JSON.stringify(this.objects)}}export function createInitialFog(){return{id:"auto-global-fog",name:"Global fog",type:"global_fog",fog:{type:"density",color:"#b8f8ff",density:.005,near:100,far:1e3}}}export function createInitialSky(){return{id:"auto-sky",name:"Sky",type:"sky",sky:{materialId:null}}}export function createWorldEnvironment(){return{id:"auto-world-env",name:"World Environment",type:"world_env",worldEnv:{ao:{enabled:!1,blendIntensity:1,radius:.25,distanceExponent:1,thickness:1,distanceFallOff:1,scale:1,samples:16,onlyAO:!1},toneMapping:{mapping:o,exposure:1},environment:{textureId:null,intensity:1}}}}/*
2
- * Copyright (©) 2023. All rights reserved.
2
+ * Copyright (©) 2025 Hology Interactive AB. All rights reserved.
3
3
  * See the LICENSE.md file for details.
4
4
  */
package/dist/scene/sky.js CHANGED
@@ -1,4 +1,4 @@
1
1
  import*as e from"three";import{AmbientLight as a,FogExp2 as t}from"three";import{attributes as r,NodeShaderMaterial as o,uniforms as i,vec4 as n,varyingVec3 as s,float as h,normalize as d,rgb as c,mix as m,max as w,pow as p}from"three-shader-graph";export function basicSceneSetup(r){!function(t){new a(16777215,.5);var r=new e.HemisphereLight(16777215,273,.5*Math.PI);r.name=ambientLightName,r.position.set(0,100,0),t.add(r);new e.HemisphereLightHelper(r,10);var o=new e.DirectionalLight(16777215,.7);o.position.set(-30,50,30),o.castShadow=!0,o.shadow.mapSize.width=2048,o.shadow.mapSize.height=2048;var i=250;o.shadow.normalBias=.3,o.shadow.camera.left=-i,o.shadow.camera.right=i,o.shadow.camera.top=i,o.shadow.camera.bottom=-i,o.shadow.camera.far=500,o.shadow.bias=-5e-4;new e.DirectionalLightHelper(o,10);var n=new e.PointLight(16777215,1,50);n.castShadow=!0,n.position.set(0,40,0),n.shadow.camera.near=1,n.shadow.camera.far=60,n.shadow.bias=-.005}(r),function(e){e.fog=new t(l,f)}(r)}export const ambientLightName="default_ambient";const l=157554,f=.005;export const defaultSkyMaterial=function(){const a=h(5),t=h(.6),l=new e.Color(16777215),f=new e.Color(13431551),g=s(i.modelMatrix.multiplyVec(n(r.position,1)).xyz),u=d(g.addScalar(a)).y,S=w(p(w(u,h(0)),h(t)),h(0)),b=n(m(c(f),c(l),S),h(1)),y=new o({color:b.rgba});return y.side=e.BackSide,y.depthTest=!1,y}();export function createSky(){var a=new e.SphereGeometry(300,10,15),t=new e.Mesh(a,defaultSkyMaterial);return t.renderOrder=-999,t.raycast=()=>{},t}/*
2
- * Copyright (©) 2023. All rights reserved.
2
+ * Copyright (©) 2025 Hology Interactive AB. All rights reserved.
3
3
  * See the LICENSE.md file for details.
4
4
  */
@@ -1,4 +1,4 @@
1
1
  import{randomUUID as e}from"../../utils/uuid.js";import{pathJoin as t}from"../../utils/files.js";import{combineLatest as a,EMPTY as i,filter as r,firstValueFrom as s,from as n,map as h,mergeAll as o,mergeMap as l,Observable as c,of as d,startWith as p,Subject as u,switchMap as w,tap as f}from"rxjs";import{sleepDelay as m}from"../../utils/async.js";const y={},v={},j={},b={};null==y.read&&window.require&&(Object.assign(y,window.require("fs")),Object.assign(v,y.promises),Object.assign(j,window.require("path")),Object.assign(b,window.require("chokidar")));const F=null!=y.existsSync;function g(){if(F){const e="--path=",t=window.process.argv.find((t=>t.startsWith(e)));return t?t.substring(e.length):""}return""}const x=/^[A-Z]:/;function P(...e){return 0===e.length?"":x.test(e[0])||F?j.join(...e):t(...e)}export class ObjectStorage{get pathResources(){return P(this.path+"-resources")}constructor(e,t){this.name=e,this.filePathFn=t,this.basePathUpdates=new u,this.basePath=this.basePathUpdates.pipe(h((e=>P(g(),e))),f((e=>{this.path=P(e,this.name),O(this.path),this.determineIfMetaFileShouldBeCreated()}))),this.loaded=s(this.basePath),this.shouldCreateIndex=!0,this.watchers=[]}setBasePath(e){this.basePathUpdates.next(e)}async determineIfMetaFileShouldBeCreated(){try{(await v.readFile(P(g(),"vite.config.ts"))).toString().includes("hologyBuild")&&(this.shouldCreateIndex=!1)}catch(e){console.warn("Failed to read vite config to determine if meta files should be created")}}async createFolder(e,t=""){S(),await v.mkdir(j.join(this.path,t,e),{recursive:!0})}async deleteFolderForceDangerous(e){await v.rm(j.join(this.path,e),{recursive:!0,force:!0})}async moveFolder(e,t){if(S(),""==e)return void console.warn("Can not move a folder in root");const a=j.resolve(j.join(this.path,t),j.basename(e));if(await C(a)){if(a!==j.resolve(this.path,e))throw new Error("Can not move to directory as a file already exists with the same name")}else{if(function(e,t){const a=j.resolve(e),i=j.resolve(t),r=j.normalize(a)+j.sep;return(j.normalize(i)+j.sep).startsWith(r)}(j.join(this.path,e),j.join(this.path,t)))throw new Error("Can not move a folder into a folder it contains");await v.rename(j.join(this.path,e),a)}}async renameFolder(e,t){await v.rename(j.join(this.path,e),j.resolve(j.dirname(j.join(this.path,e)),t))}async moveToFolder(e,t){if(S(),e.path===t)return;const a=this.privateObjectPath({...e,path:t});await v.rename(this.privateObjectPath(e),a)}getAbsolutePath(e=""){return j.join(this.path,e)}watchFolders(){const e=v.readdir(this.path,{recursive:!0,withFileTypes:!0});return a([n(e),this.watchDir(this.path).pipe(r((e=>!e.filename.endsWith(".json"))),p(null))]).pipe(w((([e,t])=>null!=t?n(v.readdir(this.path,{recursive:!0,withFileTypes:!0})):d(e))),h((e=>Array.from(new Set(e.filter((e=>e.isDirectory())).map((e=>j.relative(this.path,j.join(e.path,e.name)).replace(/^\.$/,""))).values())))))}watch(){S();n(this.loaded).pipe(w((()=>a([this.watchDir(this.pathResources),n(this.getAll())]).pipe(r((([e])=>null!=e)),l((([e,t])=>{if("change"===e.event){const a=j.basename(e.filename),i=t.filter((e=>e.fileKey===a));if(i.length>0)return n(i).pipe(l((e=>{const t=this.privateObjectRelativePath(e);return n(this.readFileIfExists(t)).pipe(h((a=>({event:"change",object:a,path:e.path,filename:t}))))})))}return i}))))));return n(this.loaded).pipe(w((()=>this.watchDir(this.path))),l((e=>{const t={event:e.event,path:j.dirname(e.filename).replace(/^\.$/,""),filename:j.basename(e.filename)};return e.filename.endsWith(".json")?"unlink"!==e.event?n(this.readFileIfExists(e.filename)).pipe(h((e=>({object:e,...t})))):d({object:null,...t}):"change"===e.event?n(this.reloadSubdirectory(e.filename)).pipe(o(),h((e=>({object:e,...t})))):i})))}async reloadSubdirectory(e){return(await this.getAll(e)).filter((t=>t.path.startsWith(e)))}async readFileIfExists(e){const t=P(this.path,e);try{const a=await v.readFile(t);return{...JSON.parse(a.toString()),path:j.dirname(e).replace(/^\.$/,""),filename:j.basename(e)}}catch{return console.error("Could not find file at "+t),null}}async getAll(e){if(F){await this.loaded,await O(this.path);const t=(await v.readdir(j.join(this.path,e??""),{recursive:!0,withFileTypes:!0})).filter((e=>e.isFile()&&e.name.endsWith(".json")&&!/^[\._]/.test(e.name)));return await Promise.all(t.map((e=>v.readFile(P(e.path,e.name)).then((t=>({...JSON.parse(t.toString()),path:j.relative(this.path,e.path).replace(/^\.$/,""),filename:j.basename(e.path)}))))))}const t=await this.loadIndex();return Promise.all(Object.keys(t).map((e=>this.get(e))))}async get(e){const t=await this.loadIndex(),a=t[e]??Object.values(t).find((t=>t.name===e));if(null==a)return;const i=this.privateObjectPath(a);if(!F)return(await fetch(i)).json();return await I(i)?JSON.parse((await v.readFile(i)).toString()):null}async save(e){return S(),await this.loaded,await v.writeFile(this.privateObjectPath(e),this.serialize(e)),await this.updateIndex(),e}async rename(e,t){const a={...e,name:t},i=this.privateObjectPath(e),r=this.privateObjectPath(a);try{await v.rename(i,r)}catch(e){console.error(e),console.warn("Rename failed, retrying",{currentPath:i,newPath:r}),await m(400),await v.rename(i,r)}return await this.save(a),await this.updateIndex(),a}async delete(e){await v.unlink(this.privateObjectPath(e)),this.updateIndex()}async create(t){S(),await this.loaded,t.id=e();const a=this.privateObjectPath(t);if(await C(a))throw Error(`Can not create because a file already exists at ${a}`);return await v.writeFile(a,this.serialize(t)),await this.updateIndex(),t}prepareCreate(t){return S(),t.id=e(),t}serialize(e){const t={...e};return delete t.path,delete t.filename,JSON.stringify(t,null,2)}async updateIndex(){S();const e=await this.getAll(),t={};for(const a of e)t[a.id]={id:a.id,name:a.name??a.id,path:a.path};if(this.cachedIndex=t,F){if(!this.shouldCreateIndex)return;await v.writeFile(this.indexFilePath,JSON.stringify(t,null,2))}}get indexFilePath(){return P(this.path,"_meta.json")}async loadIndex(){return null==this.cachedIndex&&(F?await this.updateIndex():this.cachedIndex=await(await fetch(this.indexFilePath)).json()),this.cachedIndex}async ensureResourceDir(){await O(P(this.path+"-resources"))}async saveFile(e,t){return S(),await O(P(this.path+"-resources")),v.copyFile(t.path,P(this.path+"-resources",e.fileKey))}async saveExtraFile(e,t){return S(),await O(P(this.path+"-resources")),v.copyFile(e,P(this.path+"-resources",t))}getAssetPath(e){return window&&"function"==typeof window.require?window.require("path").join(this.path+"-resources",e.fileKey):P(this.path+"-resources",e.fileKey)}async replaceFile(e,t){if(await I(t))return v.copyFile(t,P(this.path+"-resources",e.fileKey));console.error("Failed to replace file using path "+t)}async deleteFile(e){if(null==e)return;S();const t=P(this.path+"-resources",e);return await I(t)?v.unlink(t):void 0}privateObjectPath(e){return P(this.path,this.privateObjectRelativePath(e))}privateObjectRelativePath(e){return this.filePathFn?P(e.path??"",this.filePathFn(e)):P(e.path??"",tokenizeName(e.name??e.id)+".json")}watchDir(e){return new c((t=>{const a=b.watch(e,{cwd:e});return a.on("all",((e,a,i)=>{t.next({event:e,filename:a})})),a.on("unlinkDir",(e=>{})),a.on("error",(()=>{})),this.watchers.push(a),()=>{a.close()}}))}}export function tokenizeName(e){return e.trim().replace(/\s/g,"_").replace(/[^a-z0-9_\-\.]/gi,"")}async function O(e){F&&(await I(e)||await v.mkdir(e,{recursive:!0}))}function I(e){return!!F&&new Promise((function(t,a){y.exists(e,(function(e){t(e)}))}))}function S(){if(!F)throw new Error("Must have direct access to filesystem")}async function C(e){try{await v.access(e,v.constants.F_OK)}catch(e){return!1}return!0}/*
2
- * Copyright (©) 2023. All rights reserved.
2
+ * Copyright (©) 2025 Hology Interactive AB. All rights reserved.
3
3
  * See the LICENSE.md file for details.
4
4
  */
@@ -1,4 +1,4 @@
1
1
  import{__decorate as e,__metadata as t}from"tslib";import{Color as a,Texture as s,Vector2 as r}from"three";import{colorToNormal as o,float as i,rgba as p,standardMaterial as l,textureSampler2d as d,uniforms as n,normalize as h,varying as m}from"three-shader-graph";import{decalAlpha as y,decalNormal as c,decalUV as u}from"../../shader-nodes/decal.js";import{depthWorldPosition as S}from"../../shader-nodes/depth.js";import{DecalNodeShader as g}from"../decal-shader.js";import{Parameter as v}from"../parameter.js";export class DecalStandardShader extends g{constructor(){super(...arguments),this.color=new a("#FFFFFF"),this.opacity=1,this.roughness=1,this.metalness=0}output(){const e=u;let t=i(this.opacity);null!=this.alphaMap&&(t=t.multiply(d(this.alphaMap).sample(e).r)),t=t.multiply(y);let a=p(this.color,t);null!=this.colorMap&&(a=a.multiply(d(this.colorMap).sample(e)));let s=p(this.emissive,t);null!=this.emissiveMap&&(s=s.multiply(d(this.emissiveMap).sample(e)));let r=i(this.roughness);null!=this.roughnessMap&&(r=r.multiply(d(this.roughnessMap).sample(e).g));let g=i(this.metalness);null!=this.metalnessMap&&(g=g.multiply(d(this.metalnessMap).sample(e).b));let v=h(m(n.normalMatrix).multiplyVec(c));null!=this.normalMap&&(v=o(d(this.normalMap).sample(e),this.normalScale?.x??1,v,S,e));let M=null;return null!=this.aoMap&&(M=d(this.aoMap).sample(e).r),{color:l({color:a,emissive:s,emissiveIntensity:i(this.emissiveIntensity??1),roughness:r,metalness:g,normal:v,ambientOcclusion:M,ambientOcclusionIntensity:i(this.aoMapIntensity??1),worldPosition:S})}}build(){const e=super.build();return e.depthTest=!0,e.depthWrite=!1,e.userData.isDecal=!0,e}}e([v(),t("design:type",a)],DecalStandardShader.prototype,"color",void 0),e([v({range:[0,1]}),t("design:type",Number)],DecalStandardShader.prototype,"opacity",void 0),e([v(),t("design:type",s)],DecalStandardShader.prototype,"colorMap",void 0),e([v(),t("design:type",s)],DecalStandardShader.prototype,"alphaMap",void 0),e([v({range:[0,1]}),t("design:type",Number)],DecalStandardShader.prototype,"roughness",void 0),e([v(),t("design:type",s)],DecalStandardShader.prototype,"roughnessMap",void 0),e([v({range:[0,1]}),t("design:type",Number)],DecalStandardShader.prototype,"metalness",void 0),e([v(),t("design:type",s)],DecalStandardShader.prototype,"metalnessMap",void 0),e([v(),t("design:type",s)],DecalStandardShader.prototype,"aoMap",void 0),e([v(),t("design:type",Number)],DecalStandardShader.prototype,"aoMapIntensity",void 0),e([v(),t("design:type",a)],DecalStandardShader.prototype,"emissive",void 0),e([v({range:[0,10]}),t("design:type",Number)],DecalStandardShader.prototype,"emissiveIntensity",void 0),e([v(),t("design:type",s)],DecalStandardShader.prototype,"emissiveMap",void 0),e([v(),t("design:type",s)],DecalStandardShader.prototype,"normalMap",void 0),e([v(),t("design:type",r)],DecalStandardShader.prototype,"normalScale",void 0);/*
2
- * Copyright (©) 2023. All rights reserved.
2
+ * Copyright (©) 2025 Hology Interactive AB. All rights reserved.
3
3
  * See the LICENSE.md file for details.
4
4
  */
@@ -1,4 +1,4 @@
1
1
  import{__decorate as t,__metadata as e}from"tslib";import{Color as r,Texture as o}from"three";import{Parameter as i}from"../parameter.js";import{DecalNodeShader as p}from"../decal-shader.js";import{rgba as a,textureSampler2d as l,float as s}from"three-shader-graph";import{decalAlpha as n,decalUV as h}from"../../shader-nodes/decal.js";export class DecalUnlitShader extends p{constructor(){super(...arguments),this.color=new r("#FFFFFF"),this.opacity=1,this.intensity=1}output(){const t=h;let e=s(this.opacity);null!=this.alphaMap&&(e=e.multiply(l(this.alphaMap).sample(t).r)),e=e.multiply(n);let r=a(this.color,e);return null!=this.colorMap&&(r=r.multiply(l(this.colorMap).sample(t))),r=a(r.rgb.multiplyScalar(this.intensity),r.a),{color:r}}}t([i(),e("design:type",r)],DecalUnlitShader.prototype,"color",void 0),t([i({range:[0,1]}),e("design:type",Number)],DecalUnlitShader.prototype,"opacity",void 0),t([i({range:[0,10]}),e("design:type",Number)],DecalUnlitShader.prototype,"intensity",void 0),t([i(),e("design:type",o)],DecalUnlitShader.prototype,"colorMap",void 0),t([i(),e("design:type",o)],DecalUnlitShader.prototype,"alphaMap",void 0);/*
2
- * Copyright (©) 2023. All rights reserved.
2
+ * Copyright (©) 2025 Hology Interactive AB. All rights reserved.
3
3
  * See the LICENSE.md file for details.
4
4
  */
@@ -1,4 +1,4 @@
1
1
  export*from"./standard-shader.js";export*from"./lambert-shader.js";export*from"./unlit-shader.js";/*
2
- * Copyright (©) 2023. All rights reserved.
2
+ * Copyright (©) 2025 Hology Interactive AB. All rights reserved.
3
3
  * See the LICENSE.md file for details.
4
4
  */
@@ -1,4 +1,4 @@
1
1
  import{__decorate as e,__metadata as t}from"tslib";import{Color as i,Texture as a,MeshLambertMaterial as r}from"three";import{Shader as p}from"../shader.js";import{Parameter as o}from"../parameter.js";import{removeObjectUndefined as s}from"../../utils/collections.js";export class LambertShader extends p{constructor(){super(...arguments),this.color=new i("#FFFFFF"),this.opacity=1}build(){return new r(s({color:this.color,opacity:this.opacity,emissive:this.emissive,emissiveIntensity:this.emissiveIntensity,emissiveMap:this.emissiveMap,map:this.map,lightMap:this.lightMap,lightMapIntensity:this.lightMapIntensity,aoMap:this.aoMap,aoMapIntensity:this.aoMapIntensity,specularMap:this.specularMap,alphaMap:this.alphaMap,envMap:this.envMap,reflectivity:this.reflectivity,refractionRatio:this.refractionRatio}))}}e([o(),t("design:type",i)],LambertShader.prototype,"color",void 0),e([o({label:"Color Map"}),t("design:type",a)],LambertShader.prototype,"map",void 0),e([o({range:[0,1]}),t("design:type",Number)],LambertShader.prototype,"opacity",void 0),e([o(),t("design:type",a)],LambertShader.prototype,"alphaMap",void 0),e([o(),t("design:type",i)],LambertShader.prototype,"emissive",void 0),e([o({range:[0,1]}),t("design:type",Number)],LambertShader.prototype,"emissiveIntensity",void 0),e([o(),t("design:type",a)],LambertShader.prototype,"emissiveMap",void 0),e([o(),t("design:type",a)],LambertShader.prototype,"lightMap",void 0),e([o(),t("design:type",Number)],LambertShader.prototype,"lightMapIntensity",void 0),e([o(),t("design:type",a)],LambertShader.prototype,"aoMap",void 0),e([o(),t("design:type",Number)],LambertShader.prototype,"aoMapIntensity",void 0),e([o(),t("design:type",a)],LambertShader.prototype,"specularMap",void 0),e([o(),t("design:type",a)],LambertShader.prototype,"envMap",void 0),e([o({range:[0,1]}),t("design:type",Number)],LambertShader.prototype,"reflectivity",void 0),e([o({range:[0,1]}),t("design:type",Number)],LambertShader.prototype,"refractionRatio",void 0);/*
2
- * Copyright (©) 2023. All rights reserved.
2
+ * Copyright (©) 2025 Hology Interactive AB. All rights reserved.
3
3
  * See the LICENSE.md file for details.
4
4
  */
@@ -1,4 +1,4 @@
1
1
  import{__decorate as e,__metadata as t}from"tslib";import{Material as s,MathUtils as a,MeshBasicMaterial as o,MeshLambertMaterial as l,MeshStandardMaterial as i}from"three";import{cos as n,float as r,mix as p,standardMaterial as m,step as h,varyingAttributes as u,SimplexNoiseNode as c,varying as d,uniforms as y,vec4 as g,attributes as M,smoothstep as S,textureSampler2d as f,rgba as v,varyingTransformed as b,colorToNormal as C}from"three-shader-graph";import{LayerMixMode as L,mixColorsByLayer as A}from"../../shader-nodes/layers.js";import{Parameter as x}from"../parameter.js";import{NodeShader as N}from"../shader.js";const w=d(y.modelMatrix.multiplyVec(g(M.position,1)).xz);export class LandscapeCompositeShader extends N{constructor(){super(...arguments),this.layers=[],this.uvScale=1,this.transition=L.soft,this.noiseScale=1,this.noiseAmount=.2,this.softness=.3,this.enableSlope=!1,this.slopeAngle=35}output(){const e=new j,t=u.uv.multiplyScalar(this.uvScale??1),s=this.layers.map((e=>{if(e instanceof i||e instanceof l||e instanceof o){let s=v(e.color,1);return null!=e.map&&(s=s.multiply(f(e.map).sample(t))),s}return v("white")})),d=this.layers.map((e=>(e instanceof i||e instanceof l)&&null!=e.normalMap?C(f(e.normalMap).sample(t),e.normalScale?.x??1):b.normal)),y=this.layers.map((s=>{let a=r(1);return s instanceof i&&(a=r(s.roughness??1),null!=s.roughnessMap&&(a=a.multiply(e.get(s.roughnessMap,t).g))),a})),g=this.layers.map((s=>{let a=r(0);return s instanceof i&&(a=r(s.metalness??0),null!=s.metalnessMap&&(a=a.multiply(e.get(s.metalnessMap,t).b))),a}));let M,x,N,z;this.enableSlope&&null!=this.slopeMaterial&&this.slopeMaterial instanceof i&&(M=v(this.slopeMaterial.color,1),null!=this.slopeMaterial.map&&(M=M.multiply(e.get(this.slopeMaterial.map,t))),x=b.normal,null!=this.slopeMaterial.normalMap&&(x=C(e.get(this.slopeMaterial.normalMap,t),this.slopeMaterial.normalScale?.x??1)),N=r(this.slopeMaterial.roughness??1),null!=this.slopeMaterial.roughnessMap&&(N=N.multiply(e.get(this.slopeMaterial.roughnessMap,t).g)),z=r(this.slopeMaterial.metalness??0),null!=this.slopeMaterial.roughnessMap&&(z=z.multiply(e.get(this.slopeMaterial.metalnessMap,t).b)));const B=(e,t)=>{const s=A({layerColors:e.slice(0,8),noiseScale:this.noiseScale,noiseAmount:this.noiseAmount,mode:this.transition,decay:this.softness}),o=r(this.noiseAmount).multiply(r(.1)),l=r(this.noiseScale),i=new c(w.multiplyScalar(l)).multiply(r(2)).subtract(r(1)).multiply(o),m=r(a.degToRad(this.slopeAngle)).add(i.multiply(r(.1)));let d=p(s,t,h(m,n(u.normal.y)));if(this.transition==L.soft){const e=m,a=r(this.softness).divide(r(2)),o=e.subtract(a),l=e.add(a);d=p(s,t,S(o,l,n(u.normal.y)))}return this.enableSlope&&null!=t?d:s},H=B(s,M),R=B(d,x),T=B(y,N),V=B(g,z);return{color:m({color:H,normal:R,roughness:T,metalness:V}),landscape:!0}}}e([x({type:s}),t("design:type",Array)],LandscapeCompositeShader.prototype,"layers",void 0),e([x(),t("design:type",Number)],LandscapeCompositeShader.prototype,"uvScale",void 0),e([x({options:[{value:L.hard,name:"Hard"},{value:L.soft,name:"Soft"}]}),t("design:type",Number)],LandscapeCompositeShader.prototype,"transition",void 0),e([x(),t("design:type",Number)],LandscapeCompositeShader.prototype,"noiseScale",void 0),e([x(),t("design:type",Number)],LandscapeCompositeShader.prototype,"noiseAmount",void 0),e([x(),t("design:type",Number)],LandscapeCompositeShader.prototype,"softness",void 0),e([x(),t("design:type",Boolean)],LandscapeCompositeShader.prototype,"enableSlope",void 0),e([x(),t("design:type",s)],LandscapeCompositeShader.prototype,"slopeMaterial",void 0),e([x(),t("design:type",Number)],LandscapeCompositeShader.prototype,"slopeAngle",void 0);class j{constructor(){this.cache=new Map}get(e,t){return this.cache.has(e)||this.cache.set(e,f(e).sample(t)),this.cache.get(e)}}/*
2
- * Copyright (©) 2023. All rights reserved.
2
+ * Copyright (©) 2025 Hology Interactive AB. All rights reserved.
3
3
  * See the LICENSE.md file for details.
4
4
  */
@@ -1,4 +1,4 @@
1
1
  import{__decorate as o,__metadata as e}from"tslib";import{Color as t,MathUtils as s}from"three";import{cos as i,float as r,mix as n,rgb as d,standardMaterial as a,step as p,varyingAttributes as h,SimplexNoiseNode as l,varying as y,uniforms as c,vec4 as m,attributes as C,smoothstep as u}from"three-shader-graph";import{LayerMixMode as f,mixColorsByLayer as S}from"../../shader-nodes/layers.js";import{Parameter as g}from"../parameter.js";import{NodeShader as v}from"../shader.js";const L=y(c.modelMatrix.multiplyVec(m(C.position,1)).xz);export class LandscapeShader extends v{constructor(){super(...arguments),this.baseColor=new t("#dddddd"),this.firstColor=new t("#FF6F61"),this.secondColor=new t("#6B5B95"),this.thirdColor=new t("#88B04B"),this.fourthColor=new t("#F7CAC9"),this.fifthColor=new t("#92A8D1"),this.sixthColor=new t("#FFE156"),this.seventhColor=new t("#34568B"),this.eighthColor=new t("#FF6F91"),this.transition=f.soft,this.noiseScale=1,this.noiseAmount=.2,this.softness=.3,this.enableSlope=!1,this.slopeColor=new t("#999999"),this.slopeAngle=35}output(){const o=S({layerColors:[d(this.baseColor),d(this.firstColor),d(this.secondColor),d(this.thirdColor),d(this.fourthColor),d(this.fifthColor),d(this.sixthColor),d(this.seventhColor),d(this.eighthColor)],noiseScale:this.noiseScale,noiseAmount:this.noiseAmount,mode:this.transition,decay:this.softness}),e=r(this.noiseAmount).multiply(r(.1)),t=r(this.noiseScale),y=new l(L.multiplyScalar(t)).multiply(r(2)).subtract(r(1)).multiply(e),c=r(s.degToRad(this.slopeAngle)).add(y.multiply(r(.1)));let m=n(o,d(this.slopeColor),p(c,i(h.normal.y)));if(this.transition==f.soft){const e=c,t=r(this.softness).divide(r(2)),s=e.subtract(t),a=e.add(t);m=n(o,d(this.slopeColor),u(s,a,i(h.normal.y)))}return{color:a({color:this.enableSlope?m:o}),landscape:!0}}}o([g(),e("design:type",t)],LandscapeShader.prototype,"baseColor",void 0),o([g(),e("design:type",t)],LandscapeShader.prototype,"firstColor",void 0),o([g(),e("design:type",t)],LandscapeShader.prototype,"secondColor",void 0),o([g(),e("design:type",t)],LandscapeShader.prototype,"thirdColor",void 0),o([g(),e("design:type",t)],LandscapeShader.prototype,"fourthColor",void 0),o([g(),e("design:type",t)],LandscapeShader.prototype,"fifthColor",void 0),o([g(),e("design:type",t)],LandscapeShader.prototype,"sixthColor",void 0),o([g(),e("design:type",t)],LandscapeShader.prototype,"seventhColor",void 0),o([g(),e("design:type",t)],LandscapeShader.prototype,"eighthColor",void 0),o([g({options:[{value:f.hard,name:"Hard"},{value:f.soft,name:"Soft"}]}),e("design:type",Number)],LandscapeShader.prototype,"transition",void 0),o([g(),e("design:type",Number)],LandscapeShader.prototype,"noiseScale",void 0),o([g(),e("design:type",Number)],LandscapeShader.prototype,"noiseAmount",void 0),o([g(),e("design:type",Number)],LandscapeShader.prototype,"softness",void 0),o([g(),e("design:type",Boolean)],LandscapeShader.prototype,"enableSlope",void 0),o([g(),e("design:type",t)],LandscapeShader.prototype,"slopeColor",void 0),o([g(),e("design:type",Number)],LandscapeShader.prototype,"slopeAngle",void 0);/*
2
- * Copyright (©) 2023. All rights reserved.
2
+ * Copyright (©) 2025 Hology Interactive AB. All rights reserved.
3
3
  * See the LICENSE.md file for details.
4
4
  */
@@ -1,4 +1,4 @@
1
1
  import{__decorate as e,__metadata as t}from"tslib";import{Color as a,MeshStandardMaterial as p,Texture as i,Vector2 as d}from"three";import{Shader as r}from"../shader.js";import{Parameter as s}from"../parameter.js";import{removeObjectUndefined as o}from"../../utils/collections.js";export class StandardShader extends r{constructor(){super(...arguments),this.color=new a("#FFFFFF"),this.opacity=1,this.roughness=1,this.metalness=0}build(){return new p(o({color:this.color,opacity:this.opacity,roughness:this.roughness,metalness:this.metalness,map:this.map,lightMap:this.lightMap,lightMapIntensity:this.lightMapIntensity,aoMap:this.aoMap,aoMapIntensity:this.aoMapIntensity,emissive:this.emissive,emissiveIntensity:this.emissiveIntensity,emissiveMap:this.emissiveMap,bumpMap:this.bumpMap,bumpScale:this.bumpScale,normalMap:this.normalMap,normalScale:this.normalScale,displacementMap:this.displacementMap,displacementScale:this.displacementScale,displacementBias:this.displacementBias,roughnessMap:this.roughnessMap,metalnessMap:this.metalnessMap,alphaMap:this.alphaMap,envMap:this.envMap,envMapIntensity:this.envMapIntensity,refractionRatio:this.refractionRatio}))}}e([s(),t("design:type",a)],StandardShader.prototype,"color",void 0),e([s({label:"Color Map"}),t("design:type",i)],StandardShader.prototype,"map",void 0),e([s({range:[0,1]}),t("design:type",Number)],StandardShader.prototype,"opacity",void 0),e([s(),t("design:type",i)],StandardShader.prototype,"alphaMap",void 0),e([s({range:[0,1]}),t("design:type",Number)],StandardShader.prototype,"roughness",void 0),e([s(),t("design:type",i)],StandardShader.prototype,"roughnessMap",void 0),e([s({range:[0,1]}),t("design:type",Number)],StandardShader.prototype,"metalness",void 0),e([s(),t("design:type",i)],StandardShader.prototype,"metalnessMap",void 0),e([s(),t("design:type",i)],StandardShader.prototype,"lightMap",void 0),e([s(),t("design:type",Number)],StandardShader.prototype,"lightMapIntensity",void 0),e([s(),t("design:type",i)],StandardShader.prototype,"aoMap",void 0),e([s(),t("design:type",Number)],StandardShader.prototype,"aoMapIntensity",void 0),e([s(),t("design:type",a)],StandardShader.prototype,"emissive",void 0),e([s({range:[0,10]}),t("design:type",Number)],StandardShader.prototype,"emissiveIntensity",void 0),e([s(),t("design:type",i)],StandardShader.prototype,"emissiveMap",void 0),e([s(),t("design:type",i)],StandardShader.prototype,"bumpMap",void 0),e([s(),t("design:type",Number)],StandardShader.prototype,"bumpScale",void 0),e([s(),t("design:type",i)],StandardShader.prototype,"normalMap",void 0),e([s(),t("design:type",d)],StandardShader.prototype,"normalScale",void 0),e([s(),t("design:type",i)],StandardShader.prototype,"displacementMap",void 0),e([s(),t("design:type",Number)],StandardShader.prototype,"displacementScale",void 0),e([s(),t("design:type",Number)],StandardShader.prototype,"displacementBias",void 0),e([s(),t("design:type",i)],StandardShader.prototype,"envMap",void 0),e([s({range:[0,1]}),t("design:type",Number)],StandardShader.prototype,"envMapIntensity",void 0),e([s({range:[0,1]}),t("design:type",Number)],StandardShader.prototype,"refractionRatio",void 0);/*
2
- * Copyright (©) 2023. All rights reserved.
2
+ * Copyright (©) 2025 Hology Interactive AB. All rights reserved.
3
3
  * See the LICENSE.md file for details.
4
4
  */
@@ -1,4 +1,4 @@
1
1
  import{__decorate as t,__metadata as e}from"tslib";import{AddOperation as i,MultiplyOperation as p,MixOperation as o,Color as a,MeshBasicMaterial as r,Texture as n}from"three";import{Shader as s}from"../shader.js";import{Parameter as d}from"../parameter.js";import{removeObjectUndefined as l}from"../../utils/collections.js";export class UnlitShader extends s{constructor(){super(...arguments),this.color=new a("#FFFFFF"),this.opacity=1,this.intensity=1}build(){return new r(l({color:this.color.multiplyScalar(this.intensity),opacity:this.opacity,map:this.map,lightMap:this.lightMap,lightMapIntensity:this.lightMapIntensity,aoMap:this.aoMap,aoMapIntensity:this.aoMapIntensity,specularMap:this.specularMap,alphaMap:this.alphaMap,envMap:this.envMap,combine:this.combine,reflectivity:this.reflectivity,refractionRatio:this.refractionRatio}))}}t([d(),e("design:type",a)],UnlitShader.prototype,"color",void 0),t([d({range:[0,1]}),e("design:type",Number)],UnlitShader.prototype,"opacity",void 0),t([d({range:[0,10]}),e("design:type",Number)],UnlitShader.prototype,"intensity",void 0),t([d(),e("design:type",n)],UnlitShader.prototype,"map",void 0),t([d(),e("design:type",n)],UnlitShader.prototype,"lightMap",void 0),t([d(),e("design:type",Number)],UnlitShader.prototype,"lightMapIntensity",void 0),t([d(),e("design:type",n)],UnlitShader.prototype,"aoMap",void 0),t([d(),e("design:type",Number)],UnlitShader.prototype,"aoMapIntensity",void 0),t([d(),e("design:type",n)],UnlitShader.prototype,"specularMap",void 0),t([d(),e("design:type",n)],UnlitShader.prototype,"alphaMap",void 0),t([d(),e("design:type",n)],UnlitShader.prototype,"envMap",void 0),t([d({options:[{name:"Mix",value:o},{name:"Multiply",value:p},{name:"Add",value:i}]}),e("design:type",Number)],UnlitShader.prototype,"combine",void 0),t([d({range:[0,1]}),e("design:type",Number)],UnlitShader.prototype,"reflectivity",void 0),t([d({range:[0,1]}),e("design:type",Number)],UnlitShader.prototype,"refractionRatio",void 0);/*
2
- * Copyright (©) 2023. All rights reserved.
2
+ * Copyright (©) 2025 Hology Interactive AB. All rights reserved.
3
3
  * See the LICENSE.md file for details.
4
4
  */
@@ -1,4 +1,4 @@
1
1
  import{NodeShaderMaterial as r}from"../shader-nodes/index.js";import{decalDiscard as d}from"../shader-nodes/decal.js";export class DecalNodeShader{build(){const e=this.output();let s=d;return null!=e.discard&&(s=s.or(e.discard)),new r({transparent:!1,...e,discard:s})}}/*
2
- * Copyright (©) 2023. All rights reserved.
2
+ * Copyright (©) 2025 Hology Interactive AB. All rights reserved.
3
3
  * See the LICENSE.md file for details.
4
4
  */
@@ -1,4 +1,4 @@
1
1
  export*from"./parameter.js";export*from"./builtin/index.js";export*from"./shader.js";export*from"./decal-shader.js";export*from"./sprite-shader.js";export*from"./trail-shader.js";/*
2
- * Copyright (©) 2023. All rights reserved.
2
+ * Copyright (©) 2025 Hology Interactive AB. All rights reserved.
3
3
  * See the LICENSE.md file for details.
4
4
  */
@@ -1,4 +1,4 @@
1
1
  import"reflect-metadata";import{reflect as t,decorateProperty as e}from"@plumier/reflect";import{ArrayMap as r}from"../utils/collections.js";Symbol("format");class o{constructor(t){this.options=t,this.isParameterDecorator=!0}}new Map;const a=new r;export function Parameter(t){return function(r,n,c){if(null!=r){a.push(r.constructor,{name:n,options:t??{}});try{e(new o(t))(r,n,c)}catch(t){console.warn("Failed to decorate method ",r,n,c)}}}}export function extractShaderParameters(t){return a.get(t).map((({name:e,options:r})=>{const o=Reflect.getMetadata("design:type",t.prototype,e),a=r.type??o;return r.array=o===Array,{name:e,type:a,options:r}}))}export function ParameterCategory(t){}/*
2
- * Copyright (©) 2023. All rights reserved.
2
+ * Copyright (©) 2025 Hology Interactive AB. All rights reserved.
3
3
  * See the LICENSE.md file for details.
4
4
  */
@@ -1,4 +1,4 @@
1
1
  import{NodeShaderMaterial as r,BooleanNode as s,attributeFloat as e}from"../shader-nodes/index.js";export*from"./parameter.js";export class Shader{}const a=e("hole").gt(.5);export class NodeShader{build(){const e=this.output();return new r({transparent:!1,...e,...!0===e.landscape?{discard:null!=e.discard&&e.discard instanceof s?e.discard.or(a):a}:{}})}}/*
2
- * Copyright (©) 2023. All rights reserved.
2
+ * Copyright (©) 2025 Hology Interactive AB. All rights reserved.
3
3
  * See the LICENSE.md file for details.
4
4
  */
@@ -1,4 +1,4 @@
1
1
  import{NodeShaderMaterial as o}from"../shader-nodes/index.js";import{Vec4Node as t,glslFunction as e,transformed as i,uniforms as r,UniformFloatNode as n}from"three-shader-graph";import*as a from"three";export class SpriteNodeShader{build(){const o=this.output(),t=getSpritePosition(new n("rotation",0));return new SpriteNodeShaderMaterial({color:o.color,discard:o.discard,transparent:o.transparent??!0,position:t,uniforms:{color:{value:new a.Color(0)}}})}}export function getSpritePosition(o){return e(t,{position:i.position,modelViewMatrix:r.modelViewMatrix,rotation:o},"\n vec2 center = vec2(0.5, 0.5);\n vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );\n // Using scale form instance matrix instead of modelMatrix\n vec2 scale;\n scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );\n scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );\n \n // This times 2 on scale seem to make it appear like when using regular sprites. \n // Not sure if this is correct though.\n vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * (scale);\n \n vec2 rotatedPosition;\n rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;\n rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;\n \n mvPosition.xy += rotatedPosition;\n return projectionMatrix * mvPosition;\n ")}export class SpriteNodeShaderMaterial extends o{get color(){return this.uniforms.color.value}set color(o){this.uniforms.color.value=new a.Color(o)}get rotation(){return this.uniforms.rotation.value}set rotation(o){this.uniforms.rotation.value=o}}/*
2
- * Copyright (©) 2023. All rights reserved.
2
+ * Copyright (©) 2025 Hology Interactive AB. All rights reserved.
3
3
  * See the LICENSE.md file for details.
4
4
  */
@@ -1,4 +1,4 @@
1
1
  import{NodeShaderMaterial as r}from"three-shader-graph";import{Trail as e}from"../effects/vfx/trail-renderer";export class TrailNodeShader{build(){const o=this.output(),{position:t}=e.getTrailShaderNodes(!1),a=new r({position:t,color:o.color});return e.applyTrailShaderParameters(a),a}}/*
2
- * Copyright (©) 2023. All rights reserved.
2
+ * Copyright (©) 2025 Hology Interactive AB. All rights reserved.
3
3
  * See the LICENSE.md file for details.
4
4
  */
@@ -1,4 +1,4 @@
1
1
  import{length as r,pow as t}from"three-shader-graph";export function bulge(e,a,l=1){let o=e;o=e.subtract(a);const u=r(o),c=1===l?u:t(u,l);return o=o.multiplyScalar(c),o=e.add(a),o}/*
2
- * Copyright (©) 2023. All rights reserved.
2
+ * Copyright (©) 2025 Hology Interactive AB. All rights reserved.
3
3
  * See the LICENSE.md file for details.
4
4
  */
@@ -1,4 +1,4 @@
1
1
  import{abs as t,inverse as r,min as o,smoothstep as e,uniforms as a,varying as c,vec4 as l}from"three-shader-graph";import{depthNormal as p,depthWorldPosition as x}from"./depth.js";const d=c(r(a.instanceMatrix.multiply(a.modelMatrix))),i=d.multiplyVec(l(x,1)).xyz;export const decalNormal=d.multiplyVec(l(p,0)).xyz;export const decalDiscard=t(i.x).gt(.5).or(t(i.y).gt(.5)).or(t(i.z).gt(.5));export const decalUV=i.xz.addScalar(.5);export const decalAlpha=o(e(.5,.4,t(i.x)),o(e(.5,.4,t(i.y)),e(.5,.4,t(i.z))));/*
2
- * Copyright (©) 2023. All rights reserved.
2
+ * Copyright (©) 2025 Hology Interactive AB. All rights reserved.
3
3
  * See the LICENSE.md file for details.
4
4
  */
@@ -1,4 +1,4 @@
1
1
  import{Vector2 as t}from"three";import{dot as e,float as o,FloatExpressionNode as r,FloatNode as n,texture2d as s,uniformVec2 as c,vec2 as a,Vec2ExpressionNode as i,vec4 as p,Vec4Node as l,uniformSampler2d as h,uniformFloat as u,varying as d,inverse as m,uniforms as x,cross as f,normalize as _}from"three-shader-graph";import*as g from"three";export function supportsDepthTextureExtension(t){return!!t.extensions.get("WEBGL_depth_texture")}export const depthUniformName="hology_depth_map";export const resolutionUniformName="hology_resolution";export const nearUniformName="hology_camera_near";export const farUniformName="hology_camera_far";export const depthSampler=h(depthUniformName,new g.DepthTexture(1,1));const U=u(nearUniformName,.5),k=u(farUniformName,500);class y extends n{compile(t){const e=t.variable();var o=t.get(U),r=t.get(k);return{chunk:`\n float depth_${e} = 2.0 * ${o} * ${r} / (${r} + ${o} - (2.0 * ${t.get(this.depth)} - 1.0) * (${r} - ${o}));\n `,out:`depth_${e}`}}constructor(t){super(),this.depth=t}}function $(t){return new y(t)}const v=new class extends l{constructor(){super(...arguments),this.k="31u50"}compile(t){return{pars:`\n const float UnpackDownscale_${this.k} = 255. / 256.; // 0..1 -> fraction (excluding 1)\n const vec4 PackFactors_${this.k} = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 );\n const vec4 UnpackFactors_${this.k} = vec4( UnpackDownscale_${this.k} / PackFactors_${this.k}.rgb, 1.0 / PackFactors_${this.k}.a );\n `,out:`UnpackFactors_${this.k}`}}};function w(t){return o=s(depthSampler,t),e(o,v);var o}const N=new r("gl_FragCoord.z");export const fragmentLinearEyeDepth=$(N);export const resolution=c("hology_resolution",new t(250,1e3));export const screenUV=new i("gl_FragCoord.xy").divide(resolution);export const linearEyeDepth=$(w(screenUV));const V=d(m(x.projectionMatrix)),F=d(m(x.viewMatrix));function b(t=screenUV){const e=w(t).multiply(2).subtract(1),o=t.multiplyScalar(2).subtractScalar(1),r=p(o.x,o.y,e,1),n=V.multiplyVec(r),s=n.xyz.divideScalar(n.w);return F.multiplyVec(p(s,1)).xyz}export const depthWorldPosition=b(screenUV);const D=o(1).divide(resolution.x),P=o(1).divide(resolution.y),S=b(screenUV.add(a(D,o(0)))),E=b(screenUV.add(a(o(0),P)));export const depthNormal=_(f(S.subtract(depthWorldPosition),E.subtract(depthWorldPosition)));/*
2
- * Copyright (©) 2023. All rights reserved.
2
+ * Copyright (©) 2025 Hology Interactive AB. All rights reserved.
3
3
  * See the LICENSE.md file for details.
4
4
  */
@@ -1,4 +1,4 @@
1
1
  import{Vec3ExpressionNode as t,attributes as r,dot as e,float as o,normalize as i,pow as f,saturate as m,transformed as n,uniforms as p,varyingAttributes as c,varyingVec3 as s,vec4 as a}from"three-shader-graph";import{fragmentLinearEyeDepth as u,linearEyeDepth as d}from"./depth.js";import{oneMinus as h}from"./math.js";p.modelMatrix.multiplyVec(a(r.position,1));export function fresnelEffect(t=1){return f(h(m(e(n.viewDir,n.normal))),o(t))}const l=o(1).subtract(d.subtract(u).divide(d));export function edgeDepthEffect(t=1){return f(l,o(t))}/*
2
- * Copyright (©) 2023. All rights reserved.
2
+ * Copyright (©) 2025 Hology Interactive AB. All rights reserved.
3
3
  * See the LICENSE.md file for details.
4
4
  */
@@ -1,4 +1,4 @@
1
1
  export function glslFunction(t,e,n){const o=t.typeName;return new class extends t{compile(t){const c=`customFunction_${t.variable()}`,s=Object.entries(e).map((([t,e])=>`${e.constructor.typeName} ${t}`)).join(", "),r=Object.values(e).map((e=>t.get(e))).join(", ");return{pars:`${o} ${c}(${s}) {\n ${n}\n }`,out:`${c}(${r})`}}}}/*
2
- * Copyright (©) 2023. All rights reserved.
2
+ * Copyright (©) 2025 Hology Interactive AB. All rights reserved.
3
3
  * See the LICENSE.md file for details.
4
4
  */
@@ -1,4 +1,4 @@
1
1
  export*from"three-shader-graph";export{linearEyeDepth,fragmentLinearEyeDepth,depthSampler,resolution,screenUV,depthWorldPosition}from"./depth.js";export{timeUniforms}from"./time.js";export{particleUniforms}from"./particle.js";export*from"./layers.js";export*from"./landscape.js";export*from"./shapes.js";export*from"./voronoi.js";export*from"./effects.js";export*from"./math.js";export*from"./bulge.js";export*from"./texture-sequence.js";export*from"./decal.js";export*from"./scene-sample.js";/*
2
- * Copyright (©) 2023. All rights reserved.
2
+ * Copyright (©) 2025 Hology Interactive AB. All rights reserved.
3
3
  * See the LICENSE.md file for details.
4
4
  */
@@ -1,4 +1,4 @@
1
1
  import{attributes as r,float as t,uniforms as o,vec4 as e,varyingVec2 as a}from"three-shader-graph";const i=o.modelMatrix.multiplyVec(e(r.position,1));export function getLandscapeCoords(r){return a(i.xz.multiplyScalar(t(r)))}/*
2
- * Copyright (©) 2023. All rights reserved.
2
+ * Copyright (©) 2025 Hology Interactive AB. All rights reserved.
3
3
  * See the LICENSE.md file for details.
4
4
  */
@@ -1,4 +1,4 @@
1
1
  import{float as e,uniforms as o,vec4 as r,attributes as a,SimplexNoiseNode as t,select as i,mix as l,smoothstep as d,AttributeVec4Node as n,varying as s}from"three-shader-graph";export var LayerMixMode;!function(e){e[e.hard=0]="hard",e[e.soft=1]="soft"}(LayerMixMode||(LayerMixMode={}));const y={enableNoise:!0,noiseScale:e(.1),noiseAmount:e(.5),decay:.3,mode:LayerMixMode.soft},c=s(o.modelMatrix.multiplyVec(r(a.position,1)).xz),m=new n("material"),u=new n("material2"),x=s(m),p=s(u),M=[e(0),x.x,x.y,x.z,x.w,p.x,p.y,p.z,p.w];export function mixColorsByLayer(o){const r={...y,...o},a=e(r.noiseAmount).multiply(e(.1)),n=e(r.noiseScale),s=new t(c.multiplyScalar(n)).multiply(e(2)).subtract(e(1)).multiply(a),m=e(.5),u=r.enableNoise?m.add(s.multiply(e(.1))):m;if(r.mode==LayerMixMode.hard)return r.layerColors.reduce(((e,o,r)=>i(M[r].gt(u),o,e)));{const o=e(r.decay),a=e(.5),t=o.divide(e(2)),i=a.subtract(t),n=a.add(t);return r.layerColors.slice(0,M.length).reduce(((e,o,r)=>l(e,o,d(i,n,M[r].add(s)))))}}/*
2
- * Copyright (©) 2023. All rights reserved.
2
+ * Copyright (©) 2025 Hology Interactive AB. All rights reserved.
3
3
  * See the LICENSE.md file for details.
4
4
  */
@@ -1,4 +1,4 @@
1
1
  import{FloatNode as t,IntNode as r,Vec2Node as e,Vec3Node as n,Vec4Node as s,float as a,int as c,vec2 as u,vec3 as o,vec4 as i}from"three-shader-graph";export function oneMinus(f){switch(!0){case f instanceof t:return a(1).subtract(f);case f instanceof r:return c(1).subtract(f);case f instanceof e:return u(1,1).subtract(f);case f instanceof n:return o(1,1,1).subtract(f);case f instanceof s:return i(1,1,1,1).subtract(f)}throw"Unsupported type "+f}/*
2
- * Copyright (©) 2023. All rights reserved.
2
+ * Copyright (©) 2025 Hology Interactive AB. All rights reserved.
3
3
  * See the LICENSE.md file for details.
4
4
  */
@@ -1,4 +1,4 @@
1
1
  import{Vector3 as e}from"three";import{attributeVec3 as t,ifDefApply as o,uniformFloat as r,uniformVec3 as i,varying as a,Vec3ExpressionNode as c}from"three-shader-graph";export const particleEnergyUniformName="hology_particle_energy";export const particleTimeUniformName="hology_particle_time";export const particleVelcoityUniformName="hology_particle_velocity";export const particleUniforms={energy:o("USE_INSTANCING",r("hology_particle_energy",1),(()=>t("particleData").y)),color:o("USE_INSTANCING",i("color",new e(0,0,0)),(()=>a(new c("instanceColor")))),opacity:o("USE_INSTANCING",r("opacity",1),(()=>t("particleData").x)),time:r("hology_particle_time")};export const particleAttributes={};/*
2
- * Copyright (©) 2023. All rights reserved.
2
+ * Copyright (©) 2025 Hology Interactive AB. All rights reserved.
3
3
  * See the LICENSE.md file for details.
4
4
  */
@@ -1,4 +1,4 @@
1
1
  import{uniformSampler2d as e,Vec3ExpressionNode as o}from"three-shader-graph";import*as r from"three";export const sceneMapUniformName="hology_scene_map";export const sceneColorSampler=e("hology_scene_map",new r.Texture);export function sampleSceneColor(e){return sceneColorSampler.sample(e)}export const fragCoord=new o("gl_FragCoord");/*
2
- * Copyright (©) 2023. All rights reserved.
2
+ * Copyright (©) 2025 Hology Interactive AB. All rights reserved.
3
3
  * See the LICENSE.md file for details.
4
4
  */
@@ -1,4 +1,4 @@
1
1
  import{float as t,length as a,min as r,max as e,saturate as c,dFdx as d,dFdy as l,abs as u,ComponentsVec2Node as n,vec2 as i}from"three-shader-graph";export function rectangleFloat(t,a,e){const o=u(t.multiplyScalar(2).subtractScalar(1)).subtract(new n(a,e)),s=i(1,1).subtract(o.divide(u(d(p=o)).add(u(l(p)))));var p;return c(r(s.x,s.y))}export function roundedRectangleFloat(o,s,p,b){const m=e(r(r(u(b.multiply(2)),u(s)),u(p)),t(1e-5)),v=u(o.multiplyScalar(2).subtractScalar(1)).subtract(new n(s,p)).addScalar(m),S=a(e(i(0,0),v)).divide(m);return c(t(1).subtract(S).divide(u(d(y=S)).add(u(l(y)))));var y}/*
2
- * Copyright (©) 2023. All rights reserved.
2
+ * Copyright (©) 2025 Hology Interactive AB. All rights reserved.
3
3
  * See the LICENSE.md file for details.
4
4
  */
@@ -1,4 +1,4 @@
1
1
  import{float as l,floor as t,min as e,mod as p,varying as a,vec2 as i}from"three-shader-graph";export function sampleFlipbook(m,o,r,c,d,s=60,u="clamp"){const n=r*c;let h;switch(u){case"clamp":h=t(e(d.multiply(l(s)),l(n-1)));break;case"loop":h=t(p(d.multiply(l(s)),l(n)))}const y=l(1/r),b=l(1/c),f=p(h,l(r)).multiply(y),k=t(h.divide(c).add(1)).multiply(b),v=i(f,l(1).subtract(k));return m.sample(a(v.add(o.divide(i(r,c)))))}/*
2
- * Copyright (©) 2023. All rights reserved.
2
+ * Copyright (©) 2025 Hology Interactive AB. All rights reserved.
3
3
  * See the LICENSE.md file for details.
4
4
  */
@@ -1,4 +1,4 @@
1
1
  import{uniformFloat as e}from"three-shader-graph";export const elapsedTimeUniformName="hology_elapsed_time";export const timeUniforms={elapsed:e("hology_elapsed_time")};/*
2
- * Copyright (©) 2023. All rights reserved.
2
+ * Copyright (©) 2025 Hology Interactive AB. All rights reserved.
3
3
  * See the LICENSE.md file for details.
4
4
  */
@@ -1,4 +1,4 @@
1
1
  import{select as t,length as a,ComponentsVec2Node as r,ConstantMat2Node as l,fract as d,sin as n,cos as e,vec2 as o,vec3 as u,floor as c}from"three-shader-graph";export function voronoi(i,p,m){const y=i.multiplyScalar(m),s=c(y),x=d(y),f=[-1,0,1],h=f.flatMap((t=>f.map((a=>[t,a])))).reduce(((c,[i,m])=>{const y=o(i,m),f=function(t,a){const o=new l(15.27,47.63,99.41,89.98);return t=d(n(t.multiplyMat(o)).multiplyScalar(46839.32)),new r(n(t.y.add(a)).multiply(.5).add(.5),e(t.x.add(a)).multiply(.5).add(.5))}(y.add(s),p),h=a(y.add(f).subtract(x));return t(h.lt(c.x),u(h,f.x,f.y),c)}),u(8,0,0));return{noise:h.x,cells:h.y}}/*
2
- * Copyright (©) 2023. All rights reserved.
2
+ * Copyright (©) 2025 Hology Interactive AB. All rights reserved.
3
3
  * See the LICENSE.md file for details.
4
4
  */
@@ -1,4 +1,4 @@
1
1
  import{__decorate as t}from"tslib";import"reflect-metadata";import{expect as e,test as a}from"vitest";import{Actor as s,ActorComponent as o,ActorFactory as n,BaseActor as c,Component as i,inject as r}from"../gameplay/index.js";import{Container as l,Service as m}from"typedi";a("injecting without a service decorator",(()=>{class t{}const e=l.of("test");e.set({id:t,type:t});e.get(t)})),a("creating actors with non default container instance",(async()=>{const t=new n(l.of("custom"),{inEditor:!1});l.set(n,t);const a=await t.create(v);e(a.componentA.a.value).toBe(a.a.value),e(l.of("another").get(p).value).toBeGreaterThan(a.a.value)})),a("injection with dynamically attached component using same container",(async()=>{const t=new n(l.of("custom2"),{inEditor:!1});l.set(n,t);const a=await t.create(w);e(a.componentA.a.value).toBe(a.a.value)}));let u=class{};u=t([m()],u);let h=0,p=class{constructor(){this.name="a",this.value=h++,this.b=r(d)}};p=t([m()],p);let d=class{constructor(){this.name="b",this.value=h++}};d=t([m()],d);let f=class extends o{constructor(){super(...arguments),this.a=r(p)}};f=t([i()],f);let v=class extends c{constructor(){super(...arguments),this.a=r(p),this.componentA=this.attach(f)}};v=t([s()],v);let w=class extends c{constructor(){super(...arguments),this.a=r(p)}onInit(){this.componentA=this.attach(f)}};w=t([s()],w);/*
2
- * Copyright (©) 2023. All rights reserved.
2
+ * Copyright (©) 2025 Hology Interactive AB. All rights reserved.
3
3
  * See the LICENSE.md file for details.
4
4
  */
@@ -1,4 +1,4 @@
1
1
  export function sleepDelay(e){return new Promise((t=>setTimeout(t,e)))}export function whenIdle(e){return new Promise(((t,n)=>{window.requestIdleCallback((()=>{t(e())}),{timeout:500})}))}/*
2
- * Copyright (©) 2023. All rights reserved.
2
+ * Copyright (©) 2025 Hology Interactive AB. All rights reserved.
3
3
  * See the LICENSE.md file for details.
4
4
  */
@@ -1,4 +1,4 @@
1
1
  export const hasSharedArrayBufferSupport=window.crossOriginIsolated&&void 0!==window.SharedArrayBuffer;export function toSharedFloat32Array(r){const e=new SharedArrayBuffer(r.buffer.byteLength),t=new Float32Array(e);return t.set(r),t}export function toSharedUint32Array(r){const e=new SharedArrayBuffer(r.buffer.byteLength),t=new Uint32Array(e);return t.set(r),t}/*
2
- * Copyright (©) 2023. All rights reserved.
2
+ * Copyright (©) 2025 Hology Interactive AB. All rights reserved.
3
3
  * See the LICENSE.md file for details.
4
4
  */
@@ -1,4 +1,4 @@
1
1
  export function groupBy(t,e){const r=new Map;for(const s of t??[]){const t=e(s);r.has(t)||r.set(t,[]),r.get(t).push(s)}return r}export function indexBy(t,e){const r=new Map;for(const s of t??[])r.set(e(s),s);return r}export class DefaultMap{constructor(t){this.defaultValue=t,this.map=new Map}clear(){this.map.clear()}delete(t){return this.map.delete(t)}forEach(t,e){this.map.forEach(t)}getDefault(){return"function"==typeof this.defaultValue?this.defaultValue():JSON.parse(JSON.stringify(this.defaultValue))}get(t){return this.map.has(t)||this.map.set(t,this.getDefault()),this.map.get(t)}has(t){return!0}set(t,e){return this.map.set(t,e),this}get size(){return this.map.size}entries(){return this.map.entries()}keys(){return this.map.keys()}values(){return this.map.values()}[Symbol.iterator](){return this.map[Symbol.iterator]()}}Symbol.toStringTag;export class ArrayMap extends DefaultMap{constructor(){super((()=>[]))}push(t,e){this.get(t).push(e)}}export function partition(t,e){let r=[],s=[];for(const a of t)(e(a)?r:s).push(a);return[r,s]}export function removeObjectUndefined(t){for(const e of Object.keys(t))null==t[e]&&delete t[e];return t}/*
2
- * Copyright (©) 2023. All rights reserved.
2
+ * Copyright (©) 2025 Hology Interactive AB. All rights reserved.
3
3
  * See the LICENSE.md file for details.
4
4
  */
@@ -1,4 +1,4 @@
1
1
  import{ease as e}from"@hology/nebula";export class Curve2{static decode(e){return"string"==typeof e?EaseCurve.fromString(e):Curve2.linear()}getY(e){return e}static linear(){return new EaseCurve(e.easeLinear)}}export class EaseCurve extends Curve2{constructor(e){super(),this.fn=e}getY(e){return this.fn(e)}static fromString(r){const n=e["ease"+r];return null==n?(console.warn("no easing function called "+r),new EaseCurve(e.easeLinear)):new EaseCurve(n)}}/*
2
- * Copyright (©) 2023. All rights reserved.
2
+ * Copyright (©) 2025 Hology Interactive AB. All rights reserved.
3
3
  * See the LICENSE.md file for details.
4
4
  */
@@ -1,4 +1,4 @@
1
1
  export function pathJoin(...e){return e.map(((e,r)=>0===r?e.trim().replace(/[\/]*$/g,""):e.trim().replace(/(^[\/]*|[\/]*$)/g,""))).filter((e=>e.length)).join("/")}/*
2
- * Copyright (©) 2023. All rights reserved.
2
+ * Copyright (©) 2025 Hology Interactive AB. All rights reserved.
3
3
  * See the LICENSE.md file for details.
4
4
  */
@@ -1,4 +1,4 @@
1
1
  export function*iterateMaterials(e){if(e instanceof Array)for(const i of e)yield i;else yield e}/*
2
- * Copyright (©) 2023. All rights reserved.
2
+ * Copyright (©) 2025 Hology Interactive AB. All rights reserved.
3
3
  * See the LICENSE.md file for details.
4
4
  */
@@ -1,4 +1,4 @@
1
1
  import*as t from"three";import{Vector3 as e}from"three";export function clamp(t,e,n){return Math.max(Math.min(n,t),e)}export function byChance(t,e){Math.random()<t&&e()}export function mean(t){let e=0,n=t.length;for(;--n>=0;)e+=t[n];return t.length>0?e/t.length:0}export function meanVectors3(t){const e=n.set(0,0,0);for(const n of t)e.add(n);return e.divideScalar(t.length),e}export function meanBottomVectors3(t){const e=n.set(0,0,0);let o=null;for(const n of t)e.add(n),(null==o||n.y<o)&&(o=n.y);return e.divideScalar(t.length),e.y=o,e}export function meanVectors3Mapped(t,n){const o=new e,r=new e;for(const e of t)r.add(n(e,o));return r.divideScalar(t.length),r}const n=new e;export function meanVectors3withWeight(t,e,o){let r=0;for(const t of e)r+=t;n.set(0,0,0);let a=0;for(const o of t){const t=e[a]/r;n.x+=o.x*t,n.y+=o.y*t,n.z+=o.z*t,a++}return o.copy(n),o}export function randomString(t=9){return Math.random().toString(36).substring(2,t)}export function toDegrees(t){return t*(180/Math.PI)}var o=new t.Sphere,r=new t.Sphere;export function boundingRadius(...e){o.makeEmpty(),r.makeEmpty();for(var n=0;n<e.length;n++)e[n].traverse((e=>{if(e instanceof t.Mesh){const t=e.geometry;t.computeBoundingSphere(),r.copy(t.boundingSphere),r.applyMatrix4(e.matrixWorld),o.makeEmpty().union(r)}}));return o.radius}/*
2
- * Copyright (©) 2023. All rights reserved.
2
+ * Copyright (©) 2025 Hology Interactive AB. All rights reserved.
3
3
  * See the LICENSE.md file for details.
4
4
  */
@@ -1,4 +1,4 @@
1
1
  import*as e from"three";import{SkeletonUtils as t}from"three-stdlib";export class NoRaycastMesh extends e.Mesh{raycast(...e){}}export function cloneMesh(e){return t.clone(e)}/*
2
- * Copyright (©) 2023. All rights reserved.
2
+ * Copyright (©) 2025 Hology Interactive AB. All rights reserved.
3
3
  * See the LICENSE.md file for details.
4
4
  */
@@ -1,4 +1,4 @@
1
1
  import*as e from"three";import{computeBoundsTree as o,disposeBoundsTree as r,acceleratedRaycast as t}from"three-mesh-bvh";export function polyfill(){e.BufferGeometry.prototype.computeBoundsTree=o,e.BufferGeometry.prototype.disposeBoundsTree=r,e.Mesh.prototype.raycast=t}/*
2
- * Copyright (©) 2023. All rights reserved.
2
+ * Copyright (©) 2025 Hology Interactive AB. All rights reserved.
3
3
  * See the LICENSE.md file for details.
4
4
  */
@@ -1,4 +1,4 @@
1
1
  import{depthUniformName as e}from"../../shader-nodes/depth.js";import{Mesh as r}from"three";import{Pass as t}from"three-stdlib";class s extends t{constructor(e,r,t,s){super(),this.scene=e,this.camera=r,this.depthMaterial=t,this.depthRenderTarget=s,this.needsSwap=!0}dispose(){}setSize(e,r){}render(t,s,i,a,n){if(this.renderToScreen)t.setRenderTarget(null),t.render(this.scene,this.camera);else{const i=[];this.scene.traverse((t=>{t instanceof r&&t.visible&&(t.material?.userData?.water||t.material?.uniforms&&null!=t.material?.uniforms[e])&&(t.visible=!1,i.push(t))})),this.scene.overrideMaterial=this.depthMaterial,t.setRenderTarget(this.depthRenderTarget),t.render(this.scene,this.camera),this.scene.overrideMaterial=null,i.forEach((e=>e.visible=!0)),t.setRenderTarget(s),t.clear(),t.render(this.scene,this.camera)}}}export{s as DepthPass};/*
2
- * Copyright (©) 2023. All rights reserved.
2
+ * Copyright (©) 2025 Hology Interactive AB. All rights reserved.
3
3
  * See the LICENSE.md file for details.
4
4
  */
@@ -1,4 +1,4 @@
1
1
  import e from"three/examples/jsm/libs/stats.module.js";class t extends e.Panel{constructor(e,t="GPU MS"){super(t,"#f90","#210");let i=!0,s=e.getExtension("EXT_disjoint_timer_query_webgl2");null===s&&(i=!1,s=e.getExtension("EXT_disjoint_timer_query"),null===s&&console.warn("GPUStatsPanel: disjoint_time_query extension not available.")),this.context=e,this.extension=s,this.maxTime=30,this.activeQueries=0,this.startQuery=function(){if(this.activeQueries>2)return;const e=this.context,t=this.extension;if(null===t)return;let s;i?(s=e.createQuery(),e.beginQuery(t.TIME_ELAPSED_EXT,s)):(s=t.createQueryEXT(),t.beginQueryEXT(t.TIME_ELAPSED_EXT,s)),this.activeQueries++;const n=()=>{let r,E,u;i?(r=e.getQueryParameter(s,e.QUERY_RESULT_AVAILABLE),E=e.getParameter(t.GPU_DISJOINT_EXT),u=e.getQueryParameter(s,e.QUERY_RESULT)):(r=t.getQueryObjectEXT(s,t.QUERY_RESULT_AVAILABLE_EXT),E=e.getParameter(t.GPU_DISJOINT_EXT),u=t.getQueryObjectEXT(s,t.QUERY_RESULT_EXT));const a=1e-6*u;r?(E||this.update(a,this.maxTime),this.activeQueries--):requestAnimationFrame(n)};n()},this.endQuery=function(){const e=this.extension,t=this.context;null!==e&&(i?t.endQuery(e.TIME_ELAPSED_EXT):e.endQueryEXT(e.TIME_ELAPSED_EXT))}}}export{t as GPUStatsPanel};/*
2
- * Copyright (©) 2023. All rights reserved.
2
+ * Copyright (©) 2025 Hology Interactive AB. All rights reserved.
3
3
  * See the LICENSE.md file for details.
4
4
  */