import { Texture } from "three/webgpu"; import { ParallaxConfig } from "./ParallaxConfig"; type Node = any; export interface ParallaxMappingResult { uv: Node; depthDelta: Node; } /** * Parallax Occlusion Mapping with proper height texture sampling. * * All ray-march paths use TSL `Loop` + `If` + `Break` + `.assign()` mutating * single VarNodes declared once outside the loop. The previous JS-unrolled * `select` chain produced one VarNode per JS step that referenced the * previous step's VarNode, and at higher quality (`steps >= 32`) that long * chain made Three's WGSL builder emit * `nodeVarN = ( nodeVarM - /* Recursion detected. *\/ )` * fragments and refuse to compile the fragment shader. The Loop + assign * pattern (from Promontis' POM reference) avoids that entirely and emits a * real for-loop in the shader. */ export declare class ParallaxMapper { /** * Apply parallax offset to UV coordinates * @param uv - Base UV coordinates * @param heightMap - Height texture to sample during ray marching * @param config - Parallax configuration * @param scale - Texture scale applied to UVs */ apply(uv: Node, heightMap: Texture, config: ParallaxConfig, scale?: number): Node; /** * Apply parallax and return auxiliary data for material/post effects. */ applyDetailed(uv: Node, heightMap: Texture, config: ParallaxConfig, scale?: number): ParallaxMappingResult; /** * Simple parallax - single offset based on height. * Fast but low quality, good for subtle effects. No loop. */ private simpleParallax; /** * Steep Parallax Mapping - fixed step ray marching with height-aware early * exit. Single VarNode + Loop + If + Break. */ private steepParallax; /** * Parallax Occlusion Mapping - full quality with binary search refinement. * Single-VarNode + Loop pattern; no chained `select` VarNodes. */ private parallaxOcclusionMapping; /** * Silhouette-friendly POM variant with binary refinement and a non-zero * reference plane. Returns both displaced UV and depth delta. */ private silhouetteParallaxOcclusionMapping; private createHeightSampler; /** * Get view direction in tangent space. Prefer Three's `parallaxDirection` * builtin, falling back to a manual TBN inverse when unavailable. */ private getViewDirTangentSpace; /** * Compute a tangent-space parallax ray with max-offset clamping so the UV * never travels further than the texture detail can support at grazing * angles. */ private computeClampedParallaxRay; private resolveQualitySteps; /** * Legacy method for backward compatibility * @deprecated Use apply() with heightMap texture instead */ applyLegacy(uv: Node, height: Node, config: ParallaxConfig): Node; } export {}; //# sourceMappingURL=ParallaxMapper.d.ts.map