/** * Shader Graph Type Definitions * * Node-based visual shader programming system for HoloScript */ /** * Shader data types */ export type ShaderDataType = 'float' | 'vec2' | 'vec3' | 'vec4' | 'mat2' | 'mat3' | 'mat4' | 'int' | 'ivec2' | 'ivec3' | 'ivec4' | 'bool' | 'sampler2D' | 'samplerCube'; /** * Type compatibility map for connections */ export declare const TYPE_SIZES: Record; /** * Check if types are compatible for connection */ export declare function areTypesCompatible(from: ShaderDataType, to: ShaderDataType): boolean; /** * Get type conversion code */ export declare function getTypeConversion(from: ShaderDataType, to: ShaderDataType, expr: string): string; /** * Port direction */ export type PortDirection = 'input' | 'output'; /** * Node port definition */ export interface IShaderPort { /** Port identifier */ id: string; /** Display name */ name: string; /** Port direction */ direction: PortDirection; /** Data type */ type: ShaderDataType; /** Default value for inputs */ defaultValue?: number | number[]; /** Whether this port is required */ required?: boolean; /** Connected port reference */ connected?: { nodeId: string; portId: string; }; } /** * Node categories */ export type NodeCategory = 'input' | 'output' | 'math' | 'vector' | 'color' | 'texture' | 'utility' | 'material' | 'volumetric' | 'custom'; /** * Base shader node */ export interface IShaderNode { /** Unique node ID */ id: string; /** Node type identifier */ type: string; /** Display name */ name: string; /** Category */ category: NodeCategory; /** Input ports */ inputs: IShaderPort[]; /** Output ports */ outputs: IShaderPort[]; /** Position in graph editor */ position: { x: number; y: number; }; /** Custom properties */ properties?: Record; /** Preview enabled */ preview?: boolean; } /** * Connection between nodes */ export interface IShaderConnection { /** Connection ID */ id: string; /** Source node ID */ fromNode: string; /** Source port ID */ fromPort: string; /** Target node ID */ toNode: string; /** Target port ID */ toPort: string; } /** * Complete shader graph */ export interface IShaderGraph { /** Graph ID */ id: string; /** Graph name */ name: string; /** Description */ description?: string; /** All nodes */ nodes: Map; /** All connections */ connections: IShaderConnection[]; /** Graph version */ version: string; /** Metadata */ metadata?: Record; } /** * Node template for creating new nodes */ export interface INodeTemplate { /** Node type identifier */ type: string; /** Display name */ name: string; /** Category */ category: NodeCategory; /** Description */ description: string; /** Input port definitions */ inputs: Omit[]; /** Output port definitions */ outputs: Omit[]; /** Default properties */ defaultProperties?: Record; /** WGSL code generator */ generateCode: (node: IShaderNode, inputs: Record) => string; } /** * Input nodes */ export declare const INPUT_NODES: INodeTemplate[]; /** * Math nodes */ export declare const MATH_NODES: INodeTemplate[]; /** * Trigonometry nodes */ export declare const TRIG_NODES: INodeTemplate[]; /** * Vector nodes */ export declare const VECTOR_NODES: INodeTemplate[]; /** * Color nodes */ export declare const COLOR_NODES: INodeTemplate[]; /** * Texture nodes */ export declare const TEXTURE_NODES: INodeTemplate[]; /** * Utility nodes */ export declare const UTILITY_NODES: INodeTemplate[]; /** * Advanced material nodes — exotic optics, animation, weathering */ export declare const ADVANCED_MATERIAL_NODES: INodeTemplate[]; /** * Volumetric material nodes — ray marching, 3D noise, scattering */ export declare const VOLUMETRIC_NODES: INodeTemplate[]; /** * Output nodes */ export declare const OUTPUT_NODES: INodeTemplate[]; /** * Screen-space, caustics, and displacement nodes */ export declare const SCREEN_SPACE_NODES: INodeTemplate[]; /** * All built-in node templates */ export declare const ALL_NODE_TEMPLATES: INodeTemplate[]; /** * Get node template by type */ export declare function getNodeTemplate(type: string): INodeTemplate | undefined; /** * Compiled shader output */ export interface ICompiledShader { /** Vertex shader code */ vertexCode: string; /** Fragment shader code */ fragmentCode: string; /** Required uniforms */ uniforms: IShaderUniform[]; /** Required textures */ textures: IShaderTexture[]; /** Compilation warnings */ warnings: string[]; /** Compilation errors */ errors: string[]; } /** * Shader uniform */ export interface IShaderUniform { name: string; type: ShaderDataType; defaultValue?: number | number[]; } /** * Shader texture */ export interface IShaderTexture { name: string; type: 'texture_2d' | 'texture_cube'; binding: number; } /** * Compilation options */ export interface ICompileOptions { /** Target shader format */ target: 'wgsl' | 'glsl' | 'hlsl'; /** Enable optimizations */ optimize?: boolean; /** Include debug info */ debug?: boolean; /** Custom defines */ defines?: Record; } //# sourceMappingURL=ShaderGraphTypes.d.ts.map