@zephyr3d/scene 0.9.4 → 0.9.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/dist/animation/animationmask.js +224 -0
- package/dist/animation/animationmask.js.map +1 -0
- package/dist/animation/animationset.js +268 -67
- package/dist/animation/animationset.js.map +1 -1
- package/dist/animation/animationtrack.js.map +1 -1
- package/dist/animation/eulerrotationtrack.js +3 -0
- package/dist/animation/eulerrotationtrack.js.map +1 -1
- package/dist/animation/fixed_geometry_cache_track.js +7 -0
- package/dist/animation/fixed_geometry_cache_track.js.map +1 -1
- package/dist/animation/ik_modifier.js.map +1 -1
- package/dist/animation/joint_dynamics/collision.js +6 -4
- package/dist/animation/joint_dynamics/collision.js.map +1 -1
- package/dist/animation/joint_dynamics/controller.js +390 -43
- package/dist/animation/joint_dynamics/controller.js.map +1 -1
- package/dist/animation/joint_dynamics/joint_dynamics_system.js +62 -3
- package/dist/animation/joint_dynamics/joint_dynamics_system.js.map +1 -1
- package/dist/animation/joint_dynamics/solver.js +4 -3
- package/dist/animation/joint_dynamics/solver.js.map +1 -1
- package/dist/animation/joint_dynamics/types.js.map +1 -1
- package/dist/animation/joint_dynamics_modifier.js +2 -0
- package/dist/animation/joint_dynamics_modifier.js.map +1 -1
- package/dist/animation/morphtarget.js +3 -72
- package/dist/animation/morphtarget.js.map +1 -1
- package/dist/animation/morphtrack.js +3 -0
- package/dist/animation/morphtrack.js.map +1 -1
- package/dist/animation/pca_geometry_cache_track.js +3 -0
- package/dist/animation/pca_geometry_cache_track.js.map +1 -1
- package/dist/animation/proptrack.js +3 -0
- package/dist/animation/proptrack.js.map +1 -1
- package/dist/animation/rotationtrack.js +3 -0
- package/dist/animation/rotationtrack.js.map +1 -1
- package/dist/animation/scaletrack.js +3 -0
- package/dist/animation/scaletrack.js.map +1 -1
- package/dist/animation/skeleton.js +254 -79
- package/dist/animation/skeleton.js.map +1 -1
- package/dist/animation/skeleton_modifier.js.map +1 -1
- package/dist/animation/spring_modifier.js.map +1 -1
- package/dist/animation/translationtrack.js +3 -0
- package/dist/animation/translationtrack.js.map +1 -1
- package/dist/app/engine.js +171 -107
- package/dist/app/engine.js.map +1 -1
- package/dist/app/scriptregistry.js +251 -80
- package/dist/app/scriptregistry.js.map +1 -1
- package/dist/asset/assetmanager.js +344 -365
- package/dist/asset/assetmanager.js.map +1 -1
- package/dist/asset/loaders/gltf/gltf_loader.js +17 -14
- package/dist/asset/loaders/gltf/gltf_loader.js.map +1 -1
- package/dist/asset/loaders/loader.js +1 -6
- package/dist/asset/loaders/loader.js.map +1 -1
- package/dist/asset/loaders/zabc/zabc_loader.js.map +1 -1
- package/dist/asset/model.js +1000 -131
- package/dist/asset/model.js.map +1 -1
- package/dist/avatar/wardrobe.js +474 -0
- package/dist/avatar/wardrobe.js.map +1 -0
- package/dist/index.d.ts +1125 -199
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/material/mixins/lightmodel/pbrmetallicroughness.js +6 -3
- package/dist/material/mixins/lightmodel/pbrmetallicroughness.js.map +1 -1
- package/dist/material/mixins/pbr/common.js +72 -15
- package/dist/material/mixins/pbr/common.js.map +1 -1
- package/dist/material/msdf_text_sprite.js +4 -4
- package/dist/material/msdf_text_sprite.js.map +1 -1
- package/dist/material/pbrblueprint.js +102 -102
- package/dist/material/pbrblueprint.js.map +1 -1
- package/dist/render/envlight.js +54 -1
- package/dist/render/envlight.js.map +1 -1
- package/dist/render/sky.js +9 -0
- package/dist/render/sky.js.map +1 -1
- package/dist/scene/batchgroup.js +11 -13
- package/dist/scene/batchgroup.js.map +1 -1
- package/dist/scene/environment.js +15 -2
- package/dist/scene/environment.js.map +1 -1
- package/dist/scene/mesh.js +79 -16
- package/dist/scene/mesh.js.map +1 -1
- package/dist/scene/scene.js +1 -0
- package/dist/scene/scene.js.map +1 -1
- package/dist/scene/scene_node.js +203 -2
- package/dist/scene/scene_node.js.map +1 -1
- package/dist/text/font/font_asset.js.map +1 -1
- package/dist/text/msdf/generator.js.map +1 -1
- package/dist/text/msdf/shape.js +4 -1
- package/dist/text/msdf/shape.js.map +1 -1
- package/dist/text/runtime/msdf_text_atlas_manager.js +4 -1
- package/dist/text/runtime/msdf_text_atlas_manager.js.map +1 -1
- package/dist/utility/blueprint/material/inputs.js +1157 -1154
- package/dist/utility/blueprint/material/inputs.js.map +1 -1
- package/dist/utility/bounding_volume.js.map +1 -1
- package/dist/utility/pmrem.js +34 -8
- package/dist/utility/pmrem.js.map +1 -1
- package/dist/utility/serialization/manager.js +22 -9
- package/dist/utility/serialization/manager.js.map +1 -1
- package/dist/utility/serialization/scene/animation.js +700 -7
- package/dist/utility/serialization/scene/animation.js.map +1 -1
- package/dist/utility/serialization/scene/mesh.js +64 -4
- package/dist/utility/serialization/scene/mesh.js.map +1 -1
- package/dist/utility/serialization/scene/node.js +187 -8
- package/dist/utility/serialization/scene/node.js.map +1 -1
- package/dist/utility/serialization/types.js.map +1 -1
- package/dist/utility/textures/sheenlut.js +138 -0
- package/dist/utility/textures/sheenlut.js.map +1 -0
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inputs.js","sources":["../../../../src/utility/blueprint/material/inputs.ts"],"sourcesContent":["import type { SerializableClass } from '../../serialization';\nimport { BaseGraphNode } from '../node';\n\n/**\n * Vertex output node\n */\nexport class VertexOutputNode extends BaseGraphNode {\n private _index: number;\n constructor(index: number) {\n super();\n this._index = index;\n this._outputs = [\n { id: 1, name: '' },\n { id: 2, name: 'x', swizzle: 'x' },\n { id: 3, name: 'y', swizzle: 'y' },\n { id: 4, name: 'z', swizzle: 'z' },\n { id: 5, name: 'w', swizzle: 'w' }\n ];\n }\n get index() {\n return this._index;\n }\n static getSerializationCls(): SerializableClass {\n return {\n ctor: VertexOutputNode,\n name: 'VertexOutputNode',\n createFunc(ctx: unknown, init: number) {\n return { obj: new VertexOutputNode(init) };\n },\n getInitParams(obj: VertexOutputNode) {\n return obj._index;\n },\n getProps() {\n return [];\n }\n };\n }\n /**\n * Generates a string representation of this node\n *\n * @returns 'vertex index'\n */\n toString() {\n return `Vertex Output${this._index}`;\n }\n /**\n * Validates the node state\n *\n * @returns Empty string (always valid)\n *\n * @remarks\n * Vertex index nodes are always valid as they have no inputs.\n */\n protected validate() {\n return '';\n }\n /**\n * Gets the output type for a specific output slot\n *\n * @param id - The output slot ID\n * @returns 'float' for individual channel outputs (id \\> 1), 'vec4' for full color\n */\n protected getType(id: number) {\n return id > 1 ? 'float' : 'vec4';\n }\n}\n\n/**\n * Vertex index input node\n */\nexport class VertexIndexNode extends BaseGraphNode {\n /**\n * Creates a new vertex index node\n */\n constructor() {\n super();\n this._outputs = [{ id: 1, name: '' }];\n }\n /**\n * Gets the serialization descriptor for this node type\n *\n * @returns Serialization class descriptor\n */\n static getSerializationCls() {\n return {\n ctor: VertexIndexNode,\n name: 'VertexIndexNode',\n getProps() {\n return [];\n }\n };\n }\n /**\n * Generates a string representation of this node\n *\n * @returns 'vertex index'\n */\n toString() {\n return 'vertex index';\n }\n /**\n * Validates the node state\n *\n * @returns Empty string (always valid)\n *\n * @remarks\n * Vertex index nodes are always valid as they have no inputs.\n */\n protected validate() {\n return '';\n }\n /**\n * Gets the output type for a specific output slot\n *\n * @returns 'float'\n */\n protected getType() {\n return 'float';\n }\n}\n\n/**\n * Instance index input node\n */\nexport class InstanceIndexNode extends BaseGraphNode {\n /**\n * Creates a new instance index node\n */\n constructor() {\n super();\n this._outputs = [{ id: 1, name: '' }];\n }\n /**\n * Gets the serialization descriptor for this node type\n *\n * @returns Serialization class descriptor\n */\n static getSerializationCls() {\n return {\n ctor: InstanceIndexNode,\n name: 'InstanceIndexNode',\n getProps() {\n return [];\n }\n };\n }\n /**\n * Generates a string representation of this node\n *\n * @returns 'instance index'\n */\n toString() {\n return 'instance index';\n }\n /**\n * Validates the node state\n *\n * @returns Empty string (always valid)\n *\n * @remarks\n * Instance index nodes are always valid as they have no inputs.\n */\n protected validate() {\n return '';\n }\n /**\n * Gets the output type for a specific output slot\n *\n * @returns 'float'\n */\n protected getType() {\n return 'float';\n }\n}\n\n/**\n * Vertex color input node\n *\n * @remarks\n * Provides access to per-vertex color data from the mesh.\n * Vertex colors are stored as RGBA values (vec4) and can be used for:\n * - Hand-painted color variations\n * - Ambient occlusion baking\n * - Blend weights for texture mixing\n * - Custom data encoded in color channels\n *\n * Outputs:\n * - Output 1: Full RGBA color (vec4)\n * - Output 2: Red channel (float)\n * - Output 3: Green channel (float)\n * - Output 4: Blue channel (float)\n * - Output 5: Alpha channel (float)\n *\n * @example\n * ```typescript\n * const vertexColor = new VertexColorNode();\n *\n * // Use full color\n * baseColorNode.connectInput(1, vertexColor, 1);\n *\n * // Use individual channels\n * roughnessNode.connectInput(1, vertexColor, 2); // Red as roughness\n * metallicNode.connectInput(1, vertexColor, 3); // Green as metallic\n * ```\n *\n * @public\n */\nexport class VertexColorNode extends BaseGraphNode {\n /**\n * Creates a new vertex color node\n *\n * @remarks\n * Initializes with 5 output slots: full RGBA and individual R, G, B, A channels.\n */\n constructor() {\n super();\n this._outputs = [\n { id: 1, name: '' },\n { id: 2, name: 'r', swizzle: 'x' },\n { id: 3, name: 'g', swizzle: 'y' },\n { id: 4, name: 'b', swizzle: 'z' },\n { id: 5, name: 'a', swizzle: 'w' }\n ];\n }\n /**\n * Gets the serialization descriptor for this node type\n *\n * @returns Serialization class descriptor\n */\n static getSerializationCls() {\n return {\n ctor: VertexColorNode,\n name: 'VertexColorNode',\n getProps() {\n return [];\n }\n };\n }\n /**\n * Generates a string representation of this node\n *\n * @returns 'vertex color'\n */\n toString() {\n return 'vertex color';\n }\n /**\n * Validates the node state\n *\n * @returns Empty string (always valid)\n *\n * @remarks\n * Vertex color nodes are always valid as they have no inputs.\n */\n protected validate() {\n return '';\n }\n /**\n * Gets the output type for a specific output slot\n *\n * @param id - The output slot ID\n * @returns 'float' for individual channel outputs (id \\> 1), 'vec4' for full color\n */\n protected getType(id: number) {\n return id > 1 ? 'float' : 'vec4';\n }\n}\n\n/**\n * Vertex UV coordinate input node\n *\n * @remarks\n * Provides access to per-vertex texture coordinates (UV coordinates) from the mesh.\n * UV coordinates map 3D mesh vertices to 2D texture space, typically in the range [0, 1].\n *\n * Used for:\n * - Texture sampling (most common use)\n * - Procedural pattern generation\n * - Gradient effects based on position in UV space\n * - Decal placement\n *\n * Outputs:\n * - Output 1: Full UV coordinates (vec2)\n * - Output 2: U coordinate (horizontal, float)\n * - Output 3: V coordinate (vertical, float)\n *\n * @example\n * ```typescript\n * const uv = new VertexUVNode();\n *\n * // Sample texture using UV coordinates\n * textureSample.connectInput(1, uv, 1);\n *\n * // Use U coordinate for horizontal gradient\n * mixNode.connectInput(3, uv, 2);\n * ```\n *\n * @public\n */\nexport class VertexUVNode extends BaseGraphNode {\n /**\n * Creates a new vertex UV node\n *\n * @remarks\n * Initializes with 3 output slots: full UV and individual U, V components.\n */\n constructor() {\n super();\n this._outputs = [\n { id: 1, name: '' },\n { id: 2, name: 'x', swizzle: 'x' },\n { id: 3, name: 'y', swizzle: 'y' }\n ];\n }\n /**\n * Gets the serialization descriptor for this node type\n *\n * @returns Serialization class descriptor\n */\n static getSerializationCls() {\n return {\n ctor: VertexUVNode,\n name: 'VertexUVNode',\n getProps() {\n return [];\n }\n };\n }\n /**\n * Generates a string representation of this node\n *\n * @returns 'vertex UV'\n */\n toString() {\n return 'vertex UV';\n }\n /**\n * Validates the node state\n *\n * @returns Empty string (always valid)\n *\n * @remarks\n * Vertex UV nodes are always valid as they have no inputs.\n */\n protected validate() {\n return '';\n }\n /**\n * Gets the output type for a specific output slot\n *\n * @param id - The output slot ID\n * @returns 'float' for individual component outputs (id \\> 1), 'vec2' for full UV\n */\n protected getType(id: number) {\n return id > 1 ? 'float' : 'vec2';\n }\n}\n\n/**\n * Vertex world position input node\n *\n * @remarks\n * Provides access to the vertex position in world space coordinates.\n * World position is the absolute 3D location of the vertex in the scene,\n * after applying all model transformations but before view/projection.\n *\n * Used for:\n * - Distance-based effects (fog, fade)\n * - World-space texturing (triplanar mapping)\n * - Position-based color gradients\n * - Vertex animation based on world location\n * - Custom lighting calculations\n *\n * Outputs:\n * - Output 1: Full position (vec3)\n * - Output 2: X coordinate (float)\n * - Output 3: Y coordinate (float)\n * - Output 4: Z coordinate (float)\n *\n * @example\n * ```typescript\n * const worldPos = new VertexPositionNode();\n *\n * // Calculate distance from origin\n * const origin = new ConstantVec3Node();\n * const distance = new DistanceNode();\n * distance.connectInput(1, worldPos, 1);\n * distance.connectInput(2, origin, 1);\n *\n * // Height-based color gradient\n * colorMix.connectInput(3, worldPos, 3); // Use Y (height)\n * ```\n *\n * @public\n */\nexport class VertexPositionNode extends BaseGraphNode {\n /**\n * Creates a new vertex position node\n *\n * @remarks\n * Initializes with 4 output slots: full position and individual X, Y, Z components.\n */\n constructor() {\n super();\n this._outputs = [\n { id: 1, name: '' },\n { id: 2, name: 'x', swizzle: 'x' },\n { id: 3, name: 'y', swizzle: 'y' },\n { id: 4, name: 'z', swizzle: 'z' }\n ];\n }\n /**\n * Generates a string representation of this node\n *\n * @returns 'world position'\n */\n toString() {\n return 'world position';\n }\n /**\n * Gets the serialization descriptor for this node type\n *\n * @returns Serialization class descriptor\n */\n static getSerializationCls() {\n return {\n ctor: VertexPositionNode,\n name: 'VertexPositionNode',\n getProps() {\n return [];\n }\n };\n }\n /**\n * Validates the node state\n *\n * @returns Empty string (always valid)\n *\n * @remarks\n * Vertex position nodes are always valid as they have no inputs.\n */\n protected validate() {\n return '';\n }\n /**\n * Gets the output type for a specific output slot\n *\n * @param id - The output slot ID\n * @returns 'float' for individual component outputs (id \\> 1), 'vec3' for full position\n */\n protected getType(id: number) {\n return id > 1 ? 'float' : 'vec3';\n }\n}\n\n/**\n * Pixel world position input node\n *\n * @remarks\n * Provides access to current pixel world-space position.\n *\n * Outputs:\n * - Output 1: Full position (vec3)\n * - Output 2: X coordinate (float)\n * - Output 3: Y coordinate (float)\n * - Output 4: Z coordinate (float)\n *\n * @public\n */\nexport class PixelWorldPositionNode extends BaseGraphNode {\n /**\n * Creates a new pixel world position node\n */\n constructor() {\n super();\n this._outputs = [\n { id: 1, name: '' },\n { id: 2, name: 'x', swizzle: 'x' },\n { id: 3, name: 'y', swizzle: 'y' },\n { id: 4, name: 'z', swizzle: 'z' }\n ];\n }\n /**\n * Generates a string representation of this node\n *\n * @returns 'pixel world position'\n */\n toString() {\n return 'pixel world position';\n }\n /**\n * Gets the serialization descriptor for this node type\n *\n * @returns Serialization class descriptor\n */\n static getSerializationCls() {\n return {\n ctor: PixelWorldPositionNode,\n name: 'PixelWorldPositionNode',\n getProps() {\n return [];\n }\n };\n }\n /**\n * Validates the node state\n *\n * @returns Empty string (always valid)\n */\n protected validate() {\n return '';\n }\n /**\n * Gets the output type for a specific output slot\n *\n * @param id - The output slot ID\n * @returns 'float' for individual component outputs (id \\> 1), 'vec3' for full position\n */\n protected getType(id: number) {\n return id > 1 ? 'float' : 'vec3';\n }\n}\n\n/**\n * Vertex normal input node\n *\n * @remarks\n * Provides access to per-vertex normal vectors in world space.\n * Normals are unit vectors perpendicular to the surface, used extensively\n * in lighting calculations and surface orientation effects.\n *\n * Used for:\n * - Custom lighting calculations\n * - Fresnel effects (view-dependent shading)\n * - Rim lighting\n * - Normal-based masking\n * - Environment mapping\n *\n * Outputs:\n * - Output 1: Full normal vector (vec3, normalized)\n * - Output 2: X component (float)\n * - Output 3: Y component (float)\n * - Output 4: Z component (float)\n *\n * @example\n * ```typescript\n * const normal = new VertexNormalNode();\n * const viewDir = new ViewDirectionNode();\n *\n * // Calculate Fresnel effect\n * const dot = new DotProductNode();\n * dot.connectInput(1, normal, 1);\n * dot.connectInput(2, viewDir, 1);\n *\n * // Rim lighting using Y component\n * rimMask.connectInput(1, normal, 3);\n * ```\n *\n * @public\n */\nexport class VertexNormalNode extends BaseGraphNode {\n /**\n * Creates a new vertex normal node\n *\n * @remarks\n * Initializes with 4 output slots: full normal and individual X, Y, Z components.\n */\n constructor() {\n super();\n this._outputs = [\n { id: 1, name: '' },\n { id: 2, name: 'x', swizzle: 'x' },\n { id: 3, name: 'y', swizzle: 'y' },\n { id: 4, name: 'z', swizzle: 'z' }\n ];\n }\n /**\n * Generates a string representation of this node\n *\n * @returns 'vertex normal'\n */\n toString() {\n return 'vertex normal';\n }\n /**\n * Gets the serialization descriptor for this node type\n *\n * @returns Serialization class descriptor\n */\n static getSerializationCls() {\n return {\n ctor: VertexNormalNode,\n name: 'VertexNormalNode',\n getProps() {\n return [];\n }\n };\n }\n /**\n * Validates the node state\n *\n * @returns Empty string (always valid)\n *\n * @remarks\n * Vertex normal nodes are always valid as they have no inputs.\n */\n protected validate() {\n return '';\n }\n /**\n * Gets the output type for a specific output slot\n *\n * @param id - The output slot ID\n * @returns 'float' for individual component outputs (id \\> 1), 'vec3' for full normal\n */\n protected getType(id: number) {\n return id > 1 ? 'float' : 'vec3';\n }\n}\n\n/**\n * Pixel normal input node\n *\n * @remarks\n * Provides access to the world-space surface normal used in fragment shading.\n *\n * Outputs:\n * - Output 1: Full normal vector (vec3, normalized)\n * - Output 2: X component (float)\n * - Output 3: Y component (float)\n * - Output 4: Z component (float)\n *\n * @public\n */\nexport class PixelNormalNode extends BaseGraphNode {\n /**\n * Creates a new pixel normal node\n *\n * @remarks\n * Initializes with 4 output slots: full normal and individual X, Y, Z components.\n */\n constructor() {\n super();\n this._outputs = [\n { id: 1, name: '' },\n { id: 2, name: 'x', swizzle: 'x' },\n { id: 3, name: 'y', swizzle: 'y' },\n { id: 4, name: 'z', swizzle: 'z' }\n ];\n }\n /**\n * Generates a string representation of this node\n *\n * @returns 'pixel normal'\n */\n toString() {\n return 'pixel normal';\n }\n /**\n * Gets the serialization descriptor for this node type\n *\n * @returns Serialization class descriptor\n */\n static getSerializationCls() {\n return {\n ctor: PixelNormalNode,\n name: 'PixelNormalNode',\n getProps() {\n return [];\n }\n };\n }\n /**\n * Validates the node state\n *\n * @returns Empty string (always valid)\n */\n protected validate() {\n return '';\n }\n /**\n * Gets the output type for a specific output slot\n *\n * @param id - The output slot ID\n * @returns 'float' for individual component outputs (id \\> 1), 'vec3' for full normal\n */\n protected getType(id: number) {\n return id > 1 ? 'float' : 'vec3';\n }\n}\n\n/**\n * Vertex tangent input node\n *\n * @remarks\n * Provides access to per-vertex tangent vectors in world space.\n * Tangents are unit vectors parallel to the surface, aligned with the U texture coordinate direction.\n * Together with normals and binormals, they form the tangent-space basis (TBN matrix).\n *\n * Used for:\n * - Normal mapping (constructing TBN matrix)\n * - Anisotropic reflections (hair, brushed metal)\n * - Tangent-space calculations\n * - Flow map effects\n *\n * Outputs:\n * - Output 1: Full tangent vector (vec3, normalized)\n * - Output 2: X component (float)\n * - Output 3: Y component (float)\n * - Output 4: Z component (float)\n *\n * @example\n * ```typescript\n * const tangent = new VertexTangentNode();\n * const normal = new VertexNormalNode();\n * const binormal = new VertexBinormalNode();\n *\n * // Construct TBN matrix for normal mapping\n * const tbnMatrix = new MakeMatrixNode();\n * tbnMatrix.connectInput(1, tangent, 1);\n * tbnMatrix.connectInput(2, binormal, 1);\n * tbnMatrix.connectInput(3, normal, 1);\n * ```\n *\n * @public\n */\nexport class VertexTangentNode extends BaseGraphNode {\n /**\n * Creates a new vertex tangent node\n *\n * @remarks\n * Initializes with 4 output slots: full tangent and individual X, Y, Z components.\n */\n constructor() {\n super();\n this._outputs = [\n { id: 1, name: '' },\n { id: 2, name: 'x', swizzle: 'x' },\n { id: 3, name: 'y', swizzle: 'y' },\n { id: 4, name: 'z', swizzle: 'z' }\n ];\n }\n /**\n * Generates a string representation of this node\n *\n * @returns 'vertex tangent'\n */\n toString() {\n return 'vertex tangent';\n }\n /**\n * Gets the serialization descriptor for this node type\n *\n * @returns Serialization class descriptor\n */\n static getSerializationCls() {\n return {\n ctor: VertexTangentNode,\n name: 'VertexTangentNode',\n getProps() {\n return [];\n }\n };\n }\n /**\n * Validates the node state\n *\n * @returns Empty string (always valid)\n *\n * @remarks\n * Vertex tangent nodes are always valid as they have no inputs.\n */\n protected validate() {\n return '';\n }\n /**\n * Gets the output type for a specific output slot\n *\n * @param id - The output slot ID\n * @returns 'float' for individual component outputs (id \\> 1), 'vec3' for full tangent\n */\n protected getType(id: number) {\n return id > 1 ? 'float' : 'vec3';\n }\n}\n\n/**\n * Vertex binormal (bitangent) input node\n *\n * @remarks\n * Provides access to per-vertex binormal (also called bitangent) vectors in world space.\n * Binormals are unit vectors perpendicular to both the normal and tangent,\n * aligned with the V texture coordinate direction.\n * Together with normals and tangents, they form the tangent-space basis (TBN matrix).\n *\n * The binormal is typically computed as: binormal = cross(normal, tangent) * handedness\n *\n * Used for:\n * - Normal mapping (constructing TBN matrix)\n * - Tangent-space calculations\n * - Surface flow effects\n * - Oriented texture mapping\n *\n * Outputs:\n * - Output 1: Full binormal vector (vec3, normalized)\n * - Output 2: X component (float)\n * - Output 3: Y component (float)\n * - Output 4: Z component (float)\n *\n * @example\n * ```typescript\n * const tangent = new VertexTangentNode();\n * const normal = new VertexNormalNode();\n * const binormal = new VertexBinormalNode();\n *\n * // Use for normal mapping transformation\n * const normalMap = new TextureSampleNode();\n * const tbnTransform = new TransformNode();\n * tbnTransform.connectInput(1, normalMap, 1);\n * tbnTransform.connectInput(2, tbnMatrixNode, 1);\n * ```\n *\n * @public\n */\nexport class VertexBinormalNode extends BaseGraphNode {\n /**\n * Creates a new vertex binormal node\n *\n * @remarks\n * Initializes with 4 output slots: full binormal and individual X, Y, Z components.\n */\n constructor() {\n super();\n this._outputs = [\n { id: 1, name: '' },\n { id: 2, name: 'x', swizzle: 'x' },\n { id: 3, name: 'y', swizzle: 'y' },\n { id: 4, name: 'z', swizzle: 'z' }\n ];\n }\n /**\n * Generates a string representation of this node\n *\n * @returns 'vertex binormal'\n */\n toString() {\n return 'vertex binormal';\n }\n /**\n * Gets the serialization descriptor for this node type\n *\n * @returns Serialization class descriptor\n */\n static getSerializationCls() {\n return {\n ctor: VertexBinormalNode,\n name: 'VertexBinormalNode',\n getProps() {\n return [];\n }\n };\n }\n /**\n * Validates the node state\n *\n * @returns Empty string (always valid)\n *\n * @remarks\n * Vertex binormal nodes are always valid as they have no inputs.\n */\n protected validate() {\n return '';\n }\n /**\n * Gets the output type for a specific output slot\n *\n * @param id - The output slot ID\n * @returns 'float' for individual component outputs (id \\> 1), 'vec3' for full binormal\n */\n protected getType(id: number) {\n return id > 1 ? 'float' : 'vec3';\n }\n}\n\n/**\n * Projection matrix input node\n *\n * @remarks\n * Provides the camera's projection matrix (view space to clip space transformation).\n * This matrix transforms coordinates from camera/view space to normalized device coordinates (NDC).\n *\n * For perspective projection: converts frustum to cube, applies perspective divide\n * For orthographic projection: applies parallel projection scaling\n *\n * Used for:\n * - Custom vertex transformations\n * - Screen-space effects\n * - Depth calculations\n * - Custom projection modifications\n *\n * Output:\n * - Output 1: 4x4 projection matrix (mat4)\n *\n * @example\n * ```typescript\n * const projMatrix = new ProjectionMatrixNode();\n * const viewSpacePos = new ViewSpacePositionNode();\n *\n * // Transform to clip space\n * const transform = new TransformNode();\n * transform.connectInput(1, viewSpacePos, 1);\n * transform.connectInput(2, projMatrix, 1);\n * ```\n *\n * @public\n */\nexport class ProjectionMatrixNode extends BaseGraphNode {\n /**\n * Creates a new projection matrix node\n *\n * @remarks\n * Initializes with one output slot for the mat4 matrix.\n */\n constructor() {\n super();\n this._outputs = [{ id: 1, name: '' }];\n }\n /**\n * Generates a string representation of this node\n *\n * @returns 'ViewToClipMatrix'\n */\n toString() {\n return 'ViewToClipMatrix';\n }\n /**\n * Gets the serialization descriptor for this node type\n *\n * @returns Serialization class descriptor\n */\n static getSerializationCls() {\n return {\n ctor: ProjectionMatrixNode,\n name: 'ProjectionMatrixNode',\n getProps() {\n return [];\n }\n };\n }\n /**\n * Validates the node state\n *\n * @returns Empty string (always valid)\n *\n * @remarks\n * Matrix nodes are always valid as they have no inputs.\n */\n protected validate() {\n return '';\n }\n /**\n * Gets the output type\n *\n * @returns 'mat4'\n */\n protected getType() {\n return 'mat4';\n }\n}\n\n/**\n * View matrix input node\n *\n * @remarks\n * Provides the camera's view matrix (world space to view space transformation).\n * This matrix transforms coordinates from world space to camera/view space,\n * where the camera is at the origin looking down the negative Z axis.\n *\n * The view matrix is the inverse of the camera's world transformation matrix.\n *\n * Used for:\n * - Custom lighting in view space\n * - View-space normal calculations\n * - Billboard effects\n * - Custom camera-relative transformations\n *\n * Output:\n * - Output 1: 4x4 view matrix (mat4)\n *\n * @example\n * ```typescript\n * const viewMatrix = new ViewMatrixNode();\n * const worldPos = new VertexPositionNode();\n *\n * // Transform to view space\n * const transform = new TransformNode();\n * transform.connectInput(1, worldPos, 1);\n * transform.connectInput(2, viewMatrix, 1);\n * ```\n *\n * @public\n */\nexport class ViewMatrixNode extends BaseGraphNode {\n /**\n * Creates a new view matrix node\n *\n * @remarks\n * Initializes with one output slot for the mat4 matrix.\n */\n constructor() {\n super();\n this._outputs = [{ id: 1, name: '' }];\n }\n /**\n * Generates a string representation of this node\n *\n * @returns 'WorldToViewMatrix'\n */\n toString() {\n return 'WorldToViewMatrix';\n }\n /**\n * Gets the serialization descriptor for this node type\n *\n * @returns Serialization class descriptor\n */\n static getSerializationCls() {\n return {\n ctor: ViewMatrixNode,\n name: 'ViewMatrixNode',\n getProps() {\n return [];\n }\n };\n }\n /**\n * Validates the node state\n *\n * @returns Empty string (always valid)\n *\n * @remarks\n * Matrix nodes are always valid as they have no inputs.\n */\n protected validate() {\n return '';\n }\n /**\n * Gets the output type\n *\n * @returns 'mat4'\n */\n protected getType() {\n return 'mat4';\n }\n}\n\n/**\n * View-projection matrix input node\n *\n * @remarks\n * Provides the combined view-projection matrix (world space to clip space transformation).\n * This is the product of the view matrix and projection matrix, commonly used for\n * transforming vertices from world space directly to clip space in one step.\n *\n * Equivalent to: projectionMatrix * viewMatrix\n *\n * Used for:\n * - Vertex position transformation (most common use)\n * - Custom vertex shaders\n * - Screen-space position calculations\n * - Shadow mapping\n *\n * Output:\n * - Output 1: 4x4 view-projection matrix (mat4)\n *\n * @example\n * ```typescript\n * const viewProjMatrix = new ViewProjMatrixNode();\n * const worldPos = new VertexPositionNode();\n *\n * // Transform directly to clip space\n * const transform = new TransformNode();\n * transform.connectInput(1, worldPos, 1);\n * transform.connectInput(2, viewProjMatrix, 1);\n * ```\n *\n * @public\n */\nexport class ViewProjMatrixNode extends BaseGraphNode {\n /**\n * Creates a new view-projection matrix node\n *\n * @remarks\n * Initializes with one output slot for the mat4 matrix.\n */\n constructor() {\n super();\n this._outputs = [{ id: 1, name: '' }];\n }\n /**\n * Generates a string representation of this node\n *\n * @returns 'WorldToClipMatrix'\n */\n toString() {\n return 'WorldToClipMatrix';\n }\n /**\n * Gets the serialization descriptor for this node type\n *\n * @returns Serialization class descriptor\n */\n static getSerializationCls() {\n return {\n ctor: ViewProjMatrixNode,\n name: 'ViewProjMatrixNode',\n getProps() {\n return [];\n }\n };\n }\n /**\n * Validates the node state\n *\n * @returns Empty string (always valid)\n *\n * @remarks\n * Matrix nodes are always valid as they have no inputs.\n */\n protected validate() {\n return '';\n }\n /**\n * Gets the output type\n *\n * @returns 'mat4'\n */\n protected getType() {\n return 'mat4';\n }\n}\n\n/**\n * Inverse projection matrix input node\n *\n * @remarks\n * Provides the inverse of the projection matrix (clip space to view space transformation).\n * This matrix transforms coordinates from normalized device coordinates (NDC) back to camera/view space.\n *\n * Used for:\n * - Screen-space to view-space reconstruction\n * - Depth buffer unprojection\n * - Deferred rendering position reconstruction\n * - Ray marching from screen space\n *\n * Output:\n * - Output 1: 4x4 inverse projection matrix (mat4)\n *\n * @example\n * ```typescript\n * const invProjMatrix = new InvProjMatrixNode();\n * const clipPos = new ClipSpacePositionNode();\n *\n * // Reconstruct view space position\n * const transform = new TransformNode();\n * transform.connectInput(1, clipPos, 1);\n * transform.connectInput(2, invProjMatrix, 1);\n * ```\n *\n * @public\n */\nexport class InvProjMatrixNode extends BaseGraphNode {\n /**\n * Creates a new inverse projection matrix node\n *\n * @remarks\n * Initializes with one output slot for the mat4 matrix.\n */\n constructor() {\n super();\n this._outputs = [{ id: 1, name: '' }];\n }\n /**\n * Generates a string representation of this node\n *\n * @returns 'ClipToViewMatrix'\n */\n toString() {\n return 'ClipToViewMatrix';\n }\n /**\n * Gets the serialization descriptor for this node type\n *\n * @returns Serialization class descriptor\n */\n static getSerializationCls() {\n return {\n ctor: InvProjMatrixNode,\n name: 'InvProjMatrixNode',\n getProps() {\n return [];\n }\n };\n }\n /**\n * Validates the node state\n *\n * @returns Empty string (always valid)\n *\n * @remarks\n * Matrix nodes are always valid as they have no inputs.\n */\n protected validate() {\n return '';\n }\n /**\n * Gets the output type\n *\n * @returns 'mat4'\n */\n protected getType() {\n return 'mat4';\n }\n}\n\n/**\n * Inverse view-projection matrix input node\n *\n * @remarks\n * Provides the inverse of the view-projection matrix (clip space to world space transformation).\n * This matrix transforms coordinates from normalized device coordinates (NDC) back to world space.\n *\n * Equivalent to: inverse(projectionMatrix * viewMatrix)\n *\n * Used for:\n * - Screen-space to world-space reconstruction\n * - Deferred rendering world position reconstruction\n * - Picking and ray casting from screen coordinates\n * - Screen-space effects needing world position\n *\n * Output:\n * - Output 1: 4x4 inverse view-projection matrix (mat4)\n *\n * @example\n * ```typescript\n * const invViewProjMatrix = new InvViewProjMatrixNode();\n * const screenPos = new ScreenPositionNode();\n *\n * // Reconstruct world position from screen coordinates\n * const transform = new TransformNode();\n * transform.connectInput(1, screenPos, 1);\n * transform.connectInput(2, invViewProjMatrix, 1);\n * ```\n *\n * @public\n */\nexport class InvViewProjMatrixNode extends BaseGraphNode {\n /**\n * Creates a new inverse view-projection matrix node\n *\n * @remarks\n * Initializes with one output slot for the mat4 matrix.\n */\n constructor() {\n super();\n this._outputs = [{ id: 1, name: '' }];\n }\n /**\n * Generates a string representation of this node\n *\n * @returns 'ClipToWorldMatrix'\n */\n toString() {\n return 'ClipToWorldMatrix';\n }\n /**\n * Gets the serialization descriptor for this node type\n *\n * @returns Serialization class descriptor\n */\n static getSerializationCls() {\n return {\n ctor: InvViewProjMatrixNode,\n name: 'InvViewProjMatrixNode',\n getProps() {\n return [];\n }\n };\n }\n /**\n * Validates the node state\n *\n * @returns Empty string (always valid)\n *\n * @remarks\n * Matrix nodes are always valid as they have no inputs.\n */\n protected validate() {\n return '';\n }\n /**\n * Gets the output type\n *\n * @returns 'mat4'\n */\n protected getType() {\n return 'mat4';\n }\n}\n\n/**\n * Billboard matrix input node\n *\n * @public\n */\nexport class BillboardMatrixNode extends BaseGraphNode {\n /**\n * Creates a new billboard matrix node\n *\n * @remarks\n * Initializes with one output slot for the mat3 matrix.\n */\n constructor() {\n super();\n this._outputs = [{ id: 1, name: '' }];\n }\n /**\n * Generates a string representation of this node\n *\n * @returns 'BillboardMatrix'\n */\n toString() {\n return 'BillboardMatrix';\n }\n /**\n * Gets the serialization descriptor for this node type\n *\n * @returns Serialization class descriptor\n */\n static getSerializationCls() {\n return {\n ctor: BillboardMatrixNode,\n name: 'BillboardMatrixNode',\n getProps() {\n return [];\n }\n };\n }\n /**\n * Validates the node state\n *\n * @returns Empty string (always valid)\n *\n * @remarks\n * Matrix nodes are always valid as they have no inputs.\n */\n protected validate() {\n return '';\n }\n /**\n * Gets the output type\n *\n * @returns 'mat4'\n */\n protected getType() {\n return 'mat3';\n }\n}\n\n/**\n * Elapsed time input node\n *\n * @remarks\n * Provides the total elapsed time since the application started, in seconds.\n * This value continuously increases and is useful for creating time-based animations\n * and effects directly in the material shader.\n *\n * Used for:\n * - Animated textures (scrolling, rotating)\n * - Pulsating effects\n * - Wave animations\n * - Oscillating values (using sin/cos)\n * - Time-based procedural patterns\n *\n * Output:\n * - Output 1: Elapsed time in seconds (float)\n *\n * @example\n * ```typescript\n * const time = new ElapsedTimeNode();\n * const speed = new ConstantScalarNode();\n * speed.x = 0.5;\n *\n * // Animate UV scrolling\n * const mul = new CompMulNode();\n * mul.connectInput(1, time, 1);\n * mul.connectInput(2, speed, 1);\n *\n * const add = new CompAddNode();\n * add.connectInput(1, uvNode, 1);\n * add.connectInput(2, mul, 1);\n *\n * // Pulsating effect with sine wave\n * const sin = new SinNode();\n * sin.connectInput(1, time, 1);\n * ```\n *\n * @public\n */\nexport class ElapsedTimeNode extends BaseGraphNode {\n /**\n * Creates a new elapsed time node\n *\n * @remarks\n * Initializes with one output slot for the time value.\n */\n constructor() {\n super();\n this._outputs = [{ id: 1, name: '' }];\n }\n /**\n * Generates a string representation of this node\n *\n * @returns 'Elapsed time'\n */\n toString() {\n return 'Elapsed time';\n }\n /**\n * Gets the serialization descriptor for this node type\n *\n * @returns Serialization class descriptor\n */\n static getSerializationCls() {\n return {\n ctor: ElapsedTimeNode,\n name: 'ElapsedTimeNode',\n getProps() {\n return [];\n }\n };\n }\n /**\n * Validates the node state\n *\n * @returns Empty string (always valid)\n *\n * @remarks\n * Time nodes are always valid as they have no inputs.\n */\n protected validate() {\n return '';\n }\n /**\n * Gets the output type\n *\n * @returns 'float'\n */\n protected getType() {\n return 'float';\n }\n}\n\n/**\n * Camera position input node\n *\n * @remarks\n * Provides the world-space position of the camera/viewer.\n * This is the location of the camera in the 3D scene coordinate system.\n *\n * Used for:\n * - View direction calculations\n * - Distance-based effects (distance fog, LOD)\n * - Reflections and refractions\n * - Fresnel effects\n * - Environment mapping\n * - Specular highlights\n *\n * Outputs:\n * - Output 1: Full camera position (vec3)\n * - Output 2: X coordinate (float)\n * - Output 3: Y coordinate (float)\n * - Output 4: Z coordinate (float)\n *\n * @example\n * ```typescript\n * const cameraPos = new CameraPositionNode();\n * const worldPos = new VertexPositionNode();\n *\n * // Calculate view direction\n * const viewDir = new CompSubNode();\n * viewDir.connectInput(1, cameraPos, 1);\n * viewDir.connectInput(2, worldPos, 1);\n *\n * const normalizedViewDir = new NormalizeNode();\n * normalizedViewDir.connectInput(1, viewDir, 1);\n *\n * // Calculate distance to camera\n * const distance = new DistanceNode();\n * distance.connectInput(1, cameraPos, 1);\n * distance.connectInput(2, worldPos, 1);\n * ```\n *\n * @public\n */\nexport class CameraPositionNode extends BaseGraphNode {\n /**\n * Creates a new camera position node\n *\n * @remarks\n * Initializes with 4 output slots: full position and individual X, Y, Z components.\n */\n constructor() {\n super();\n this._outputs = [\n { id: 1, name: '' },\n { id: 2, name: 'x', swizzle: 'x' },\n { id: 3, name: 'y', swizzle: 'y' },\n { id: 4, name: 'z', swizzle: 'z' }\n ];\n }\n /**\n * Generates a string representation of this node\n *\n * @returns 'camera position'\n */\n toString() {\n return 'camera position';\n }\n /**\n * Gets the serialization descriptor for this node type\n *\n * @returns Serialization class descriptor\n */\n static getSerializationCls() {\n return {\n ctor: CameraPositionNode,\n name: 'CameraPositionNode',\n getProps() {\n return [];\n }\n };\n }\n /**\n * Validates the node state\n *\n * @returns Empty string (always valid)\n *\n * @remarks\n * Camera position nodes are always valid as they have no inputs.\n */\n protected validate() {\n return '';\n }\n /**\n * Gets the output type for a specific output slot\n *\n * @param id - The output slot ID\n * @returns 'float' for individual component outputs (id \\> 1), 'vec3' for full position\n */\n protected getType(id: number) {\n return id > 1 ? 'float' : 'vec3';\n }\n}\n\n/**\n * Camera vector input node\n *\n * @remarks\n * Provides the world-space direction from current surface point to camera.\n *\n * Outputs:\n * - Output 1: Full vector (vec3, normalized)\n * - Output 2: X component (float)\n * - Output 3: Y component (float)\n * - Output 4: Z component (float)\n *\n * @public\n */\nexport class CameraVectorNode extends BaseGraphNode {\n /**\n * Creates a new camera vector node\n *\n * @remarks\n * Initializes with 4 output slots: full vector and individual X, Y, Z components.\n */\n constructor() {\n super();\n this._outputs = [\n { id: 1, name: '' },\n { id: 2, name: 'x', swizzle: 'x' },\n { id: 3, name: 'y', swizzle: 'y' },\n { id: 4, name: 'z', swizzle: 'z' }\n ];\n }\n /**\n * Generates a string representation of this node\n *\n * @returns 'camera vector'\n */\n toString() {\n return 'camera vector';\n }\n /**\n * Gets the serialization descriptor for this node type\n *\n * @returns Serialization class descriptor\n */\n static getSerializationCls() {\n return {\n ctor: CameraVectorNode,\n name: 'CameraVectorNode',\n getProps() {\n return [];\n }\n };\n }\n /**\n * Validates the node state\n *\n * @returns Empty string (always valid)\n */\n protected validate() {\n return '';\n }\n /**\n * Gets the output type for a specific output slot\n *\n * @param id - The output slot ID\n * @returns 'float' for individual component outputs (id \\> 1), 'vec3' for full vector\n */\n protected getType(id: number) {\n return id > 1 ? 'float' : 'vec3';\n }\n}\n\n/**\n * Sky environment texture input node\n *\n * @remarks\n * Provides access to the scene's sky/environment cubemap texture.\n * This is typically used for skybox rendering, environment reflections,\n * and image-based lighting (IBL).\n *\n * The texture is a cubemap (texCube) that can be sampled using a 3D direction vector.\n *\n * Used for:\n * - Skybox rendering\n * - Environment reflections on metallic surfaces\n * - Image-based lighting (IBL)\n * - Ambient lighting from environment\n * - Reflections and refractions\n *\n * Output:\n * - Output 1: Cubemap texture sampler (texCube)\n *\n * @example\n * ```typescript\n * const skyTexture = new SkyEnvTextureNode();\n * const reflectionDir = new ReflectNode();\n *\n * // Sample environment for reflection\n * const envSample = new TextureSampleCubeNode();\n * envSample.connectInput(1, skyTexture, 1);\n * envSample.connectInput(2, reflectionDir, 1);\n *\n * // Use for metallic reflections\n * metalColor.connectInput(1, envSample, 1);\n * ```\n *\n * @public\n */\nexport class SkyEnvTextureNode extends BaseGraphNode {\n /**\n * Creates a new sky environment texture node\n *\n * @remarks\n * Initializes with one output slot for the cubemap sampler.\n */\n constructor() {\n super();\n this._outputs = [{ id: 1, name: '' }];\n }\n /**\n * Generates a string representation of this node\n *\n * @returns 'SkyEnvTexture'\n */\n toString() {\n return 'SkyEnvTexture';\n }\n /**\n * Gets the serialization descriptor for this node type\n *\n * @returns Serialization class descriptor\n */\n static getSerializationCls() {\n return {\n ctor: SkyEnvTextureNode,\n name: 'SkyEnvTextureNode',\n getProps() {\n return [];\n }\n };\n }\n /**\n * Validates the node state\n *\n * @returns Empty string (always valid)\n *\n * @remarks\n * Sky environment texture nodes are always valid as they have no inputs.\n */\n protected validate() {\n return '';\n }\n /**\n * Gets the output type\n *\n * @returns 'texCube' (cubemap texture sampler)\n */\n protected getType() {\n return 'texCube';\n }\n}\n\n/**\n * Camera near/far plane input node\n *\n * @remarks\n * Provides the camera's near and far clipping plane distances.\n * These values define the camera's visible depth range:\n * - Near plane: The closest distance at which objects are rendered\n * - Far plane: The farthest distance at which objects are rendered\n *\n * Used for:\n * - Depth linearization (converting from NDC depth to linear depth)\n * - Fog calculations based on depth\n * - Custom depth-of-field effects\n * - Z-buffer precision calculations\n * - Distance-based effects\n *\n * Outputs:\n * - Output 1: Both values as vec2 (x = near, y = far)\n * - Output 2: Near plane distance (float)\n * - Output 3: Far plane distance (float)\n *\n * @example\n * ```typescript\n * const nearFar = new CameraNearFarNode();\n * const depth = new DepthNode();\n *\n * // Linearize depth buffer value\n * // linearDepth = (2.0 * near) / (far + near - depth * (far - near))\n * const farMinusNear = new CompSubNode();\n * farMinusNear.connectInput(1, nearFar, 3); // far\n * farMinusNear.connectInput(2, nearFar, 2); // near\n *\n * // Use for distance fog\n * const fogFactor = new SaturateNode();\n * fogFactor.connectInput(1, linearDepthCalc, 1);\n * ```\n *\n * @public\n */\nexport class CameraNearFarNode extends BaseGraphNode {\n /**\n * Creates a new camera near/far node\n *\n * @remarks\n * Initializes with 3 output slots: combined vec2 and individual near/far values.\n */\n constructor() {\n super();\n this._outputs = [\n { id: 1, name: '' },\n { id: 2, name: 'near', swizzle: 'x' },\n { id: 3, name: 'far', swizzle: 'y' }\n ];\n }\n /**\n * Generates a string representation of this node\n *\n * @returns 'camera near far'\n */\n toString() {\n return 'camera near far';\n }\n /**\n * Gets the serialization descriptor for this node type\n *\n * @returns Serialization class descriptor\n */\n static getSerializationCls() {\n return {\n ctor: CameraNearFarNode,\n name: 'CameraNearFarNode',\n getProps() {\n return [];\n }\n };\n }\n /**\n * Validates the node state\n *\n * @returns Empty string (always valid)\n *\n * @remarks\n * Camera near/far nodes are always valid as they have no inputs.\n */\n protected validate() {\n return '';\n }\n /**\n * Gets the output type for a specific output slot\n *\n * @param id - The output slot ID\n * @returns 'float' for individual component outputs (id \\> 1), 'vec2' for combined output\n */\n protected getType(id: number) {\n return id > 1 ? 'float' : 'vec2';\n }\n}\n\n/**\n * Vertex position resolver node\n *\n * @remarks\n * Provides the resolved vertex position in object space (After applying skinning and morphing)\n *\n * @public\n */\nexport class ResolveVertexPositionNode extends BaseGraphNode {\n /**\n * Creates a new vertex position resolver node\n */\n constructor() {\n super();\n this._outputs = [{ id: 1, name: '' }];\n }\n /**\n * Generates a string representation of this node\n *\n * @returns 'vertex position resolved'\n */\n toString() {\n return 'vertex position resolved';\n }\n /**\n * Gets the serialization descriptor for this node type\n *\n * @returns Serialization class descriptor\n */\n static getSerializationCls() {\n return {\n ctor: ResolveVertexPositionNode,\n name: 'ResolveVertexPositionNode',\n getProps() {\n return [];\n }\n };\n }\n /**\n * Validates the node state\n *\n * @returns Empty string (always valid)\n *\n * @remarks\n * Vertex position resolver nodes are always valid as they have no inputs.\n */\n protected validate() {\n return '';\n }\n /**\n * Gets the output type for a specific output slot\n *\n * @returns vec3\n */\n protected getType() {\n return 'vec3';\n }\n}\n\n/**\n * Vertex normal resolver node\n *\n * @remarks\n * Provides the resolved vertex normal in object space (After applying skinning and morphing)\n *\n * @public\n */\nexport class ResolveVertexNormalNode extends BaseGraphNode {\n /**\n * Creates a new vertex normal resolver node\n */\n constructor() {\n super();\n this._outputs = [{ id: 1, name: '' }];\n }\n /**\n * Generates a string representation of this node\n *\n * @returns 'vertex normal resolved'\n */\n toString() {\n return 'vertex normal resolved';\n }\n /**\n * Gets the serialization descriptor for this node type\n *\n * @returns Serialization class descriptor\n */\n static getSerializationCls() {\n return {\n ctor: ResolveVertexNormalNode,\n name: 'ResolveVertexNormalNode',\n getProps() {\n return [];\n }\n };\n }\n /**\n * Validates the node state\n *\n * @returns Empty string (always valid)\n *\n * @remarks\n * Vertex normal resolve node are always valid as they have no inputs.\n */\n protected validate() {\n return '';\n }\n /**\n * Gets the output type for a specific output slot\n *\n * @returns vec3\n */\n protected getType() {\n return 'vec3';\n }\n}\n\n/**\n * Vertex tangent resolver node\n *\n * @remarks\n * Provides the resolved vertex tangent in object space (After applying skinning and morphing)\n *\n * @public\n */\nexport class ResolveVertexTangentNode extends BaseGraphNode {\n /**\n * Creates a new vertex tangent resolver node\n */\n constructor() {\n super();\n this._outputs = [{ id: 1, name: '' }];\n }\n /**\n * Generates a string representation of this node\n *\n * @returns 'vertex tangent resolved'\n */\n toString() {\n return 'vertex tangent resolved';\n }\n /**\n * Gets the serialization descriptor for this node type\n *\n * @returns Serialization class descriptor\n */\n static getSerializationCls() {\n return {\n ctor: ResolveVertexTangentNode,\n name: 'ResolveVertexTangentNode',\n getProps() {\n return [];\n }\n };\n }\n /**\n * Validates the node state\n *\n * @returns Empty string (always valid)\n *\n * @remarks\n * Vertex tangent resolve node are always valid as they have no inputs.\n */\n protected validate() {\n return '';\n }\n /**\n * Gets the output type for a specific output slot\n *\n * @returns vec4\n */\n protected getType() {\n return 'vec4';\n }\n}\n"],"names":["VertexOutputNode","BaseGraphNode","_index","index","_outputs","id","name","swizzle","getSerializationCls","ctor","createFunc","ctx","init","obj","getInitParams","getProps","toString","getType","VertexIndexNode","InstanceIndexNode","VertexColorNode","VertexUVNode","VertexPositionNode","PixelWorldPositionNode","VertexNormalNode","PixelNormalNode","VertexTangentNode","VertexBinormalNode","ProjectionMatrixNode","ViewMatrixNode","ViewProjMatrixNode","InvProjMatrixNode","InvViewProjMatrixNode","BillboardMatrixNode","ElapsedTimeNode","CameraPositionNode","CameraVectorNode","SkyEnvTextureNode","CameraNearFarNode","ResolveVertexPositionNode","ResolveVertexNormalNode","ResolveVertexTangentNode"],"mappings":";;AAGA;;IAGO,MAAMA,gBAAyBC,SAAAA,aAAAA,CAAAA;IAC5BC,MAAe;AACvB,IAAA,WAAA,CAAYC,KAAa,CAAE;QACzB,KAAK,EAAA;QACL,IAAI,CAACD,MAAM,GAAGC,KAAAA;QACd,IAAI,CAACC,QAAQ,GAAG;AACd,YAAA;gBAAEC,EAAI,EAAA,CAAA;gBAAGC,IAAM,EAAA;AAAG,aAAA;AAClB,YAAA;gB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B,GAAA;QAC3B,OAAO;YACLC,IAAM+B,EAAAA,uBAAAA;YACNlC,IAAM,EAAA,yBAAA;AACNS,YAAAA,QAAAA,CAAAA,GAAAA;AACE,gBAAA,OAAO,EAAE;AACX;AACF,SAAA;AACF;AACA;;;;;;;AAOC,MACD,QAAqB,GAAA;QACnB,OAAO,EAAA;AACT;AACA;;;;AAIC,MACD,OAAoB,GAAA;QAClB,OAAO,MAAA;AACT;AACF;AAEA;;;;;;;IAQO,MAAM0B,wBAAiCxC,SAAAA,aAAAA,CAAAA;AAC5C;;AAEC,MACD,WAAc,EAAA;QACZ,KAAK,EAAA;QACL,IAAI,CAACG,QAAQ,GAAG;AAAC,YAAA;gBAAEC,EAAI,EAAA,CAAA;gBAAGC,IAAM,EAAA;AAAG;AAAE,SAAA;AACvC;AACA;;;;AAIC,MACDU,QAAW,GAAA;QACT,OAAO,yBAAA;AACT;AACA;;;;AAIC,MACD,OAAOR,mBAAsB,GAAA;QAC3B,OAAO;YACLC,IAAMgC,EAAAA,wBAAAA;YACNnC,IAAM,EAAA,0BAAA;AACNS,YAAAA,QAAAA,CAAAA,GAAAA;AACE,gBAAA,OAAO,EAAE;AACX;AACF,SAAA;AACF;AACA;;;;;;;AAOC,MACD,QAAqB,GAAA;QACnB,OAAO,EAAA;AACT;AACA;;;;AAIC,MACD,OAAoB,GAAA;QAClB,OAAO,MAAA;AACT;AACF;;;;"}
|
|
1
|
+
{"version":3,"file":"inputs.js","sources":["../../../../src/utility/blueprint/material/inputs.ts"],"sourcesContent":["import type { SerializableClass } from '../../serialization';\r\nimport { BaseGraphNode } from '../node';\r\n\r\n/**\r\n * Vertex output node\r\n * @public\r\n */\r\nexport class VertexOutputNode extends BaseGraphNode {\r\n private _index: number;\r\n constructor(index: number) {\r\n super();\r\n this._index = index;\r\n this._outputs = [\r\n { id: 1, name: '' },\r\n { id: 2, name: 'x', swizzle: 'x' },\r\n { id: 3, name: 'y', swizzle: 'y' },\r\n { id: 4, name: 'z', swizzle: 'z' },\r\n { id: 5, name: 'w', swizzle: 'w' }\r\n ];\r\n }\r\n get index() {\r\n return this._index;\r\n }\r\n static getSerializationCls(): SerializableClass {\r\n return {\r\n ctor: VertexOutputNode,\r\n name: 'VertexOutputNode',\r\n createFunc(ctx: unknown, init: number) {\r\n return { obj: new VertexOutputNode(init) };\r\n },\r\n getInitParams(obj: VertexOutputNode) {\r\n return obj._index;\r\n },\r\n getProps() {\r\n return [];\r\n }\r\n };\r\n }\r\n /**\r\n * Generates a string representation of this node\r\n *\r\n * @returns 'vertex index'\r\n */\r\n toString() {\r\n return `Vertex Output${this._index}`;\r\n }\r\n /**\r\n * Validates the node state\r\n *\r\n * @returns Empty string (always valid)\r\n *\r\n * @remarks\r\n * Vertex index nodes are always valid as they have no inputs.\r\n */\r\n protected validate() {\r\n return '';\r\n }\r\n /**\r\n * Gets the output type for a specific output slot\r\n *\r\n * @param id - The output slot ID\r\n * @returns 'float' for individual channel outputs (id \\> 1), 'vec4' for full color\r\n */\r\n protected getType(id: number) {\r\n return id > 1 ? 'float' : 'vec4';\r\n }\r\n}\r\n\r\n/**\r\n * Vertex index input node\r\n * @public\r\n */\r\nexport class VertexIndexNode extends BaseGraphNode {\r\n /**\r\n * Creates a new vertex index node\r\n */\r\n constructor() {\r\n super();\r\n this._outputs = [{ id: 1, name: '' }];\r\n }\r\n /**\r\n * Gets the serialization descriptor for this node type\r\n *\r\n * @returns Serialization class descriptor\r\n */\r\n static getSerializationCls() {\r\n return {\r\n ctor: VertexIndexNode,\r\n name: 'VertexIndexNode',\r\n getProps() {\r\n return [];\r\n }\r\n };\r\n }\r\n /**\r\n * Generates a string representation of this node\r\n *\r\n * @returns 'vertex index'\r\n */\r\n toString() {\r\n return 'vertex index';\r\n }\r\n /**\r\n * Validates the node state\r\n *\r\n * @returns Empty string (always valid)\r\n *\r\n * @remarks\r\n * Vertex index nodes are always valid as they have no inputs.\r\n */\r\n protected validate() {\r\n return '';\r\n }\r\n /**\r\n * Gets the output type for a specific output slot\r\n *\r\n * @returns 'float'\r\n */\r\n protected getType() {\r\n return 'float';\r\n }\r\n}\r\n\r\n/**\r\n * Instance index input node\r\n * @public\r\n */\r\nexport class InstanceIndexNode extends BaseGraphNode {\r\n /**\r\n * Creates a new instance index node\r\n */\r\n constructor() {\r\n super();\r\n this._outputs = [{ id: 1, name: '' }];\r\n }\r\n /**\r\n * Gets the serialization descriptor for this node type\r\n *\r\n * @returns Serialization class descriptor\r\n */\r\n static getSerializationCls() {\r\n return {\r\n ctor: InstanceIndexNode,\r\n name: 'InstanceIndexNode',\r\n getProps() {\r\n return [];\r\n }\r\n };\r\n }\r\n /**\r\n * Generates a string representation of this node\r\n *\r\n * @returns 'instance index'\r\n */\r\n toString() {\r\n return 'instance index';\r\n }\r\n /**\r\n * Validates the node state\r\n *\r\n * @returns Empty string (always valid)\r\n *\r\n * @remarks\r\n * Instance index nodes are always valid as they have no inputs.\r\n */\r\n protected validate() {\r\n return '';\r\n }\r\n /**\r\n * Gets the output type for a specific output slot\r\n *\r\n * @returns 'float'\r\n */\r\n protected getType() {\r\n return 'float';\r\n }\r\n}\r\n\r\n/**\r\n * Vertex color input node\r\n *\r\n * @remarks\r\n * Provides access to per-vertex color data from the mesh.\r\n * Vertex colors are stored as RGBA values (vec4) and can be used for:\r\n * - Hand-painted color variations\r\n * - Ambient occlusion baking\r\n * - Blend weights for texture mixing\r\n * - Custom data encoded in color channels\r\n *\r\n * Outputs:\r\n * - Output 1: Full RGBA color (vec4)\r\n * - Output 2: Red channel (float)\r\n * - Output 3: Green channel (float)\r\n * - Output 4: Blue channel (float)\r\n * - Output 5: Alpha channel (float)\r\n *\r\n * @example\r\n * ```typescript\r\n * const vertexColor = new VertexColorNode();\r\n *\r\n * // Use full color\r\n * baseColorNode.connectInput(1, vertexColor, 1);\r\n *\r\n * // Use individual channels\r\n * roughnessNode.connectInput(1, vertexColor, 2); // Red as roughness\r\n * metallicNode.connectInput(1, vertexColor, 3); // Green as metallic\r\n * ```\r\n *\r\n * @public\r\n */\r\nexport class VertexColorNode extends BaseGraphNode {\r\n /**\r\n * Creates a new vertex color node\r\n *\r\n * @remarks\r\n * Initializes with 5 output slots: full RGBA and individual R, G, B, A channels.\r\n */\r\n constructor() {\r\n super();\r\n this._outputs = [\r\n { id: 1, name: '' },\r\n { id: 2, name: 'r', swizzle: 'x' },\r\n { id: 3, name: 'g', swizzle: 'y' },\r\n { id: 4, name: 'b', swizzle: 'z' },\r\n { id: 5, name: 'a', swizzle: 'w' }\r\n ];\r\n }\r\n /**\r\n * Gets the serialization descriptor for this node type\r\n *\r\n * @returns Serialization class descriptor\r\n */\r\n static getSerializationCls() {\r\n return {\r\n ctor: VertexColorNode,\r\n name: 'VertexColorNode',\r\n getProps() {\r\n return [];\r\n }\r\n };\r\n }\r\n /**\r\n * Generates a string representation of this node\r\n *\r\n * @returns 'vertex color'\r\n */\r\n toString() {\r\n return 'vertex color';\r\n }\r\n /**\r\n * Validates the node state\r\n *\r\n * @returns Empty string (always valid)\r\n *\r\n * @remarks\r\n * Vertex color nodes are always valid as they have no inputs.\r\n */\r\n protected validate() {\r\n return '';\r\n }\r\n /**\r\n * Gets the output type for a specific output slot\r\n *\r\n * @param id - The output slot ID\r\n * @returns 'float' for individual channel outputs (id \\> 1), 'vec4' for full color\r\n */\r\n protected getType(id: number) {\r\n return id > 1 ? 'float' : 'vec4';\r\n }\r\n}\r\n\r\n/**\r\n * Vertex UV coordinate input node\r\n *\r\n * @remarks\r\n * Provides access to per-vertex texture coordinates (UV coordinates) from the mesh.\r\n * UV coordinates map 3D mesh vertices to 2D texture space, typically in the range [0, 1].\r\n *\r\n * Used for:\r\n * - Texture sampling (most common use)\r\n * - Procedural pattern generation\r\n * - Gradient effects based on position in UV space\r\n * - Decal placement\r\n *\r\n * Outputs:\r\n * - Output 1: Full UV coordinates (vec2)\r\n * - Output 2: U coordinate (horizontal, float)\r\n * - Output 3: V coordinate (vertical, float)\r\n *\r\n * @example\r\n * ```typescript\r\n * const uv = new VertexUVNode();\r\n *\r\n * // Sample texture using UV coordinates\r\n * textureSample.connectInput(1, uv, 1);\r\n *\r\n * // Use U coordinate for horizontal gradient\r\n * mixNode.connectInput(3, uv, 2);\r\n * ```\r\n *\r\n * @public\r\n */\r\nexport class VertexUVNode extends BaseGraphNode {\r\n /**\r\n * Creates a new vertex UV node\r\n *\r\n * @remarks\r\n * Initializes with 3 output slots: full UV and individual U, V components.\r\n */\r\n constructor() {\r\n super();\r\n this._outputs = [\r\n { id: 1, name: '' },\r\n { id: 2, name: 'x', swizzle: 'x' },\r\n { id: 3, name: 'y', swizzle: 'y' }\r\n ];\r\n }\r\n /**\r\n * Gets the serialization descriptor for this node type\r\n *\r\n * @returns Serialization class descriptor\r\n */\r\n static getSerializationCls() {\r\n return {\r\n ctor: VertexUVNode,\r\n name: 'VertexUVNode',\r\n getProps() {\r\n return [];\r\n }\r\n };\r\n }\r\n /**\r\n * Generates a string representation of this node\r\n *\r\n * @returns 'vertex UV'\r\n */\r\n toString() {\r\n return 'vertex UV';\r\n }\r\n /**\r\n * Validates the node state\r\n *\r\n * @returns Empty string (always valid)\r\n *\r\n * @remarks\r\n * Vertex UV nodes are always valid as they have no inputs.\r\n */\r\n protected validate() {\r\n return '';\r\n }\r\n /**\r\n * Gets the output type for a specific output slot\r\n *\r\n * @param id - The output slot ID\r\n * @returns 'float' for individual component outputs (id \\> 1), 'vec2' for full UV\r\n */\r\n protected getType(id: number) {\r\n return id > 1 ? 'float' : 'vec2';\r\n }\r\n}\r\n\r\n/**\r\n * Vertex world position input node\r\n *\r\n * @remarks\r\n * Provides access to the vertex position in world space coordinates.\r\n * World position is the absolute 3D location of the vertex in the scene,\r\n * after applying all model transformations but before view/projection.\r\n *\r\n * Used for:\r\n * - Distance-based effects (fog, fade)\r\n * - World-space texturing (triplanar mapping)\r\n * - Position-based color gradients\r\n * - Vertex animation based on world location\r\n * - Custom lighting calculations\r\n *\r\n * Outputs:\r\n * - Output 1: Full position (vec3)\r\n * - Output 2: X coordinate (float)\r\n * - Output 3: Y coordinate (float)\r\n * - Output 4: Z coordinate (float)\r\n *\r\n * @example\r\n * ```typescript\r\n * const worldPos = new VertexPositionNode();\r\n *\r\n * // Calculate distance from origin\r\n * const origin = new ConstantVec3Node();\r\n * const distance = new DistanceNode();\r\n * distance.connectInput(1, worldPos, 1);\r\n * distance.connectInput(2, origin, 1);\r\n *\r\n * // Height-based color gradient\r\n * colorMix.connectInput(3, worldPos, 3); // Use Y (height)\r\n * ```\r\n *\r\n * @public\r\n */\r\nexport class VertexPositionNode extends BaseGraphNode {\r\n /**\r\n * Creates a new vertex position node\r\n *\r\n * @remarks\r\n * Initializes with 4 output slots: full position and individual X, Y, Z components.\r\n */\r\n constructor() {\r\n super();\r\n this._outputs = [\r\n { id: 1, name: '' },\r\n { id: 2, name: 'x', swizzle: 'x' },\r\n { id: 3, name: 'y', swizzle: 'y' },\r\n { id: 4, name: 'z', swizzle: 'z' }\r\n ];\r\n }\r\n /**\r\n * Generates a string representation of this node\r\n *\r\n * @returns 'world position'\r\n */\r\n toString() {\r\n return 'world position';\r\n }\r\n /**\r\n * Gets the serialization descriptor for this node type\r\n *\r\n * @returns Serialization class descriptor\r\n */\r\n static getSerializationCls() {\r\n return {\r\n ctor: VertexPositionNode,\r\n name: 'VertexPositionNode',\r\n getProps() {\r\n return [];\r\n }\r\n };\r\n }\r\n /**\r\n * Validates the node state\r\n *\r\n * @returns Empty string (always valid)\r\n *\r\n * @remarks\r\n * Vertex position nodes are always valid as they have no inputs.\r\n */\r\n protected validate() {\r\n return '';\r\n }\r\n /**\r\n * Gets the output type for a specific output slot\r\n *\r\n * @param id - The output slot ID\r\n * @returns 'float' for individual component outputs (id \\> 1), 'vec3' for full position\r\n */\r\n protected getType(id: number) {\r\n return id > 1 ? 'float' : 'vec3';\r\n }\r\n}\r\n\r\n/**\r\n * Pixel world position input node\r\n *\r\n * @remarks\r\n * Provides access to current pixel world-space position.\r\n *\r\n * Outputs:\r\n * - Output 1: Full position (vec3)\r\n * - Output 2: X coordinate (float)\r\n * - Output 3: Y coordinate (float)\r\n * - Output 4: Z coordinate (float)\r\n *\r\n * @public\r\n */\r\nexport class PixelWorldPositionNode extends BaseGraphNode {\r\n /**\r\n * Creates a new pixel world position node\r\n */\r\n constructor() {\r\n super();\r\n this._outputs = [\r\n { id: 1, name: '' },\r\n { id: 2, name: 'x', swizzle: 'x' },\r\n { id: 3, name: 'y', swizzle: 'y' },\r\n { id: 4, name: 'z', swizzle: 'z' }\r\n ];\r\n }\r\n /**\r\n * Generates a string representation of this node\r\n *\r\n * @returns 'pixel world position'\r\n */\r\n toString() {\r\n return 'pixel world position';\r\n }\r\n /**\r\n * Gets the serialization descriptor for this node type\r\n *\r\n * @returns Serialization class descriptor\r\n */\r\n static getSerializationCls() {\r\n return {\r\n ctor: PixelWorldPositionNode,\r\n name: 'PixelWorldPositionNode',\r\n getProps() {\r\n return [];\r\n }\r\n };\r\n }\r\n /**\r\n * Validates the node state\r\n *\r\n * @returns Empty string (always valid)\r\n */\r\n protected validate() {\r\n return '';\r\n }\r\n /**\r\n * Gets the output type for a specific output slot\r\n *\r\n * @param id - The output slot ID\r\n * @returns 'float' for individual component outputs (id \\> 1), 'vec3' for full position\r\n */\r\n protected getType(id: number) {\r\n return id > 1 ? 'float' : 'vec3';\r\n }\r\n}\r\n\r\n/**\r\n * Vertex normal input node\r\n *\r\n * @remarks\r\n * Provides access to per-vertex normal vectors in world space.\r\n * Normals are unit vectors perpendicular to the surface, used extensively\r\n * in lighting calculations and surface orientation effects.\r\n *\r\n * Used for:\r\n * - Custom lighting calculations\r\n * - Fresnel effects (view-dependent shading)\r\n * - Rim lighting\r\n * - Normal-based masking\r\n * - Environment mapping\r\n *\r\n * Outputs:\r\n * - Output 1: Full normal vector (vec3, normalized)\r\n * - Output 2: X component (float)\r\n * - Output 3: Y component (float)\r\n * - Output 4: Z component (float)\r\n *\r\n * @example\r\n * ```typescript\r\n * const normal = new VertexNormalNode();\r\n * const viewDir = new ViewDirectionNode();\r\n *\r\n * // Calculate Fresnel effect\r\n * const dot = new DotProductNode();\r\n * dot.connectInput(1, normal, 1);\r\n * dot.connectInput(2, viewDir, 1);\r\n *\r\n * // Rim lighting using Y component\r\n * rimMask.connectInput(1, normal, 3);\r\n * ```\r\n *\r\n * @public\r\n */\r\nexport class VertexNormalNode extends BaseGraphNode {\r\n /**\r\n * Creates a new vertex normal node\r\n *\r\n * @remarks\r\n * Initializes with 4 output slots: full normal and individual X, Y, Z components.\r\n */\r\n constructor() {\r\n super();\r\n this._outputs = [\r\n { id: 1, name: '' },\r\n { id: 2, name: 'x', swizzle: 'x' },\r\n { id: 3, name: 'y', swizzle: 'y' },\r\n { id: 4, name: 'z', swizzle: 'z' }\r\n ];\r\n }\r\n /**\r\n * Generates a string representation of this node\r\n *\r\n * @returns 'vertex normal'\r\n */\r\n toString() {\r\n return 'vertex normal';\r\n }\r\n /**\r\n * Gets the serialization descriptor for this node type\r\n *\r\n * @returns Serialization class descriptor\r\n */\r\n static getSerializationCls() {\r\n return {\r\n ctor: VertexNormalNode,\r\n name: 'VertexNormalNode',\r\n getProps() {\r\n return [];\r\n }\r\n };\r\n }\r\n /**\r\n * Validates the node state\r\n *\r\n * @returns Empty string (always valid)\r\n *\r\n * @remarks\r\n * Vertex normal nodes are always valid as they have no inputs.\r\n */\r\n protected validate() {\r\n return '';\r\n }\r\n /**\r\n * Gets the output type for a specific output slot\r\n *\r\n * @param id - The output slot ID\r\n * @returns 'float' for individual component outputs (id \\> 1), 'vec3' for full normal\r\n */\r\n protected getType(id: number) {\r\n return id > 1 ? 'float' : 'vec3';\r\n }\r\n}\r\n\r\n/**\r\n * Pixel normal input node\r\n *\r\n * @remarks\r\n * Provides access to the world-space surface normal used in fragment shading.\r\n *\r\n * Outputs:\r\n * - Output 1: Full normal vector (vec3, normalized)\r\n * - Output 2: X component (float)\r\n * - Output 3: Y component (float)\r\n * - Output 4: Z component (float)\r\n *\r\n * @public\r\n */\r\nexport class PixelNormalNode extends BaseGraphNode {\r\n /**\r\n * Creates a new pixel normal node\r\n *\r\n * @remarks\r\n * Initializes with 4 output slots: full normal and individual X, Y, Z components.\r\n */\r\n constructor() {\r\n super();\r\n this._outputs = [\r\n { id: 1, name: '' },\r\n { id: 2, name: 'x', swizzle: 'x' },\r\n { id: 3, name: 'y', swizzle: 'y' },\r\n { id: 4, name: 'z', swizzle: 'z' }\r\n ];\r\n }\r\n /**\r\n * Generates a string representation of this node\r\n *\r\n * @returns 'pixel normal'\r\n */\r\n toString() {\r\n return 'pixel normal';\r\n }\r\n /**\r\n * Gets the serialization descriptor for this node type\r\n *\r\n * @returns Serialization class descriptor\r\n */\r\n static getSerializationCls() {\r\n return {\r\n ctor: PixelNormalNode,\r\n name: 'PixelNormalNode',\r\n getProps() {\r\n return [];\r\n }\r\n };\r\n }\r\n /**\r\n * Validates the node state\r\n *\r\n * @returns Empty string (always valid)\r\n */\r\n protected validate() {\r\n return '';\r\n }\r\n /**\r\n * Gets the output type for a specific output slot\r\n *\r\n * @param id - The output slot ID\r\n * @returns 'float' for individual component outputs (id \\> 1), 'vec3' for full normal\r\n */\r\n protected getType(id: number) {\r\n return id > 1 ? 'float' : 'vec3';\r\n }\r\n}\r\n\r\n/**\r\n * Vertex tangent input node\r\n *\r\n * @remarks\r\n * Provides access to per-vertex tangent vectors in world space.\r\n * Tangents are unit vectors parallel to the surface, aligned with the U texture coordinate direction.\r\n * Together with normals and binormals, they form the tangent-space basis (TBN matrix).\r\n *\r\n * Used for:\r\n * - Normal mapping (constructing TBN matrix)\r\n * - Anisotropic reflections (hair, brushed metal)\r\n * - Tangent-space calculations\r\n * - Flow map effects\r\n *\r\n * Outputs:\r\n * - Output 1: Full tangent vector (vec3, normalized)\r\n * - Output 2: X component (float)\r\n * - Output 3: Y component (float)\r\n * - Output 4: Z component (float)\r\n *\r\n * @example\r\n * ```typescript\r\n * const tangent = new VertexTangentNode();\r\n * const normal = new VertexNormalNode();\r\n * const binormal = new VertexBinormalNode();\r\n *\r\n * // Construct TBN matrix for normal mapping\r\n * const tbnMatrix = new MakeMatrixNode();\r\n * tbnMatrix.connectInput(1, tangent, 1);\r\n * tbnMatrix.connectInput(2, binormal, 1);\r\n * tbnMatrix.connectInput(3, normal, 1);\r\n * ```\r\n *\r\n * @public\r\n */\r\nexport class VertexTangentNode extends BaseGraphNode {\r\n /**\r\n * Creates a new vertex tangent node\r\n *\r\n * @remarks\r\n * Initializes with 4 output slots: full tangent and individual X, Y, Z components.\r\n */\r\n constructor() {\r\n super();\r\n this._outputs = [\r\n { id: 1, name: '' },\r\n { id: 2, name: 'x', swizzle: 'x' },\r\n { id: 3, name: 'y', swizzle: 'y' },\r\n { id: 4, name: 'z', swizzle: 'z' }\r\n ];\r\n }\r\n /**\r\n * Generates a string representation of this node\r\n *\r\n * @returns 'vertex tangent'\r\n */\r\n toString() {\r\n return 'vertex tangent';\r\n }\r\n /**\r\n * Gets the serialization descriptor for this node type\r\n *\r\n * @returns Serialization class descriptor\r\n */\r\n static getSerializationCls() {\r\n return {\r\n ctor: VertexTangentNode,\r\n name: 'VertexTangentNode',\r\n getProps() {\r\n return [];\r\n }\r\n };\r\n }\r\n /**\r\n * Validates the node state\r\n *\r\n * @returns Empty string (always valid)\r\n *\r\n * @remarks\r\n * Vertex tangent nodes are always valid as they have no inputs.\r\n */\r\n protected validate() {\r\n return '';\r\n }\r\n /**\r\n * Gets the output type for a specific output slot\r\n *\r\n * @param id - The output slot ID\r\n * @returns 'float' for individual component outputs (id \\> 1), 'vec3' for full tangent\r\n */\r\n protected getType(id: number) {\r\n return id > 1 ? 'float' : 'vec3';\r\n }\r\n}\r\n\r\n/**\r\n * Vertex binormal (bitangent) input node\r\n *\r\n * @remarks\r\n * Provides access to per-vertex binormal (also called bitangent) vectors in world space.\r\n * Binormals are unit vectors perpendicular to both the normal and tangent,\r\n * aligned with the V texture coordinate direction.\r\n * Together with normals and tangents, they form the tangent-space basis (TBN matrix).\r\n *\r\n * The binormal is typically computed as: binormal = cross(normal, tangent) * handedness\r\n *\r\n * Used for:\r\n * - Normal mapping (constructing TBN matrix)\r\n * - Tangent-space calculations\r\n * - Surface flow effects\r\n * - Oriented texture mapping\r\n *\r\n * Outputs:\r\n * - Output 1: Full binormal vector (vec3, normalized)\r\n * - Output 2: X component (float)\r\n * - Output 3: Y component (float)\r\n * - Output 4: Z component (float)\r\n *\r\n * @example\r\n * ```typescript\r\n * const tangent = new VertexTangentNode();\r\n * const normal = new VertexNormalNode();\r\n * const binormal = new VertexBinormalNode();\r\n *\r\n * // Use for normal mapping transformation\r\n * const normalMap = new TextureSampleNode();\r\n * const tbnTransform = new TransformNode();\r\n * tbnTransform.connectInput(1, normalMap, 1);\r\n * tbnTransform.connectInput(2, tbnMatrixNode, 1);\r\n * ```\r\n *\r\n * @public\r\n */\r\nexport class VertexBinormalNode extends BaseGraphNode {\r\n /**\r\n * Creates a new vertex binormal node\r\n *\r\n * @remarks\r\n * Initializes with 4 output slots: full binormal and individual X, Y, Z components.\r\n */\r\n constructor() {\r\n super();\r\n this._outputs = [\r\n { id: 1, name: '' },\r\n { id: 2, name: 'x', swizzle: 'x' },\r\n { id: 3, name: 'y', swizzle: 'y' },\r\n { id: 4, name: 'z', swizzle: 'z' }\r\n ];\r\n }\r\n /**\r\n * Generates a string representation of this node\r\n *\r\n * @returns 'vertex binormal'\r\n */\r\n toString() {\r\n return 'vertex binormal';\r\n }\r\n /**\r\n * Gets the serialization descriptor for this node type\r\n *\r\n * @returns Serialization class descriptor\r\n */\r\n static getSerializationCls() {\r\n return {\r\n ctor: VertexBinormalNode,\r\n name: 'VertexBinormalNode',\r\n getProps() {\r\n return [];\r\n }\r\n };\r\n }\r\n /**\r\n * Validates the node state\r\n *\r\n * @returns Empty string (always valid)\r\n *\r\n * @remarks\r\n * Vertex binormal nodes are always valid as they have no inputs.\r\n */\r\n protected validate() {\r\n return '';\r\n }\r\n /**\r\n * Gets the output type for a specific output slot\r\n *\r\n * @param id - The output slot ID\r\n * @returns 'float' for individual component outputs (id \\> 1), 'vec3' for full binormal\r\n */\r\n protected getType(id: number) {\r\n return id > 1 ? 'float' : 'vec3';\r\n }\r\n}\r\n\r\n/**\r\n * Projection matrix input node\r\n *\r\n * @remarks\r\n * Provides the camera's projection matrix (view space to clip space transformation).\r\n * This matrix transforms coordinates from camera/view space to normalized device coordinates (NDC).\r\n *\r\n * For perspective projection: converts frustum to cube, applies perspective divide\r\n * For orthographic projection: applies parallel projection scaling\r\n *\r\n * Used for:\r\n * - Custom vertex transformations\r\n * - Screen-space effects\r\n * - Depth calculations\r\n * - Custom projection modifications\r\n *\r\n * Output:\r\n * - Output 1: 4x4 projection matrix (mat4)\r\n *\r\n * @example\r\n * ```typescript\r\n * const projMatrix = new ProjectionMatrixNode();\r\n * const viewSpacePos = new ViewSpacePositionNode();\r\n *\r\n * // Transform to clip space\r\n * const transform = new TransformNode();\r\n * transform.connectInput(1, viewSpacePos, 1);\r\n * transform.connectInput(2, projMatrix, 1);\r\n * ```\r\n *\r\n * @public\r\n */\r\nexport class ProjectionMatrixNode extends BaseGraphNode {\r\n /**\r\n * Creates a new projection matrix node\r\n *\r\n * @remarks\r\n * Initializes with one output slot for the mat4 matrix.\r\n */\r\n constructor() {\r\n super();\r\n this._outputs = [{ id: 1, name: '' }];\r\n }\r\n /**\r\n * Generates a string representation of this node\r\n *\r\n * @returns 'ViewToClipMatrix'\r\n */\r\n toString() {\r\n return 'ViewToClipMatrix';\r\n }\r\n /**\r\n * Gets the serialization descriptor for this node type\r\n *\r\n * @returns Serialization class descriptor\r\n */\r\n static getSerializationCls() {\r\n return {\r\n ctor: ProjectionMatrixNode,\r\n name: 'ProjectionMatrixNode',\r\n getProps() {\r\n return [];\r\n }\r\n };\r\n }\r\n /**\r\n * Validates the node state\r\n *\r\n * @returns Empty string (always valid)\r\n *\r\n * @remarks\r\n * Matrix nodes are always valid as they have no inputs.\r\n */\r\n protected validate() {\r\n return '';\r\n }\r\n /**\r\n * Gets the output type\r\n *\r\n * @returns 'mat4'\r\n */\r\n protected getType() {\r\n return 'mat4';\r\n }\r\n}\r\n\r\n/**\r\n * View matrix input node\r\n *\r\n * @remarks\r\n * Provides the camera's view matrix (world space to view space transformation).\r\n * This matrix transforms coordinates from world space to camera/view space,\r\n * where the camera is at the origin looking down the negative Z axis.\r\n *\r\n * The view matrix is the inverse of the camera's world transformation matrix.\r\n *\r\n * Used for:\r\n * - Custom lighting in view space\r\n * - View-space normal calculations\r\n * - Billboard effects\r\n * - Custom camera-relative transformations\r\n *\r\n * Output:\r\n * - Output 1: 4x4 view matrix (mat4)\r\n *\r\n * @example\r\n * ```typescript\r\n * const viewMatrix = new ViewMatrixNode();\r\n * const worldPos = new VertexPositionNode();\r\n *\r\n * // Transform to view space\r\n * const transform = new TransformNode();\r\n * transform.connectInput(1, worldPos, 1);\r\n * transform.connectInput(2, viewMatrix, 1);\r\n * ```\r\n *\r\n * @public\r\n */\r\nexport class ViewMatrixNode extends BaseGraphNode {\r\n /**\r\n * Creates a new view matrix node\r\n *\r\n * @remarks\r\n * Initializes with one output slot for the mat4 matrix.\r\n */\r\n constructor() {\r\n super();\r\n this._outputs = [{ id: 1, name: '' }];\r\n }\r\n /**\r\n * Generates a string representation of this node\r\n *\r\n * @returns 'WorldToViewMatrix'\r\n */\r\n toString() {\r\n return 'WorldToViewMatrix';\r\n }\r\n /**\r\n * Gets the serialization descriptor for this node type\r\n *\r\n * @returns Serialization class descriptor\r\n */\r\n static getSerializationCls() {\r\n return {\r\n ctor: ViewMatrixNode,\r\n name: 'ViewMatrixNode',\r\n getProps() {\r\n return [];\r\n }\r\n };\r\n }\r\n /**\r\n * Validates the node state\r\n *\r\n * @returns Empty string (always valid)\r\n *\r\n * @remarks\r\n * Matrix nodes are always valid as they have no inputs.\r\n */\r\n protected validate() {\r\n return '';\r\n }\r\n /**\r\n * Gets the output type\r\n *\r\n * @returns 'mat4'\r\n */\r\n protected getType() {\r\n return 'mat4';\r\n }\r\n}\r\n\r\n/**\r\n * View-projection matrix input node\r\n *\r\n * @remarks\r\n * Provides the combined view-projection matrix (world space to clip space transformation).\r\n * This is the product of the view matrix and projection matrix, commonly used for\r\n * transforming vertices from world space directly to clip space in one step.\r\n *\r\n * Equivalent to: projectionMatrix * viewMatrix\r\n *\r\n * Used for:\r\n * - Vertex position transformation (most common use)\r\n * - Custom vertex shaders\r\n * - Screen-space position calculations\r\n * - Shadow mapping\r\n *\r\n * Output:\r\n * - Output 1: 4x4 view-projection matrix (mat4)\r\n *\r\n * @example\r\n * ```typescript\r\n * const viewProjMatrix = new ViewProjMatrixNode();\r\n * const worldPos = new VertexPositionNode();\r\n *\r\n * // Transform directly to clip space\r\n * const transform = new TransformNode();\r\n * transform.connectInput(1, worldPos, 1);\r\n * transform.connectInput(2, viewProjMatrix, 1);\r\n * ```\r\n *\r\n * @public\r\n */\r\nexport class ViewProjMatrixNode extends BaseGraphNode {\r\n /**\r\n * Creates a new view-projection matrix node\r\n *\r\n * @remarks\r\n * Initializes with one output slot for the mat4 matrix.\r\n */\r\n constructor() {\r\n super();\r\n this._outputs = [{ id: 1, name: '' }];\r\n }\r\n /**\r\n * Generates a string representation of this node\r\n *\r\n * @returns 'WorldToClipMatrix'\r\n */\r\n toString() {\r\n return 'WorldToClipMatrix';\r\n }\r\n /**\r\n * Gets the serialization descriptor for this node type\r\n *\r\n * @returns Serialization class descriptor\r\n */\r\n static getSerializationCls() {\r\n return {\r\n ctor: ViewProjMatrixNode,\r\n name: 'ViewProjMatrixNode',\r\n getProps() {\r\n return [];\r\n }\r\n };\r\n }\r\n /**\r\n * Validates the node state\r\n *\r\n * @returns Empty string (always valid)\r\n *\r\n * @remarks\r\n * Matrix nodes are always valid as they have no inputs.\r\n */\r\n protected validate() {\r\n return '';\r\n }\r\n /**\r\n * Gets the output type\r\n *\r\n * @returns 'mat4'\r\n */\r\n protected getType() {\r\n return 'mat4';\r\n }\r\n}\r\n\r\n/**\r\n * Inverse projection matrix input node\r\n *\r\n * @remarks\r\n * Provides the inverse of the projection matrix (clip space to view space transformation).\r\n * This matrix transforms coordinates from normalized device coordinates (NDC) back to camera/view space.\r\n *\r\n * Used for:\r\n * - Screen-space to view-space reconstruction\r\n * - Depth buffer unprojection\r\n * - Deferred rendering position reconstruction\r\n * - Ray marching from screen space\r\n *\r\n * Output:\r\n * - Output 1: 4x4 inverse projection matrix (mat4)\r\n *\r\n * @example\r\n * ```typescript\r\n * const invProjMatrix = new InvProjMatrixNode();\r\n * const clipPos = new ClipSpacePositionNode();\r\n *\r\n * // Reconstruct view space position\r\n * const transform = new TransformNode();\r\n * transform.connectInput(1, clipPos, 1);\r\n * transform.connectInput(2, invProjMatrix, 1);\r\n * ```\r\n *\r\n * @public\r\n */\r\nexport class InvProjMatrixNode extends BaseGraphNode {\r\n /**\r\n * Creates a new inverse projection matrix node\r\n *\r\n * @remarks\r\n * Initializes with one output slot for the mat4 matrix.\r\n */\r\n constructor() {\r\n super();\r\n this._outputs = [{ id: 1, name: '' }];\r\n }\r\n /**\r\n * Generates a string representation of this node\r\n *\r\n * @returns 'ClipToViewMatrix'\r\n */\r\n toString() {\r\n return 'ClipToViewMatrix';\r\n }\r\n /**\r\n * Gets the serialization descriptor for this node type\r\n *\r\n * @returns Serialization class descriptor\r\n */\r\n static getSerializationCls() {\r\n return {\r\n ctor: InvProjMatrixNode,\r\n name: 'InvProjMatrixNode',\r\n getProps() {\r\n return [];\r\n }\r\n };\r\n }\r\n /**\r\n * Validates the node state\r\n *\r\n * @returns Empty string (always valid)\r\n *\r\n * @remarks\r\n * Matrix nodes are always valid as they have no inputs.\r\n */\r\n protected validate() {\r\n return '';\r\n }\r\n /**\r\n * Gets the output type\r\n *\r\n * @returns 'mat4'\r\n */\r\n protected getType() {\r\n return 'mat4';\r\n }\r\n}\r\n\r\n/**\r\n * Inverse view-projection matrix input node\r\n *\r\n * @remarks\r\n * Provides the inverse of the view-projection matrix (clip space to world space transformation).\r\n * This matrix transforms coordinates from normalized device coordinates (NDC) back to world space.\r\n *\r\n * Equivalent to: inverse(projectionMatrix * viewMatrix)\r\n *\r\n * Used for:\r\n * - Screen-space to world-space reconstruction\r\n * - Deferred rendering world position reconstruction\r\n * - Picking and ray casting from screen coordinates\r\n * - Screen-space effects needing world position\r\n *\r\n * Output:\r\n * - Output 1: 4x4 inverse view-projection matrix (mat4)\r\n *\r\n * @example\r\n * ```typescript\r\n * const invViewProjMatrix = new InvViewProjMatrixNode();\r\n * const screenPos = new ScreenPositionNode();\r\n *\r\n * // Reconstruct world position from screen coordinates\r\n * const transform = new TransformNode();\r\n * transform.connectInput(1, screenPos, 1);\r\n * transform.connectInput(2, invViewProjMatrix, 1);\r\n * ```\r\n *\r\n * @public\r\n */\r\nexport class InvViewProjMatrixNode extends BaseGraphNode {\r\n /**\r\n * Creates a new inverse view-projection matrix node\r\n *\r\n * @remarks\r\n * Initializes with one output slot for the mat4 matrix.\r\n */\r\n constructor() {\r\n super();\r\n this._outputs = [{ id: 1, name: '' }];\r\n }\r\n /**\r\n * Generates a string representation of this node\r\n *\r\n * @returns 'ClipToWorldMatrix'\r\n */\r\n toString() {\r\n return 'ClipToWorldMatrix';\r\n }\r\n /**\r\n * Gets the serialization descriptor for this node type\r\n *\r\n * @returns Serialization class descriptor\r\n */\r\n static getSerializationCls() {\r\n return {\r\n ctor: InvViewProjMatrixNode,\r\n name: 'InvViewProjMatrixNode',\r\n getProps() {\r\n return [];\r\n }\r\n };\r\n }\r\n /**\r\n * Validates the node state\r\n *\r\n * @returns Empty string (always valid)\r\n *\r\n * @remarks\r\n * Matrix nodes are always valid as they have no inputs.\r\n */\r\n protected validate() {\r\n return '';\r\n }\r\n /**\r\n * Gets the output type\r\n *\r\n * @returns 'mat4'\r\n */\r\n protected getType() {\r\n return 'mat4';\r\n }\r\n}\r\n\r\n/**\r\n * Billboard matrix input node\r\n *\r\n * @public\r\n */\r\nexport class BillboardMatrixNode extends BaseGraphNode {\r\n /**\r\n * Creates a new billboard matrix node\r\n *\r\n * @remarks\r\n * Initializes with one output slot for the mat3 matrix.\r\n */\r\n constructor() {\r\n super();\r\n this._outputs = [{ id: 1, name: '' }];\r\n }\r\n /**\r\n * Generates a string representation of this node\r\n *\r\n * @returns 'BillboardMatrix'\r\n */\r\n toString() {\r\n return 'BillboardMatrix';\r\n }\r\n /**\r\n * Gets the serialization descriptor for this node type\r\n *\r\n * @returns Serialization class descriptor\r\n */\r\n static getSerializationCls() {\r\n return {\r\n ctor: BillboardMatrixNode,\r\n name: 'BillboardMatrixNode',\r\n getProps() {\r\n return [];\r\n }\r\n };\r\n }\r\n /**\r\n * Validates the node state\r\n *\r\n * @returns Empty string (always valid)\r\n *\r\n * @remarks\r\n * Matrix nodes are always valid as they have no inputs.\r\n */\r\n protected validate() {\r\n return '';\r\n }\r\n /**\r\n * Gets the output type\r\n *\r\n * @returns 'mat4'\r\n */\r\n protected getType() {\r\n return 'mat3';\r\n }\r\n}\r\n\r\n/**\r\n * Elapsed time input node\r\n *\r\n * @remarks\r\n * Provides the total elapsed time since the application started, in seconds.\r\n * This value continuously increases and is useful for creating time-based animations\r\n * and effects directly in the material shader.\r\n *\r\n * Used for:\r\n * - Animated textures (scrolling, rotating)\r\n * - Pulsating effects\r\n * - Wave animations\r\n * - Oscillating values (using sin/cos)\r\n * - Time-based procedural patterns\r\n *\r\n * Output:\r\n * - Output 1: Elapsed time in seconds (float)\r\n *\r\n * @example\r\n * ```typescript\r\n * const time = new ElapsedTimeNode();\r\n * const speed = new ConstantScalarNode();\r\n * speed.x = 0.5;\r\n *\r\n * // Animate UV scrolling\r\n * const mul = new CompMulNode();\r\n * mul.connectInput(1, time, 1);\r\n * mul.connectInput(2, speed, 1);\r\n *\r\n * const add = new CompAddNode();\r\n * add.connectInput(1, uvNode, 1);\r\n * add.connectInput(2, mul, 1);\r\n *\r\n * // Pulsating effect with sine wave\r\n * const sin = new SinNode();\r\n * sin.connectInput(1, time, 1);\r\n * ```\r\n *\r\n * @public\r\n */\r\nexport class ElapsedTimeNode extends BaseGraphNode {\r\n /**\r\n * Creates a new elapsed time node\r\n *\r\n * @remarks\r\n * Initializes with one output slot for the time value.\r\n */\r\n constructor() {\r\n super();\r\n this._outputs = [{ id: 1, name: '' }];\r\n }\r\n /**\r\n * Generates a string representation of this node\r\n *\r\n * @returns 'Elapsed time'\r\n */\r\n toString() {\r\n return 'Elapsed time';\r\n }\r\n /**\r\n * Gets the serialization descriptor for this node type\r\n *\r\n * @returns Serialization class descriptor\r\n */\r\n static getSerializationCls() {\r\n return {\r\n ctor: ElapsedTimeNode,\r\n name: 'ElapsedTimeNode',\r\n getProps() {\r\n return [];\r\n }\r\n };\r\n }\r\n /**\r\n * Validates the node state\r\n *\r\n * @returns Empty string (always valid)\r\n *\r\n * @remarks\r\n * Time nodes are always valid as they have no inputs.\r\n */\r\n protected validate() {\r\n return '';\r\n }\r\n /**\r\n * Gets the output type\r\n *\r\n * @returns 'float'\r\n */\r\n protected getType() {\r\n return 'float';\r\n }\r\n}\r\n\r\n/**\r\n * Camera position input node\r\n *\r\n * @remarks\r\n * Provides the world-space position of the camera/viewer.\r\n * This is the location of the camera in the 3D scene coordinate system.\r\n *\r\n * Used for:\r\n * - View direction calculations\r\n * - Distance-based effects (distance fog, LOD)\r\n * - Reflections and refractions\r\n * - Fresnel effects\r\n * - Environment mapping\r\n * - Specular highlights\r\n *\r\n * Outputs:\r\n * - Output 1: Full camera position (vec3)\r\n * - Output 2: X coordinate (float)\r\n * - Output 3: Y coordinate (float)\r\n * - Output 4: Z coordinate (float)\r\n *\r\n * @example\r\n * ```typescript\r\n * const cameraPos = new CameraPositionNode();\r\n * const worldPos = new VertexPositionNode();\r\n *\r\n * // Calculate view direction\r\n * const viewDir = new CompSubNode();\r\n * viewDir.connectInput(1, cameraPos, 1);\r\n * viewDir.connectInput(2, worldPos, 1);\r\n *\r\n * const normalizedViewDir = new NormalizeNode();\r\n * normalizedViewDir.connectInput(1, viewDir, 1);\r\n *\r\n * // Calculate distance to camera\r\n * const distance = new DistanceNode();\r\n * distance.connectInput(1, cameraPos, 1);\r\n * distance.connectInput(2, worldPos, 1);\r\n * ```\r\n *\r\n * @public\r\n */\r\nexport class CameraPositionNode extends BaseGraphNode {\r\n /**\r\n * Creates a new camera position node\r\n *\r\n * @remarks\r\n * Initializes with 4 output slots: full position and individual X, Y, Z components.\r\n */\r\n constructor() {\r\n super();\r\n this._outputs = [\r\n { id: 1, name: '' },\r\n { id: 2, name: 'x', swizzle: 'x' },\r\n { id: 3, name: 'y', swizzle: 'y' },\r\n { id: 4, name: 'z', swizzle: 'z' }\r\n ];\r\n }\r\n /**\r\n * Generates a string representation of this node\r\n *\r\n * @returns 'camera position'\r\n */\r\n toString() {\r\n return 'camera position';\r\n }\r\n /**\r\n * Gets the serialization descriptor for this node type\r\n *\r\n * @returns Serialization class descriptor\r\n */\r\n static getSerializationCls() {\r\n return {\r\n ctor: CameraPositionNode,\r\n name: 'CameraPositionNode',\r\n getProps() {\r\n return [];\r\n }\r\n };\r\n }\r\n /**\r\n * Validates the node state\r\n *\r\n * @returns Empty string (always valid)\r\n *\r\n * @remarks\r\n * Camera position nodes are always valid as they have no inputs.\r\n */\r\n protected validate() {\r\n return '';\r\n }\r\n /**\r\n * Gets the output type for a specific output slot\r\n *\r\n * @param id - The output slot ID\r\n * @returns 'float' for individual component outputs (id \\> 1), 'vec3' for full position\r\n */\r\n protected getType(id: number) {\r\n return id > 1 ? 'float' : 'vec3';\r\n }\r\n}\r\n\r\n/**\r\n * Camera vector input node\r\n *\r\n * @remarks\r\n * Provides the world-space direction from current surface point to camera.\r\n *\r\n * Outputs:\r\n * - Output 1: Full vector (vec3, normalized)\r\n * - Output 2: X component (float)\r\n * - Output 3: Y component (float)\r\n * - Output 4: Z component (float)\r\n *\r\n * @public\r\n */\r\nexport class CameraVectorNode extends BaseGraphNode {\r\n /**\r\n * Creates a new camera vector node\r\n *\r\n * @remarks\r\n * Initializes with 4 output slots: full vector and individual X, Y, Z components.\r\n */\r\n constructor() {\r\n super();\r\n this._outputs = [\r\n { id: 1, name: '' },\r\n { id: 2, name: 'x', swizzle: 'x' },\r\n { id: 3, name: 'y', swizzle: 'y' },\r\n { id: 4, name: 'z', swizzle: 'z' }\r\n ];\r\n }\r\n /**\r\n * Generates a string representation of this node\r\n *\r\n * @returns 'camera vector'\r\n */\r\n toString() {\r\n return 'camera vector';\r\n }\r\n /**\r\n * Gets the serialization descriptor for this node type\r\n *\r\n * @returns Serialization class descriptor\r\n */\r\n static getSerializationCls() {\r\n return {\r\n ctor: CameraVectorNode,\r\n name: 'CameraVectorNode',\r\n getProps() {\r\n return [];\r\n }\r\n };\r\n }\r\n /**\r\n * Validates the node state\r\n *\r\n * @returns Empty string (always valid)\r\n */\r\n protected validate() {\r\n return '';\r\n }\r\n /**\r\n * Gets the output type for a specific output slot\r\n *\r\n * @param id - The output slot ID\r\n * @returns 'float' for individual component outputs (id \\> 1), 'vec3' for full vector\r\n */\r\n protected getType(id: number) {\r\n return id > 1 ? 'float' : 'vec3';\r\n }\r\n}\r\n\r\n/**\r\n * Sky environment texture input node\r\n *\r\n * @remarks\r\n * Provides access to the scene's sky/environment cubemap texture.\r\n * This is typically used for skybox rendering, environment reflections,\r\n * and image-based lighting (IBL).\r\n *\r\n * The texture is a cubemap (texCube) that can be sampled using a 3D direction vector.\r\n *\r\n * Used for:\r\n * - Skybox rendering\r\n * - Environment reflections on metallic surfaces\r\n * - Image-based lighting (IBL)\r\n * - Ambient lighting from environment\r\n * - Reflections and refractions\r\n *\r\n * Output:\r\n * - Output 1: Cubemap texture sampler (texCube)\r\n *\r\n * @example\r\n * ```typescript\r\n * const skyTexture = new SkyEnvTextureNode();\r\n * const reflectionDir = new ReflectNode();\r\n *\r\n * // Sample environment for reflection\r\n * const envSample = new TextureSampleCubeNode();\r\n * envSample.connectInput(1, skyTexture, 1);\r\n * envSample.connectInput(2, reflectionDir, 1);\r\n *\r\n * // Use for metallic reflections\r\n * metalColor.connectInput(1, envSample, 1);\r\n * ```\r\n *\r\n * @public\r\n */\r\nexport class SkyEnvTextureNode extends BaseGraphNode {\r\n /**\r\n * Creates a new sky environment texture node\r\n *\r\n * @remarks\r\n * Initializes with one output slot for the cubemap sampler.\r\n */\r\n constructor() {\r\n super();\r\n this._outputs = [{ id: 1, name: '' }];\r\n }\r\n /**\r\n * Generates a string representation of this node\r\n *\r\n * @returns 'SkyEnvTexture'\r\n */\r\n toString() {\r\n return 'SkyEnvTexture';\r\n }\r\n /**\r\n * Gets the serialization descriptor for this node type\r\n *\r\n * @returns Serialization class descriptor\r\n */\r\n static getSerializationCls() {\r\n return {\r\n ctor: SkyEnvTextureNode,\r\n name: 'SkyEnvTextureNode',\r\n getProps() {\r\n return [];\r\n }\r\n };\r\n }\r\n /**\r\n * Validates the node state\r\n *\r\n * @returns Empty string (always valid)\r\n *\r\n * @remarks\r\n * Sky environment texture nodes are always valid as they have no inputs.\r\n */\r\n protected validate() {\r\n return '';\r\n }\r\n /**\r\n * Gets the output type\r\n *\r\n * @returns 'texCube' (cubemap texture sampler)\r\n */\r\n protected getType() {\r\n return 'texCube';\r\n }\r\n}\r\n\r\n/**\r\n * Camera near/far plane input node\r\n *\r\n * @remarks\r\n * Provides the camera's near and far clipping plane distances.\r\n * These values define the camera's visible depth range:\r\n * - Near plane: The closest distance at which objects are rendered\r\n * - Far plane: The farthest distance at which objects are rendered\r\n *\r\n * Used for:\r\n * - Depth linearization (converting from NDC depth to linear depth)\r\n * - Fog calculations based on depth\r\n * - Custom depth-of-field effects\r\n * - Z-buffer precision calculations\r\n * - Distance-based effects\r\n *\r\n * Outputs:\r\n * - Output 1: Both values as vec2 (x = near, y = far)\r\n * - Output 2: Near plane distance (float)\r\n * - Output 3: Far plane distance (float)\r\n *\r\n * @example\r\n * ```typescript\r\n * const nearFar = new CameraNearFarNode();\r\n * const depth = new DepthNode();\r\n *\r\n * // Linearize depth buffer value\r\n * // linearDepth = (2.0 * near) / (far + near - depth * (far - near))\r\n * const farMinusNear = new CompSubNode();\r\n * farMinusNear.connectInput(1, nearFar, 3); // far\r\n * farMinusNear.connectInput(2, nearFar, 2); // near\r\n *\r\n * // Use for distance fog\r\n * const fogFactor = new SaturateNode();\r\n * fogFactor.connectInput(1, linearDepthCalc, 1);\r\n * ```\r\n *\r\n * @public\r\n */\r\nexport class CameraNearFarNode extends BaseGraphNode {\r\n /**\r\n * Creates a new camera near/far node\r\n *\r\n * @remarks\r\n * Initializes with 3 output slots: combined vec2 and individual near/far values.\r\n */\r\n constructor() {\r\n super();\r\n this._outputs = [\r\n { id: 1, name: '' },\r\n { id: 2, name: 'near', swizzle: 'x' },\r\n { id: 3, name: 'far', swizzle: 'y' }\r\n ];\r\n }\r\n /**\r\n * Generates a string representation of this node\r\n *\r\n * @returns 'camera near far'\r\n */\r\n toString() {\r\n return 'camera near far';\r\n }\r\n /**\r\n * Gets the serialization descriptor for this node type\r\n *\r\n * @returns Serialization class descriptor\r\n */\r\n static getSerializationCls() {\r\n return {\r\n ctor: CameraNearFarNode,\r\n name: 'CameraNearFarNode',\r\n getProps() {\r\n return [];\r\n }\r\n };\r\n }\r\n /**\r\n * Validates the node state\r\n *\r\n * @returns Empty string (always valid)\r\n *\r\n * @remarks\r\n * Camera near/far nodes are always valid as they have no inputs.\r\n */\r\n protected validate() {\r\n return '';\r\n }\r\n /**\r\n * Gets the output type for a specific output slot\r\n *\r\n * @param id - The output slot ID\r\n * @returns 'float' for individual component outputs (id \\> 1), 'vec2' for combined output\r\n */\r\n protected getType(id: number) {\r\n return id > 1 ? 'float' : 'vec2';\r\n }\r\n}\r\n\r\n/**\r\n * Vertex position resolver node\r\n *\r\n * @remarks\r\n * Provides the resolved vertex position in object space (After applying skinning and morphing)\r\n *\r\n * @public\r\n */\r\nexport class ResolveVertexPositionNode extends BaseGraphNode {\r\n /**\r\n * Creates a new vertex position resolver node\r\n */\r\n constructor() {\r\n super();\r\n this._outputs = [{ id: 1, name: '' }];\r\n }\r\n /**\r\n * Generates a string representation of this node\r\n *\r\n * @returns 'vertex position resolved'\r\n */\r\n toString() {\r\n return 'vertex position resolved';\r\n }\r\n /**\r\n * Gets the serialization descriptor for this node type\r\n *\r\n * @returns Serialization class descriptor\r\n */\r\n static getSerializationCls() {\r\n return {\r\n ctor: ResolveVertexPositionNode,\r\n name: 'ResolveVertexPositionNode',\r\n getProps() {\r\n return [];\r\n }\r\n };\r\n }\r\n /**\r\n * Validates the node state\r\n *\r\n * @returns Empty string (always valid)\r\n *\r\n * @remarks\r\n * Vertex position resolver nodes are always valid as they have no inputs.\r\n */\r\n protected validate() {\r\n return '';\r\n }\r\n /**\r\n * Gets the output type for a specific output slot\r\n *\r\n * @returns vec3\r\n */\r\n protected getType() {\r\n return 'vec3';\r\n }\r\n}\r\n\r\n/**\r\n * Vertex normal resolver node\r\n *\r\n * @remarks\r\n * Provides the resolved vertex normal in object space (After applying skinning and morphing)\r\n *\r\n * @public\r\n */\r\nexport class ResolveVertexNormalNode extends BaseGraphNode {\r\n /**\r\n * Creates a new vertex normal resolver node\r\n */\r\n constructor() {\r\n super();\r\n this._outputs = [{ id: 1, name: '' }];\r\n }\r\n /**\r\n * Generates a string representation of this node\r\n *\r\n * @returns 'vertex normal resolved'\r\n */\r\n toString() {\r\n return 'vertex normal resolved';\r\n }\r\n /**\r\n * Gets the serialization descriptor for this node type\r\n *\r\n * @returns Serialization class descriptor\r\n */\r\n static getSerializationCls() {\r\n return {\r\n ctor: ResolveVertexNormalNode,\r\n name: 'ResolveVertexNormalNode',\r\n getProps() {\r\n return [];\r\n }\r\n };\r\n }\r\n /**\r\n * Validates the node state\r\n *\r\n * @returns Empty string (always valid)\r\n *\r\n * @remarks\r\n * Vertex normal resolve node are always valid as they have no inputs.\r\n */\r\n protected validate() {\r\n return '';\r\n }\r\n /**\r\n * Gets the output type for a specific output slot\r\n *\r\n * @returns vec3\r\n */\r\n protected getType() {\r\n return 'vec3';\r\n }\r\n}\r\n\r\n/**\r\n * Vertex tangent resolver node\r\n *\r\n * @remarks\r\n * Provides the resolved vertex tangent in object space (After applying skinning and morphing)\r\n *\r\n * @public\r\n */\r\nexport class ResolveVertexTangentNode extends BaseGraphNode {\r\n /**\r\n * Creates a new vertex tangent resolver node\r\n */\r\n constructor() {\r\n super();\r\n this._outputs = [{ id: 1, name: '' }];\r\n }\r\n /**\r\n * Generates a string representation of this node\r\n *\r\n * @returns 'vertex tangent resolved'\r\n */\r\n toString() {\r\n return 'vertex tangent resolved';\r\n }\r\n /**\r\n * Gets the serialization descriptor for this node type\r\n *\r\n * @returns Serialization class descriptor\r\n */\r\n static getSerializationCls() {\r\n return {\r\n ctor: ResolveVertexTangentNode,\r\n name: 'ResolveVertexTangentNode',\r\n getProps() {\r\n return [];\r\n }\r\n };\r\n }\r\n /**\r\n * Validates the node state\r\n *\r\n * @returns Empty string (always valid)\r\n *\r\n * @remarks\r\n * Vertex tangent resolve node are always valid as they have no inputs.\r\n */\r\n protected validate() {\r\n return '';\r\n }\r\n /**\r\n * Gets the output type for a specific output slot\r\n *\r\n * @returns vec4\r\n */\r\n protected getType() {\r\n return 'vec4';\r\n }\r\n}\r\n"],"names":["VertexOutputNode","BaseGraphNode","_index","index","_outputs","id","name","swizzle","getSerializationCls","ctor","createFunc","ctx","init","obj","getInitParams","getProps","toString","getType","VertexIndexNode","InstanceIndexNode","VertexColorNode","VertexUVNode","VertexPositionNode","PixelWorldPositionNode","VertexNormalNode","PixelNormalNode","VertexTangentNode","VertexBinormalNode","ProjectionMatrixNode","ViewMatrixNode","ViewProjMatrixNode","InvProjMatrixNode","InvViewProjMatrixNode","BillboardMatrixNode","ElapsedTimeNode","CameraPositionNode","CameraVectorNode","SkyEnvTextureNode","CameraNearFarNode","ResolveVertexPositionNode","ResolveVertexNormalNode","ResolveVertexTangentNode"],"mappings":";;AAGA;;;IAIO,MAAMA,gBAAyBC,SAAAA,aAAAA,CAAAA;IAC5BC,MAAe;AACvB,IAAA,WAAA,CAAYC,KAAa,CAAE;QACzB,KAAK,EAAA;QACL,IAAI,CAACD,MAAM,GAAGC,KAAAA;QACd,IAAI,CAACC,QAAQ,GAAG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AACA;;;;AAIC,MACDU,QAAW,GAAA;QACT,OAAO,wBAAA;AACT;AACA;;;;AAIC,MACD,OAAOR,mBAAsB,GAAA;QAC3B,OAAO;YACLC,IAAM+B,EAAAA,uBAAAA;YACNlC,IAAM,EAAA,yBAAA;AACNS,YAAAA,QAAAA,CAAAA,GAAAA;AACE,gBAAA,OAAO,EAAE;AACX;AACF,SAAA;AACF;AACA;;;;;;;AAOC,MACD,QAAqB,GAAA;QACnB,OAAO,EAAA;AACT;AACA;;;;AAIC,MACD,OAAoB,GAAA;QAClB,OAAO,MAAA;AACT;AACF;AAEA;;;;;;;IAQO,MAAM0B,wBAAiCxC,SAAAA,aAAAA,CAAAA;AAC5C;;AAEC,MACD,WAAc,EAAA;QACZ,KAAK,EAAA;QACL,IAAI,CAACG,QAAQ,GAAG;AAAC,YAAA;gBAAEC,EAAI,EAAA,CAAA;gBAAGC,IAAM,EAAA;AAAG;AAAE,SAAA;AACvC;AACA;;;;AAIC,MACDU,QAAW,GAAA;QACT,OAAO,yBAAA;AACT;AACA;;;;AAIC,MACD,OAAOR,mBAAsB,GAAA;QAC3B,OAAO;YACLC,IAAMgC,EAAAA,wBAAAA;YACNnC,IAAM,EAAA,0BAAA;AACNS,YAAAA,QAAAA,CAAAA,GAAAA;AACE,gBAAA,OAAO,EAAE;AACX;AACF,SAAA;AACF;AACA;;;;;;;AAOC,MACD,QAAqB,GAAA;QACnB,OAAO,EAAA;AACT;AACA;;;;AAIC,MACD,OAAoB,GAAA;QAClB,OAAO,MAAA;AACT;AACF;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bounding_volume.js","sources":["../../src/utility/bounding_volume.ts"],"sourcesContent":["import type { Vector3, Matrix4x4, Plane } from '@zephyr3d/base';\r\nimport { Frustum, AABB, ClipState } from '@zephyr3d/base';\r\n\r\n/**\r\n * Base interface for any kind of bounding volumes\r\n * @public\r\n */\r\nexport interface BoundingVolume {\r\n /**\r\n * Creates a new bounding volume by copying from this bounding volume\r\n */\r\n clone(): BoundingVolume;\r\n /**\r\n * Creates a new bounding volume by tranforming this bounding volume by a matrix\r\n * @param matrix - The transform matrix\r\n * @returns The created bounding volume\r\n */\r\n transform(matrix: Matrix4x4): BoundingVolume;\r\n /**\r\n * Check if this bounding volume is behind a plane\r\n * @param plane - The plane to check\r\n * @returns true if the bounding volume behinds the plane, false otherwise\r\n */\r\n behindPlane(plane: Plane): boolean;\r\n /**\r\n * Check if this bounding volume is outside a frustum\r\n * @param frustum - The frustum to check\r\n * @returns true if the bounding volume outsides the frustum, false otherwise\r\n */\r\n outsideFrustum(frustum: Frustum | Matrix4x4): boolean;\r\n /**\r\n * Gets the minimum AABB that contains the bounding volume\r\n * @returns The mimimum AABB that contains the bounding volume\r\n */\r\n toAABB(): AABB;\r\n}\r\n\r\n/**\r\n * The bounding box class\r\n * @public\r\n */\r\nexport class BoundingBox extends AABB implements BoundingVolume {\r\n /**\r\n * Creates an empty bounding box\r\n */\r\n constructor();\r\n /**\r\n * Creates a bounding box from an AABB\r\n * @param box - The AABB\r\n */\r\n constructor(box: AABB);\r\n /**\r\n * Creates a bounding box from the min point and the max point\r\n * @param minPoint - Min point of the box\r\n * @param maxPoint - Max point of the box\r\n */\r\n constructor(minPoint: Vector3, maxPoint: Vector3);\r\n constructor(arg0?: Vector3 | AABB, arg1?: Vector3) {\r\n super(arg0 as any, arg1!);\r\n }\r\n /** {@inheritDoc BoundingVolume.behindPlane} */\r\n behindPlane(plane: Plane): boolean {\r\n return this.toAABB().behindPlane(plane);\r\n }\r\n /** {@inheritDoc BoundingVolume.clone} */\r\n clone() {\r\n return new BoundingBox(this);\r\n }\r\n /** {@inheritDoc BoundingVolume.transform} */\r\n transform(matrix: Matrix4x4) {\r\n return new BoundingBox(AABB.transform(this, matrix));\r\n }\r\n /** {@inheritDoc BoundingVolume.outsideFrustum} */\r\n outsideFrustum(frustum: Frustum | Matrix4x4) {\r\n return (\r\n (frustum instanceof Frustum ? this.getClipStateWithFrustum(frustum) : this.getClipState(frustum)) ===\r\n ClipState.NOT_CLIPPED\r\n );\r\n }\r\n /** {@inheritDoc BoundingVolume.toAABB} */\r\n toAABB() {\r\n return this;\r\n }\r\n}\r\n"],"names":["BoundingBox","AABB","arg0","arg1","behindPlane","plane","toAABB","clone","transform","matrix","outsideFrustum","frustum","Frustum","getClipStateWithFrustum","getClipState","ClipState","NOT_CLIPPED"],"mappings":";;AAqCA;;;IAIO,MAAMA,WAAoBC,SAAAA,IAAAA,CAAAA;IAgB/B,WAAYC,CAAAA,IAAqB,EAAEC,IAAc,CAAE;AACjD,QAAA,KAAK,CAACD,IAAaC,EAAAA,IAAAA,CAAAA;AACrB;oDAEAC,WAAYC,CAAAA,KAAY,EAAW;AACjC,QAAA,OAAO,IAAI,CAACC,MAAM,EAAA,CAAGF,WAAW,CAACC,KAAAA,CAAAA;AACnC;AACA,8CACAE,KAAQ,GAAA;QACN,OAAO,IAAIP,YAAY,IAAI,CAAA;AAC7B;kDAEAQ,SAAUC,CAAAA,MAAiB,EAAE;AAC3B,QAAA,OAAO,IAAIT,WAAYC,CAAAA,IAAAA,CAAKO,SAAS,CAAC,IAAI,EAAEC,MAAAA,CAAAA,CAAAA;AAC9C;uDAEAC,cAAeC,CAAAA,OAA4B,EAAE;AAC3C,QAAA,OACE,CAACA,OAAAA,YAAmBC,OAAU,GAAA,IAAI,CAACC,uBAAuB,CAACF,OAAW,CAAA,GAAA,IAAI,CAACG,YAAY,CAACH,OAAO,CAAA,MAC/FI,UAAUC,WAAW;AAEzB;AACA,+CACAV,MAAS,GAAA;AACP,QAAA,OAAO,IAAI;AACb;AACF;;;;"}
|
|
1
|
+
{"version":3,"file":"bounding_volume.js","sources":["../../src/utility/bounding_volume.ts"],"sourcesContent":["import type { Vector3, Matrix4x4, Plane } from '@zephyr3d/base';\r\nimport { Frustum, AABB, ClipState } from '@zephyr3d/base';\r\n\r\n/**\r\n * Base interface for any kind of bounding volumes\r\n * @public\r\n */\r\nexport interface BoundingVolume {\r\n /**\r\n * Creates a new bounding volume by copying from this bounding volume\r\n */\r\n clone(): BoundingVolume;\r\n /**\r\n * Creates a new bounding volume by tranforming this bounding volume by a matrix\r\n * @param matrix - The transform matrix\r\n * @returns The created bounding volume\r\n */\r\n transform(matrix: Matrix4x4): BoundingVolume;\r\n /**\r\n * Check if this bounding volume is behind a plane\r\n * @param plane - The plane to check\r\n * @returns true if the bounding volume behinds the plane, false otherwise\r\n */\r\n behindPlane(plane: Plane): boolean;\r\n /**\r\n * Check if this bounding volume is outside a frustum\r\n * @param frustum - The frustum to check\r\n * @returns true if the bounding volume outsides the frustum, false otherwise\r\n */\r\n outsideFrustum(frustum: Frustum | Matrix4x4): boolean;\r\n /**\r\n * Gets the minimum AABB that contains the bounding volume\r\n * @returns The mimimum AABB that contains the bounding volume\r\n */\r\n toAABB(): AABB;\r\n}\r\n\r\n/**\r\n * The bounding box class\r\n * @public\r\n */\r\nexport class BoundingBox extends AABB implements BoundingVolume {\r\n /**\r\n * Creates an empty bounding box\r\n */\r\n constructor();\r\n /**\r\n * Creates a bounding box from an AABB\r\n * @param box - The AABB\r\n */\r\n constructor(box: AABB);\r\n /**\r\n * Creates a bounding box from the min point and the max point\r\n * @param minPoint - Min point of the box\r\n * @param maxPoint - Max point of the box\r\n */\r\n constructor(minPoint: Vector3, maxPoint: Vector3);\r\n constructor(arg0?: Vector3 | AABB, arg1?: Vector3) {\r\n super(arg0 as any, arg1!);\r\n }\r\n /** {@inheritDoc BoundingVolume.behindPlane} */\r\n behindPlane(plane: Plane): boolean {\r\n return this.toAABB().behindPlane(plane);\r\n }\r\n /** {@inheritDoc BoundingVolume.clone} */\r\n clone() {\r\n return new BoundingBox(this) as this;\r\n }\r\n /** {@inheritDoc BoundingVolume.transform} */\r\n transform(matrix: Matrix4x4) {\r\n return new BoundingBox(AABB.transform(this, matrix));\r\n }\r\n /** {@inheritDoc BoundingVolume.outsideFrustum} */\r\n outsideFrustum(frustum: Frustum | Matrix4x4) {\r\n return (\r\n (frustum instanceof Frustum ? this.getClipStateWithFrustum(frustum) : this.getClipState(frustum)) ===\r\n ClipState.NOT_CLIPPED\r\n );\r\n }\r\n /** {@inheritDoc BoundingVolume.toAABB} */\r\n toAABB() {\r\n return this;\r\n }\r\n}\r\n"],"names":["BoundingBox","AABB","arg0","arg1","behindPlane","plane","toAABB","clone","transform","matrix","outsideFrustum","frustum","Frustum","getClipStateWithFrustum","getClipState","ClipState","NOT_CLIPPED"],"mappings":";;AAqCA;;;IAIO,MAAMA,WAAoBC,SAAAA,IAAAA,CAAAA;IAgB/B,WAAYC,CAAAA,IAAqB,EAAEC,IAAc,CAAE;AACjD,QAAA,KAAK,CAACD,IAAaC,EAAAA,IAAAA,CAAAA;AACrB;oDAEAC,WAAYC,CAAAA,KAAY,EAAW;AACjC,QAAA,OAAO,IAAI,CAACC,MAAM,EAAA,CAAGF,WAAW,CAACC,KAAAA,CAAAA;AACnC;AACA,8CACAE,KAAQ,GAAA;QACN,OAAO,IAAIP,YAAY,IAAI,CAAA;AAC7B;kDAEAQ,SAAUC,CAAAA,MAAiB,EAAE;AAC3B,QAAA,OAAO,IAAIT,WAAYC,CAAAA,IAAAA,CAAKO,SAAS,CAAC,IAAI,EAAEC,MAAAA,CAAAA,CAAAA;AAC9C;uDAEAC,cAAeC,CAAAA,OAA4B,EAAE;AAC3C,QAAA,OACE,CAACA,OAAAA,YAAmBC,OAAU,GAAA,IAAI,CAACC,uBAAuB,CAACF,OAAW,CAAA,GAAA,IAAI,CAACG,YAAY,CAACH,OAAO,CAAA,MAC/FI,UAAUC,WAAW;AAEzB;AACA,+CACAV,MAAS,GAAA;AACP,QAAA,OAAO,IAAI;AACb;AACF;;;;"}
|
package/dist/utility/pmrem.js
CHANGED
|
@@ -101,7 +101,7 @@ function createPMREMProgram(type, numSamples) {
|
|
|
101
101
|
});
|
|
102
102
|
},
|
|
103
103
|
fragment (pb) {
|
|
104
|
-
if (type === 'ggx') {
|
|
104
|
+
if (type === 'ggx' || type === 'charlie') {
|
|
105
105
|
this.alphaG = pb.float().uniform(0);
|
|
106
106
|
}
|
|
107
107
|
this.vFilteringInfo = pb.vec3().uniform(0);
|
|
@@ -206,7 +206,7 @@ function createPMREMProgram(type, numSamples) {
|
|
|
206
206
|
this.$return(this.result);
|
|
207
207
|
});
|
|
208
208
|
}
|
|
209
|
-
if (type === 'ggx') {
|
|
209
|
+
if (type === 'ggx' || type === 'charlie') {
|
|
210
210
|
pb.func('hemisphereImportanceSampleDggx', [
|
|
211
211
|
pb.vec2('u'),
|
|
212
212
|
pb.float('a')
|
|
@@ -217,6 +217,15 @@ function createPMREMProgram(type, numSamples) {
|
|
|
217
217
|
this.$l.sinTheta = pb.sqrt(pb.sub(1, this.cosTheta2));
|
|
218
218
|
this.$return(pb.vec3(pb.mul(pb.cos(this.phi), this.sinTheta), pb.mul(pb.sin(this.phi), this.sinTheta), this.cosTheta));
|
|
219
219
|
});
|
|
220
|
+
pb.func('hemisphereImportanceSampleCharlie', [
|
|
221
|
+
pb.vec2('u'),
|
|
222
|
+
pb.float('a')
|
|
223
|
+
], function() {
|
|
224
|
+
this.$l.phi = pb.mul(this.u.x, 2 * Math.PI);
|
|
225
|
+
this.$l.sinTheta = pb.pow(this.u.y, pb.div(this.a, pb.add(pb.mul(2, this.a), 1)));
|
|
226
|
+
this.$l.cosTheta = pb.sqrt(pb.sub(1, pb.mul(this.sinTheta, this.sinTheta)));
|
|
227
|
+
this.$return(pb.vec3(pb.mul(pb.cos(this.phi), this.sinTheta), pb.mul(pb.sin(this.phi), this.sinTheta), this.cosTheta));
|
|
228
|
+
});
|
|
220
229
|
pb.func('normalDistributionFunction_TrowbridgeReitzGGX', [
|
|
221
230
|
pb.float('NoH'),
|
|
222
231
|
pb.float('alphaG')
|
|
@@ -225,6 +234,15 @@ function createPMREMProgram(type, numSamples) {
|
|
|
225
234
|
this.$l.d = pb.add(pb.mul(this.NoH, this.NoH, pb.sub(this.a2, 1)), 1);
|
|
226
235
|
this.$return(pb.div(this.a2, pb.mul(this.d, this.d, Math.PI)));
|
|
227
236
|
});
|
|
237
|
+
pb.func('normalDistributionFunction_Charlie', [
|
|
238
|
+
pb.float('NoH'),
|
|
239
|
+
pb.float('roughness')
|
|
240
|
+
], function() {
|
|
241
|
+
this.$l.invR = pb.div(1, pb.max(this.roughness, 0.000001));
|
|
242
|
+
this.$l.cos2h = pb.mul(this.NoH, this.NoH);
|
|
243
|
+
this.$l.sin2h = pb.max(pb.sub(1, this.cos2h), 0.0078125);
|
|
244
|
+
this.$return(pb.div(pb.mul(pb.add(this.invR, 2), pb.pow(this.sin2h, pb.mul(this.invR, 0.5))), 2 * Math.PI));
|
|
245
|
+
});
|
|
228
246
|
pb.func('radiance', [
|
|
229
247
|
pb.float('alphaG'),
|
|
230
248
|
pb.vec3('direction'),
|
|
@@ -251,14 +269,22 @@ function createPMREMProgram(type, numSamples) {
|
|
|
251
269
|
this.$l.weight = pb.float(0);
|
|
252
270
|
this.$for(pb.int('i'), 0, numSamples, function() {
|
|
253
271
|
this.$l.Xi = this.hammersley2d(this.i, numSamples);
|
|
254
|
-
|
|
272
|
+
if (type === 'ggx') {
|
|
273
|
+
this.$l.H = this.hemisphereImportanceSampleDggx(this.Xi, this.alphaG);
|
|
274
|
+
} else {
|
|
275
|
+
this.$l.H = this.hemisphereImportanceSampleCharlie(this.Xi, this.alphaG);
|
|
276
|
+
}
|
|
255
277
|
this.$l.NoV = pb.float(1);
|
|
256
278
|
this.$l.NoH = this.H.z;
|
|
257
279
|
this.$l.NoH2 = pb.mul(this.H.z, this.H.z);
|
|
258
280
|
this.$l.NoL = pb.sub(pb.mul(this.NoH2, 2), 1);
|
|
259
281
|
this.$l.L = pb.normalize(pb.vec3(pb.mul(this.NoH, this.H.x, 2), pb.mul(this.NoH, this.H.y, 2), this.NoL));
|
|
260
282
|
this.$if(pb.greaterThan(this.NoL, 0), function() {
|
|
261
|
-
|
|
283
|
+
if (type === 'ggx') {
|
|
284
|
+
this.$l.pdf_inversed = pb.div(4, this.normalDistributionFunction_TrowbridgeReitzGGX(this.NoH, this.alphaG));
|
|
285
|
+
} else {
|
|
286
|
+
this.$l.pdf_inversed = pb.div(4, this.normalDistributionFunction_Charlie(this.NoH, this.alphaG));
|
|
287
|
+
}
|
|
262
288
|
this.$l.omegaS = pb.mul(this.pdf_inversed, this.NUM_SAMPLES_FLOAT_INVERSED);
|
|
263
289
|
this.$l.l = pb.add(pb.sub(this.log4(this.omegaS), this.log4(this.omegaP)), this.log4(this.K));
|
|
264
290
|
this.$l.mipLevel = pb.clamp(this.l, 0, this.maxLevel);
|
|
@@ -273,7 +299,7 @@ function createPMREMProgram(type, numSamples) {
|
|
|
273
299
|
});
|
|
274
300
|
}
|
|
275
301
|
pb.main(function() {
|
|
276
|
-
if (type === 'ggx') {
|
|
302
|
+
if (type === 'ggx' || type === 'charlie') {
|
|
277
303
|
this.$l.color = this.radiance(this.alphaG, this.$inputs.direction, this.vFilteringInfo);
|
|
278
304
|
}
|
|
279
305
|
if (type === 'lambertian') {
|
|
@@ -293,7 +319,7 @@ function doPrefilterCubemap(type, roughness, miplevel, srcTexture, sampler, dstF
|
|
|
293
319
|
bindgroup.setValue('vFilteringInfo', filteringInfo);
|
|
294
320
|
bindgroup.setValue('hdrScale', 1);
|
|
295
321
|
bindgroup.setTexture('inputTexture', srcTexture);
|
|
296
|
-
if (type === 'ggx') {
|
|
322
|
+
if (type === 'ggx' || type === 'charlie') {
|
|
297
323
|
bindgroup.setValue('alphaG', roughness);
|
|
298
324
|
}
|
|
299
325
|
device.setProgram(program);
|
|
@@ -339,10 +365,10 @@ function doPrefilterCubemap(type, roughness, miplevel, srcTexture, sampler, dstF
|
|
|
339
365
|
const attachMiplevel = fb.getColorAttachmentMipLevel(0);
|
|
340
366
|
const generateMipmap = fb.getColorAttachmentGenerateMipmaps(0);
|
|
341
367
|
const destTex = fb.getColorAttachments()[0];
|
|
342
|
-
const mips = type === 'ggx' ? destTex.mipLevelCount : 1;
|
|
368
|
+
const mips = type === 'ggx' || type === 'charlie' ? destTex.mipLevelCount : 1;
|
|
343
369
|
for(let i = 0; i < mips; i++){
|
|
344
370
|
const alpha = i === 0 ? 0 : Math.pow(2, i) / width;
|
|
345
|
-
doPrefilterCubemap(type, alpha, i, srcTex, fetchSampler(type === 'ggx' ? 'clamp_nearest_nomip' : 'clamp_linear'), fb, filteringInfo, numSamples ?? 64);
|
|
371
|
+
doPrefilterCubemap(type, alpha, i, srcTex, fetchSampler(type === 'ggx' || type === 'charlie' ? 'clamp_nearest_nomip' : 'clamp_linear'), fb, filteringInfo, numSamples ?? 64);
|
|
346
372
|
}
|
|
347
373
|
device.popDeviceStates();
|
|
348
374
|
device.setRenderStates(rs);
|