import { ImageTexture2D } from '@awayjs/renderer'; import { DirectionalLight } from '../lights/DirectionalLight'; import { ShadowMethodBase, _Shader_ShadowMethodBase } from './ShadowMethodBase'; /** * ShadowDitheredMethod provides a soft shadowing technique by randomly distributing sample points differently for each fragment. */ export declare class ShadowDitheredMethod extends ShadowMethodBase { static _grainTexture: ImageTexture2D; private static _grainUsages; private static _grainBitmapImage2D; private _depthMapSize; private _range; private _numSamples; static assetType: string; /** * @inheritDoc */ get assetType(): string; /** * The amount of samples to take for dithering. Minimum 1, maximum 24. The actual maximum may depend on the * complexity of the shader. */ get numSamples(): number; set numSamples(value: number); /** * The range in the shadow map in which to distribute the samples. */ get range(): number; set range(value: number); /** * Creates a new ShadowDitheredMethod object. * @param castingLight The light casting the shadows * @param numSamples The amount of samples to take for dithering. Minimum 1, maximum 24. */ constructor(castingLight: DirectionalLight, numSamples?: number, range?: number); /** * Creates a texture containing the dithering noise texture. */ private initGrainTexture; /** * @inheritDoc */ dispose(): void; } import { ShaderRegisterCache, ShaderRegisterData, ShaderRegisterElement } from '@awayjs/stage'; import { _Render_RenderableBase, ChunkVO } from '@awayjs/renderer'; import { LightingShader } from '../shaders/LightingShader'; /** * _Shader_ShadowDitheredMethod provides a soft shadowing technique by randomly distributing sample points differently for each fragment. */ export declare class _Shader_ShadowDitheredMethod extends _Shader_ShadowMethodBase { private _grainMap; private _fragmentConstantsIndex; /** * Creates a new _Shader_ShadowDitheredMethod. */ init(method: ShadowDitheredMethod, shader: LightingShader): void; /** * @inheritDoc */ _initVO(chunkVO: ChunkVO): void; /** * @inheritDoc */ _initConstants(): void; /** * @inheritDoc */ _activate(): void; /** * @inheritDoc */ _getFragmentCode(targetReg: ShaderRegisterElement, regCache: ShaderRegisterCache, sharedRegisters: ShaderRegisterData): string; /** * @inheritDoc */ _setRenderState(renderState: _Render_RenderableBase): void; /** * Adds the code for another tap to the shader code. * @param uvReg The uv register for the tap. * @param depthMapRegister The texture register containing the depth map. * @param decReg The register containing the depth map decoding data. * @param targetReg The target register to add the tap comparison result. * @param regCache The register cache managing the registers. * @return */ private _addSample; } //# sourceMappingURL=ShadowDitheredMethod.d.ts.map