import { ShaderBinding } from "../runtime/shaderRuntime.js"; import { type SerializedShaderBlockDefinition } from "../serialization/serializedShaderBlockDefinition.js"; import { type SmartFilter } from "../smartFilter.js"; import { type ShaderProgram } from "../utils/shaderCodeUtils.js"; import { ShaderBlock } from "./shaderBlock.js"; import { type Nullable } from "@onerjs/core/types.js"; /** * A block which loads a SerializedBlockDefinition for use in a SmartFilter. */ export declare class CustomShaderBlock extends ShaderBlock { /** * Deserializes a CustomShaderBlock from a serialized block definition. * @param smartFilter - The smart filter this block belongs to * @param name - Defines the name of the block * @param blockDefinition - The serialized block definition * @param data - The data property from the serialized block, if applicable * @returns The deserialized CustomShaderBlock instance */ static Create(smartFilter: SmartFilter, name: string, blockDefinition: SerializedShaderBlockDefinition, data?: any): CustomShaderBlock; /** * The class name of the block. */ static ClassName: string; private readonly _shaderProgram; private readonly _blockType; private readonly _namespace; private readonly _fragmentConstProperties; private _autoBoundInputs; /** * A list of the names of the properties added to this instance of the block, for example, * fragment const properties. * */ readonly dynamicPropertyNames: string[]; /** * The type of the block - used when serializing / deserializing the block, and in the editor. */ get blockType(): string; /** * The namespace of the block, which is used to reduce name collisions between blocks and also to group blocks in the editor UI. * By convention, sub namespaces are separated by a period (e.g. "Babylon.Demo.Effects"). */ get namespace(): Nullable; /** * Instantiates a new custom shader block. * @param smartFilter - The smart filter this block belongs to * @param name - The name of the block * @param disableOptimization - If true, this optimizer will not attempt to optimize this block * @param blockType - The type of the block * @param namespace - The namespace of the block * @param inputConnectionPoints - The input connection points of the * @param fragmentConstProperties - The define properties for the block * @param shaderProgram - The shader program for the block */ private constructor(); /** * Gets the shader program to use to render the block. * @returns The shader program to use to render the block */ getShaderProgram(): ShaderProgram; /** * Creates a dynamic property for the supplied const property with EditableInPropertyPage decorator. * @param constProperty - The const property metadata */ private _createConstProperty; /** * Checks a specific input connection point type to see if it has a default value, and registers the input * connection point accordingly. * @param connectionPoint - The input connection point to register */ private _registerSerializedInputConnectionPointV1; /** * Gets the shader binding for the custom shader block. * @returns The shader binding for the custom shader block */ getShaderBinding(): ShaderBinding; /** * Validates the default value of a connection point and returns it if valid. * If the default value is not provided or is invalid, this returns null. * @param connectionPointType - The type of the connection point * @param connectionPointName - The name of the connection point * @param defaultValue - The default value of the connection point * @returns The default value, or null if no default value is provided or it was invalid */ private _validateDefaultValue; } //# sourceMappingURL=customShaderBlock.d.ts.map