/** * Create a shader from named shader chunks. * * @param {import('../../platform/graphics/graphics-device.js').GraphicsDevice} device - The * graphics device. * @param {string} vsName - The vertex shader chunk name. * @param {string} fsName - The fragment shader chunk name. * @param {boolean | Record} [useTransformFeedback] - Whether * to use transform feedback. Defaults to false. * @param {object} [shaderDefinitionOptions] - Additional options that will be added to the shader * definition. * @param {boolean} [shaderDefinitionOptions.useTransformFeedback] - Whether to use transform * feedback. Defaults to false. * @param {string | string[]} [shaderDefinitionOptions.fragmentOutputTypes] - Fragment shader * output types, which default to vec4. Passing a string will set the output type for all color * attachments. Passing an array will set the output type for each color attachment. * @see ShaderUtils.createDefinition * @returns {Shader} The newly created shader. * @category Graphics */ export function createShader(device: import("../../platform/graphics/graphics-device.js").GraphicsDevice, vsName: string, fsName: string, useTransformFeedback?: boolean | Record, shaderDefinitionOptions?: { useTransformFeedback?: boolean; fragmentOutputTypes?: string | string[]; }): Shader; /** * Create a shader from the supplied source code. Note that this function adds additional shader * blocks to both vertex and fragment shaders, which allow the shader to use more features and * compile on both WebGL and WebGPU. Specifically, these blocks are added, and should not be * part of provided vsCode and fsCode: shader version, shader precision, commonly used extensions. * * @param {import('../../platform/graphics/graphics-device.js').GraphicsDevice} device - The * graphics device. * @param {string} vsCode - The vertex shader code. * @param {string} fsCode - The fragment shader code. * @param {string} uniqueName - Unique name for the shader. If a shader with this name already * exists, it will be returned instead of a new shader instance. * @param {Object} [attributes] - Object detailing the mapping of vertex shader * attribute names to semantics SEMANTIC_*. This enables the engine to match vertex buffer data as * inputs to the shader. Defaults to undefined, which generates the default attributes. * @param {boolean | Record} [useTransformFeedback] - Whether * to use transform feedback. Defaults to false. * @param {object} [shaderDefinitionOptions] - Additional options that will be added to the shader * definition. * @param {boolean} [shaderDefinitionOptions.useTransformFeedback] - Whether to use transform * feedback. Defaults to false. * @param {string | string[]} [shaderDefinitionOptions.fragmentOutputTypes] - Fragment shader * output types, which default to vec4. Passing a string will set the output type for all color * attachments. Passing an array will set the output type for each color attachment. * @see ShaderUtils.createDefinition * @returns {Shader} The newly created shader. * @category Graphics */ export function createShaderFromCode(device: import("../../platform/graphics/graphics-device.js").GraphicsDevice, vsCode: string, fsCode: string, uniqueName: string, attributes?: { [x: string]: string; }, useTransformFeedback?: boolean | Record, shaderDefinitionOptions?: { useTransformFeedback?: boolean; fragmentOutputTypes?: string | string[]; }): Shader; /** * Process shader using shader processing options, utilizing cache of the ProgramLibrary * * @param {Shader} shader - The shader to be processed. * @param {import('../../platform/graphics/shader-processor-options.js').ShaderProcessorOptions} processingOptions - * The shader processing options. * @returns {Shader} The processed shader. * @ignore */ export function processShader(shader: Shader, processingOptions: import("../../platform/graphics/shader-processor-options.js").ShaderProcessorOptions): Shader; import { Shader } from '../../platform/graphics/shader.js';