UNPKG

@lightningjs/renderer

Version:
30 lines (29 loc) 1.87 kB
import type { WebGlCoreRenderer } from '../WebGlCoreRenderer.js'; import { WebGlCoreShader, type DimensionsShaderProp, type AlphaShaderProp } from '../WebGlCoreShader.js'; import { type UniformInfo } from '../internal/ShaderUtils.js'; import type { WebGlCoreCtxTexture } from '../WebGlCoreCtxTexture.js'; import { ShaderEffect, type EffectDescUnion } from './effects/ShaderEffect.js'; import type { EffectMap } from '../../../CoreShaderManager.js'; export interface DynamicShaderProps extends DimensionsShaderProp, AlphaShaderProp { effects?: EffectDescUnion[]; } export declare class DynamicShader extends WebGlCoreShader { effects: Array<InstanceType<EffectMap[keyof EffectMap]>>; constructor(renderer: WebGlCoreRenderer, props: DynamicShaderProps, effectContructors: Partial<EffectMap>); bindTextures(textures: WebGlCoreCtxTexture[]): void; bindUniformMethods(props: DynamicShaderProps): void; protected bindProps(props: Required<DynamicShaderProps>): void; canBatchShaderProps(propsA: Required<DynamicShaderProps>, propsB: Required<DynamicShaderProps>): boolean; static createShader(props: DynamicShaderProps, effectContructors: Partial<EffectMap>): { effects: ShaderEffect[]; uniforms: UniformInfo[]; fragment: string; vertex: string; }; static resolveMethodDuplicate(key: string, effectMethod: string, methodCollection: Record<string, string>, increment?: number): string; static resolveDefaults(props: DynamicShaderProps, effectContructors?: Partial<EffectMap>): Required<DynamicShaderProps>; static makeCacheKey(props: DynamicShaderProps, effectContructors?: Partial<EffectMap>): string; static z$__type__Props: DynamicShaderProps; static vertex: () => string; static fragment: (uniforms: string, methods: string, effectMethods: string, drawEffects: string) => string; }