shaders 2.2.4 → 2.2.6

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.
@@ -1,3 +1,4 @@
1
+ import { Node } from 'three/webgpu';
1
2
  import { CleanupCallback, ComponentDefinition, NodeMetadata, RenderCallback, ResizeCallback, UniformsMap } from './types';
2
3
  import { PerformanceStats } from './performanceTracker';
3
4
 
@@ -98,6 +99,14 @@ interface NodeInfo {
98
99
  */
99
100
  acceptsUVContext: boolean;
100
101
  }
102
+ /**
103
+ * The registry of nodes in the shader tree.
104
+ */
105
+ interface NodeRegistry {
106
+ nodes: Map<string, NodeInfo>;
107
+ rootId: string | null;
108
+ idToNodeId: Map<string, string>;
109
+ }
101
110
  /**
102
111
  * Options for initializing the renderer.
103
112
  */
@@ -124,6 +133,23 @@ export declare function shaderRenderer(): {
124
133
  nodes: ReadonlyMap<string, NodeInfo>;
125
134
  };
126
135
  getRendererType: () => "webgpu" | "webgl" | null;
136
+ __testing: {
137
+ isUVComposable: (nodeInfo: NodeInfo) => boolean;
138
+ canSkipRTT: (distortionInfo: NodeInfo) => boolean;
139
+ hasUVPropagationOpportunity: (sortedChildren: NodeInfo[]) => boolean;
140
+ needsTransformation: (transform: import('./types').TransformConfig | undefined) => boolean;
141
+ findUVChain: (startNodeId: string) => NodeInfo[];
142
+ findSiblingUVChain: (sortedChildren: NodeInfo[], startIndex: number) => NodeInfo[];
143
+ findChildNodes: (parentId: string) => NodeInfo[];
144
+ composeUVContextChain: (startNodeId: string, _processedMasks: Set<string>, currentlyComposedNodes?: Set<string>) => Node;
145
+ composeUVChain: (chain: NodeInfo[], processedMasks: Set<string>, currentlyComposedNodes?: Set<string>) => Node;
146
+ composeSiblingUVChain: (chain: NodeInfo[], inputContent: Node, currentlyComposedNodes?: Set<string>) => Node;
147
+ composeSiblingsWithUVContext: (sortedChildren: NodeInfo[], processedMasks: Set<string>, currentlyComposedNodes?: Set<string>) => Node;
148
+ applyMaskIfNeeded: (result: Node, nodeInfo: NodeInfo, nodeId: string, processedMasks: Set<string>, distortedUV?: Node) => Node;
149
+ applyNodeTransformation: (result: Node, nodeInfo: NodeInfo) => Node;
150
+ getNodeRegistry: () => NodeRegistry;
151
+ getParentToChildren: () => Map<string | null, Set<string>>;
152
+ };
127
153
  };
128
154
  export {};
129
155
  //# sourceMappingURL=renderer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"renderer.d.ts","sourceRoot":"","sources":["../src/renderer.ts"],"names":[],"mappings":"AAeA,OAAO,EAAC,eAAe,EAAE,mBAAmB,EAAE,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,WAAW,EAAC,MAAM,SAAS,CAAA;AACvH,OAAO,EAAqB,gBAAgB,EAAC,MAAM,sBAAsB,CAAA;AAIzE;;GAEG;AACH,UAAU,QAAQ;IAEd;;;OAGG;IACH,EAAE,EAAE,MAAM,CAAA;IAEV;;OAEG;IACH,aAAa,EAAE,MAAM,CAAA;IAErB;;OAEG;IACH,gBAAgB,EAAE,mBAAmB,CAAC,cAAc,CAAC,CAAA;IAErD;;OAEG;IACH,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;IAEvB;;OAEG;IACH,WAAW,EAAE,OAAO,CAAA;IAEpB;;;;OAIG;IACH,aAAa,EAAE,OAAO,CAAA;IAEtB;;OAEG;IACH,cAAc,EAAE,GAAG,CAAA;IAEnB;;OAEG;IACH,QAAQ,EAAE,YAAY,CAAA;IAEtB;;OAEG;IACH,QAAQ,EAAE,WAAW,CAAA;IAErB;;;OAGG;IACH,gBAAgB,EAAE,eAAe,EAAE,CAAA;IAEnC;;;OAGG;IACH,qBAAqB,EAAE,cAAc,EAAE,CAAA;IAEvC;;;OAGG;IACH,oBAAoB,EAAE,cAAc,EAAE,CAAA;IAEtC;;;OAGG;IACH,eAAe,EAAE,cAAc,EAAE,CAAA;IAEjC;;;OAGG;IACH,iBAAiB,CAAC,EAAE;QAChB,OAAO,EAAE,GAAG,CAAA;QACZ,OA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AC,KACrC,IAAI;uDAsHa,QAAQ,EAAE,kBACV,GAAG,CAAC,MAAM,CAAC,2BACF,GAAG,CAAC,MAAM,CAAC,KACrC,IAAI;oCApnBK,IAAI,YACF,QAAQ,UACV,MAAM,kBACE,GAAG,CAAC,MAAM,CAAC,gBACb,IAAI,KACnB,IAAI;0CAuCK,IAAI,YACF,QAAQ,KACnB,IAAI;;;;EAm8EV"}
@@ -20,7 +20,7 @@ export interface TransformConfig {
20
20
  * @param transform The transform configuration to check
21
21
  * @returns true if transformation is needed, false if all values are defaults
22
22
  */
23
- export declare const needsTransformation: (transform: TransformConfig) => boolean;
23
+ export declare const needsTransformation: (transform: TransformConfig | undefined) => boolean;
24
24
  /**
25
25
  * Applies 2D transformations to UV coordinates using Three.js TSL.
26
26
  * Handles translation, rotation, scale, and custom anchor point with aspect-ratio awareness.
@@ -1 +1 @@
1
- {"version":3,"file":"uvTransform.d.ts","sourceRoot":"","sources":["../../src/utilities/uvTransform.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,IAAI,EAAC,MAAM,cAAc,CAAA;AAUjC;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,EAAE,SAAS,GAAG,aAAa,GAAG,QAAQ,GAAG,MAAM,CAAA;CACrD;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB,cAAe,eAAe,KAAG,OAShE,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,gBAAgB,OACrB,IAAI,kBACQ,IAAI,kBACJ,IAAI,mBACH,IAAI,gBACP,IAAI,kBACF,IAAI,kBACJ,IAAI,sBACA,IAAI,KACzB,IAwCF,CAAA;AAED;;;;;;;;;;GAUG;A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