@hology/core 0.0.155 → 0.0.157
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/rendering.js +1 -1
- package/dist/scene/materializer.d.ts.map +1 -1
- package/dist/scene/materializer.js +1 -1
- package/dist/scene/model.d.ts +21 -0
- package/dist/scene/model.d.ts.map +1 -1
- package/dist/shader/builtin/decal-standard-shader.d.ts +5 -1
- package/dist/shader/builtin/decal-standard-shader.d.ts.map +1 -1
- package/dist/shader/builtin/decal-standard-shader.js +1 -1
- package/dist/shader/builtin/decal-unlit-shader.d.ts +3 -1
- package/dist/shader/builtin/decal-unlit-shader.d.ts.map +1 -1
- package/dist/shader/builtin/decal-unlit-shader.js +1 -1
- package/dist/shader/builtin/toon-shader.d.ts +6 -1
- package/dist/shader/builtin/toon-shader.d.ts.map +1 -1
- package/dist/shader/builtin/toon-shader.js +1 -1
- package/dist/shader-nodes/curve-sample.d.ts +1 -2
- package/dist/shader-nodes/curve-sample.d.ts.map +1 -1
- package/dist/shader-nodes/curve-sample.js +1 -1
- package/package.json +1 -1
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decal-unlit-shader.d.ts","sourceRoot":"","sources":["../../../src/shader/builtin/decal-unlit-shader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiD,KAAK,EAAE,QAAQ,EAA2D,OAAO,
|
|
1
|
+
{"version":3,"file":"decal-unlit-shader.d.ts","sourceRoot":"","sources":["../../../src/shader/builtin/decal-unlit-shader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiD,KAAK,EAAE,QAAQ,EAA2D,OAAO,EAAE,OAAO,EAAY,MAAM,OAAO,CAAC;AAI5K,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAKrD,qBAAa,gBAAiB,SAAQ,eAAe;IACtC,KAAK,EAAE,KAAK,CAAwB;IACtB,OAAO,EAAE,MAAM,CAAI;IAClB,SAAS,EAAE,MAAM,CAAI;IACpC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,OAAO,CAAmB;IACR,SAAS,EAAE,MAAM,CAAI;IAE/D,MAAM;;;IA4BN,KAAK;CAUN"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{__decorate as t,__metadata as e}from"tslib";import{Color as
|
|
1
|
+
import{__decorate as t,__metadata as e}from"tslib";import{Color as i,Texture as a,Vector2 as r,BackSide as o}from"three";import{Parameter as l}from"../parameter.js";import{DecalNodeShader as s}from"../decal-shader.js";import{rgb as p,rgba as n,textureSampler2d as d,float as h,AttributeVec3Node as c,varying as m,ifDefApply as y,Vec3ExpressionNode as u}from"three-shader-graph";import{decalAlpha as S,decalUV as g}from"../../shader-nodes/decal.js";import{tileUv as D}from"./decal-standard-shader";export class DecalUnlitShader extends s{constructor(){super(...arguments),this.color=new i("#FFFFFF"),this.opacity=1,this.intensity=1,this.atlasSize=new r(1,1),this.atlasTile=1}output(){let t=D(g,this.atlasSize,this.atlasTile);const e=m(new c("particleData"));let i=y("IS_PARTICLE",h(this.opacity),()=>e.x);null!=this.alphaMap&&(i=i.multiply(d(this.alphaMap).sample(t).r)),i=i.multiply(S);const a=m(y("IS_PARTICLE",p(this.color),()=>new u("instanceColor")));let r=y("IS_PARTICLE",p(this.color),()=>a.rgb),o=n(r,i);return null!=this.colorMap&&(o=o.multiply(d(this.colorMap).sample(t))),o=n(o.rgb.multiplyScalar(this.intensity),o.a),{color:o}}build(){const t=super.build();return t.depthTest=!0,t.depthWrite=!1,t.userData.isDecal=!0,t.side=o,t}}t([l(),e("design:type",i)],DecalUnlitShader.prototype,"color",void 0),t([l({range:[0,1]}),e("design:type",Number)],DecalUnlitShader.prototype,"opacity",void 0),t([l({range:[0,10]}),e("design:type",Number)],DecalUnlitShader.prototype,"intensity",void 0),t([l(),e("design:type",a)],DecalUnlitShader.prototype,"colorMap",void 0),t([l(),e("design:type",a)],DecalUnlitShader.prototype,"alphaMap",void 0),t([l(),e("design:type",r)],DecalUnlitShader.prototype,"atlasSize",void 0),t([l({range:[1,64],precision:0}),e("design:type",Number)],DecalUnlitShader.prototype,"atlasTile",void 0);/*
|
|
2
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
|
-
import { Color, Material, Texture } from 'three';
|
|
1
|
+
import { Color, Material, Texture, Vector2 } from 'three';
|
|
2
2
|
import { Shader } from '../shader.js';
|
|
3
3
|
export declare class ToonShader extends Shader {
|
|
4
4
|
color: Color;
|
|
@@ -8,9 +8,14 @@ export declare class ToonShader extends Shader {
|
|
|
8
8
|
lightSteps: number[];
|
|
9
9
|
lightMap?: Texture;
|
|
10
10
|
lightMapIntensity?: number;
|
|
11
|
+
normalMap?: Texture;
|
|
12
|
+
normalScale?: Vector2;
|
|
11
13
|
aoMap?: Texture;
|
|
12
14
|
aoMapIntensity?: number;
|
|
13
15
|
alphaMap?: Texture;
|
|
16
|
+
emissive?: Color;
|
|
17
|
+
emissiveIntensity?: number;
|
|
18
|
+
emissiveMap?: Texture;
|
|
14
19
|
build(): Material;
|
|
15
20
|
}
|
|
16
21
|
//# sourceMappingURL=toon-shader.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toon-shader.d.ts","sourceRoot":"","sources":["../../../src/shader/builtin/toon-shader.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"toon-shader.d.ts","sourceRoot":"","sources":["../../../src/shader/builtin/toon-shader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAe,QAAQ,EAA+B,OAAO,EAAE,OAAO,EAAC,MAAM,OAAO,CAAC;AAIlG,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,qBAAa,UAAW,SAAQ,MAAM;IACvB,KAAK,EAAE,KAAK,CAAwB;IACtB,OAAO,EAAE,MAAM,CAAI;IAClB,SAAS,EAAE,MAAM,CAAI;IACpC,GAAG,CAAC,EAAE,OAAO,CAAC;IAC2B,UAAU,EAAE,MAAM,EAAE,CAAK;IAClE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,WAAW,CAAC,EAAE,OAAO,CAAoB;IACzC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,KAAK,CAAC;IACF,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC1C,WAAW,CAAC,EAAE,OAAO,CAAC;IAGnC,KAAK,IAAI,QAAQ;CAgClB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{__decorate as t,__metadata as e}from"tslib";import{Color as o,DataTexture as i,MeshToonMaterial as p,RedFormat as
|
|
1
|
+
import{__decorate as t,__metadata as e}from"tslib";import{Color as o,DataTexture as i,MeshToonMaterial as p,RedFormat as s,Texture as a,Vector2 as n}from"three";import{removeObjectUndefined as r}from"../../utils/collections.js";import{Parameter as h}from"../parameter.js";import{Shader as d}from"../shader.js";export class ToonShader extends d{constructor(){super(...arguments),this.color=new o("#FFFFFF"),this.opacity=1,this.intensity=1,this.lightSteps=[],this.normalScale=new n(1,1)}build(){let t;if(null!=this.lightSteps&&this.lightSteps.length>0){const e=new Uint8Array(this.lightSteps.length);for(let t=0;t<=e.length;t++)e[t]=255*this.lightSteps[t];t=new i(e,e.length,1,s),t.needsUpdate=!0}return new p(r({color:this.color.multiplyScalar(this.intensity),opacity:this.opacity,map:this.map,gradientMap:t,lightMap:this.lightMap,lightMapIntensity:this.lightMapIntensity,normalMap:this.normalMap,normalScale:this.normalScale,emissive:this.emissive,emissiveIntensity:this.emissiveIntensity,emissiveMap:this.emissiveMap,aoMap:this.aoMap,aoMapIntensity:this.aoMapIntensity,alphaMap:this.alphaMap}))}}t([h(),e("design:type",o)],ToonShader.prototype,"color",void 0),t([h({range:[0,1]}),e("design:type",Number)],ToonShader.prototype,"opacity",void 0),t([h({range:[0,10]}),e("design:type",Number)],ToonShader.prototype,"intensity",void 0),t([h(),e("design:type",a)],ToonShader.prototype,"map",void 0),t([h({type:Number,array:!0,range:[0,1]}),e("design:type",Array)],ToonShader.prototype,"lightSteps",void 0),t([h(),e("design:type",a)],ToonShader.prototype,"lightMap",void 0),t([h(),e("design:type",Number)],ToonShader.prototype,"lightMapIntensity",void 0),t([h(),e("design:type",a)],ToonShader.prototype,"normalMap",void 0),t([h(),e("design:type",n)],ToonShader.prototype,"normalScale",void 0),t([h(),e("design:type",a)],ToonShader.prototype,"aoMap",void 0),t([h(),e("design:type",Number)],ToonShader.prototype,"aoMapIntensity",void 0),t([h(),e("design:type",a)],ToonShader.prototype,"alphaMap",void 0),t([h(),e("design:type",o)],ToonShader.prototype,"emissive",void 0),t([h({range:[0,10]}),e("design:type",Number)],ToonShader.prototype,"emissiveIntensity",void 0),t([h(),e("design:type",a)],ToonShader.prototype,"emissiveMap",void 0);/*
|
|
2
2
|
* Copyright (©) 2025 Hology Interactive AB. All rights reserved.
|
|
3
3
|
* See the LICENSE.md file for details.
|
|
4
4
|
*/
|
|
@@ -2,10 +2,9 @@ import { FloatNode, Sampler2DNode } from "three-shader-graph";
|
|
|
2
2
|
import { Curve2 } from "../utils/curve";
|
|
3
3
|
export declare function sampleCurve(curve: Curve2, t: FloatNode): FloatNode;
|
|
4
4
|
export declare function curveSampler(curve: Curve2, resolution?: number): CurveSampler;
|
|
5
|
-
declare class CurveSampler {
|
|
5
|
+
export declare class CurveSampler {
|
|
6
6
|
private sampler;
|
|
7
7
|
constructor(sampler: Sampler2DNode);
|
|
8
8
|
sample(t: FloatNode): FloatNode;
|
|
9
9
|
}
|
|
10
|
-
export {};
|
|
11
10
|
//# sourceMappingURL=curve-sample.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"curve-sample.d.ts","sourceRoot":"","sources":["../../src/shader-nodes/curve-sample.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,aAAa,EAA0B,MAAM,oBAAoB,CAAC;AACtF,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC,EAAE,SAAS,aAEtD;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,GAAE,MAAW,gBAalE;AAED,
|
|
1
|
+
{"version":3,"file":"curve-sample.d.ts","sourceRoot":"","sources":["../../src/shader-nodes/curve-sample.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,aAAa,EAA0B,MAAM,oBAAoB,CAAC;AACtF,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC,EAAE,SAAS,aAEtD;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,GAAE,MAAW,gBAalE;AAED,qBAAa,YAAY;IACX,OAAO,CAAC,OAAO;gBAAP,OAAO,EAAE,aAAa;IAC1C,MAAM,CAAC,CAAC,EAAE,SAAS,GAAG,SAAS;CAGhC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{DataTexture as e,LinearFilter as r,RedFormat as t,UnsignedByteType as n}from"three";import{textureSampler2d as
|
|
1
|
+
import{DataTexture as e,LinearFilter as r,RedFormat as t,UnsignedByteType as n}from"three";import{textureSampler2d as p,vec2 as a}from"three-shader-graph";export function sampleCurve(e,r){return curveSampler(e).sample(r)}export function curveSampler(a,m=64){const o=new Uint8Array(m);for(let e=0;e<m;e++){const r=e/m;o[e]=255*a.getY(r)}const s=new e(o,m,1);s.format=t,s.type=n,s.minFilter=s.magFilter=r,s.needsUpdate=!0;const l=p(s);return new CurveSampler(l)}export class CurveSampler{constructor(e){this.sampler=e}sample(e){return this.sampler.sample(a(e,0)).r}}/*
|
|
2
2
|
* Copyright (©) 2025 Hology Interactive AB. All rights reserved.
|
|
3
3
|
* See the LICENSE.md file for details.
|
|
4
4
|
*/
|