Luxar Viewer API Documentation - v2026.9.22
    Preparing search index...

    Module rendering/picking/picking-system/lens-distortion

    Brown–Conrady lens-distortion math for the picking system.

    TypeScript port of the GLSL applyDistortion function in rendering/post-processing/mega/shader.glsl.ts:117-128 (and its TSL counterpart in mega/shader.tsl.ts). Uses the green-channel distortion (the reference channel — no chromatic offset).

    Maps from distorted screen space back into undistorted source space. The picking system applies it to mouse coords so they index into the undistorted pick buffer correctly when post-processing distortion is active.

    Extracted from PickingSystem so the parity contract with the shader can be unit-tested directly. The caller supplies a scratch { x, y } so the hot path stays allocation-free.

    LensDistortionParams
    UVScratch
    applyLensDistortion