material-designer-runtime 0.1.3 → 0.1.5
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/README.md +167 -1
- package/dist/cache/bake-cache.d.ts +45 -0
- package/dist/cache/cache.worker.d.ts +1 -0
- package/dist/cache/codec.d.ts +13 -0
- package/dist/cache/idb-core.d.ts +27 -0
- package/dist/cache/index.d.ts +7 -0
- package/dist/cache/indexeddb-store.d.ts +13 -0
- package/dist/cache/key.d.ts +21 -0
- package/dist/cache/memory-store.d.ts +2 -0
- package/dist/cache/types.d.ts +85 -0
- package/dist/cache/worker-client.d.ts +8 -0
- package/dist/graph/bake-service.d.ts +25 -1
- package/dist/graph/channel-baker.d.ts +4 -0
- package/dist/graph/node-profiler.d.ts +25 -0
- package/dist/graph/texture-transfer.d.ts +13 -0
- package/dist/graph/textured-surface.d.ts +3 -6
- package/dist/index.d.ts +6 -2
- package/dist/index.js +1965 -857
- package/dist/runtime.d.ts +23 -1
- package/dist/topology.d.ts +2 -0
- package/dist/tsl/shape.d.ts +4 -1
- package/dist/version.d.ts +1 -0
- package/package.json +1 -1
package/dist/runtime.d.ts
CHANGED
|
@@ -3,13 +3,24 @@ import type { NodeMaterial, WebGPURenderer } from "three/webgpu";
|
|
|
3
3
|
import { MaterialGraphSession } from "./document";
|
|
4
4
|
import { MaterialBakeService } from "./graph/bake-service";
|
|
5
5
|
import { TexturedSurface } from "./graph/textured-surface";
|
|
6
|
-
import type
|
|
6
|
+
import { type ChannelTextures } from "./graph/mesh-material";
|
|
7
|
+
import type { MaterialGraphDocument, PbrSocket } from "./graph/types";
|
|
7
8
|
import { type NodeRegistry } from "./graph/registry";
|
|
9
|
+
import { BakeTextureCache } from "./cache/bake-cache";
|
|
10
|
+
import type { BakeCacheEntryMeta, BakeCacheMetrics, BakeCacheOptions } from "./cache/types";
|
|
11
|
+
import type { BakeCacheKey } from "./cache/key";
|
|
12
|
+
export interface CachedChannelTextures extends ChannelTextures {
|
|
13
|
+
size: number;
|
|
14
|
+
channels: PbrSocket[];
|
|
15
|
+
height: THREE.Texture | null;
|
|
16
|
+
dispose(): void;
|
|
17
|
+
}
|
|
8
18
|
export interface MaterialGraphRuntimeOptions {
|
|
9
19
|
document?: MaterialGraphDocument;
|
|
10
20
|
registry?: NodeRegistry;
|
|
11
21
|
bakeService?: MaterialBakeService;
|
|
12
22
|
source?: string;
|
|
23
|
+
cache?: BakeTextureCache | BakeCacheOptions | false;
|
|
13
24
|
}
|
|
14
25
|
export declare class MaterialGraphRuntime {
|
|
15
26
|
readonly graph: MaterialGraphSession;
|
|
@@ -36,4 +47,15 @@ export declare class MaterialGraphRuntime {
|
|
|
36
47
|
refresh(): Promise<void>;
|
|
37
48
|
regenerate(): this;
|
|
38
49
|
dispose(): void;
|
|
50
|
+
get cache(): BakeTextureCache | null;
|
|
51
|
+
setCacheEnabled(on: boolean): this;
|
|
52
|
+
get cacheEnabled(): boolean;
|
|
53
|
+
clearCache(): Promise<void>;
|
|
54
|
+
rebuildCache(): Promise<void>;
|
|
55
|
+
getCachedTextures(): Promise<BakeCacheEntryMeta | null>;
|
|
56
|
+
listCachedTextures(): Promise<BakeCacheEntryMeta[]>;
|
|
57
|
+
loadCachedChannelTextures(): Promise<CachedChannelTextures | null>;
|
|
58
|
+
cacheMetrics(): Promise<BakeCacheMetrics | null>;
|
|
59
|
+
flushCache(): Promise<void>;
|
|
60
|
+
cacheKey(): BakeCacheKey;
|
|
39
61
|
}
|
package/dist/topology.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import { type NodeRegistry } from "./graph/registry";
|
|
2
2
|
import type { MaterialGraphDocument } from "./graph/types";
|
|
3
|
+
export declare function canonicalStringify(value: unknown): string;
|
|
3
4
|
export declare function createMaterialTopologyKey(doc: MaterialGraphDocument, registry: NodeRegistry): string;
|
|
5
|
+
export declare function createMaterialParamKey(doc: MaterialGraphDocument, registry: NodeRegistry): string;
|
package/dist/tsl/shape.d.ts
CHANGED
|
@@ -4,10 +4,13 @@ export interface ShapeUniforms {
|
|
|
4
4
|
irregularity: V;
|
|
5
5
|
dome: V;
|
|
6
6
|
edge: V;
|
|
7
|
+
tilt: V;
|
|
8
|
+
formRandom: V;
|
|
9
|
+
erode: V;
|
|
7
10
|
}
|
|
8
11
|
export interface ShapeResult {
|
|
9
12
|
mask: V;
|
|
10
13
|
height: V;
|
|
11
14
|
}
|
|
12
|
-
export declare function shapeField(coord: V, type: string, sides: number, seedIn: V | null, u: ShapeUniforms): ShapeResult;
|
|
15
|
+
export declare function shapeField(coord: V, type: string, sides: number, erodeTaps: number, seedIn: V | null, u: ShapeUniforms): ShapeResult;
|
|
13
16
|
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const MATERIAL_RUNTIME_VERSION: string;
|