@hology/core 0.0.234 → 0.0.236
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.
- package/dist/csm.d.ts +2 -2
- package/dist/data/surface-definition.js +1 -1
- package/dist/effects/sequence/sequence-action.d.ts +4 -4
- package/dist/effects/sequence/sequence-animation-retiming.d.ts +1 -1
- package/dist/effects/sequence/sequence-data.d.ts +3 -2
- package/dist/effects/sequence/sequence-definitions.d.ts +2 -2
- package/dist/effects/sequence/sequence-event.d.ts +1 -1
- package/dist/effects/sequence/sequence-locator.d.ts +1 -1
- package/dist/effects/sequence/sequence-ops.d.ts +1 -1
- package/dist/effects/sequence/sequence-player.d.ts +8 -7
- package/dist/effects/sequence/sequence-transform.d.ts +1 -1
- package/dist/effects/sequence/sequence-value-lane.d.ts +2 -2
- package/dist/effects/vfx/behaviours.d.ts +2 -1
- package/dist/effects/vfx/initializsers.d.ts +2 -1
- package/dist/effects/vfx/rates.d.ts +1 -1
- package/dist/effects/vfx/trail-renderer.d.ts +1 -1
- package/dist/effects/vfx/vfx-asset.d.ts +4 -3
- package/dist/effects/vfx/vfx-binding-runtime.d.ts +2 -2
- package/dist/effects/vfx/vfx-collision-behaviour.d.ts +3 -2
- package/dist/effects/vfx/vfx-defs.d.ts +7 -3
- package/dist/effects/vfx/vfx-defs.js +1 -1
- package/dist/effects/vfx/vfx-input-runtime.d.ts +1 -1
- package/dist/effects/vfx/vfx-materializer.d.ts +7 -7
- package/dist/effects/vfx/vfx-param.d.ts +3 -3
- package/dist/effects/vfx/vfx-renderers.d.ts +4 -3
- package/dist/effects/vfx/vfx-renderers.js +1 -1
- package/dist/effects/vfx/vfx-service.d.ts +1 -1
- package/dist/effects/vfx/vfx-service.js +1 -1
- package/dist/game-component/game-component.d.ts +1 -1
- package/dist/gameplay/actors/builtin/components/character/character-movement-like.d.ts +2 -0
- package/dist/gameplay/actors/builtin/components/character/character-movement.d.ts +13 -0
- package/dist/gameplay/actors/builtin/components/character/character-movement.js +1 -1
- package/dist/gameplay/actors/builtin/components/character/root-motion-constraint.d.ts +7 -0
- package/dist/gameplay/actors/builtin/components/character/root-motion-constraint.js +4 -0
- package/dist/gameplay/actors/builtin/components/editor-sprite-component.d.ts +1 -1
- package/dist/gameplay/actors/builtin/components/editor-sprite-component.js +1 -1
- package/dist/gameplay/actors/builtin/components/volume-editor-component.d.ts +1 -1
- package/dist/gameplay/actors/builtin/components/volume-editor-component.js +1 -1
- package/dist/gameplay/actors/builtin/navmesh-actor.d.ts +1 -1
- package/dist/gameplay/actors/builtin/navmesh-actor.js +1 -1
- package/dist/gameplay/actors/builtin/post-process-volume-actor.d.ts +1 -1
- package/dist/gameplay/actors/builtin/post-process-volume-actor.js +1 -1
- package/dist/gameplay/actors/component.d.ts +2 -2
- package/dist/gameplay/actors/controller/actor-controller.d.ts +1 -1
- package/dist/gameplay/actors/controller/actor-controller.js +1 -1
- package/dist/gameplay/actors/index.d.ts +1 -0
- package/dist/gameplay/actors/index.js +1 -1
- package/dist/gameplay/actors/internal/component-init.d.ts +1 -1
- package/dist/gameplay/actors/internal/container-map.d.ts +2 -2
- package/dist/gameplay/ai/behavior-tree/move.d.ts +3 -3
- package/dist/gameplay/ai/behavior-tree/move.js +1 -1
- package/dist/gameplay/ai/build-tile.d.ts +2 -1
- package/dist/gameplay/ai/dynamic-tiled-navmesh.d.ts +4 -3
- package/dist/gameplay/ai/navigation.js +1 -1
- package/dist/gameplay/animation/anim-sm.d.ts +1 -1
- package/dist/gameplay/animation/retarget.d.ts +2 -1
- package/dist/gameplay/animation/root-motion.d.ts +2 -1
- package/dist/gameplay/event-graph/runtime-assets.d.ts +1 -1
- package/dist/gameplay/initiate.d.ts +5 -5
- package/dist/gameplay/inject.d.ts +1 -1
- package/dist/gameplay/net/browser/index.d.ts +3 -2
- package/dist/gameplay/net/browser/index.js +1 -1
- package/dist/gameplay/net/net-session.d.ts +2 -2
- package/dist/gameplay/services/asset-loader.js +1 -1
- package/dist/gameplay/services/game-time-scheduler.d.ts +1 -1
- package/dist/gameplay/services/physics/abstract-physics-system.d.ts +7 -7
- package/dist/gameplay/services/pointer-events.d.ts +2 -2
- package/dist/gameplay/services/pointer-events.js +1 -1
- package/dist/gameplay/services/world.d.ts +1 -1
- package/dist/gameplay/services/world.js +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +1 -1
- package/dist/rendering/cluster-generator.d.ts +2 -1
- package/dist/rendering/fog/fog-volume-actor.d.ts +1 -1
- package/dist/rendering/fog/fog-volume-actor.js +1 -1
- package/dist/rendering/fog/fog-volume-object.d.ts +2 -1
- package/dist/rendering/fog/volumetric-fog-pass.d.ts +4 -2
- package/dist/rendering/fog/volumetric-fog-pass.js +1 -1
- package/dist/rendering/light-probes/light-volume-capture.d.ts +2 -1
- package/dist/rendering/motion-vector-node.d.ts +2 -1
- package/dist/rendering/node-material-webgpu-resolver.d.ts +2 -1
- package/dist/rendering/node-material-webgpu-resolver.js +1 -1
- package/dist/rendering/post-process-effect.d.ts +1 -1
- package/dist/rendering.js +1 -1
- package/dist/scene/asset-resource-loader.d.ts +5 -4
- package/dist/scene/assets-provider.d.ts +2 -2
- package/dist/scene/batched-mesh-2.d.ts +1 -1
- package/dist/scene/bootstrap.d.ts +8 -7
- package/dist/scene/collision/collision-shape-import.d.ts +3 -3
- package/dist/scene/collision/collision-shape.d.ts +2 -1
- package/dist/scene/custom-param-deserialize.d.ts +1 -1
- package/dist/scene/custom-param-runtime-types.d.ts +2 -1
- package/dist/scene/landscape/landscape-manager.d.ts +6 -6
- package/dist/scene/landscape/landscape-manager.js +1 -1
- package/dist/scene/landscape/utils.d.ts +2 -2
- package/dist/scene/materializer.js +1 -1
- package/dist/scene/materials/grass-foliage.d.ts +2 -2
- package/dist/scene/materials/grass.d.ts +1 -1
- package/dist/scene/materials/utils/material-painting.d.ts +2 -1
- package/dist/scene/materials/water.d.ts +1 -1
- package/dist/scene/model.d.ts +1 -1
- package/dist/scene/objects/prefab.d.ts +3 -3
- package/dist/scene/objects/shapes.d.ts +4 -2
- package/dist/scene/runtime-asset-service.d.ts +2 -2
- package/dist/scene/runtime-backend-service.d.ts +2 -2
- package/dist/scene/runtime-bundled-backend-service.d.ts +3 -3
- package/dist/scene/scatter/painted-scatter-manager.d.ts +1 -1
- package/dist/scene/scatter/surface-scatter-manager.d.ts +4 -4
- package/dist/scene/scene-data-service.d.ts +1 -1
- package/dist/scene/surface-query.d.ts +2 -2
- package/dist/scene/surface-query.js +1 -1
- package/dist/shader/builtin/decal-unlit-shader.js +1 -1
- package/dist/shader/builtin/index.d.ts +1 -1
- package/dist/shader/decal-shader.d.ts +3 -2
- package/dist/shader/graph/compiler.d.ts +1 -1
- package/dist/shader/parameter.d.ts +8 -8
- package/dist/shader/post-process-shader.d.ts +2 -1
- package/dist/shader/shader.d.ts +6 -5
- package/dist/shader/trail-shader.d.ts +3 -2
- package/dist/shader/trail-shader.js +1 -1
- package/dist/shader/uv-nodes.d.ts +2 -2
- package/dist/shader-nodes/bulge.d.ts +1 -1
- package/dist/shader-nodes/curve-sample.d.ts +2 -2
- package/dist/shader-nodes/depth.d.ts +3 -3
- package/dist/shader-nodes/dither.d.ts +1 -1
- package/dist/shader-nodes/effects.d.ts +1 -1
- package/dist/shader-nodes/glsl-node.d.ts +1 -1
- package/dist/shader-nodes/gradient-sample.d.ts +1 -1
- package/dist/shader-nodes/landscape.d.ts +1 -1
- package/dist/shader-nodes/layers.d.ts +1 -1
- package/dist/shader-nodes/material-flags.d.ts +1 -1
- package/dist/shader-nodes/particle.d.ts +1 -1
- package/dist/shader-nodes/pom.d.ts +2 -1
- package/dist/shader-nodes/pom.js +1 -1
- package/dist/shader-nodes/scene-sample.d.ts +2 -1
- package/dist/shader-nodes/shapes.d.ts +1 -1
- package/dist/shader-nodes/texture-sequence.d.ts +1 -1
- package/dist/shader-nodes/time.d.ts +1 -1
- package/dist/shader-nodes/voronoi.d.ts +1 -1
- package/dist/shader-nodes/wgsl-node.d.ts +1 -1
- package/dist/test/character-root-motion-constraint.test.d.ts +2 -0
- package/dist/test/character-root-motion-constraint.test.js +4 -0
- package/dist/test/node-material-webgpu-resolver.test.js +1 -1
- package/dist/utils/materials.d.ts +1 -1
- package/dist/utils/mesh.d.ts +1 -1
- package/dist/utils/obb-utils.d.ts +2 -1
- package/dist/utils/three/cleanup.d.ts +1 -1
- package/dist/utils/three/depth-pass.d.ts +1 -1
- package/dist/utils/three/traverse.d.ts +2 -1
- package/dist/worker/index.js +1 -1
- package/package.json +3 -2
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NodeShaderMaterial } from '../../shader-nodes/index.js';
|
|
2
|
-
import { Color, Texture } from 'three';
|
|
3
|
-
import { RenderingView } from '../../rendering.js';
|
|
2
|
+
import type { Color, Texture } from 'three';
|
|
3
|
+
import type { RenderingView } from '../../rendering.js';
|
|
4
4
|
export interface GrassFoliageMaterialParameters {
|
|
5
5
|
map: Texture;
|
|
6
6
|
color: Color;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as THREE from 'three';
|
|
2
|
-
import { RenderingView } from '../../rendering.js';
|
|
2
|
+
import type { RenderingView } from '../../rendering.js';
|
|
3
3
|
export declare function createGrassMaterial(params: any, renderingView: RenderingView): THREE.MeshStandardMaterial;
|
|
4
4
|
export declare function createGrassMaterialOld(params: any, renderingView: RenderingView): THREE.ShaderMaterial;
|
|
5
5
|
//# sourceMappingURL=grass.d.ts.map
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import { Mesh
|
|
1
|
+
import type { Mesh } from "three";
|
|
2
|
+
import { BufferAttribute } from "three";
|
|
2
3
|
export declare function getMaterialAttribute(mesh: Mesh, index: number, recreate?: boolean): BufferAttribute;
|
|
3
4
|
//# sourceMappingURL=material-painting.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import * as THREE from 'three';
|
|
2
|
-
import { RenderingView } from '../../rendering.js';
|
|
2
|
+
import type { RenderingView } from '../../rendering.js';
|
|
3
3
|
export declare function createWaterMaterial(params: any, renderingView: RenderingView): THREE.ShaderMaterial;
|
|
4
4
|
//# sourceMappingURL=water.d.ts.map
|
package/dist/scene/model.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EulerOrder, Side } from 'three';
|
|
1
|
+
import type { EulerOrder, Side } from 'three';
|
|
2
2
|
import type { SequenceData } from '../effects/sequence/sequence-data.js';
|
|
3
3
|
import type { BlendingMode, VfxAssetData } from '../effects/vfx/vfx-asset.js';
|
|
4
4
|
import type { ShaderGraphDocument, ShaderGraphMaterialReference } from '../shader/graph/model.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Object3D } from "three";
|
|
2
|
-
import { BaseActor } from "../../gameplay/actors/actor.js";
|
|
3
|
-
import { Asset } from "../model";
|
|
1
|
+
import type { Object3D } from "three";
|
|
2
|
+
import type { BaseActor } from "../../gameplay/actors/actor.js";
|
|
3
|
+
import type { Asset } from "../model.js";
|
|
4
4
|
export declare class Prefab {
|
|
5
5
|
asset: Asset;
|
|
6
6
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { CollisionShape } from '../collision/collision-shape.js';
|
|
2
|
+
import { BoxCollisionShape, CapsuleCollisionShape, ConeCollisionShape, ConvexPolyhedronCollisionShape, CylinderCollisionShape, PlaneCollisionShape, SphereCollisionShape, TrimeshCollisionShape } from '../collision/collision-shape.js';
|
|
3
|
+
import type { BufferGeometry, Vector2, Color } from "three";
|
|
4
|
+
import { BoxGeometry, PlaneGeometry, CylinderGeometry, SphereGeometry, TorusGeometry, ConeGeometry, CircleGeometry, CapsuleGeometry } from "three";
|
|
3
5
|
import { TextGeometry } from 'three/examples/jsm/geometries/TextGeometry.js';
|
|
4
6
|
type AVec3 = [number, number, number];
|
|
5
7
|
type ShapeParameterDef<T = boolean | number | string | Vector2 | AVec3 | Color> = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AssetsProvider } from '../scene/assets-provider.js';
|
|
2
2
|
import { Subject } from 'rxjs';
|
|
3
|
-
import { Asset } from '../scene/model.js';
|
|
4
|
-
import { RuntimeBackendService } from './runtime-backend-service.js';
|
|
3
|
+
import type { Asset } from '../scene/model.js';
|
|
4
|
+
import type { RuntimeBackendService } from './runtime-backend-service.js';
|
|
5
5
|
export declare class RuntimeAssetsService extends AssetsProvider {
|
|
6
6
|
private backend;
|
|
7
7
|
private assets;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { SceneObject } from './materializer.js';
|
|
2
|
-
import { Asset, SceneData } from './model.js';
|
|
1
|
+
import type { SceneObject } from './materializer.js';
|
|
2
|
+
import type { Asset, SceneData } from './model.js';
|
|
3
3
|
export interface RuntimeBackendService {
|
|
4
4
|
getAssets(): Promise<Asset[]>;
|
|
5
5
|
getAsset(id: string): Promise<Asset>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { SceneObject } from './materializer.js';
|
|
2
|
-
import { Asset, SceneData } from './model.js';
|
|
3
|
-
import { RuntimeBackendService } from './runtime-backend-service.js';
|
|
1
|
+
import type { SceneObject } from './materializer.js';
|
|
2
|
+
import type { Asset, SceneData } from './model.js';
|
|
3
|
+
import type { RuntimeBackendService } from './runtime-backend-service.js';
|
|
4
4
|
export declare class RuntimeBundledBackendService implements RuntimeBackendService {
|
|
5
5
|
private assets;
|
|
6
6
|
private scenes;
|
|
@@ -2,7 +2,7 @@ import type { RenderingView } from '../../rendering.js';
|
|
|
2
2
|
import type { AssetResourceLoader } from '../asset-resource-loader.js';
|
|
3
3
|
import type { AssetsProvider } from '../assets-provider.js';
|
|
4
4
|
import type { SceneDataProvider } from '../materializer.js';
|
|
5
|
-
import { Scene } from 'three';
|
|
5
|
+
import type { Scene } from 'three';
|
|
6
6
|
export declare class PaintedScatterManager {
|
|
7
7
|
private scene;
|
|
8
8
|
private dataProvider;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { RenderingView } from '../../rendering.js';
|
|
2
|
-
import { AssetResourceLoader } from '../asset-resource-loader.js';
|
|
3
|
-
import { AssetsProvider } from '../assets-provider.js';
|
|
1
|
+
import type { RenderingView } from '../../rendering.js';
|
|
2
|
+
import type { AssetResourceLoader } from '../asset-resource-loader.js';
|
|
3
|
+
import type { AssetsProvider } from '../assets-provider.js';
|
|
4
4
|
import type { SceneDataProvider } from '../materializer.js';
|
|
5
|
-
import { Scene } from 'three';
|
|
5
|
+
import type { Scene } from 'three';
|
|
6
6
|
export declare class SurfaceScatterManager {
|
|
7
7
|
private scene;
|
|
8
8
|
private dataProvider;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SceneDataProvider, SceneObject, ChangeCallback } from '../scene/materializer.js';
|
|
1
|
+
import type { SceneDataProvider, SceneObject, ChangeCallback } from '../scene/materializer.js';
|
|
2
2
|
import { BehaviorSubject } from 'rxjs';
|
|
3
3
|
import { Matrix4 } from 'three';
|
|
4
4
|
export declare class SceneDataService implements SceneDataProvider {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BaseSurfaceDefinition } from "../data/surface-definition";
|
|
2
|
-
import { Intersection } from "three";
|
|
1
|
+
import type { BaseSurfaceDefinition } from "../data/surface-definition.js";
|
|
2
|
+
import type { Intersection } from "three";
|
|
3
3
|
export declare function findSurfaceDefinition(intersection: Intersection): BaseSurfaceDefinition | null;
|
|
4
4
|
//# sourceMappingURL=surface-query.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Mesh as t,Vector3 as e}from"three";import{BatchedMesh2 as r}from"./batched-mesh-2";export function findSurfaceDefinition(e){const u=e.object;if(null==u||!(u instanceof t)||null==u.material)return;const o=Array.isArray(u.material)?u.material[e.face.materialIndex]:u.material;if(null==o)return null;if(u instanceof r){const t=u.surfaceByInstance?.[e.batchId];if(null!=t)return t}let l;return l=function(t,e,r){if(null==t.userData.surfaceByLayer||!e.hasAttribute("material"))return null;const u=function(t,e){const r=t.object,u=e.getAttribute("position"),o=e.index,l=t.faceIndex,f=o?o.getX(3*l+0):3*l+0,c=o?o.getX(3*l+1):3*l+1,s=o?o.getX(3*l+2):3*l+2;n.fromBufferAttribute(u,f).applyMatrix4(r.matrixWorld),a.fromBufferAttribute(u,c).applyMatrix4(r.matrixWorld),i.fromBufferAttribute(u,s).applyMatrix4(r.matrixWorld);const m=t.point,d=m.distanceToSquared(n),p=m.distanceToSquared(a),b=m.distanceToSquared(i),y=d<p?d<b?f:s:p<b?c:s,x=e.getAttribute("material"),g=e.getAttribute("material2"),A=4;let B=0;const h=.5;if(null!=x)for(let t=0;t<A;t++){x.getComponent(y,t)>h&&(B=t+1)}if(null!=g)for(let t=0;t<A;t++){g.getComponent(y,t)>h&&(B=t+5)}return B}(r,e);return t.userData.surfaceByLayer[u]}(o,u.geometry,e),null!=l?l:o.userData.surface}const n=new e,a=new e,i=new e;/*
|
|
1
|
+
import{Mesh as t,Vector3 as e}from"three";import{BatchedMesh2 as r}from"./batched-mesh-2.js";export function findSurfaceDefinition(e){const u=e.object;if(null==u||!(u instanceof t)||null==u.material)return;const o=Array.isArray(u.material)?u.material[e.face.materialIndex]:u.material;if(null==o)return null;if(u instanceof r){const t=u.surfaceByInstance?.[e.batchId];if(null!=t)return t}let l;return l=function(t,e,r){if(null==t.userData.surfaceByLayer||!e.hasAttribute("material"))return null;const u=function(t,e){const r=t.object,u=e.getAttribute("position"),o=e.index,l=t.faceIndex,f=o?o.getX(3*l+0):3*l+0,c=o?o.getX(3*l+1):3*l+1,s=o?o.getX(3*l+2):3*l+2;n.fromBufferAttribute(u,f).applyMatrix4(r.matrixWorld),a.fromBufferAttribute(u,c).applyMatrix4(r.matrixWorld),i.fromBufferAttribute(u,s).applyMatrix4(r.matrixWorld);const m=t.point,d=m.distanceToSquared(n),p=m.distanceToSquared(a),b=m.distanceToSquared(i),y=d<p?d<b?f:s:p<b?c:s,x=e.getAttribute("material"),g=e.getAttribute("material2"),A=4;let B=0;const h=.5;if(null!=x)for(let t=0;t<A;t++){x.getComponent(y,t)>h&&(B=t+1)}if(null!=g)for(let t=0;t<A;t++){g.getComponent(y,t)>h&&(B=t+5)}return B}(r,e);return t.userData.surfaceByLayer[u]}(o,u.geometry,e),null!=l?l:o.userData.surface}const n=new e,a=new e,i=new e;/*
|
|
2
2
|
* Copyright (©) 2026 Hology Interactive AB. All rights reserved.
|
|
3
3
|
* See the LICENSE.md file for details.
|
|
4
4
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{__decorate as t,__metadata as e}from"tslib";import{Color as i,Texture as r,Vector2 as a,BackSide as l}from"three";import{Parameter as o}from"../parameter.js";import{DecalNodeShader as p}from"../decal-shader.js";import{float as s,rgb as d,rgba as n,textureSampler2d as h}from"three-shader-graph";import{decalAlpha as c,decalUV as m}from"../../shader-nodes/decal.js";import{particleUniforms as y}from"../../shader-nodes/particle.js";import{tileUv as u}from"./decal-standard-shader";export class DecalUnlitShader extends p{constructor(){super(...arguments),this.color=new i("#FFFFFF"),this.opacity=1,this.intensity=1,this.atlasSize=new a(1,1),this.atlasTile=1}output(){let t=u(m,this.atlasSize,this.atlasTile),e=s(this.opacity).multiply(y.opacity);null!=this.alphaMap&&(e=e.multiply(h(this.alphaMap).sample(t).r)),e=e.multiply(c);let i=n(d(this.color).multiply(y.color),e);return null!=this.colorMap&&(i=i.multiply(h(this.colorMap).sample(t))),i=n(i.rgb.multiplyScalar(this.intensity),i.a),{color:i,emissive:i.rgb}}build(){const t=super.build();return t.depthTest=!0,t.depthWrite=!1,t.userData.isDecal=!0,t.side=l,t}}t([o(),e("design:type",i)],DecalUnlitShader.prototype,"color",void 0),t([o({range:[0,1]}),e("design:type",Number)],DecalUnlitShader.prototype,"opacity",void 0),t([o({range:[0,10]}),e("design:type",Number)],DecalUnlitShader.prototype,"intensity",void 0),t([o(),e("design:type",r)],DecalUnlitShader.prototype,"colorMap",void 0),t([o(),e("design:type",r)],DecalUnlitShader.prototype,"alphaMap",void 0),t([o(),e("design:type",a)],DecalUnlitShader.prototype,"atlasSize",void 0),t([o({range:[1,64],precision:0}),e("design:type",Number)],DecalUnlitShader.prototype,"atlasTile",void 0);/*
|
|
1
|
+
import{__decorate as t,__metadata as e}from"tslib";import{Color as i,Texture as r,Vector2 as a,BackSide as l}from"three";import{Parameter as o}from"../parameter.js";import{DecalNodeShader as p}from"../decal-shader.js";import{float as s,rgb as d,rgba as n,textureSampler2d as h}from"three-shader-graph";import{decalAlpha as c,decalUV as m}from"../../shader-nodes/decal.js";import{particleUniforms as y}from"../../shader-nodes/particle.js";import{tileUv as u}from"./decal-standard-shader.js";export class DecalUnlitShader extends p{constructor(){super(...arguments),this.color=new i("#FFFFFF"),this.opacity=1,this.intensity=1,this.atlasSize=new a(1,1),this.atlasTile=1}output(){let t=u(m,this.atlasSize,this.atlasTile),e=s(this.opacity).multiply(y.opacity);null!=this.alphaMap&&(e=e.multiply(h(this.alphaMap).sample(t).r)),e=e.multiply(c);let i=n(d(this.color).multiply(y.color),e);return null!=this.colorMap&&(i=i.multiply(h(this.colorMap).sample(t))),i=n(i.rgb.multiplyScalar(this.intensity),i.a),{color:i,emissive:i.rgb}}build(){const t=super.build();return t.depthTest=!0,t.depthWrite=!1,t.userData.isDecal=!0,t.side=l,t}}t([o(),e("design:type",i)],DecalUnlitShader.prototype,"color",void 0),t([o({range:[0,1]}),e("design:type",Number)],DecalUnlitShader.prototype,"opacity",void 0),t([o({range:[0,10]}),e("design:type",Number)],DecalUnlitShader.prototype,"intensity",void 0),t([o(),e("design:type",r)],DecalUnlitShader.prototype,"colorMap",void 0),t([o(),e("design:type",r)],DecalUnlitShader.prototype,"alphaMap",void 0),t([o(),e("design:type",a)],DecalUnlitShader.prototype,"atlasSize",void 0),t([o({range:[1,64],precision:0}),e("design:type",Number)],DecalUnlitShader.prototype,"atlasTile",void 0);/*
|
|
2
2
|
* Copyright (©) 2026 Hology Interactive AB. All rights reserved.
|
|
3
3
|
* See the LICENSE.md file for details.
|
|
4
4
|
*/
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { Material } from "three";
|
|
2
|
-
import { NodeShaderOutput
|
|
1
|
+
import type { Material } from "three";
|
|
2
|
+
import type { NodeShaderOutput } from "./shader.js";
|
|
3
|
+
import { Shader } from "./shader.js";
|
|
3
4
|
export declare abstract class DecalNodeShader extends Shader {
|
|
4
5
|
build(): Material;
|
|
5
6
|
abstract output(): NodeShaderOutput;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Material, Side } from 'three';
|
|
1
|
+
import type { Material, Side } from 'three';
|
|
2
2
|
import { FloatNode, NodeShaderMaterial, Vec2Node, Vec3Node } from '../../shader-nodes/index.js';
|
|
3
3
|
import type { NodeShaderOutput } from '../shader.js';
|
|
4
4
|
import type { ShaderGraphDocument, ShaderGraphMaterialSide, ShaderGraphNode, ShaderGraphValueType } from './model.js';
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import 'reflect-metadata';
|
|
2
|
-
import { AbstractType, Type } from '../utils/type.js';
|
|
3
|
-
import { BaseActor } from '../gameplay/actors/actor.js';
|
|
4
|
-
import { Color, Euler, Material, Object3D, Texture, Vector2, Vector3, Vector4, AnimationClip } from 'three';
|
|
5
|
-
import { BooleanNode, FloatNode, RgbNode, Sampler2DNode, Vec2Node, Vec3Node, Vec4Node } from '../shader-nodes/index.js';
|
|
6
|
-
import { VisualEffect } from '../effects/vfx/vfx-param.js';
|
|
7
|
-
import { Prefab, PrefabOf } from '../scene/objects/prefab.js';
|
|
8
|
-
import { DataAssetRef } from '../scene/objects/data-asset.js';
|
|
9
|
-
import { Curve2 } from '../utils/curve.js';
|
|
2
|
+
import type { AbstractType, Type } from '../utils/type.js';
|
|
3
|
+
import type { BaseActor } from '../gameplay/actors/actor.js';
|
|
4
|
+
import type { Color, Euler, Material, Object3D, Texture, Vector2, Vector3, Vector4, AnimationClip } from 'three';
|
|
5
|
+
import type { BooleanNode, FloatNode, RgbNode, Sampler2DNode, Vec2Node, Vec3Node, Vec4Node } from '../shader-nodes/index.js';
|
|
6
|
+
import type { VisualEffect } from '../effects/vfx/vfx-param.js';
|
|
7
|
+
import type { Prefab, PrefabOf } from '../scene/objects/prefab.js';
|
|
8
|
+
import type { DataAssetRef } from '../scene/objects/data-asset.js';
|
|
9
|
+
import type { Curve2 } from '../utils/curve.js';
|
|
10
10
|
import type { ColorLayer, MaskLayer } from './color-layer.js';
|
|
11
11
|
import type { Sequence } from '../effects/sequence/sequence-data.js';
|
|
12
12
|
export type KnownParameterType = Type<FloatNode | Number | Texture | Sampler2DNode | Boolean | BooleanNode | Vector2 | Vec2Node | Vector3 | Vec3Node | Vector4 | Vec4Node | Color | RgbNode | String | BaseActor | Euler | Object3D | Material | AnimationClip | VisualEffect | Sequence | Prefab | PrefabOf<BaseActor> | DataAssetRef | Curve2 | ColorLayer | MaskLayer>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ShaderMaterial } from 'three';
|
|
2
|
-
import { FloatNode,
|
|
2
|
+
import type { FloatNode, Vec2Node, Vec3Node, Vec4Node } from '../shader-nodes/index.js';
|
|
3
|
+
import { NodeShaderMaterial } from '../shader-nodes/index.js';
|
|
3
4
|
export type PostProcessShaderOutput = Vec4Node | Vec3Node | Vec2Node | FloatNode;
|
|
4
5
|
export interface PostProcessMaterialBuilder {
|
|
5
6
|
build(): ShaderMaterial;
|
package/dist/shader/shader.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { ActorComponent } from '../gameplay/actors/component.js';
|
|
2
|
-
import { BaseActor } from '../gameplay/actors/actor.js';
|
|
3
|
-
import { Material } from 'three';
|
|
4
|
-
import { Mat4Node,
|
|
5
|
-
import {
|
|
1
|
+
import type { ActorComponent } from '../gameplay/actors/component.js';
|
|
2
|
+
import type { BaseActor } from '../gameplay/actors/actor.js';
|
|
3
|
+
import type { Material } from 'three';
|
|
4
|
+
import type { Mat4Node, Vec4Node, Vec3Node, FloatNode, Vec2Node } from '../shader-nodes/index.js';
|
|
5
|
+
import { BooleanNode } from '../shader-nodes/index.js';
|
|
6
|
+
import type { Type } from '../utils/type.js';
|
|
6
7
|
export * from './parameter.js';
|
|
7
8
|
export declare abstract class Shader {
|
|
8
9
|
alphaTest: number;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { Material } from "three";
|
|
2
|
-
import { NodeShaderOutput
|
|
1
|
+
import type { Material } from "three";
|
|
2
|
+
import type { NodeShaderOutput } from "./shader.js";
|
|
3
|
+
import { Shader } from "./shader.js";
|
|
3
4
|
export declare abstract class TrailNodeShader extends Shader {
|
|
4
5
|
build(): Material;
|
|
5
6
|
abstract output(): NodeShaderOutput;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Shader as r}from"./shader.js";import{NodeShaderMaterial as e}from"three-shader-graph";import{Trail as o}from"../effects/vfx/trail-renderer";export class TrailNodeShader extends r{build(){const r=this.output(),{position:t}=o.getTrailShaderNodes(!1),a=new e({position:t,color:r.color});return o.applyTrailShaderParameters(a),a}}/*
|
|
1
|
+
import{Shader as r}from"./shader.js";import{NodeShaderMaterial as e}from"three-shader-graph";import{Trail as o}from"../effects/vfx/trail-renderer.js";export class TrailNodeShader extends r{build(){const r=this.output(),{position:t}=o.getTrailShaderNodes(!1),a=new e({position:t,color:r.color});return o.applyTrailShaderParameters(a),a}}/*
|
|
2
2
|
* Copyright (©) 2026 Hology Interactive AB. All rights reserved.
|
|
3
3
|
* See the LICENSE.md file for details.
|
|
4
4
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Texture } from 'three';
|
|
2
|
-
import { Vec2Node } from 'three-shader-graph';
|
|
1
|
+
import type { Texture } from 'three';
|
|
2
|
+
import type { Vec2Node } from 'three-shader-graph';
|
|
3
3
|
export declare function applyUvTiling(uv: Vec2Node, texture: Texture): Vec2Node;
|
|
4
4
|
//# sourceMappingURL=uv-nodes.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { FloatNode, Sampler2DNode } from "three-shader-graph";
|
|
2
|
-
import { Curve2 } from "../utils/curve";
|
|
1
|
+
import type { FloatNode, Sampler2DNode } from "three-shader-graph";
|
|
2
|
+
import type { Curve2 } from "../utils/curve.js";
|
|
3
3
|
export declare function sampleCurve(curve: Curve2, t: FloatNode): FloatNode;
|
|
4
4
|
export declare function sampleNamedEasingCurve(name: unknown, t: FloatNode): FloatNode | undefined;
|
|
5
5
|
export declare function curveSampler(curve: Curve2, resolution?: number): CurveSampler;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { WebGLRenderer } from "three";
|
|
2
|
-
import { FloatNode, Vec2Node
|
|
3
|
-
import type { Compiler } from "three-shader-graph";
|
|
1
|
+
import type { WebGLRenderer } from "three";
|
|
2
|
+
import { FloatNode, Vec2Node } from "three-shader-graph";
|
|
3
|
+
import type { Compiler, Vec3Node } from "three-shader-graph";
|
|
4
4
|
export declare function supportsDepthTextureExtension(renderer: WebGLRenderer): boolean;
|
|
5
5
|
export declare const depthUniformName = "hology_depth_map";
|
|
6
6
|
export declare const resolutionUniformName = "hology_resolution";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FloatNode, BooleanNode, IntNode, Vec2Node, Vec3Node, Vec4Node, Mat2Node, Mat3Node, Mat4Node, RgbNode, RgbaNode, Sampler2DNode } from "../shader-nodes/index.js";
|
|
1
|
+
import type { FloatNode, BooleanNode, IntNode, Vec2Node, Vec3Node, Vec4Node, Mat2Node, Mat3Node, Mat4Node, RgbNode, RgbaNode, Sampler2DNode } from "../shader-nodes/index.js";
|
|
2
2
|
type AbstractType<T> = abstract new (...args: unknown[]) => T;
|
|
3
3
|
type ShaderNode = FloatNode | BooleanNode | IntNode | Vec2Node | Vec3Node | Vec4Node | Mat2Node | Mat3Node | Mat4Node | RgbNode | RgbaNode | Sampler2DNode;
|
|
4
4
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Color } from 'three';
|
|
2
|
-
import { FloatNode, RgbaNode, Sampler2DNode } from 'three-shader-graph';
|
|
2
|
+
import type { FloatNode, RgbaNode, Sampler2DNode } from 'three-shader-graph';
|
|
3
3
|
export interface ColorGradientStop {
|
|
4
4
|
position: number;
|
|
5
5
|
color: string | number | Color | number[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BooleanNode } from 'three-shader-graph';
|
|
2
|
-
import { Compiler } from 'three-shader-graph';
|
|
2
|
+
import type { Compiler } from 'three-shader-graph';
|
|
3
3
|
export declare const MATERIAL_FLAG_ALPHA_TEST = 1;
|
|
4
4
|
export declare const MATERIAL_FLAG_RECEIVE_DECALS = 2;
|
|
5
5
|
declare class SampledSurfaceRejectsDecalsNode extends BooleanNode {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FloatNode, Vec3Node } from 'three-shader-graph';
|
|
2
|
-
import { Compiler } from 'three-shader-graph';
|
|
2
|
+
import type { Compiler } from 'three-shader-graph';
|
|
3
3
|
export declare const particleEnergyUniformName = "hology_particle_energy";
|
|
4
4
|
export declare const particleTimeUniformName = "hology_particle_time";
|
|
5
5
|
export declare const particleVelcoityUniformName = "hology_particle_velocity";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { FloatNode, Sampler2DNode,
|
|
1
|
+
import type { FloatNode, Sampler2DNode, Vec3Node, Vec4Node } from "three-shader-graph";
|
|
2
|
+
import { Vec2Node } from "three-shader-graph";
|
|
2
3
|
/**
|
|
3
4
|
* Computes tangent vector using normal, position and uv.
|
|
4
5
|
* Equivalent to:
|
package/dist/shader-nodes/pom.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{abs as e,attributes as t,cross as n,dFdx as r,dFdy as a,float as i,normalize as l,select as s,transformed as p,UniformSampler2dArraySlice as f,uniforms as $,varying as o,Vec2Node as v,vec3 as u,vec4 as m}from"three-shader-graph";import{isWgslCompiler as h,isWgslFragmentCompiler as d}from"three-shader-graph";import{glslFunction as c}from"./glsl-node";export function computeTangent(e,t,i){const s=r(t),p=a(t),f=r(i),$=a(i),o=n(p,e),v=n(e,s),u=o.multiplyScalar(f.x).add(v.multiplyScalar($.x));return m(l(u),1)}export function fallbackTangent(t){const r=e(t.y),a=s(r.lt(i(.999)),u(0,1,0),u(1,0,0));return l(n(a,t))}const g=t.normal,S=o(l($.normalMatrix.multiplyVec(g))),x=o(p.mvPosition.xyz.multiplyScalar(-1));export function parallaxOcclusionMapping(e,t,n,r=8,a=24){return new y(e,t,n,r,a)}class y extends v{constructor(e,t,n,r,a){super(),this.uv=e,this.heightMap=t,this.heightScale=n,this.minLayers=r,this.maxLayers=a}compile(e){if(!h(e))return{out:e.get(this.compileGlsl())};if(!d(e))throw new Error("Parallax occlusion mapping requires fragment-stage derivatives in WGSL.");const t=`pom_${e.variable()}`,n=e.get(this.uv),r=e.get(this.heightMap),a=e.get(this.heightScale),l=e.get(S),s=e.get(x),p=e.get(i(this.minLayers)),f=e.get(i(this.maxLayers)),$=C(this.heightMap)?e.get(L(this.heightMap)):null;return{chunk:`\n let ${t}Uv = ${n};\n let ${t}Normal = normalize(${l});\n let ${t}ViewPosition = ${s};\n let ${t}ViewDirection = normalize(${t}ViewPosition);\n let ${t}Dp1 = dpdx(-${t}ViewPosition);\n // WGSL fragment coordinates have the opposite Y orientation from GLSL.\n // Negate both Y derivatives so the reconstructed cotangent frame keeps\n // the same handedness as the GLSL implementation.\n let ${t}Dp2 = -dpdy(-${t}ViewPosition);\n let ${t}Duv1 = dpdx(${t}Uv);\n let ${t}Duv2 = -dpdy(${t}Uv);\n let ${t}Dp2Perp = cross(${t}Dp2, ${t}Normal);\n let ${t}Dp1Perp = cross(${t}Normal, ${t}Dp1);\n let ${t}T = ${t}Dp2Perp * ${t}Duv1.x + ${t}Dp1Perp * ${t}Duv2.x;\n let ${t}B = ${t}Dp2Perp * ${t}Duv1.y + ${t}Dp1Perp * ${t}Duv2.y;\n let ${t}InvMax = inverseSqrt(max(dot(${t}T, ${t}T), dot(${t}B, ${t}B)));\n let ${t}Tbn = mat3x3<f32>(\n ${t}T * ${t}InvMax,\n ${t}B * ${t}InvMax,\n ${t}Normal\n );\n let ${t}Vv = -(transpose(${t}Tbn) * ${t}ViewDirection);\n let ${t}SafeVvZ = select(\n ${t}Vv.z,\n select(-0.0001, 0.0001, ${t}Vv.z >= 0.0),\n abs(${t}Vv.z) < 0.0001\n );\n let ${t}ParallaxLimit = (-length(${t}Vv.xy) / ${t}SafeVvZ) * ${a};\n let ${t}OffsetDirection = normalize(${t}Vv.xy);\n let ${t}MaxOffset = ${t}OffsetDirection * ${t}ParallaxLimit;\n let ${t}NumSamples = max(\n 1.0,\n mix(${f}, ${p}, dot(-${t}ViewDirection, ${t}Normal))\n );\n let ${t}StepSize = 1.0 / ${t}NumSamples;\n var ${t}CurrentRayHeight = 1.0;\n var ${t}CurrentOffset = vec2<f32>(0.0);\n var ${t}LastOffset = vec2<f32>(0.0);\n var ${t}LastSampledHeight = 1.0;\n var ${t}CurrentSampledHeight = 1.0;\n for (var ${t}SampleIndex: i32 = 0; ${t}SampleIndex < 24; ${t}SampleIndex = ${t}SampleIndex + 1) {\n if (f32(${t}SampleIndex) > ${t}NumSamples) {\n break;\n }\n ${t}CurrentSampledHeight = ${null==$?`textureSampleLevel(${r}Texture, ${r}Sampler, ${t}Uv + ${t}CurrentOffset, 0.0).r`:`textureSampleLevel(${r}Texture, ${r}Sampler, ${t}Uv + ${t}CurrentOffset, i32(${$}), 0.0).r`};\n if (${t}CurrentSampledHeight > ${t}CurrentRayHeight) {\n let ${t}Delta1 = ${t}CurrentSampledHeight - ${t}CurrentRayHeight;\n let ${t}Delta2 = (${t}CurrentRayHeight + ${t}StepSize) - ${t}LastSampledHeight;\n let ${t}Ratio = ${t}Delta1 / (${t}Delta1 + ${t}Delta2);\n ${t}CurrentOffset = ${t}Ratio * ${t}LastOffset + (1.0 - ${t}Ratio) * ${t}CurrentOffset;\n break;\n }\n ${t}CurrentRayHeight = ${t}CurrentRayHeight - ${t}StepSize;\n ${t}LastOffset = ${t}CurrentOffset;\n ${t}CurrentOffset = ${t}CurrentOffset + ${t}StepSize * ${t}MaxOffset;\n ${t}LastSampledHeight = ${t}CurrentSampledHeight;\n }\n let ${t}UvWithOffset = ${t}Uv + ${t}CurrentOffset;\n `,out:`${t}UvWithOffset`}}compileGlsl(){const e=C(this.heightMap)?L(this.heightMap):null,t=null==e?"texture2D(heightMap, uv + vCurrOffset).r":"texture(heightMap, vec3(uv + vCurrOffset, heightMapLayer)).r",n={uv:this.uv,heightScale:this.heightScale,heightMap:this.heightMap,minLayers:i(this.minLayers),maxLayers:i(this.maxLayers),vN:S,vViewPosition:x,...null==e?{}:{heightMapLayer:e}};return c(v,n,`\n vec3 N = normalize(vN);\n vec3 viewDir = normalize(vViewPosition);\n vec3 dp1 = dFdx(-vViewPosition);\n vec3 dp2 = dFdy(-vViewPosition);\n vec2 duv1 = dFdx(uv);\n vec2 duv2 = dFdy(uv);\n vec3 dp2perp = cross(dp2, N);\n vec3 dp1perp = cross(N, dp1);\n vec3 T = dp2perp * duv1.x + dp1perp * duv2.x;\n vec3 B = dp2perp * duv1.y + dp1perp * duv2.y;\n float invmax = inversesqrt(max(dot(T, T), dot(B, B)));\n mat3 tbn = mat3(T * invmax, B * invmax, N);\n vec3 vv = -viewDir * tbn;\n float parallaxLimit = -length(vv.xy) / vv.z;\n parallaxLimit *= heightScale;\n vec2 vOffsetDir = normalize(vv.xy);\n vec2 vMaxOffset = vOffsetDir * parallaxLimit;\n float nNumSamples = mix(float(maxLayers), float(minLayers), dot(-viewDir, N));\n float fStepSize = 1.0 / nNumSamples;\n float fCurrRayHeight = 1.0;\n vec2 vCurrOffset = vec2(0.0);\n vec2 vLastOffset = vec2(0.0);\n float fLastSampledHeight = 1.0;\n float fCurrSampledHeight = 1.0;\n for (int nCurrSample = 0; nCurrSample < 24; nCurrSample++) {\n if (float(nCurrSample) > nNumSamples) break;\n fCurrSampledHeight = ${t};\n if (fCurrSampledHeight > fCurrRayHeight) {\n float delta1 = fCurrSampledHeight - fCurrRayHeight;\n float delta2 = (fCurrRayHeight + fStepSize) - fLastSampledHeight;\n float ratio = delta1 / (delta1 + delta2);\n vCurrOffset = ratio * vLastOffset + (1.0 - ratio) * vCurrOffset;\n break;\n } else {\n fCurrRayHeight -= fStepSize;\n vLastOffset = vCurrOffset;\n vCurrOffset += fStepSize * vMaxOffset;\n fLastSampledHeight = fCurrSampledHeight;\n }\n }\n return uv + vCurrOffset;\n `)}}function C(e){return e instanceof f||"sampler2DArray"===e.constructor.typeName}function L(e){return e.index??i(0)}/*
|
|
1
|
+
import{abs as e,attributes as t,cross as n,dFdx as r,dFdy as a,float as i,normalize as l,select as s,transformed as p,UniformSampler2dArraySlice as f,uniforms as $,varying as o,Vec2Node as v,vec3 as u,vec4 as m}from"three-shader-graph";import{isWgslCompiler as h,isWgslFragmentCompiler as d}from"three-shader-graph";import{glslFunction as c}from"./glsl-node.js";export function computeTangent(e,t,i){const s=r(t),p=a(t),f=r(i),$=a(i),o=n(p,e),v=n(e,s),u=o.multiplyScalar(f.x).add(v.multiplyScalar($.x));return m(l(u),1)}export function fallbackTangent(t){const r=e(t.y),a=s(r.lt(i(.999)),u(0,1,0),u(1,0,0));return l(n(a,t))}const g=t.normal,S=o(l($.normalMatrix.multiplyVec(g))),x=o(p.mvPosition.xyz.multiplyScalar(-1));export function parallaxOcclusionMapping(e,t,n,r=8,a=24){return new y(e,t,n,r,a)}class y extends v{constructor(e,t,n,r,a){super(),this.uv=e,this.heightMap=t,this.heightScale=n,this.minLayers=r,this.maxLayers=a}compile(e){if(!h(e))return{out:e.get(this.compileGlsl())};if(!d(e))throw new Error("Parallax occlusion mapping requires fragment-stage derivatives in WGSL.");const t=`pom_${e.variable()}`,n=e.get(this.uv),r=e.get(this.heightMap),a=e.get(this.heightScale),l=e.get(S),s=e.get(x),p=e.get(i(this.minLayers)),f=e.get(i(this.maxLayers)),$=C(this.heightMap)?e.get(L(this.heightMap)):null;return{chunk:`\n let ${t}Uv = ${n};\n let ${t}Normal = normalize(${l});\n let ${t}ViewPosition = ${s};\n let ${t}ViewDirection = normalize(${t}ViewPosition);\n let ${t}Dp1 = dpdx(-${t}ViewPosition);\n // WGSL fragment coordinates have the opposite Y orientation from GLSL.\n // Negate both Y derivatives so the reconstructed cotangent frame keeps\n // the same handedness as the GLSL implementation.\n let ${t}Dp2 = -dpdy(-${t}ViewPosition);\n let ${t}Duv1 = dpdx(${t}Uv);\n let ${t}Duv2 = -dpdy(${t}Uv);\n let ${t}Dp2Perp = cross(${t}Dp2, ${t}Normal);\n let ${t}Dp1Perp = cross(${t}Normal, ${t}Dp1);\n let ${t}T = ${t}Dp2Perp * ${t}Duv1.x + ${t}Dp1Perp * ${t}Duv2.x;\n let ${t}B = ${t}Dp2Perp * ${t}Duv1.y + ${t}Dp1Perp * ${t}Duv2.y;\n let ${t}InvMax = inverseSqrt(max(dot(${t}T, ${t}T), dot(${t}B, ${t}B)));\n let ${t}Tbn = mat3x3<f32>(\n ${t}T * ${t}InvMax,\n ${t}B * ${t}InvMax,\n ${t}Normal\n );\n let ${t}Vv = -(transpose(${t}Tbn) * ${t}ViewDirection);\n let ${t}SafeVvZ = select(\n ${t}Vv.z,\n select(-0.0001, 0.0001, ${t}Vv.z >= 0.0),\n abs(${t}Vv.z) < 0.0001\n );\n let ${t}ParallaxLimit = (-length(${t}Vv.xy) / ${t}SafeVvZ) * ${a};\n let ${t}OffsetDirection = normalize(${t}Vv.xy);\n let ${t}MaxOffset = ${t}OffsetDirection * ${t}ParallaxLimit;\n let ${t}NumSamples = max(\n 1.0,\n mix(${f}, ${p}, dot(-${t}ViewDirection, ${t}Normal))\n );\n let ${t}StepSize = 1.0 / ${t}NumSamples;\n var ${t}CurrentRayHeight = 1.0;\n var ${t}CurrentOffset = vec2<f32>(0.0);\n var ${t}LastOffset = vec2<f32>(0.0);\n var ${t}LastSampledHeight = 1.0;\n var ${t}CurrentSampledHeight = 1.0;\n for (var ${t}SampleIndex: i32 = 0; ${t}SampleIndex < 24; ${t}SampleIndex = ${t}SampleIndex + 1) {\n if (f32(${t}SampleIndex) > ${t}NumSamples) {\n break;\n }\n ${t}CurrentSampledHeight = ${null==$?`textureSampleLevel(${r}Texture, ${r}Sampler, ${t}Uv + ${t}CurrentOffset, 0.0).r`:`textureSampleLevel(${r}Texture, ${r}Sampler, ${t}Uv + ${t}CurrentOffset, i32(${$}), 0.0).r`};\n if (${t}CurrentSampledHeight > ${t}CurrentRayHeight) {\n let ${t}Delta1 = ${t}CurrentSampledHeight - ${t}CurrentRayHeight;\n let ${t}Delta2 = (${t}CurrentRayHeight + ${t}StepSize) - ${t}LastSampledHeight;\n let ${t}Ratio = ${t}Delta1 / (${t}Delta1 + ${t}Delta2);\n ${t}CurrentOffset = ${t}Ratio * ${t}LastOffset + (1.0 - ${t}Ratio) * ${t}CurrentOffset;\n break;\n }\n ${t}CurrentRayHeight = ${t}CurrentRayHeight - ${t}StepSize;\n ${t}LastOffset = ${t}CurrentOffset;\n ${t}CurrentOffset = ${t}CurrentOffset + ${t}StepSize * ${t}MaxOffset;\n ${t}LastSampledHeight = ${t}CurrentSampledHeight;\n }\n let ${t}UvWithOffset = ${t}Uv + ${t}CurrentOffset;\n `,out:`${t}UvWithOffset`}}compileGlsl(){const e=C(this.heightMap)?L(this.heightMap):null,t=null==e?"texture2D(heightMap, uv + vCurrOffset).r":"texture(heightMap, vec3(uv + vCurrOffset, heightMapLayer)).r",n={uv:this.uv,heightScale:this.heightScale,heightMap:this.heightMap,minLayers:i(this.minLayers),maxLayers:i(this.maxLayers),vN:S,vViewPosition:x,...null==e?{}:{heightMapLayer:e}};return c(v,n,`\n vec3 N = normalize(vN);\n vec3 viewDir = normalize(vViewPosition);\n vec3 dp1 = dFdx(-vViewPosition);\n vec3 dp2 = dFdy(-vViewPosition);\n vec2 duv1 = dFdx(uv);\n vec2 duv2 = dFdy(uv);\n vec3 dp2perp = cross(dp2, N);\n vec3 dp1perp = cross(N, dp1);\n vec3 T = dp2perp * duv1.x + dp1perp * duv2.x;\n vec3 B = dp2perp * duv1.y + dp1perp * duv2.y;\n float invmax = inversesqrt(max(dot(T, T), dot(B, B)));\n mat3 tbn = mat3(T * invmax, B * invmax, N);\n vec3 vv = -viewDir * tbn;\n float parallaxLimit = -length(vv.xy) / vv.z;\n parallaxLimit *= heightScale;\n vec2 vOffsetDir = normalize(vv.xy);\n vec2 vMaxOffset = vOffsetDir * parallaxLimit;\n float nNumSamples = mix(float(maxLayers), float(minLayers), dot(-viewDir, N));\n float fStepSize = 1.0 / nNumSamples;\n float fCurrRayHeight = 1.0;\n vec2 vCurrOffset = vec2(0.0);\n vec2 vLastOffset = vec2(0.0);\n float fLastSampledHeight = 1.0;\n float fCurrSampledHeight = 1.0;\n for (int nCurrSample = 0; nCurrSample < 24; nCurrSample++) {\n if (float(nCurrSample) > nNumSamples) break;\n fCurrSampledHeight = ${t};\n if (fCurrSampledHeight > fCurrRayHeight) {\n float delta1 = fCurrSampledHeight - fCurrRayHeight;\n float delta2 = (fCurrRayHeight + fStepSize) - fLastSampledHeight;\n float ratio = delta1 / (delta1 + delta2);\n vCurrOffset = ratio * vLastOffset + (1.0 - ratio) * vCurrOffset;\n break;\n } else {\n fCurrRayHeight -= fStepSize;\n vLastOffset = vCurrOffset;\n vCurrOffset += fStepSize * vMaxOffset;\n fLastSampledHeight = fCurrSampledHeight;\n }\n }\n return uv + vCurrOffset;\n `)}}function C(e){return e instanceof f||"sampler2DArray"===e.constructor.typeName}function L(e){return e.index??i(0)}/*
|
|
2
2
|
* Copyright (©) 2026 Hology Interactive AB. All rights reserved.
|
|
3
3
|
* See the LICENSE.md file for details.
|
|
4
4
|
*/
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { FloatNode, RgbaNode, Vec2Node
|
|
1
|
+
import type { FloatNode, RgbaNode, Vec2Node } from 'three-shader-graph';
|
|
2
|
+
import { Vec3ExpressionNode } from 'three-shader-graph';
|
|
2
3
|
export declare const sceneMapUniformName = "hology_scene_map";
|
|
3
4
|
export declare const sceneColorSampler: import("three-shader-graph").UniformSampler2d;
|
|
4
5
|
export declare function sampleSceneColor(uv: Vec2Node): RgbaNode;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FloatNode, Vec2Node } from "three-shader-graph";
|
|
1
|
+
import type { FloatNode, Vec2Node } from "three-shader-graph";
|
|
2
2
|
export declare function rectangleFloat(uv: Vec2Node, width: FloatNode, height: FloatNode): FloatNode;
|
|
3
3
|
export declare function roundedRectangleFloat(uv: Vec2Node, width: FloatNode, height: FloatNode, radius: FloatNode): FloatNode;
|
|
4
4
|
//# sourceMappingURL=shapes.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FloatNode, Sampler2DNode, Vec2Node } from "three-shader-graph";
|
|
1
|
+
import type { FloatNode, Sampler2DNode, Vec2Node } from "three-shader-graph";
|
|
2
2
|
export declare function flipbookUv(uv: Vec2Node, columns: number | FloatNode, rows: number | FloatNode, time: FloatNode, fps?: number | FloatNode, mode?: 'clamp' | 'loop'): Vec2Node;
|
|
3
3
|
export declare function sampleFlipbook(sampler: Sampler2DNode, uv: Vec2Node, columns: number | FloatNode, rows: number | FloatNode, time: FloatNode, fps?: number | FloatNode, mode?: 'clamp' | 'loop'): import("three-shader-graph").RgbaNode;
|
|
4
4
|
//# sourceMappingURL=texture-sequence.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FloatNode, Vec2Node } from 'three-shader-graph';
|
|
1
|
+
import type { FloatNode, Vec2Node } from 'three-shader-graph';
|
|
2
2
|
export declare const elapsedTimeUniformName = "hology_elapsed_time";
|
|
3
3
|
export declare const timeUniforms: {
|
|
4
4
|
elapsed: import("three-shader-graph").UniformFloatNode;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FloatNode, BooleanNode, IntNode, Vec2Node, Vec3Node, Vec4Node, Mat2Node, Mat3Node, Mat4Node, RgbNode, RgbaNode, Sampler2DNode } from "../shader-nodes/index.js";
|
|
1
|
+
import type { FloatNode, BooleanNode, IntNode, Vec2Node, Vec3Node, Vec4Node, Mat2Node, Mat3Node, Mat4Node, RgbNode, RgbaNode, Sampler2DNode } from "../shader-nodes/index.js";
|
|
2
2
|
type AbstractType<T> = abstract new (...args: unknown[]) => T;
|
|
3
3
|
type ShaderNode = FloatNode | BooleanNode | IntNode | Vec2Node | Vec3Node | Vec4Node | Mat2Node | Mat3Node | Mat4Node | RgbNode | RgbaNode | Sampler2DNode;
|
|
4
4
|
/**
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{describe as o,expect as e,it as t}from"vitest";import{Vector3 as n}from"three";import{constrainRootMotionTargetApproach as r}from"../gameplay/actors/builtin/components/character/root-motion-constraint.js";o("constrainRootMotionTargetApproach",()=>{t("stops approaching at the minimum target distance",()=>{const o=new n(0,0,2);r(o,new n(0,0,0),new n(0,0,1.5),.9),e(o.x).toBeCloseTo(0),e(o.z).toBeCloseTo(.6)}),t("preserves lateral and vertical motion while clamping approach",()=>{const o=new n(.75,.4,1);r(o,new n(0,0,0),new n(0,0,1.2),.9),e(o.x).toBeCloseTo(.75),e(o.y).toBeCloseTo(.4),e(o.z).toBeCloseTo(.3)}),t("preserves retreating motion when already inside the minimum distance",()=>{const o=new n(0,0,-.5);r(o,new n(0,0,0),new n(0,0,.5),.9),e(o.z).toBeCloseTo(-.5)})});/*
|
|
2
|
+
* Copyright (©) 2026 Hology Interactive AB. All rights reserved.
|
|
3
|
+
* See the LICENSE.md file for details.
|
|
4
|
+
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{describe as e,expect as t,it as o}from"vitest";import{DataTexture as a,Material as r,MeshStandardMaterial as n,RGBAFormat as s,SpriteMaterial as i,Vector4 as l}from"three";import{batchingUniformVec4 as d,float as h,NodeShaderMaterial as p,rgb as u,rgba as m,standardMaterial as c,translateX as f,uniformFloat as v,uniformVec4 as S,uniformSampler2d as g,varyingAttributes as w,vec3 as x,vec4 as y}from"three-shader-graph";import{createNodeMaterialSignature as C,markMaterialUniformValuesNeedUpdate as B,NodeMaterialWebGpuResolver as M,setMaterialUniformValuesAutoUpdate as T,withThreeDefaultVertexAttributeValues as W}from"../rendering/node-material-webgpu-resolver.js";import{LandscapeCompositeShader as L}from"../shader/builtin/landscape-composite-shader.js";import{DecalUnlitShader as b}from"../shader/builtin/decal-unlit-shader.js";import{getSpritePosition as _}from"../shader/sprite-shader.js";import{depthNormal as G,depthWorldPosition as A,fragmentLinearEyeDepth as U,sampleSceneDepth as V,screenUV as j}from"../shader-nodes/depth.js";import{sampleSceneColor as E}from"../shader-nodes/scene-sample.js";import{applyDithering as F}from"../shader-nodes/dither.js";import{parallaxOcclusionMapping as O}from"../shader-nodes/pom.js";import{elapsedTimeUniformName as q}from"../shader-nodes/time.js";import{Trail as I}from"../effects/vfx/trail-renderer.js";import{particleUniforms as D}from"../shader-nodes/particle.js";class P extends r{set uniformValuesNeedsUpdate(e){e&&this.uniformValuesAutoVersion++}constructor(e){super(),this.disposed=!1,this.uniformValuesAutoUpdate=!0,this.uniformValuesAutoVersion=0,this.vertexShader=e.vertexShader,this.fragmentShader=e.fragmentShader,this.depthVertexShader=e.depthVertexShader??null,this.depthFragmentShader=e.depthFragmentShader??null,this.pointShadowVertexShader=e.pointShadowVertexShader??null,this.pointShadowFragmentShader=e.pointShadowFragmentShader??null,this.uniforms=e.uniforms,this.sceneTextures=e.sceneTextures??{},this.graphTextures=e.graphTextures??{},this.vertexAttributes=e.vertexAttributes??[],this.transparent=e.transparent??!1,this.alphaTest=e.alphaTest??0,this.depthTest=e.depthTest??!0,this.depthWrite=e.depthWrite??!0,this.side=e.side??this.side}dispose(){this.disposed=!0,super.dispose()}}e("NodeMaterialWebGpuResolver",()=>{o("compiles decal surface rejection without undefined WGSL expressions",()=>{const e=(new b).build(),o=new M({WGSLShaderMaterial:P}).resolve(e);t(o?.fragmentShader).not.toContain("undefined"),t(o?.fragmentShader).toContain("hology_scene_mapTexture")}),o("recompiles an opaque variant when receiveDecals changes",()=>{const e=new p({color:m(16777215)});e.userData.receiveDecals=!0;const o=new M({WGSLShaderMaterial:P},e=>[m(16777215,!1===e.userData.receiveDecals?0:2)]),a=o.resolve(e,"opaque");e.userData.receiveDecals=!1,e.needsUpdate=!0;const r=o.resolve(e,"opaque");t(r).not.toBe(a),t(a.disposed).toBe(!0),t(a.fragmentShader).not.toBe(r.fragmentShader)}),o("maps Hology elapsed time to the renderer frame clock",()=>{const e=v(q),o=new p({color:m(x(e)),transform:f(e)}),a=new M({WGSLShaderMaterial:P}).resolve(o);t(a?.vertexShader).toContain("rendererElapsedTime()"),t(a?.fragmentShader).toContain("rendererElapsedTime()"),t(a?.depthVertexShader).toContain("rendererElapsedTime()"),t(a?.pointShadowVertexShader).toContain("rendererElapsedTime()"),t(a?.uniforms).not.toHaveProperty(q)}),o("compiles the native sprite billboard position without a GLSL fallback",()=>{const e=new p({color:m(16777215),position:_(v("rotation",.25),v("screenSpaceSize",0),v("lockYAxis",1))}),o=new M({WGSLShaderMaterial:P}).resolve(e);t(o).toBeInstanceOf(P),t(o?.vertexShader).toContain("cos("),t(o?.vertexShader).toContain("sin("),t(o?.vertexShader).toContain("materialUniforms.lockYAxis"),t(o?.vertexShader).not.toContain("customFunction_")}),o("uses the per-instance rotation attribute for instanced sprites",()=>{const e=new p({color:m(16777215),position:_(v("rotation",0),void 0,void 0,!0)}),o=new M({WGSLShaderMaterial:P}).resolve(e);t(o?.vertexAttributes).toEqual(t.arrayContaining([t.objectContaining({name:"rotation",format:"float32",stepMode:"instance"})])),t(o?.vertexShader).toContain("input.rotation"),t(o?.vertexShader).not.toContain("materialUniforms.rotation")}),o("uses per-instance particle opacity in WebGPU fragment shaders",()=>{const e=new p({color:m(u(16777215),D.opacity)}),o=new M({WGSLShaderMaterial:P}).resolve(e);t(o?.vertexAttributes).toEqual(t.arrayContaining([t.objectContaining({name:"particleData",format:"float32x3",stepMode:"instance"})])),t(o?.fragmentShader).toContain(".x"),t(o?.fragmentShader).toContain("> 0.5")}),o("maps THREE.SpriteMaterial to the native sprite shader",()=>{const e=new a(new Uint8Array([255,255,255,255]),1,1,s),o=new i({map:e,color:8429760,opacity:.6,rotation:.25,sizeAttenuation:!1,alphaTest:.2,transparent:!0}),r=new M({WGSLShaderMaterial:P}),n=r.resolve(o);t(n).toBeInstanceOf(P),t(n?.vertexShader).toContain("materialUniforms.rotation"),t(n?.vertexShader).toContain("materialUniforms.screenSpaceSize"),t(n?.fragmentShader).toContain("textureSample("),t(n?.alphaTest).toBe(.2),t(n?.transparent).toBe(!0),t(n?.uniforms.rotation.value).toBe(.25),t(n?.uniforms.screenSpaceSize.value).toBe(1),o.rotation=.75;const l=r.resolve(o);t(l).toBe(n),t(l?.uniforms.rotation.value).toBe(.75)}),o("memoizes node-material signatures for repeated lookups",()=>{const e=["version","vertexShader","fragmentShader","alphaTest","alphaToCoverage","blending","colorWrite","depthFunc","depthTest","depthWrite","polygonOffset","polygonOffsetFactor","polygonOffsetUnits","premultipliedAlpha","side","stencilWrite","transparent"],o=new Map([["version",1],["vertexShader","#vertex"],["fragmentShader","#fragment"],["alphaTest",0],["alphaToCoverage",!1],["blending",1],["colorWrite",!0],["depthFunc",3],["depthTest",!0],["depthWrite",!0],["polygonOffset",!1],["polygonOffsetFactor",0],["polygonOffsetUnits",0],["premultipliedAlpha",!1],["side",0],["stencilWrite",!1],["transparent",!1]]);let a=0;const r=new Proxy({},{get:(t,r)=>"string"==typeof r&&e.includes(r)?(a+=1,o.get(r)):Reflect.get(t,r)});C(r),C(r),t(a).toBe(e.length)}),o("adapts a NodeShaderMaterial without replacing its scene material",()=>{const e=v("intensity",.75),o=new p({color:c({color:u(5210052).multiplyScalar(e),roughness:.42,metalness:.18}),transparent:!0,alphaTest:.25}),a=new M({WGSLShaderMaterial:P}),r=a.resolve(o);t(r).toBeInstanceOf(P),t(r).not.toBe(o),t(r?.transparent).toBe(!0),t(r?.alphaTest).toBe(.25),t(r?.fragmentShader).toContain("rendererPointLightForLight"),t(o.isShaderMaterial).toBe(!0),e.value=.25,t(a.resolve(o)).toBe(r),t(r?.uniforms.intensity?.value).toBe(.25)}),o("syncs direct NodeShaderMaterial uniform mutations to the resolved material",()=>{const e=S("trailTint",new l(0,0,0,0)),o=v("hology_particle_energy",1),a=new p({color:e.multiplyScalar(o)}),r=new M({WGSLShaderMaterial:P});a.uniforms.trailTint.value=new l(1,.25,.5,.75),a.uniforms.hology_particle_energy.value=.4;const n=r.resolve(a);t(n?.uniforms.trailTint.value).toEqual(new l(1,.25,.5,.75)),t(n?.uniforms.hology_particle_energy.value).toBe(.4),a.uniforms.trailTint.value.set(.2,.4,.6,.8),a.uniforms.hology_particle_energy.value=.1,t(r.resolve(a)).toBe(n),t(n?.uniforms.trailTint.value).toEqual(new l(.2,.4,.6,.8)),t(n?.uniforms.hology_particle_energy.value).toBe(.1)}),o("only syncs explicitly invalidated uniforms when auto update is disabled",()=>{const e=v("intensity",.75),o=new p({color:m(x(e))});o.uniformValuesAutoUpdate=!1;const a=new M({WGSLShaderMaterial:P}),r=a.resolve(o),n=r.uniformValuesAutoVersion;e.value=.25,t(a.resolve(o)).toBe(r),t(r?.uniforms.intensity.value).toBe(.75),t(r?.uniformValuesAutoVersion).toBe(n),o.uniformValuesNeedsUpdate=!0,t(a.resolve(o)).toBe(r),t(r?.uniforms.intensity.value).toBe(.25),t(r?.uniformValuesAutoVersion).toBe(n+1)}),o("supports explicit invalidation for mapped Three.js materials",()=>{const e=new n({roughness:.8});T(e,!1);const o=new M({WGSLShaderMaterial:P}),a=o.resolve(e);e.roughness=.2,t(o.resolve(e)).toBe(a),t(a?.uniforms.roughness.value).toBe(.8),B(e),t(o.resolve(e)).toBe(a),t(a?.uniforms.roughness.value).toBe(.2)}),o("binds uniforms referenced only by an MRT material output",()=>{const e=v("roughness",.7),o=new p({color:m(5601177),alphaTest:.1});o.outputRoughness=e;const a=new M({WGSLShaderMaterial:P},e=>[e.outputColor,y(x(0,0,1),e.outputRoughness)]).resolve(o);t(a?.fragmentShader).toContain("materialUniforms.roughness"),t(a?.fragmentShader).not.toContain("graphColor"),t(a?.fragmentShader).toMatch(/if \(.+ < 0\.1\) \{ discard; \}/),t(a?.uniforms.roughness?.value).toBe(.7)}),o("compiles a landscape composite built from node material semantic outputs",()=>{const e=new M({WGSLShaderMaterial:P}),o=new p({color:c({color:u(5147450),roughness:.82,metalness:0})}),a=new p({color:c({color:u(7432286),roughness:.6,metalness:.05})}),r=new L;r.layers=[o,a];const n=e.resolve(r.build());t(n).toBeInstanceOf(P),t(n?.fragmentShader).toContain("rendererDirectionalLightForLight"),t(n?.vertexShader).toContain("@location(6) material: vec4<f32>"),t(n?.vertexShader).toContain("@location(8) hole: f32")}),o("allocates the trail's authored vertex attributes",()=>{const e=new M({WGSLShaderMaterial:P}).resolve(I.createBaseMaterial());t(e).toBeInstanceOf(P),t(e?.vertexAttributes).toEqual(t.arrayContaining([t.objectContaining({name:"nodeID",shaderLocation:6,format:"float32"}),t.objectContaining({name:"nodeCenter",shaderLocation:7,format:"float32x3"})]))}),o("uses Three's default value when a geometry has no uv1 attribute",()=>{const e=W([{name:"uv1",shaderLocation:6,format:"float32x2"},{name:"custom",shaderLocation:7,format:"float32"}]);t(e).toEqual(t.arrayContaining([t.objectContaining({name:"uv1",defaultValue:[0,0]}),t.objectContaining({name:"custom"})])),t(e[1]).not.toHaveProperty("defaultValue")}),o("compiles the foliage transform and named texture-uniform pattern",()=>{const e=new M({WGSLShaderMaterial:P}),o=new a(new Uint8Array([255,255,255,255]),1,1,s),r=new p({color:g("map").sample(w.uv),transform:f(v("windOffset",.25)),uniforms:{map:{value:o}},alphaTest:.5}),n=e.resolve(r);t(n).toBeInstanceOf(P),t(n?.vertexShader).toContain("rendererClipPosition(_ng_localPosition"),t(n?.depthVertexShader).toContain("materialUniforms.windOffset"),t(n?.depthFragmentShader).toContain("textureSample("),t(n?.depthFragmentShader).toContain("< 0.5) { discard;"),t(n?.pointShadowFragmentShader).toContain("distanceToLight")}),o("rebuilds cached materials when scene-local texture bindings change",()=>{const e=new M({WGSLShaderMaterial:P}),o=new a(new Uint8Array([255,255,255,255]),1,1,s),r=new a(new Uint8Array([32,64,128,255]),1,1,s),n=new p({color:g("map").sample(w.uv),uniforms:{map:{value:o}},alphaTest:.5}),i=e.resolve(n);n.uniforms.map.value=r;const l=e.resolve(n);t(l).not.toBe(i),t(i.disposed).toBe(!0),n.dispose();const d=e.resolve(n);t(d).not.toBe(l),t(l.disposed).toBe(!0)}),o("uses the renderer batch id without Three’s batchingIdTexture",()=>{const e=new M({WGSLShaderMaterial:P}),o=new a(new Uint8Array([255,96,24,255]),1,1,s),r=new p({color:m(d("vp0")),uniforms:{vp0:{value:o}}}),n=e.resolve(r);t(n).toBeInstanceOf(P),t(n?.vertexShader).toContain("rendererBatchingId(input.instanceIndex)")}),o("compiles depth nodes that use fragment-coordinate expressions",()=>{const e=new M({WGSLShaderMaterial:P}),o=new p({color:m(x(j.x,j.y,U))}),a=e.resolve(o);t(a).toBeInstanceOf(P),t(a?.fragmentShader).toContain("input.position.xy"),t(a?.fragmentShader).toContain("input.position.z"),t(a?.fragmentShader).toContain("rendererCamera.viewportAndTime.xy"),t(a?.fragmentShader).not.toContain("gl_FragCoord")}),o("maps scene color and depth nodes to renderer-owned textures",()=>{const e=new M({WGSLShaderMaterial:P}),o=new p({color:E(j).multiplyScalar(V(j))}),a=e.resolve(o);t(a.sceneTextures).toEqual({hology_scene_map:"sceneColor",hology_depth_map:"sceneDepth"}),t(a.graphTextures).toEqual({}),t(a.fragmentShader).toContain("hology_scene_mapTexture"),t(a.fragmentShader).toContain("hology_depth_mapTexture"),t(a.fragmentShader).toContain("vec4<f32>(textureSample(hology_depth_mapTexture")}),o("caches distinct material variants for opaque and late draw stages",()=>{const e=new M({WGSLShaderMaterial:P},(e,t)=>"opaque"===t?[m(x(1)),m(x(0))]:void 0),o=new p({color:m(x(1))}),a=e.resolve(o,"opaque"),r=e.resolve(o,"late");t(a).not.toBe(r),t(e.resolve(o,"opaque")).toBe(a),t(e.resolve(o,"late")).toBe(r),t(a?.fragmentShader).toContain("@location(1)"),t(r?.fragmentShader).not.toContain("@location(1)")}),o("reconstructs WebGPU depth positions with inverted NDC Y",()=>{const e=new M({WGSLShaderMaterial:P}),o=new p({color:m(A.add(G.multiplyScalar(0)))}),a=e.resolve(o);t(a.fragmentShader).toContain("vec2<f32>(2.0, -2.0)"),t(a.fragmentShader).toMatch(/-\(float_op_\d+\)/)}),o("emits dither and parallax nodes without GLSL custom functions",()=>{const e=new M({WGSLShaderMaterial:P}),o=new a(new Uint8Array([128,128,128,255]),1,1,s),r=O(w.uv,g("heightMap",o),h(.03)),n=new p({color:y(r.x,r.y,F(x(.2,.4,.8)).z,1)}),i=e.resolve(n);t(i).toBeInstanceOf(P),t(i?.fragmentShader).toContain("textureSampleLevel(heightMapTexture, heightMapSampler"),t(i?.fragmentShader).toMatch(/= -dpdy\(-pom_\d+ViewPosition\)/),t(i?.fragmentShader).toMatch(/= -dpdy\(pom_\d+Uv\)/),t(i?.fragmentShader).not.toContain("customFunction_"),t(i?.fragmentShader).not.toContain("gl_FragCoord")}),o("inherits, updates, and clears the WebGPU world environment",()=>{const e=new a(new Uint8Array([255,255,255,255]),1,1,s),o=new p({color:c({color:u(8421504),roughness:.5,metalness:.1})}),r=new M({WGSLShaderMaterial:P});r.setWorldEnvironment({texture:e,intensity:.75});const n=r.resolve(o);t(n.fragmentShader).toContain("envMapTexture"),t(n.uniforms.envMapIntensity?.value).toBe(.75),t(o.envMap).toBeUndefined(),r.setWorldEnvironment({texture:e,intensity:.25});const i=r.resolve(o);t(i).toBe(n),t(i.uniforms.envMapIntensity?.value).toBe(.25),r.setWorldEnvironment(null);const l=r.resolve(o);t(l).not.toBe(n),t(n.disposed).toBe(!0),t(l.fragmentShader).not.toContain("envMapTexture")}),o("keeps an authored material environment ahead of the world environment",()=>{const e=new a(new Uint8Array([255,255,255,255]),1,1,s),o=new a(new Uint8Array([64,96,128,255]),1,1,s),r=new p({color:c({color:u(8421504),roughness:.5,metalness:.1}),envMap:o}),n=new M({WGSLShaderMaterial:P});n.setWorldEnvironment({texture:e,intensity:.2}),n.resolve(r),t(r.uniforms.envMap.value).toBe(o),t(r.envMap).toBe(o)})});/*
|
|
1
|
+
import{describe as e,expect as t,it as o}from"vitest";import{DataTexture as a,Material as r,MeshStandardMaterial as n,RGBAFormat as s,SpriteMaterial as i,Vector4 as l}from"three";import{batchingUniformVec4 as d,float as h,NodeShaderMaterial as p,rgb as u,rgba as m,standardMaterial as c,translateX as f,uniformFloat as v,uniformVec4 as S,uniformSampler2d as g,varyingAttributes as w,vec3 as x,vec4 as y}from"three-shader-graph";import{createNodeMaterialSignature as C,markMaterialUniformValuesNeedUpdate as B,NodeMaterialWebGpuResolver as M,setMaterialUniformValuesAutoUpdate as T,withThreeDefaultVertexAttributeValues as W}from"../rendering/node-material-webgpu-resolver.js";import{LandscapeCompositeShader as L}from"../shader/builtin/landscape-composite-shader.js";import{DecalUnlitShader as b}from"../shader/builtin/decal-unlit-shader.js";import{getSpritePosition as _}from"../shader/sprite-shader.js";import{depthNormal as G,depthWorldPosition as U,fragmentLinearEyeDepth as A,sampleSceneDepth as V,screenUV as j}from"../shader-nodes/depth.js";import{sampleSceneColor as E}from"../shader-nodes/scene-sample.js";import{applyDithering as F}from"../shader-nodes/dither.js";import{parallaxOcclusionMapping as O}from"../shader-nodes/pom.js";import{elapsedTimeUniformName as q}from"../shader-nodes/time.js";import{Trail as I}from"../effects/vfx/trail-renderer.js";import{particleUniforms as D}from"../shader-nodes/particle.js";class P extends r{set uniformValuesNeedsUpdate(e){e&&this.uniformValuesAutoVersion++}constructor(e){super(),this.disposed=!1,this.uniformValuesAutoUpdate=!0,this.uniformValuesAutoVersion=0,this.vertexShader=e.vertexShader,this.fragmentShader=e.fragmentShader,this.depthVertexShader=e.depthVertexShader??null,this.depthFragmentShader=e.depthFragmentShader??null,this.pointShadowVertexShader=e.pointShadowVertexShader??null,this.pointShadowFragmentShader=e.pointShadowFragmentShader??null,this.uniforms=e.uniforms,this.sceneTextures=e.sceneTextures??{},this.graphTextures=e.graphTextures??{},this.vertexAttributes=e.vertexAttributes??[],this.transparent=e.transparent??!1,this.alphaTest=e.alphaTest??0,this.depthTest=e.depthTest??!0,this.depthWrite=e.depthWrite??!0,this.side=e.side??this.side}dispose(){this.disposed=!0,super.dispose()}}e("NodeMaterialWebGpuResolver",()=>{o("compiles decal surface rejection without undefined WGSL expressions",()=>{const e=(new b).build(),o=new M({WGSLShaderMaterial:P}).resolve(e);t(o?.fragmentShader).not.toContain("undefined"),t(o?.fragmentShader).toContain("hology_scene_mapTexture")}),o("recompiles an opaque variant when receiveDecals changes",()=>{const e=new p({color:m(16777215)});e.userData.receiveDecals=!0;const o=new M({WGSLShaderMaterial:P},e=>[m(16777215,!1===e.userData.receiveDecals?0:2)]),a=o.resolve(e,"opaque");e.userData.receiveDecals=!1,e.needsUpdate=!0;const r=o.resolve(e,"opaque");t(r).not.toBe(a),t(a.disposed).toBe(!0),t(a.fragmentShader).not.toBe(r.fragmentShader)}),o("maps Hology elapsed time to the renderer frame clock",()=>{const e=v(q),o=new p({color:m(x(e)),transform:f(e)}),a=new M({WGSLShaderMaterial:P}).resolve(o);t(a?.vertexShader).toContain("rendererElapsedTime()"),t(a?.fragmentShader).toContain("rendererElapsedTime()"),t(a?.depthVertexShader).toContain("rendererElapsedTime()"),t(a?.pointShadowVertexShader).toContain("rendererElapsedTime()"),t(a?.uniforms).not.toHaveProperty(q)}),o("compiles the native sprite billboard position without a GLSL fallback",()=>{const e=new p({color:m(16777215),position:_(v("rotation",.25),v("screenSpaceSize",0),v("lockYAxis",1))}),o=new M({WGSLShaderMaterial:P}).resolve(e);t(o).toBeInstanceOf(P),t(o?.vertexShader).toContain("cos("),t(o?.vertexShader).toContain("sin("),t(o?.vertexShader).toContain("materialUniforms.lockYAxis"),t(o?.vertexShader).not.toContain("customFunction_")}),o("uses the per-instance rotation attribute for instanced sprites",()=>{const e=new p({color:m(16777215),position:_(v("rotation",0),void 0,void 0,!0)}),o=new M({WGSLShaderMaterial:P}).resolve(e);t(o?.vertexAttributes).toEqual(t.arrayContaining([t.objectContaining({name:"rotation",format:"float32",stepMode:"instance"})])),t(o?.vertexShader).toContain("input.rotation"),t(o?.vertexShader).not.toContain("materialUniforms.rotation")}),o("uses per-instance particle opacity in WebGPU fragment shaders",()=>{const e=new p({color:m(u(16777215),D.opacity)}),o=new M({WGSLShaderMaterial:P}).resolve(e);t(o?.vertexAttributes).toEqual(t.arrayContaining([t.objectContaining({name:"particleData",format:"float32x3",stepMode:"instance"})])),t(o?.fragmentShader).toContain(".x"),t(o?.fragmentShader).toContain("> 0.5")}),o("maps THREE.SpriteMaterial to the native sprite shader",()=>{const e=new a(new Uint8Array([255,255,255,255]),1,1,s),o=new i({map:e,color:8429760,opacity:.6,rotation:.25,sizeAttenuation:!1,alphaTest:.2,transparent:!0}),r=new M({WGSLShaderMaterial:P}),n=r.resolve(o);t(n).toBeInstanceOf(P),t(n?.vertexShader).toContain("materialUniforms.rotation"),t(n?.vertexShader).toContain("materialUniforms.screenSpaceSize"),t(n?.fragmentShader).toContain("textureSample("),t(n?.alphaTest).toBe(.2),t(n?.transparent).toBe(!0),t(n?.uniforms.rotation.value).toBe(.25),t(n?.uniforms.screenSpaceSize.value).toBe(1),o.rotation=.75;const l=r.resolve(o);t(l).toBe(n),t(l?.uniforms.rotation.value).toBe(.75)}),o("memoizes node-material signatures for repeated lookups",()=>{const e=["version","vertexShader","fragmentShader","alphaTest","alphaToCoverage","blending","colorWrite","depthFunc","depthTest","depthWrite","polygonOffset","polygonOffsetFactor","polygonOffsetUnits","premultipliedAlpha","side","stencilWrite","transparent"],o=new Map([["version",1],["vertexShader","#vertex"],["fragmentShader","#fragment"],["alphaTest",0],["alphaToCoverage",!1],["blending",1],["colorWrite",!0],["depthFunc",3],["depthTest",!0],["depthWrite",!0],["polygonOffset",!1],["polygonOffsetFactor",0],["polygonOffsetUnits",0],["premultipliedAlpha",!1],["side",0],["stencilWrite",!1],["transparent",!1]]);let a=0;const r=new Proxy({},{get:(t,r)=>"string"==typeof r&&e.includes(r)?(a+=1,o.get(r)):Reflect.get(t,r)});C(r),C(r),t(a).toBe(e.length)}),o("adapts a NodeShaderMaterial without replacing its scene material",()=>{const e=v("intensity",.75),o=new p({color:c({color:u(5210052).multiplyScalar(e),roughness:.42,metalness:.18}),transparent:!0,alphaTest:.25}),a=new M({WGSLShaderMaterial:P}),r=a.resolve(o);t(r).toBeInstanceOf(P),t(r).not.toBe(o),t(r?.transparent).toBe(!0),t(r?.alphaTest).toBe(.25),t(r?.fragmentShader).toContain("rendererPointLightForLight"),t(o.isShaderMaterial).toBe(!0),e.value=.25,t(a.resolve(o)).toBe(r),t(r?.uniforms.intensity?.value).toBe(.25)}),o("syncs direct NodeShaderMaterial uniform mutations to the resolved material",()=>{const e=S("trailTint",new l(0,0,0,0)),o=v("hology_particle_energy",1),a=new p({color:e.multiplyScalar(o)}),r=new M({WGSLShaderMaterial:P});a.uniforms.trailTint.value=new l(1,.25,.5,.75),a.uniforms.hology_particle_energy.value=.4;const n=r.resolve(a);t(n?.uniforms.trailTint.value).toEqual(new l(1,.25,.5,.75)),t(n?.uniforms.hology_particle_energy.value).toBe(.4),a.uniforms.trailTint.value.set(.2,.4,.6,.8),a.uniforms.hology_particle_energy.value=.1,t(r.resolve(a)).toBe(n),t(n?.uniforms.trailTint.value).toEqual(new l(.2,.4,.6,.8)),t(n?.uniforms.hology_particle_energy.value).toBe(.1)}),o("only syncs explicitly invalidated uniforms when auto update is disabled",()=>{const e=v("intensity",.75),o=new p({color:m(x(e))});o.uniformValuesAutoUpdate=!1;const a=new M({WGSLShaderMaterial:P}),r=a.resolve(o),n=r.uniformValuesAutoVersion;e.value=.25,t(a.resolve(o)).toBe(r),t(r?.uniforms.intensity.value).toBe(.75),t(r?.uniformValuesAutoVersion).toBe(n),o.uniformValuesNeedsUpdate=!0,t(a.resolve(o)).toBe(r),t(r?.uniforms.intensity.value).toBe(.25),t(r?.uniformValuesAutoVersion).toBe(n+1)}),o("supports explicit invalidation for mapped Three.js materials",()=>{const e=new n({roughness:.8});T(e,!1);const o=new M({WGSLShaderMaterial:P}),a=o.resolve(e);e.roughness=.2,t(o.resolve(e)).toBe(a),t(a?.uniforms.roughness.value).toBe(.8),B(e),t(o.resolve(e)).toBe(a),t(a?.uniforms.roughness.value).toBe(.2)}),o("binds uniforms referenced only by an MRT material output",()=>{const e=v("roughness",.7),o=new p({color:m(5601177),alphaTest:.1});o.outputRoughness=e;const a=new M({WGSLShaderMaterial:P},e=>[e.outputColor,y(x(0,0,1),e.outputRoughness)]).resolve(o);t(a?.fragmentShader).toContain("materialUniforms.roughness"),t(a?.fragmentShader).not.toContain("graphColor"),t(a?.fragmentShader).toMatch(/if \(.+ < 0\.1\) \{ discard; \}/),t(a?.uniforms.roughness?.value).toBe(.7)}),o("compiles a landscape composite built from node material semantic outputs",()=>{const e=new M({WGSLShaderMaterial:P}),o=new p({color:c({color:u(5147450),roughness:.82,metalness:0})}),a=new p({color:c({color:u(7432286),roughness:.6,metalness:.05})}),r=new L;r.layers=[o,a];const n=e.resolve(r.build());t(n).toBeInstanceOf(P),t(n?.fragmentShader).toContain("rendererDirectionalLightForLight"),t(n?.vertexShader).toContain("@location(6) material: vec4<f32>"),t(n?.vertexShader).toContain("@location(8) hole: f32")}),o("allocates the trail's authored vertex attributes",()=>{const e=new M({WGSLShaderMaterial:P}).resolve(I.createBaseMaterial());t(e).toBeInstanceOf(P),t(e?.vertexAttributes).toEqual(t.arrayContaining([t.objectContaining({name:"nodeID",shaderLocation:6,format:"float32"}),t.objectContaining({name:"nodeCenter",shaderLocation:7,format:"float32x3"})]))}),o("uses Three's default value when a geometry has no uv1 attribute",()=>{const e=W([{name:"uv1",shaderLocation:6,format:"float32x2"},{name:"custom",shaderLocation:7,format:"float32"}]);t(e).toEqual(t.arrayContaining([t.objectContaining({name:"uv1",defaultValue:[0,0]}),t.objectContaining({name:"custom"})])),t(e[1]).not.toHaveProperty("defaultValue")}),o("compiles the foliage transform and named texture-uniform pattern",()=>{const e=new M({WGSLShaderMaterial:P}),o=new a(new Uint8Array([255,255,255,255]),1,1,s),r=new p({color:g("map").sample(w.uv),transform:f(v("windOffset",.25)),uniforms:{map:{value:o}},alphaTest:.5}),n=e.resolve(r);t(n).toBeInstanceOf(P),t(n?.vertexShader).toContain("rendererClipPosition(_ng_localPosition"),t(n?.depthVertexShader).toContain("materialUniforms.windOffset"),t(n?.depthFragmentShader).toContain("textureSample("),t(n?.depthFragmentShader).toContain("< 0.5) { discard;"),t(n?.pointShadowFragmentShader).toContain("distanceToLight")}),o("rebuilds cached materials when scene-local texture bindings change",()=>{const e=new M({WGSLShaderMaterial:P}),o=new a(new Uint8Array([255,255,255,255]),1,1,s),r=new a(new Uint8Array([32,64,128,255]),1,1,s),n=new p({color:g("map").sample(w.uv),uniforms:{map:{value:o}},alphaTest:.5}),i=e.resolve(n);n.uniforms.map.value=r;const l=e.resolve(n);t(l).not.toBe(i),t(i.disposed).toBe(!0),n.dispose();const d=e.resolve(n);t(d).not.toBe(l),t(l.disposed).toBe(!0)}),o("uses the renderer batch id without Three’s batchingIdTexture",()=>{const e=new M({WGSLShaderMaterial:P}),o=new a(new Uint8Array([255,96,24,255]),1,1,s),r=new p({color:m(d("vp0")),uniforms:{vp0:{value:o}}}),n=e.resolve(r);t(n).toBeInstanceOf(P),t(n?.vertexShader).toContain("rendererBatchingId(input.instanceIndex)")}),o("compiles depth nodes that use fragment-coordinate expressions",()=>{const e=new M({WGSLShaderMaterial:P}),o=new p({color:m(x(j.x,j.y,A))}),a=e.resolve(o);t(a).toBeInstanceOf(P),t(a?.fragmentShader).toContain("input.position.xy"),t(a?.fragmentShader).toContain("input.position.z"),t(a?.fragmentShader).toContain("rendererViewportSize()"),t(a?.fragmentShader).not.toContain("gl_FragCoord")}),o("maps scene color and depth nodes to renderer-owned textures",()=>{const e=new M({WGSLShaderMaterial:P}),o=new p({color:E(j).multiplyScalar(V(j))}),a=e.resolve(o);t(a.sceneTextures).toEqual({hology_scene_map:"sceneColor",hology_depth_map:"sceneDepth"}),t(a.graphTextures).toEqual({}),t(a.fragmentShader).toContain("hology_scene_mapTexture"),t(a.fragmentShader).toContain("hology_depth_mapTexture"),t(a.fragmentShader).toContain("vec4<f32>(textureSample(hology_depth_mapTexture")}),o("caches distinct material variants for opaque and late draw stages",()=>{const e=new M({WGSLShaderMaterial:P},(e,t)=>"opaque"===t?[m(x(1)),m(x(0))]:void 0),o=new p({color:m(x(1))}),a=e.resolve(o,"opaque"),r=e.resolve(o,"late");t(a).not.toBe(r),t(e.resolve(o,"opaque")).toBe(a),t(e.resolve(o,"late")).toBe(r),t(a?.fragmentShader).toContain("@location(1)"),t(r?.fragmentShader).not.toContain("@location(1)")}),o("reconstructs WebGPU depth positions with inverted NDC Y",()=>{const e=new M({WGSLShaderMaterial:P}),o=new p({color:m(U.add(G.multiplyScalar(0)))}),a=e.resolve(o);t(a.fragmentShader).toContain("vec2<f32>(2.0, -2.0)"),t(a.fragmentShader).toMatch(/-\(float_op_\d+\)/)}),o("emits dither and parallax nodes without GLSL custom functions",()=>{const e=new M({WGSLShaderMaterial:P}),o=new a(new Uint8Array([128,128,128,255]),1,1,s),r=O(w.uv,g("heightMap",o),h(.03)),n=new p({color:y(r.x,r.y,F(x(.2,.4,.8)).z,1)}),i=e.resolve(n);t(i).toBeInstanceOf(P),t(i?.fragmentShader).toContain("textureSampleLevel(heightMapTexture, heightMapSampler"),t(i?.fragmentShader).toMatch(/= -dpdy\(-pom_\d+ViewPosition\)/),t(i?.fragmentShader).toMatch(/= -dpdy\(pom_\d+Uv\)/),t(i?.fragmentShader).not.toContain("customFunction_"),t(i?.fragmentShader).not.toContain("gl_FragCoord")}),o("inherits, updates, and clears the WebGPU world environment",()=>{const e=new a(new Uint8Array([255,255,255,255]),1,1,s),o=new p({color:c({color:u(8421504),roughness:.5,metalness:.1})}),r=new M({WGSLShaderMaterial:P});r.setWorldEnvironment({texture:e,intensity:.75});const n=r.resolve(o);t(n.fragmentShader).toContain("envMapTexture"),t(n.uniforms.envMapIntensity?.value).toBe(.75),t(o.envMap).toBeUndefined(),r.setWorldEnvironment({texture:e,intensity:.25});const i=r.resolve(o);t(i).toBe(n),t(i.uniforms.envMapIntensity?.value).toBe(.25),r.setWorldEnvironment(null);const l=r.resolve(o);t(l).not.toBe(n),t(n.disposed).toBe(!0),t(l.fragmentShader).not.toContain("envMapTexture")}),o("keeps an authored material environment ahead of the world environment",()=>{const e=new a(new Uint8Array([255,255,255,255]),1,1,s),o=new a(new Uint8Array([64,96,128,255]),1,1,s),r=new p({color:c({color:u(8421504),roughness:.5,metalness:.1}),envMap:o}),n=new M({WGSLShaderMaterial:P});n.setWorldEnvironment({texture:e,intensity:.2}),n.resolve(r),t(r.uniforms.envMap.value).toBe(o),t(r.envMap).toBe(o)})});/*
|
|
2
2
|
* Copyright (©) 2026 Hology Interactive AB. All rights reserved.
|
|
3
3
|
* See the LICENSE.md file for details.
|
|
4
4
|
*/
|
package/dist/utils/mesh.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Camera, MeshDepthMaterial, Scene, WebGLRenderTarget, WebGLRenderer } from "three";
|
|
1
|
+
import type { Camera, MeshDepthMaterial, Scene, WebGLRenderTarget, WebGLRenderer } from "three";
|
|
2
2
|
import { Pass } from "three-stdlib";
|
|
3
3
|
declare class DepthPass extends Pass {
|
|
4
4
|
private scene;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { Object3D } from 'three';
|
|
2
|
+
import { Mesh, Vector3 } from 'three';
|
|
2
3
|
type ObjectPredicate<T> = (obj: T) => boolean;
|
|
3
4
|
export declare function filterScene(scene: Object3D, predicate: ObjectPredicate<Object3D>): Object3D<import("three").Object3DEventMap, Event>[];
|
|
4
5
|
export declare function findFirstVisibleObject(scene: Object3D, predicate: ObjectPredicate<Object3D>): Object3D;
|
package/dist/worker/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{setupNavMeshWorker as r}from"../gameplay/ai/dynamic-tiled-navmesh.worker";let e;export function registerWorker(r){e=r}export function hasWorkerBuilder(){return null!=e}export function createWorker(){return e()}export function initWorker(){r()}/*
|
|
1
|
+
import{setupNavMeshWorker as r}from"../gameplay/ai/dynamic-tiled-navmesh.worker.js";let e;export function registerWorker(r){e=r}export function hasWorkerBuilder(){return null!=e}export function createWorker(){return e()}export function initWorker(){r()}/*
|
|
2
2
|
* Copyright (©) 2026 Hology Interactive AB. All rights reserved.
|
|
3
3
|
* See the LICENSE.md file for details.
|
|
4
4
|
*/
|