import { Pass, type Resizable } from 'postprocessing'; import * as THREE from 'three'; import type { GodraysPassParams } from './index'; export interface GodraysIllumPassProps { light: THREE.PointLight | THREE.DirectionalLight; camera: THREE.PerspectiveCamera; } export declare class GodraysIllumPass extends Pass implements Resizable { private material; private shadowMapSet; private props; private lastParams; private lightWorldPos; /** * Tracks whether we need to copy the shadow map depth texture to avoid comparison mode issues. * * Three.js configures depth textures differently based on shadow map type: * - PCFShadowMap (default): Sets compareFunction to LessEqualCompare, requiring sampler2DShadow * - PCFSoftShadowMap/BasicShadowMap: Sets compareFunction to null, allowing regular sampler2D * * The godrays shader needs raw depth values for raymarching, so it uses sampler2D. * When PCFShadowMap is used, we copy the depth data to our own texture without comparison mode * using WebGL's blitFramebuffer, which copies at the GPU level without shader sampling. */ private needsDepthCopy; private depthCopyTarget; private originalShadowMap; constructor(props: GodraysIllumPassProps, params: GodraysPassParams); setSize(width: number, height: number): void; render(renderer: THREE.WebGLRenderer, _inputBuffer: THREE.WebGLRenderTarget, outputBuffer: THREE.WebGLRenderTarget, _deltaTime?: number | undefined, _stencilTest?: boolean | undefined): void; /** * Copy the shadow map depth texture to our own texture without comparison mode. * Uses blitFramebuffer for GPU-level copy without shader sampling. */ private copyDepthTexture; /** * Check if the shadow map's depth texture has comparison mode enabled, * which requires copying the depth texture to avoid sampler type mismatch. * * This check is based on the actual compareFunction value rather than shadow map type, * making it robust against Three.js version differences: * - r182: PCFShadowMap has compareFunction set, PCFSoftShadowMap does not * - r183+: PCFSoftShadowMap is auto-converted to PCFShadowMap, so both have compareFunction set */ private checkForDepthCopy; setDepthTexture(depthTexture: THREE.Texture, depthPacking?: THREE.DepthPackingStrategies | undefined): void; private computeEffectiveMaxDist; private updateLightParams; updateUniforms({ light, camera }: GodraysIllumPassProps, params: GodraysPassParams): void; }