import { type Camera, Color, type Object3D, type Scene, Vector2, type WebGLRenderer, WebGLRenderTarget } from "three";
import { Pass } from "three/examples/jsm/postprocessing/Pass";
/**
 * Screen-Space Edge Detection Pass
 *
 * Implements Speckle-style edge detection using THREE methods:
 * 1. Depth discontinuity detection (silhouettes)
 * 2. Normal discontinuity detection (creases/corners)
 * 3. Object ID discontinuity detection (object boundaries)
 *
 * This approach detects edges on-the-fly without generating edge geometry,
 * resulting in constant GPU cost regardless of model complexity.
 */
export interface ScreenSpaceEdgesOptions {
    /** Edge line color (default: black) */
    edgeColor: Color;
    /** Edge opacity 0-1 (default: 0.8) */
    edgeOpacity: number;
    /** Edge thickness in pixels (default: 1.0) */
    edgeThickness: number;
    /** Depth edge sensitivity (default: 1.0) */
    depthMultiplier: number;
    /** Normal edge sensitivity (default: 1.0) */
    normalMultiplier: number;
    /** Normal edge bias - lower = more sensitive (default: 0.1) */
    normalBias: number;
    /** Enable depth-based edge detection (default: true) */
    enableDepthEdges: boolean;
    /** Enable normal-based edge detection (default: true) */
    enableNormalEdges: boolean;
    /** Enable object ID-based edge detection (default: true) */
    enableObjectIdEdges: boolean;
    /**
     * Alpha threshold below which fragments are excluded from edge detection.
     * - Default 0.01: Only completely hidden elements are skipped
     * - Set to ~0.15 to also skip ghosted elements (typically alpha 0.1)
     * This prevents ghosted elements from occluding edges of objects behind them.
     */
    ghostAlphaThreshold: number;
}
export declare class ScreenSpaceEdgesPass extends Pass {
    private scene;
    camera: Camera;
    private resolution;
    private normalTarget;
    private depthTarget;
    private objectIdTarget;
    private normalMaterial;
    private depthMaterial;
    private edgeMaterial;
    private objectIdMaterial;
    private copyMaterial;
    private alphaThresholdUniform;
    private fsQuad;
    options: ScreenSpaceEdgesOptions;
    /**
     * Objects to exclude from edge detection.
     * These objects will be temporarily hidden during the normal/depth render pass.
     * Use this to exclude UI elements, section box visuals, helpers, etc.
     */
    excludeObjects: Object3D[];
    /**
     * 🔧 FAST TOGGLE: When true, skips geometry renders and just passes through the image
     * Use this instead of `enabled` for faster on/off during camera movement
     * - `enabled = false`: Pass is completely skipped by EffectComposer (may cause pipeline issues)
     * - `bypass = true`: Pass runs but just copies input to output (very fast, no geometry render)
     */
    bypass: boolean;
    constructor(scene: Scene, camera: Camera, resolution?: Vector2, options?: Partial<ScreenSpaceEdgesOptions>);
    /**
     * Update options
     */
    setOptions(options: Partial<ScreenSpaceEdgesOptions>): void;
    /**
     * Update shader uniforms from options
     */
    private updateUniforms;
    /**
     * Resize render targets
     */
    setSize(width: number, height: number): void;
    /**
     * Main render method
     *
     * 🔧 HYBRID APPROACH:
     * - Depth edges: Uses main render's depth buffer (FREE if available)
     * - Normal edges: Requires 1 geometry pass (can't avoid - needed for crease detection)
     * - Object ID edges: 1 extra geometry pass (disabled by default)
     *
     * Note: Reconstructed normals from depth CANNOT detect internal creases!
     * We MUST render actual geometry normals for proper edge detection.
     *
     * 🔧 FAST TOGGLE: Set `bypass = true` to skip geometry renders (instant on/off)
     */
    render(renderer: WebGLRenderer, writeBuffer: WebGLRenderTarget, readBuffer: WebGLRenderTarget, deltaTime?: number, maskActive?: boolean): void;
    /**
     * Set the alpha threshold below which fragments are excluded from edge detection.
     * Use this to skip ghosted elements when rendering edges.
     * @param threshold - Alpha value (0-1). Fragments with alpha < threshold are skipped.
     *                   - 0.01 (default): Only hidden elements skipped
     *                   - 0.15: Also skip ghosted elements (typically alpha ~0.1)
     */
    setGhostAlphaThreshold(threshold: number): void;
    /**
     * Get the current alpha threshold for edge detection.
     */
    getGhostAlphaThreshold(): number;
    /**
     * Dispose resources
     */
    dispose(): void;
}
