material-designer-runtime 0.1.2 → 0.1.3
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/graph/textured-surface.d.ts +1 -0
- package/dist/index.js +23 -4
- package/dist/runtime.d.ts +1 -0
- package/package.json +1 -1
|
@@ -48,6 +48,7 @@ export declare class TexturedSurface {
|
|
|
48
48
|
getHeightTexture(): THREE.Texture | null;
|
|
49
49
|
presentChannels(): ReadonlySet<PbrSocket>;
|
|
50
50
|
refresh(): Promise<void>;
|
|
51
|
+
releaseCaches(): Promise<void>;
|
|
51
52
|
regenerate(): void;
|
|
52
53
|
setScale(value: number): void;
|
|
53
54
|
setSharpness(value: number): void;
|
package/dist/index.js
CHANGED
|
@@ -4300,7 +4300,10 @@ var ga = /* @__PURE__ */ new Map();
|
|
|
4300
4300
|
function _a(e, r) {
|
|
4301
4301
|
let a = `${e}x${r}`, s = ga.get(a);
|
|
4302
4302
|
if (s) return s;
|
|
4303
|
-
let c = new m(e, r
|
|
4303
|
+
let c = new m(e, r, {
|
|
4304
|
+
depthBuffer: !1,
|
|
4305
|
+
stencilBuffer: !1
|
|
4306
|
+
});
|
|
4304
4307
|
c.texture.colorSpace = n, c.texture.minFilter = c.texture.magFilter = t, c.texture.wrapS = c.texture.wrapT = i;
|
|
4305
4308
|
let l = G(1 / e, 1 / r), u = (e) => {
|
|
4306
4309
|
let t = new o();
|
|
@@ -4356,11 +4359,18 @@ var ja = typeof navigator < "u" && /chrome|chromium|crios|edg\//i.test(navigator
|
|
|
4356
4359
|
"emission"
|
|
4357
4360
|
];
|
|
4358
4361
|
function Na(t, n) {
|
|
4359
|
-
let r = new m(n, n
|
|
4362
|
+
let r = new m(n, n, {
|
|
4363
|
+
depthBuffer: !1,
|
|
4364
|
+
stencilBuffer: !1
|
|
4365
|
+
}), i = r.texture;
|
|
4360
4366
|
return i.colorSpace = t !== "height" && da.includes(t) ? e.SRGBColorSpace : e.NoColorSpace, i.wrapS = i.wrapT = e.RepeatWrapping, i.generateMipmaps = !0, i.minFilter = e.LinearMipmapLinearFilter, i.magFilter = e.LinearFilter, i.anisotropy = Da, r;
|
|
4361
4367
|
}
|
|
4362
4368
|
function Pa(t, n = !1) {
|
|
4363
|
-
let r = new m(t, t, {
|
|
4369
|
+
let r = new m(t, t, {
|
|
4370
|
+
type: e.HalfFloatType,
|
|
4371
|
+
depthBuffer: !1,
|
|
4372
|
+
stencilBuffer: !1
|
|
4373
|
+
}), i = r.texture;
|
|
4364
4374
|
return i.colorSpace = e.NoColorSpace, i.wrapS = i.wrapT = e.RepeatWrapping, i.generateMipmaps = n, i.minFilter = n ? e.LinearMipmapLinearFilter : e.LinearFilter, i.magFilter = e.LinearFilter, r;
|
|
4365
4375
|
}
|
|
4366
4376
|
var Fa = class {
|
|
@@ -4662,7 +4672,10 @@ var Fa = class {
|
|
|
4662
4672
|
});
|
|
4663
4673
|
}
|
|
4664
4674
|
scratchTarget(e) {
|
|
4665
|
-
return (!this.scratch || this.scratchSize !== e) && (this.scratch?.dispose(), this.scratch = new m(e, e
|
|
4675
|
+
return (!this.scratch || this.scratchSize !== e) && (this.scratch?.dispose(), this.scratch = new m(e, e, {
|
|
4676
|
+
depthBuffer: !1,
|
|
4677
|
+
stencilBuffer: !1
|
|
4678
|
+
}), this.scratchSize = e), this.scratch;
|
|
4666
4679
|
}
|
|
4667
4680
|
scratchCache(e, t, n, r = !1) {
|
|
4668
4681
|
if (this.scratchCacheSize !== t) {
|
|
@@ -4803,6 +4816,9 @@ var Ga = class {
|
|
|
4803
4816
|
refresh() {
|
|
4804
4817
|
return this.rebuild();
|
|
4805
4818
|
}
|
|
4819
|
+
async releaseCaches() {
|
|
4820
|
+
await this.whenIdle(), this.set.flushCaches();
|
|
4821
|
+
}
|
|
4806
4822
|
regenerate() {
|
|
4807
4823
|
this.flushRequested = !0, this.requestUpdate("rebuild");
|
|
4808
4824
|
}
|
|
@@ -5003,6 +5019,9 @@ var Ja = class {
|
|
|
5003
5019
|
getMeshMaterial() {
|
|
5004
5020
|
return qa(this.graph.document, { get: (e) => this.surface.getChannelTexture(e) });
|
|
5005
5021
|
}
|
|
5022
|
+
releaseCaches() {
|
|
5023
|
+
return this.surface.releaseCaches();
|
|
5024
|
+
}
|
|
5006
5025
|
get lastError() {
|
|
5007
5026
|
return this.surface.lastError ?? this.graph.lastError;
|
|
5008
5027
|
}
|
package/dist/runtime.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ export declare class MaterialGraphRuntime {
|
|
|
18
18
|
constructor(options?: MaterialGraphRuntimeOptions);
|
|
19
19
|
getNodeMaterial(): NodeMaterial;
|
|
20
20
|
getMeshMaterial(): THREE.Material;
|
|
21
|
+
releaseCaches(): Promise<void>;
|
|
21
22
|
get lastError(): string | null;
|
|
22
23
|
get busy(): boolean;
|
|
23
24
|
whenIdle(): Promise<void>;
|