@triforge/shader-core 0.1.1 → 0.1.2
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/bundle.js +26 -1
- package/dist/core/CompileContext.d.ts.map +1 -1
- package/dist/core/CompileContext.js +33 -27
- package/dist/core/glslIdentifier.d.ts +17 -0
- package/dist/core/glslIdentifier.d.ts.map +1 -0
- package/dist/core/glslIdentifier.js +37 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/nodes/input/Attribute.d.ts +1 -1
- package/dist/nodes/input/Attribute.d.ts.map +1 -1
- package/dist/nodes/input/Attribute.js +8 -1
- package/dist/nodes/input/CameraData.d.ts +1 -1
- package/dist/nodes/input/ColorAttribute.d.ts +1 -1
- package/dist/nodes/input/Geometry.d.ts +1 -1
- package/dist/nodes/input/HairInfo.d.ts +1 -1
- package/dist/nodes/input/LayerWeight.d.ts +1 -1
- package/dist/nodes/input/LightPath.d.ts +1 -1
- package/dist/nodes/input/ObjectInfo.d.ts +1 -1
- package/dist/nodes/input/OceanAttribute.d.ts +1 -1
- package/dist/nodes/input/ParticleInfo.d.ts +1 -1
- package/dist/nodes/input/RGB.d.ts +1 -1
- package/dist/nodes/input/ScreenCamera.d.ts +1 -1
- package/dist/nodes/input/Tangent.d.ts +1 -1
- package/dist/nodes/input/TextureCoordinate.d.ts +1 -1
- package/dist/nodes/input/UVMap.d.ts +1 -1
- package/dist/nodes/input/Value.d.ts +1 -1
- package/dist/nodes/input/Wireframe.d.ts +1 -1
- package/dist/nodes/output/MaterialOutput.d.ts +1 -1
- package/dist/nodes/output/ScreenOutput.d.ts +1 -1
- package/dist/nodes/process/AddShader.d.ts +1 -1
- package/dist/nodes/process/AnimatedNoiseTexture.d.ts +1 -1
- package/dist/nodes/process/Blackbody.d.ts +1 -1
- package/dist/nodes/process/BrickTexture.d.ts +1 -1
- package/dist/nodes/process/BrightContrast.d.ts +1 -1
- package/dist/nodes/process/Bump.d.ts +1 -1
- package/dist/nodes/process/CheckerTexture.d.ts +1 -1
- package/dist/nodes/process/Clamp.d.ts +1 -1
- package/dist/nodes/process/ColorRamp.d.ts +1 -1
- package/dist/nodes/process/CombineColor.d.ts +1 -1
- package/dist/nodes/process/CombineRGB.d.ts +1 -1
- package/dist/nodes/process/CombineXYZ.d.ts +1 -1
- package/dist/nodes/process/DiffuseBSDF.d.ts +1 -1
- package/dist/nodes/process/Emission.d.ts +1 -1
- package/dist/nodes/process/EnvironmentTexture.d.ts +1 -1
- package/dist/nodes/process/EnvironmentTexture.d.ts.map +1 -1
- package/dist/nodes/process/EnvironmentTexture.js +2 -0
- package/dist/nodes/process/FloatCurve.d.ts +1 -1
- package/dist/nodes/process/Fresnel.d.ts +1 -1
- package/dist/nodes/process/Gamma.d.ts +1 -1
- package/dist/nodes/process/GlassBSDF.d.ts +1 -1
- package/dist/nodes/process/GlossyBSDF.d.ts +1 -1
- package/dist/nodes/process/GradientTexture.d.ts +1 -1
- package/dist/nodes/process/HashValue.d.ts +1 -1
- package/dist/nodes/process/HueSaturationValue.d.ts +1 -1
- package/dist/nodes/process/ImageTexture.d.ts +1 -1
- package/dist/nodes/process/ImageTexture.d.ts.map +1 -1
- package/dist/nodes/process/ImageTexture.js +2 -0
- package/dist/nodes/process/InvertColor.d.ts +1 -1
- package/dist/nodes/process/MagicTexture.d.ts +1 -1
- package/dist/nodes/process/MapRange.d.ts +1 -1
- package/dist/nodes/process/Mapping.d.ts +1 -1
- package/dist/nodes/process/Math.d.ts +1 -1
- package/dist/nodes/process/MixRGB.d.ts +1 -1
- package/dist/nodes/process/MixShader.d.ts +1 -1
- package/dist/nodes/process/MusgraveTexture.d.ts +1 -1
- package/dist/nodes/process/NoiseTexture.d.ts +1 -1
- package/dist/nodes/process/Normal.d.ts +1 -1
- package/dist/nodes/process/NormalMap.d.ts +1 -1
- package/dist/nodes/process/PrincipledBSDF.d.ts +1 -1
- package/dist/nodes/process/PrincipledHair.d.ts +1 -1
- package/dist/nodes/process/PrincipledVolume.d.ts +1 -1
- package/dist/nodes/process/RGBCurves.d.ts +1 -1
- package/dist/nodes/process/RGBtoBW.d.ts +1 -1
- package/dist/nodes/process/RefractionBSDF.d.ts +1 -1
- package/dist/nodes/process/SchwarzschildMarch.d.ts +1 -1
- package/dist/nodes/process/SeparateColor.d.ts +1 -1
- package/dist/nodes/process/SeparateRGB.d.ts +1 -1
- package/dist/nodes/process/SeparateXYZ.d.ts +1 -1
- package/dist/nodes/process/ShaderScript.d.ts +1 -1
- package/dist/nodes/process/ShaderToRGB.d.ts +1 -1
- package/dist/nodes/process/SheenBSDF.d.ts +1 -1
- package/dist/nodes/process/SpecularBSDF.d.ts +1 -1
- package/dist/nodes/process/SubsurfaceScattering.d.ts +1 -1
- package/dist/nodes/process/ToonBSDF.d.ts +1 -1
- package/dist/nodes/process/TranslucentBSDF.d.ts +1 -1
- package/dist/nodes/process/VectorCurves.d.ts +1 -1
- package/dist/nodes/process/VectorMath.d.ts +1 -1
- package/dist/nodes/process/VectorRotate.d.ts +1 -1
- package/dist/nodes/process/VectorTransform.d.ts +1 -1
- package/dist/nodes/process/VolumeAbsorption.d.ts +1 -1
- package/dist/nodes/process/VolumeScatter.d.ts +1 -1
- package/dist/nodes/process/VoronoiTexture.d.ts +1 -1
- package/dist/nodes/process/WaveTexture.d.ts +1 -1
- package/dist/nodes/process/Wavelength.d.ts +1 -1
- package/dist/nodes/process/WhiteNoise.d.ts +1 -1
- package/package.json +50 -50
package/dist/bundle.js
CHANGED
|
@@ -247,6 +247,24 @@ var InputNode = class extends ShaderNode {
|
|
|
247
247
|
}
|
|
248
248
|
};
|
|
249
249
|
|
|
250
|
+
// src/core/glslIdentifier.ts
|
|
251
|
+
var GLSL_IDENTIFIER = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
252
|
+
function isValidGlslIdentifier(name) {
|
|
253
|
+
if (typeof name !== "string") return false;
|
|
254
|
+
if (!GLSL_IDENTIFIER.test(name)) return false;
|
|
255
|
+
if (name.startsWith("gl_")) return false;
|
|
256
|
+
if (name.includes("__")) return false;
|
|
257
|
+
return true;
|
|
258
|
+
}
|
|
259
|
+
function assertGlslIdentifier(name, context) {
|
|
260
|
+
if (!isValidGlslIdentifier(name)) {
|
|
261
|
+
throw new Error(
|
|
262
|
+
`[st-shader-core] ${context}: "${String(name)}" is not a valid GLSL identifier. Only letters, digits and single underscores are allowed (must start with a letter or underscore, may not start with "gl_" or contain "__"). This guards against GLSL injection.`
|
|
263
|
+
);
|
|
264
|
+
}
|
|
265
|
+
return name;
|
|
266
|
+
}
|
|
267
|
+
|
|
250
268
|
// src/core/CompileContext.ts
|
|
251
269
|
var CompileContext = class _CompileContext {
|
|
252
270
|
constructor() {
|
|
@@ -337,6 +355,8 @@ var CompileContext = class _CompileContext {
|
|
|
337
355
|
const call = node.compileCall(this).trim();
|
|
338
356
|
if (call) this.calls.push(call);
|
|
339
357
|
for (const inj of node.vertexInjections()) {
|
|
358
|
+
assertGlslIdentifier(inj.attrName, `${node.nodeType} vertex attribute name`);
|
|
359
|
+
assertGlslIdentifier(inj.varyingName, `${node.nodeType} varying name`);
|
|
340
360
|
if (!this._vertexInjections.has(inj.varyingName)) {
|
|
341
361
|
this._vertexInjections.set(inj.varyingName, { attrName: inj.attrName, attrType: inj.attrType });
|
|
342
362
|
}
|
|
@@ -784,6 +804,7 @@ var Attribute = class extends InputNode {
|
|
|
784
804
|
super("Attribute");
|
|
785
805
|
/** 0 = vec3, 1 = float. Stored as number for keyframe/GSAP compat. */
|
|
786
806
|
this.parameters = { attributeType: 0 };
|
|
807
|
+
assertGlslIdentifier(attributeName, "Attribute name");
|
|
787
808
|
this._safeAttrName = attributeName.replace(/[^a-zA-Z0-9_]/g, "_");
|
|
788
809
|
this.attributeName = attributeName;
|
|
789
810
|
this.parameters.attributeType = attributeType === "float" ? 1 : 0;
|
|
@@ -1997,6 +2018,7 @@ var ImageTexture = class extends ProcessNode {
|
|
|
1997
2018
|
fix: 'new ImageTexture({ uniformName: "uMyTexture" })\n After compile(): mat.material.uniforms.uMyTexture = { value: texture }'
|
|
1998
2019
|
});
|
|
1999
2020
|
}
|
|
2021
|
+
assertGlslIdentifier(inputs.uniformName, "ImageTexture uniformName");
|
|
2000
2022
|
this.uniformName = inputs.uniformName;
|
|
2001
2023
|
this._inputs = this.createInputs(inputs, { vector: ["vector", null] });
|
|
2002
2024
|
this._outputs = this.createOutputs({ Color: "color", Alpha: "float" });
|
|
@@ -2043,6 +2065,7 @@ var EnvironmentTexture = class extends ProcessNode {
|
|
|
2043
2065
|
fix: 'new EnvironmentTexture({ uniformName: "uEnv" })\n After compile(): mat.material.uniforms.uEnv = { value: cubeTexture }'
|
|
2044
2066
|
});
|
|
2045
2067
|
}
|
|
2068
|
+
assertGlslIdentifier(inputs.uniformName, "EnvironmentTexture uniformName");
|
|
2046
2069
|
this._uniformName = inputs.uniformName;
|
|
2047
2070
|
this._inputs = this.createInputs(inputs, {
|
|
2048
2071
|
vector: ["color", null],
|
|
@@ -5574,5 +5597,7 @@ export {
|
|
|
5574
5597
|
WaveTexture,
|
|
5575
5598
|
Wavelength,
|
|
5576
5599
|
WhiteNoise,
|
|
5577
|
-
Wireframe
|
|
5600
|
+
Wireframe,
|
|
5601
|
+
assertGlslIdentifier,
|
|
5602
|
+
isValidGlslIdentifier
|
|
5578
5603
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CompileContext.d.ts","sourceRoot":"","sources":["../../src/core/CompileContext.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CompileContext.d.ts","sourceRoot":"","sources":["../../src/core/CompileContext.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AACnD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAEjD,MAAM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CAGlB"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ShaderNodeError } from './ShaderNodeError.js';
|
|
2
2
|
import { ShaderConfig } from './ShaderConfig.js';
|
|
3
|
+
import { assertGlslIdentifier } from './glslIdentifier.js';
|
|
3
4
|
/**
|
|
4
5
|
* Walks the node graph from an OutputNode, validates all connections,
|
|
5
6
|
* deduplicates GLSL function definitions, scopes variable names to node IDs,
|
|
@@ -103,8 +104,13 @@ export class CompileContext {
|
|
|
103
104
|
const call = node.compileCall(this).trim();
|
|
104
105
|
if (call)
|
|
105
106
|
this.calls.push(call);
|
|
106
|
-
// Collect vertex attribute injections from this node
|
|
107
|
+
// Collect vertex attribute injections from this node. Both the attribute
|
|
108
|
+
// name and the varying name are emitted verbatim into GLSL source, so
|
|
109
|
+
// both must be validated here — this is the single chokepoint covering
|
|
110
|
+
// every current and future vertexInjections() implementor.
|
|
107
111
|
for (const inj of node.vertexInjections()) {
|
|
112
|
+
assertGlslIdentifier(inj.attrName, `${node.nodeType} vertex attribute name`);
|
|
113
|
+
assertGlslIdentifier(inj.varyingName, `${node.nodeType} varying name`);
|
|
108
114
|
if (!this._vertexInjections.has(inj.varyingName)) {
|
|
109
115
|
this._vertexInjections.set(inj.varyingName, { attrName: inj.attrName, attrType: inj.attrType });
|
|
110
116
|
}
|
|
@@ -196,18 +202,18 @@ export class CompileContext {
|
|
|
196
202
|
const customAssigns = [...this._vertexInjections.entries()]
|
|
197
203
|
.map(([vName, { attrName }]) => ` ${vName} = ${attrName};`)
|
|
198
204
|
.join('\n');
|
|
199
|
-
return `
|
|
200
|
-
varying vec2 vUv;
|
|
201
|
-
varying vec3 vNormal;
|
|
202
|
-
varying vec3 vPosition;
|
|
203
|
-
${customAttrs}
|
|
204
|
-
|
|
205
|
-
void main() {
|
|
206
|
-
vUv = uv;
|
|
207
|
-
vNormal = normalize(mat3(transpose(inverse(modelMatrix))) * normal);
|
|
208
|
-
vPosition = (modelMatrix * vec4(position, 1.0)).xyz;
|
|
209
|
-
${customAssigns}
|
|
210
|
-
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
205
|
+
return `
|
|
206
|
+
varying vec2 vUv;
|
|
207
|
+
varying vec3 vNormal;
|
|
208
|
+
varying vec3 vPosition;
|
|
209
|
+
${customAttrs}
|
|
210
|
+
|
|
211
|
+
void main() {
|
|
212
|
+
vUv = uv;
|
|
213
|
+
vNormal = normalize(mat3(transpose(inverse(modelMatrix))) * normal);
|
|
214
|
+
vPosition = (modelMatrix * vec4(position, 1.0)).xyz;
|
|
215
|
+
${customAssigns}
|
|
216
|
+
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
|
|
211
217
|
}`.trim();
|
|
212
218
|
}
|
|
213
219
|
buildUniformDeclarations() {
|
|
@@ -222,20 +228,20 @@ ${customAssigns}
|
|
|
222
228
|
.join('\n');
|
|
223
229
|
const defsBlock = this.defs.join('\n\n');
|
|
224
230
|
const callsBlock = this.calls.map(c => ` ${c}`).join('\n');
|
|
225
|
-
return `
|
|
226
|
-
precision mediump float;
|
|
227
|
-
|
|
228
|
-
varying vec2 vUv;
|
|
229
|
-
varying vec3 vNormal;
|
|
230
|
-
varying vec3 vPosition;
|
|
231
|
-
${customVaryings}
|
|
232
|
-
|
|
233
|
-
${uniformsBlock}
|
|
234
|
-
|
|
235
|
-
${defsBlock}
|
|
236
|
-
|
|
237
|
-
void main() {
|
|
238
|
-
${callsBlock}
|
|
231
|
+
return `
|
|
232
|
+
precision mediump float;
|
|
233
|
+
|
|
234
|
+
varying vec2 vUv;
|
|
235
|
+
varying vec3 vNormal;
|
|
236
|
+
varying vec3 vPosition;
|
|
237
|
+
${customVaryings}
|
|
238
|
+
|
|
239
|
+
${uniformsBlock}
|
|
240
|
+
|
|
241
|
+
${defsBlock}
|
|
242
|
+
|
|
243
|
+
void main() {
|
|
244
|
+
${callsBlock}
|
|
239
245
|
}`.trim();
|
|
240
246
|
}
|
|
241
247
|
// ── Literal conversion ────────────────────────────────────────────
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GLSL identifier validation — the single security boundary for any string
|
|
3
|
+
* that a node injects verbatim into generated GLSL source (attribute names,
|
|
4
|
+
* uniform names, etc). The root ecosystem rule is "NEVER interpolate
|
|
5
|
+
* user-supplied strings directly into GLSL"; where a name genuinely must
|
|
6
|
+
* appear in the source (e.g. a geometry attribute name the shader reads), it
|
|
7
|
+
* MUST first pass this validator, which throws on anything that isn't a plain
|
|
8
|
+
* GLSL identifier. A name that fails this check could never reference a usable
|
|
9
|
+
* GLSL attribute/uniform anyway, so nothing legitimate is rejected.
|
|
10
|
+
*/
|
|
11
|
+
export declare function isValidGlslIdentifier(name: string): boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Returns `name` if it is a safe GLSL identifier, otherwise throws. Use at the
|
|
14
|
+
* point a name is about to be emitted into shader source.
|
|
15
|
+
*/
|
|
16
|
+
export declare function assertGlslIdentifier(name: string, context: string): string;
|
|
17
|
+
//# sourceMappingURL=glslIdentifier.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"glslIdentifier.d.ts","sourceRoot":"","sources":["../../src/core/glslIdentifier.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAOH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAM3D;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAS1E"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GLSL identifier validation — the single security boundary for any string
|
|
3
|
+
* that a node injects verbatim into generated GLSL source (attribute names,
|
|
4
|
+
* uniform names, etc). The root ecosystem rule is "NEVER interpolate
|
|
5
|
+
* user-supplied strings directly into GLSL"; where a name genuinely must
|
|
6
|
+
* appear in the source (e.g. a geometry attribute name the shader reads), it
|
|
7
|
+
* MUST first pass this validator, which throws on anything that isn't a plain
|
|
8
|
+
* GLSL identifier. A name that fails this check could never reference a usable
|
|
9
|
+
* GLSL attribute/uniform anyway, so nothing legitimate is rejected.
|
|
10
|
+
*/
|
|
11
|
+
// GLSL ES identifiers: letter/underscore start, then letters/digits/underscore.
|
|
12
|
+
const GLSL_IDENTIFIER = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
13
|
+
// Reserved: names beginning with `gl_` are reserved by the GLSL spec, and the
|
|
14
|
+
// double-underscore prefix/anywhere is reserved for implementation use.
|
|
15
|
+
export function isValidGlslIdentifier(name) {
|
|
16
|
+
if (typeof name !== 'string')
|
|
17
|
+
return false;
|
|
18
|
+
if (!GLSL_IDENTIFIER.test(name))
|
|
19
|
+
return false;
|
|
20
|
+
if (name.startsWith('gl_'))
|
|
21
|
+
return false;
|
|
22
|
+
if (name.includes('__'))
|
|
23
|
+
return false;
|
|
24
|
+
return true;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Returns `name` if it is a safe GLSL identifier, otherwise throws. Use at the
|
|
28
|
+
* point a name is about to be emitted into shader source.
|
|
29
|
+
*/
|
|
30
|
+
export function assertGlslIdentifier(name, context) {
|
|
31
|
+
if (!isValidGlslIdentifier(name)) {
|
|
32
|
+
throw new Error(`[st-shader-core] ${context}: "${String(name)}" is not a valid GLSL identifier. ` +
|
|
33
|
+
`Only letters, digits and single underscores are allowed (must start with a letter or underscore, ` +
|
|
34
|
+
`may not start with "gl_" or contain "__"). This guards against GLSL injection.`);
|
|
35
|
+
}
|
|
36
|
+
return name;
|
|
37
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export { InputSocket } from './core/InputSocket.js';
|
|
|
9
9
|
export { OutputSocket } from './core/OutputSocket.js';
|
|
10
10
|
export { SOCKET_GLSL_TYPE } from './core/SocketType.js';
|
|
11
11
|
export type { SocketType } from './core/SocketType.js';
|
|
12
|
+
export { isValidGlslIdentifier, assertGlslIdentifier } from './core/glslIdentifier.js';
|
|
12
13
|
export { CompileContext } from './core/CompileContext.js';
|
|
13
14
|
export type { CompiledMaterial } from './core/CompileContext.js';
|
|
14
15
|
export { TextureCoordinate } from './nodes/input/TextureCoordinate.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAS,wBAAwB,CAAA;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAC3D,YAAY,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAGxD,OAAO,EAAE,UAAU,EAAE,MAAQ,sBAAsB,CAAA;AACnD,OAAO,EAAE,SAAS,EAAE,MAAS,qBAAqB,CAAA;AAClD,OAAO,EAAE,UAAU,EAAE,MAAQ,sBAAsB,CAAA;AACnD,OAAO,EAAE,WAAW,EAAE,MAAO,uBAAuB,CAAA;AAGpD,OAAO,EAAE,WAAW,EAAE,MAAW,uBAAuB,CAAA;AACxD,OAAO,EAAE,YAAY,EAAE,MAAU,wBAAwB,CAAA;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AACvD,YAAY,EAAE,UAAU,EAAE,MAAO,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAS,wBAAwB,CAAA;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAC3D,YAAY,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAGxD,OAAO,EAAE,UAAU,EAAE,MAAQ,sBAAsB,CAAA;AACnD,OAAO,EAAE,SAAS,EAAE,MAAS,qBAAqB,CAAA;AAClD,OAAO,EAAE,UAAU,EAAE,MAAQ,sBAAsB,CAAA;AACnD,OAAO,EAAE,WAAW,E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11
11
|
export { OutputSocket } from './core/OutputSocket.js';
|
|
12
12
|
export { SOCKET_GLSL_TYPE } from './core/SocketType.js';
|
|
13
|
+
export { isValidGlslIdentifier, assertGlslIdentifier } from './core/glslIdentifier.js';
|
|
13
14
|
// ── Compiler ──────────────────────────────────────────────────────────────────
|
|
14
15
|
export { CompileContext } from './core/CompileContext.js';
|
|
15
16
|
// ── Input nodes ───────────────────────────────────────────────────────────────
|
|
@@ -29,7 +29,7 @@ export declare class Attribute extends InputNode {
|
|
|
29
29
|
/** Sanitized attribute name — only alphanumeric + underscore, used in GLSL. */
|
|
30
30
|
private readonly _safeAttrName;
|
|
31
31
|
constructor(attributeName: string, attributeType?: 'float' | 'vec3');
|
|
32
|
-
getOutputSockets(): Record<string, import("../../
|
|
32
|
+
getOutputSockets(): Record<string, import("../../index.js").OutputSocket>;
|
|
33
33
|
vertexInjections(): {
|
|
34
34
|
attrName: string;
|
|
35
35
|
attrType: "float";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Attribute.d.ts","sourceRoot":"","sources":["../../../src/nodes/input/Attribute.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAA;
|
|
1
|
+
{"version":3,"file":"Attribute.d.ts","sourceRoot":"","sources":["../../../src/nodes/input/Attribute.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAA;AAGlE;;;;;;;;;;;;;;GAcG;AACH,qBAAa,SAAU,SAAQ,SAAS;IACtC,IAAI,QAAQ,WAAyB;IAErC,IAAI,QAAQ,IAAI,YAAY,CAE3B;IAED,kEAAkE;IAClE,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;IAE9B,sEAAsE;IAC7D,UAAU,EAAE;QAAE,aAAa,EAAE,MAAM,CAAA;KAAE,CAAuB;IAErE,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAmE;IAE5F,+EAA+E;IAC/E,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAQ;gBAE1B,aAAa,EAAE,MAAM,EAAE,aAAa,GAAE,OAAO,GAAG,MAAe;IAiB3E,gBAAgB;IAEhB,gBAAgB;;;;;;;;;IAUhB,WAAW,IAAI,MAAM;IAErB,WAAW,CAAC,GAAG,EAAE,cAAc,GAAG,MAAM;CAkBzC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { InputNode } from '../../core/InputNode.js';
|
|
2
|
+
import { assertGlslIdentifier } from '../../core/glslIdentifier.js';
|
|
2
3
|
/**
|
|
3
4
|
* Attribute — Blender "Attribute" input node equivalent.
|
|
4
5
|
* Reads a named custom float or vector attribute from the geometry's BufferAttributes.
|
|
@@ -23,7 +24,13 @@ export class Attribute extends InputNode {
|
|
|
23
24
|
super('Attribute');
|
|
24
25
|
/** 0 = vec3, 1 = float. Stored as number for keyframe/GSAP compat. */
|
|
25
26
|
this.parameters = { attributeType: 0 };
|
|
26
|
-
// SECURITY:
|
|
27
|
+
// SECURITY: the attribute name is emitted verbatim into the vertex shader
|
|
28
|
+
// (`attribute <type> <attributeName>;` and `<varying> = <attributeName>;`),
|
|
29
|
+
// so it must be a valid GLSL identifier — reject anything else here for a
|
|
30
|
+
// clear early error. CompileContext re-validates at emit time as the
|
|
31
|
+
// authoritative boundary. The varying name uses a sanitized copy so it is
|
|
32
|
+
// always safe regardless.
|
|
33
|
+
assertGlslIdentifier(attributeName, 'Attribute name');
|
|
27
34
|
this._safeAttrName = attributeName.replace(/[^a-zA-Z0-9_]/g, '_');
|
|
28
35
|
this.attributeName = attributeName;
|
|
29
36
|
this.parameters.attributeType = attributeType === 'float' ? 1 : 0;
|
|
@@ -15,7 +15,7 @@ export declare class CameraData extends InputNode {
|
|
|
15
15
|
get metadata(): NodeMetadata;
|
|
16
16
|
private readonly _outputs;
|
|
17
17
|
constructor();
|
|
18
|
-
getOutputSockets(): Record<string, import("../../
|
|
18
|
+
getOutputSockets(): Record<string, import("../../index.js").OutputSocket>;
|
|
19
19
|
compileCall(ctx: CompileContext): string;
|
|
20
20
|
}
|
|
21
21
|
//# sourceMappingURL=CameraData.d.ts.map
|
|
@@ -16,7 +16,7 @@ export declare class ColorAttribute extends InputNode {
|
|
|
16
16
|
get metadata(): NodeMetadata;
|
|
17
17
|
private readonly _outputs;
|
|
18
18
|
constructor();
|
|
19
|
-
getOutputSockets(): Record<string, import("../../
|
|
19
|
+
getOutputSockets(): Record<string, import("../../index.js").OutputSocket>;
|
|
20
20
|
vertexInjections(): {
|
|
21
21
|
attrName: string;
|
|
22
22
|
attrType: "vec3";
|
|
@@ -17,7 +17,7 @@ export declare class Geometry extends InputNode {
|
|
|
17
17
|
get metadata(): NodeMetadata;
|
|
18
18
|
private readonly _outputs;
|
|
19
19
|
constructor();
|
|
20
|
-
getOutputSockets(): Record<string, import("../../
|
|
20
|
+
getOutputSockets(): Record<string, import("../../index.js").OutputSocket>;
|
|
21
21
|
compileCall(ctx: CompileContext): string;
|
|
22
22
|
}
|
|
23
23
|
//# sourceMappingURL=Geometry.d.ts.map
|
|
@@ -23,7 +23,7 @@ export declare class HairInfo extends InputNode {
|
|
|
23
23
|
get metadata(): NodeMetadata;
|
|
24
24
|
private readonly _outputs;
|
|
25
25
|
constructor();
|
|
26
|
-
getOutputSockets(): Record<string, import("../../
|
|
26
|
+
getOutputSockets(): Record<string, import("../../index.js").OutputSocket>;
|
|
27
27
|
vertexInjections(): ({
|
|
28
28
|
attrName: string;
|
|
29
29
|
attrType: "vec3";
|
|
@@ -20,7 +20,7 @@ export declare class LayerWeight extends InputNode {
|
|
|
20
20
|
constructor(inputs?: {
|
|
21
21
|
blend?: number;
|
|
22
22
|
} | number);
|
|
23
|
-
getOutputSockets(): Record<string, import("../../
|
|
23
|
+
getOutputSockets(): Record<string, import("../../index.js").OutputSocket>;
|
|
24
24
|
compileCall(ctx: CompileContext): string;
|
|
25
25
|
}
|
|
26
26
|
//# sourceMappingURL=LayerWeight.d.ts.map
|
|
@@ -46,7 +46,7 @@ export declare class LightPath extends InputNode {
|
|
|
46
46
|
readonly transmissionDepth: "u_st_lp_transmissionDepth";
|
|
47
47
|
};
|
|
48
48
|
constructor();
|
|
49
|
-
getOutputSockets(): Record<string, import("../../
|
|
49
|
+
getOutputSockets(): Record<string, import("../../index.js").OutputSocket>;
|
|
50
50
|
/**
|
|
51
51
|
* Register all LightPath uniforms with their rasterizer defaults.
|
|
52
52
|
* CompileContext picks these up and includes them in the compiled
|
|
@@ -16,7 +16,7 @@ export declare class ObjectInfo extends InputNode {
|
|
|
16
16
|
private readonly _outputs;
|
|
17
17
|
private readonly _seed;
|
|
18
18
|
constructor();
|
|
19
|
-
getOutputSockets(): Record<string, import("../../
|
|
19
|
+
getOutputSockets(): Record<string, import("../../index.js").OutputSocket>;
|
|
20
20
|
compileCall(ctx: CompileContext): string;
|
|
21
21
|
}
|
|
22
22
|
//# sourceMappingURL=ObjectInfo.d.ts.map
|
|
@@ -21,7 +21,7 @@ export declare class OceanAttribute extends InputNode {
|
|
|
21
21
|
get metadata(): NodeMetadata;
|
|
22
22
|
private readonly _outputs;
|
|
23
23
|
constructor();
|
|
24
|
-
getOutputSockets(): Record<string, import("../../
|
|
24
|
+
getOutputSockets(): Record<string, import("../../index.js").OutputSocket>;
|
|
25
25
|
vertexInjections(): {
|
|
26
26
|
attrName: string;
|
|
27
27
|
attrType: "float";
|
|
@@ -20,7 +20,7 @@ export declare class ParticleInfo extends InputNode {
|
|
|
20
20
|
get metadata(): NodeMetadata;
|
|
21
21
|
private readonly _outputs;
|
|
22
22
|
constructor();
|
|
23
|
-
getOutputSockets(): Record<string, import("../../
|
|
23
|
+
getOutputSockets(): Record<string, import("../../index.js").OutputSocket>;
|
|
24
24
|
vertexInjections(): {
|
|
25
25
|
attrName: string;
|
|
26
26
|
attrType: "float";
|
|
@@ -13,7 +13,7 @@ export declare class RGB extends InputNode {
|
|
|
13
13
|
private readonly hex;
|
|
14
14
|
private readonly _outputs;
|
|
15
15
|
constructor(color?: string);
|
|
16
|
-
getOutputSockets(): Record<string, import("../../
|
|
16
|
+
getOutputSockets(): Record<string, import("../../index.js").OutputSocket>;
|
|
17
17
|
compileCall(ctx: CompileContext): string;
|
|
18
18
|
}
|
|
19
19
|
//# sourceMappingURL=RGB.d.ts.map
|
|
@@ -25,7 +25,7 @@ export declare class ScreenCamera extends InputNode {
|
|
|
25
25
|
get metadata(): NodeMetadata;
|
|
26
26
|
private readonly _outputs;
|
|
27
27
|
constructor();
|
|
28
|
-
getOutputSockets(): Record<string, import("../../
|
|
28
|
+
getOutputSockets(): Record<string, import("../../index.js").OutputSocket>;
|
|
29
29
|
/**
|
|
30
30
|
* Declare the camera uniforms that ScreenOutput will inject.
|
|
31
31
|
* They are vec2/vec3/float types that live outside the standard
|
|
@@ -15,7 +15,7 @@ export declare class Tangent extends InputNode {
|
|
|
15
15
|
get metadata(): NodeMetadata;
|
|
16
16
|
private readonly _outputs;
|
|
17
17
|
constructor();
|
|
18
|
-
getOutputSockets(): Record<string, import("../../
|
|
18
|
+
getOutputSockets(): Record<string, import("../../index.js").OutputSocket>;
|
|
19
19
|
compileCall(ctx: CompileContext): string;
|
|
20
20
|
}
|
|
21
21
|
//# sourceMappingURL=Tangent.d.ts.map
|
|
@@ -11,7 +11,7 @@ export declare class TextureCoordinate extends InputNode {
|
|
|
11
11
|
get metadata(): NodeMetadata;
|
|
12
12
|
private readonly _outputs;
|
|
13
13
|
constructor();
|
|
14
|
-
getOutputSockets(): Record<string, import("../../
|
|
14
|
+
getOutputSockets(): Record<string, import("../../index.js").OutputSocket>;
|
|
15
15
|
compileCall(ctx: CompileContext): string;
|
|
16
16
|
}
|
|
17
17
|
//# sourceMappingURL=TextureCoordinate.d.ts.map
|
|
@@ -14,7 +14,7 @@ export declare class UVMap extends InputNode {
|
|
|
14
14
|
get metadata(): NodeMetadata;
|
|
15
15
|
private readonly _outputs;
|
|
16
16
|
constructor();
|
|
17
|
-
getOutputSockets(): Record<string, import("../../
|
|
17
|
+
getOutputSockets(): Record<string, import("../../index.js").OutputSocket>;
|
|
18
18
|
compileCall(ctx: CompileContext): string;
|
|
19
19
|
}
|
|
20
20
|
//# sourceMappingURL=UVMap.d.ts.map
|
|
@@ -13,7 +13,7 @@ export declare class Value extends InputNode {
|
|
|
13
13
|
private readonly val;
|
|
14
14
|
private readonly _outputs;
|
|
15
15
|
constructor(value?: number);
|
|
16
|
-
getOutputSockets(): Record<string, import("../../
|
|
16
|
+
getOutputSockets(): Record<string, import("../../index.js").OutputSocket>;
|
|
17
17
|
compileCall(ctx: CompileContext): string;
|
|
18
18
|
}
|
|
19
19
|
//# sourceMappingURL=Value.d.ts.map
|
|
@@ -19,7 +19,7 @@ export declare class Wireframe extends InputNode {
|
|
|
19
19
|
constructor(inputs?: {
|
|
20
20
|
thickness?: number;
|
|
21
21
|
} | number);
|
|
22
|
-
getOutputSockets(): Record<string, import("../../
|
|
22
|
+
getOutputSockets(): Record<string, import("../../index.js").OutputSocket>;
|
|
23
23
|
compileCall(ctx: CompileContext): string;
|
|
24
24
|
}
|
|
25
25
|
//# sourceMappingURL=Wireframe.d.ts.map
|
|
@@ -20,7 +20,7 @@ export declare class MaterialOutput extends OutputNode {
|
|
|
20
20
|
get metadata(): NodeMetadata;
|
|
21
21
|
private readonly _inputs;
|
|
22
22
|
constructor(inputs?: MaterialOutputInputs);
|
|
23
|
-
getInputSockets(): Record<string, import("../../
|
|
23
|
+
getInputSockets(): Record<string, import("../../index.js").InputSocket<unknown>>;
|
|
24
24
|
/**
|
|
25
25
|
* Converts the node graph to a THREE.MeshPhysicalMaterial for use with
|
|
26
26
|
* path-tracer renderers (three-gpu-pathtracer).
|
|
@@ -28,7 +28,7 @@ export declare class ScreenOutput extends OutputNode {
|
|
|
28
28
|
constructor(inputs?: {
|
|
29
29
|
color?: OutputSocket;
|
|
30
30
|
});
|
|
31
|
-
getInputSockets(): Record<string, import("../../
|
|
31
|
+
getInputSockets(): Record<string, import("../../index.js").InputSocket<unknown>>;
|
|
32
32
|
compileDefs(): string;
|
|
33
33
|
compileCall(ctx: CompileContext): string;
|
|
34
34
|
compile(): ShaderMaterial;
|
|
@@ -22,7 +22,7 @@ export declare class AddShader extends ProcessNode {
|
|
|
22
22
|
private readonly _inputs;
|
|
23
23
|
private readonly _outputs;
|
|
24
24
|
constructor(inputs?: AddShaderInputs);
|
|
25
|
-
getInputSockets(): Record<string, import("../../
|
|
25
|
+
getInputSockets(): Record<string, import("../../index.js").InputSocket<unknown>>;
|
|
26
26
|
getOutputSockets(): Record<string, OutputSocket>;
|
|
27
27
|
compileDefs(): string;
|
|
28
28
|
compileCall(ctx: CompileContext): string;
|
|
@@ -31,7 +31,7 @@ export declare class AnimatedNoiseTexture extends ProcessNode {
|
|
|
31
31
|
private readonly _outputs;
|
|
32
32
|
private readonly speed;
|
|
33
33
|
constructor(inputs?: AnimatedNoiseTextureInputs);
|
|
34
|
-
getInputSockets(): Record<string, import("../../
|
|
34
|
+
getInputSockets(): Record<string, import("../../index.js").InputSocket<unknown>>;
|
|
35
35
|
getOutputSockets(): Record<string, OutputSocket>;
|
|
36
36
|
compileDefs(): string;
|
|
37
37
|
compileCall(ctx: CompileContext): string;
|
|
@@ -21,7 +21,7 @@ export declare class Blackbody extends ProcessNode {
|
|
|
21
21
|
private readonly _inputs;
|
|
22
22
|
private readonly _outputs;
|
|
23
23
|
constructor(inputs?: BlackbodyInputs);
|
|
24
|
-
getInputSockets(): Record<string, import("../../
|
|
24
|
+
getInputSockets(): Record<string, import("../../index.js").InputSocket<unknown>>;
|
|
25
25
|
getOutputSockets(): Record<string, OutputSocket>;
|
|
26
26
|
compileDefs(): string;
|
|
27
27
|
compileCall(ctx: CompileContext): string;
|
|
@@ -28,7 +28,7 @@ export declare class BrickTexture extends ProcessNode {
|
|
|
28
28
|
private readonly _inputs;
|
|
29
29
|
private readonly _outputs;
|
|
30
30
|
constructor(inputs?: BrickTextureInputs);
|
|
31
|
-
getInputSockets(): Record<string, import("../../
|
|
31
|
+
getInputSockets(): Record<string, import("../../index.js").InputSocket<unknown>>;
|
|
32
32
|
getOutputSockets(): Record<string, OutputSocket>;
|
|
33
33
|
compileDefs(): string;
|
|
34
34
|
compileCall(ctx: CompileContext): string;
|
|
@@ -22,7 +22,7 @@ export declare class BrightContrast extends ProcessNode {
|
|
|
22
22
|
private readonly _inputs;
|
|
23
23
|
private readonly _outputs;
|
|
24
24
|
constructor(inputs?: BrightContrastInputs);
|
|
25
|
-
getInputSockets(): Record<string, import("../../
|
|
25
|
+
getInputSockets(): Record<string, import("../../index.js").InputSocket<unknown>>;
|
|
26
26
|
getOutputSockets(): Record<string, OutputSocket>;
|
|
27
27
|
compileDefs(): string;
|
|
28
28
|
compileCall(ctx: CompileContext): string;
|
|
@@ -23,7 +23,7 @@ export declare class Bump extends ProcessNode {
|
|
|
23
23
|
private readonly _inputs;
|
|
24
24
|
private readonly _outputs;
|
|
25
25
|
constructor(inputs?: BumpInputs);
|
|
26
|
-
getInputSockets(): Record<string, import("../../
|
|
26
|
+
getInputSockets(): Record<string, import("../../index.js").InputSocket<unknown>>;
|
|
27
27
|
getOutputSockets(): Record<string, OutputSocket>;
|
|
28
28
|
compileDefs(): string;
|
|
29
29
|
compileCall(ctx: CompileContext): string;
|
|
@@ -22,7 +22,7 @@ export declare class CheckerTexture extends ProcessNode {
|
|
|
22
22
|
private readonly _inputs;
|
|
23
23
|
private readonly _outputs;
|
|
24
24
|
constructor(inputs?: CheckerTextureInputs);
|
|
25
|
-
getInputSockets(): Record<string, import("../../
|
|
25
|
+
getInputSockets(): Record<string, import("../../index.js").InputSocket<unknown>>;
|
|
26
26
|
getOutputSockets(): Record<string, OutputSocket>;
|
|
27
27
|
compileDefs(): string;
|
|
28
28
|
compileCall(ctx: CompileContext): string;
|
|
@@ -24,7 +24,7 @@ export declare class Clamp extends ProcessNode {
|
|
|
24
24
|
private readonly _inputs;
|
|
25
25
|
private readonly _outputs;
|
|
26
26
|
constructor(inputs?: ClampInputs);
|
|
27
|
-
getInputSockets(): Record<string, import("../../
|
|
27
|
+
getInputSockets(): Record<string, import("../../index.js").InputSocket<unknown>>;
|
|
28
28
|
getOutputSockets(): Record<string, OutputSocket>;
|
|
29
29
|
compileDefs(): string;
|
|
30
30
|
compileCall(ctx: CompileContext): string;
|
|
@@ -20,7 +20,7 @@ export declare class ColorRamp extends ProcessNode {
|
|
|
20
20
|
private readonly _inputs;
|
|
21
21
|
private readonly _outputs;
|
|
22
22
|
constructor(inputs?: ColorRampInputs);
|
|
23
|
-
getInputSockets(): Record<string, import("../../
|
|
23
|
+
getInputSockets(): Record<string, import("../../index.js").InputSocket<unknown>>;
|
|
24
24
|
getOutputSockets(): Record<string, OutputSocket>;
|
|
25
25
|
compileDefs(): string;
|
|
26
26
|
compileCall(ctx: CompileContext): string;
|
|
@@ -26,7 +26,7 @@ export declare class CombineColor extends ProcessNode {
|
|
|
26
26
|
private readonly _inputs;
|
|
27
27
|
private readonly _outputs;
|
|
28
28
|
constructor(inputs?: CombineColorInputs);
|
|
29
|
-
getInputSockets(): Record<string, import("../../
|
|
29
|
+
getInputSockets(): Record<string, import("../../index.js").InputSocket<unknown>>;
|
|
30
30
|
getOutputSockets(): Record<string, OutputSocket>;
|
|
31
31
|
compileDefs(): string;
|
|
32
32
|
compileCall(ctx: CompileContext): string;
|
|
@@ -21,7 +21,7 @@ export declare class CombineRGB extends ProcessNode {
|
|
|
21
21
|
private readonly _inputs;
|
|
22
22
|
private readonly _outputs;
|
|
23
23
|
constructor(inputs?: CombineRGBInputs);
|
|
24
|
-
getInputSockets(): Record<string, import("../../
|
|
24
|
+
getInputSockets(): Record<string, import("../../index.js").InputSocket<unknown>>;
|
|
25
25
|
getOutputSockets(): Record<string, OutputSocket>;
|
|
26
26
|
compileDefs(): string;
|
|
27
27
|
compileCall(ctx: CompileContext): string;
|