import { type Effect } from "@onerjs/core/Materials/effect.js"; import { type ShaderCode } from "./buildTools/shaderCode.types.js"; /** * The shader code decorator. * Used to decorate the names of uniform, function and const variables for easier parsing. */ export declare const DecorateChar = "_"; /** * Describes a shader program. */ export type ShaderProgram = { /** * The vertex shader code. */ vertex?: string | undefined; /** * The fragment shader code. */ fragment: ShaderCode; }; /** * Creates a copy of a ShaderProgram so it can be modified without other instances being affected. * @param shaderProgram - The shader program to clone * @returns A new ShaderProgram instance */ export declare function CloneShaderProgram(shaderProgram: ShaderProgram): ShaderProgram; /** * The list of options required to create a shader block. * It mainly contains the shader code to execute and its associated parameters. */ export type ShaderCreationOptions = { /** * A friendly name for the shader visible in Spector or in logs. */ name: string; /** * Fragment shader source code. */ fragmentShader: string; /** * Vertex shader source code. */ vertexShader?: string; /** * Attributes to use in the shader */ attributeNames?: Array; /** * Uniforms to use in the shader */ uniformNames?: Array; /** * Texture sampler names to use in the shader */ samplerNames?: Array; /** * Defines to use in the shader */ defines?: Array; /** * Callback when the effect is compiled */ onCompiled?: (effect: Effect) => void; }; export declare const AutoDisableMainInputColorName = "autoMainInputColor"; export declare const DisableUniform = "disabled"; /** * Injects the disable uniform and adds a check for it at the beginning of the main function * @param shaderProgram - The shader program to inject the disable feature into */ export declare function InjectAutoSampleDisableCode(shaderProgram: ShaderProgram): void; /** * Gets the shader fragment code. * @param shaderProgram - The shader program to extract the code from. * @param mainCodeOnly - If true, only the main function code will be returned. * @returns The shader fragment code. */ export declare function GetShaderFragmentCode(shaderProgram: ShaderProgram, mainCodeOnly?: boolean): string; /** * Gets the shader creation options from a shader program. * @param shaderProgram - The shader program to build the create options from. * @returns The shader creation options. */ export declare function GetShaderCreateOptions(shaderProgram: ShaderProgram): ShaderCreationOptions; /** * Decorates a symbol (uniform, function or const) name. * @param symbol - The symbol to decorate. * @returns The decorated symbol. */ export declare function DecorateSymbol(symbol: string): string; /** * Undecorates a symbol (uniform, function or const) name. * @param symbol - The symbol to undecorate. * @returns The undecorated symbol. Throws an error if the symbol is not decorated. */ export declare function UndecorateSymbol(symbol: string): string; //# sourceMappingURL=shaderCodeUtils.d.ts.map