import { type EffectRenderer } from "@onerjs/core/Materials/effectRenderer.js"; import { type Effect } from "@onerjs/core/Materials/effect.js"; import { type ThinRenderTargetTexture } from "@onerjs/core/Materials/Textures/thinRenderTargetTexture.js"; import { type IDisposable } from "../IDisposable.js"; import { type ShaderProgram } from "../utils/shaderCodeUtils.js"; import { type IDisableableBlock } from "../blockFoundation/disableableShaderBlock.js"; import { type OutputBlock } from "../blockFoundation/outputBlock.js"; /** * The shader bindings for a ShaderBlock that can't be disabled. */ export declare abstract class ShaderBinding { /** * Binds all the required data to the shader when rendering. * Overridden by derived classes. * @param effect - defines the effect to bind the data to * @param width - defines the width of the output * @param height - defines the height of the output */ abstract bind(effect: Effect, width?: number, height?: number): void; private _remappedShaderVariables; /** * Gets the remapped shader variable name. * @param variableName - The variable name * @returns The remapped variable name */ getRemappedName(variableName: string): string; /** * Sets the remapped shader variables. * @param variableName - defines the variable name to remap * @param remappedName - defines the remapped name */ addShaderVariableRemapping(variableName: string, remappedName: string): void; } /** * The shader bindings for a disableable ShaderBlock. */ export declare abstract class DisableableShaderBinding extends ShaderBinding { private _disabled; /** * Construct a ShaderBinding instance. * @param parentBlock - The parent block */ constructor(parentBlock: IDisableableBlock); /** * Binds all the required data to the shader when rendering. * @param effect - defines the effect to bind the data to * @param _width - defines the width of the output * @param _height - defines the height of the output */ bind(effect: Effect, _width?: number, _height?: number): void; } /** * The shader runtime is the base for any runtime associated with a @see ShaderBlock. * * It encapsulates the basic needs to render a full screen effect mainly the effect wrapper holding on the shader program. * * It is able to either render to a texture or directly to the main canvas. * * It also manages the disposal of the effect wrapper. */ export declare class ShaderRuntime implements IDisposable { /** * Promise that resolves when the effect is ready to be used. */ readonly onReadyAsync: Promise; private readonly _engine; private readonly _effectRenderer; private readonly _effectWrapper; private readonly _shaderBinding; /** * Creates a new @see ShaderRuntime. * @param effectRenderer - defines the effect renderer to use to render the full screen effect * @param shaderProgram - defines the shader code associated with this runtime * @param shaderBinding - defines the shader bindings associated with this runtime */ constructor(effectRenderer: EffectRenderer, shaderProgram: ShaderProgram, shaderBinding: ShaderBinding); /** * Renders the full screen effect into a render target. * @param outputBlock - The output block to render to - assumes it has a .renderTargetWrapper */ renderToTargetWrapper(outputBlock: OutputBlock): void; /** * Renders the full screen effect into a texture. * @param renderTargetTexture - The render target texture to render into */ renderToTargetTexture(renderTargetTexture: ThinRenderTargetTexture): void; private _renderToTargetWrapper; /** * Renders the full screen effect into the main canvas. */ renderToCanvas(): void; /** * "Draws" the full screen effect into the currently bound output. * @param width - defines the width of the output * @param height - defines the height of the output */ private _draw; /** * Disposes the runtime resources. */ dispose(): void; } //# sourceMappingURL=shaderRuntime.d.ts.map