/** * Triplanar texture mapping for MeshPhysicalMaterial. * * Replaces standard UV-based texture sampling with model-space triplanar * projection via `material.onBeforeCompile`. Eliminates seams on curved * surfaces (cylinders, cones, etc.) and maintains uniform texture scale * regardless of object proportions. * * All coordinates are in **model space** to match the geometry's bounding box. * `transformed` (model-space position) and `objectNormal` (model-space normal) * are used — NOT the view-space `transformedNormal`. * * NOTE: `onBeforeCompile` receives shaders BEFORE `#include` resolution. * Therefore we replace `#include ` directives with inline GLSL * that uses triplanar sampling, rather than replacing expanded texture2D calls. * * Handles: map, normalMap, roughnessMap, metalnessMap, emissiveMap, aoMap, * clearcoatNormalMap, alphaMap. */ import * as THREE from "three"; /** * Apply triplanar texture mapping to a MeshPhysicalMaterial. * * Modifies the material's shader via `onBeforeCompile` so that all texture * lookups use model-space triplanar projection instead of UV coordinates. * The material should be a **clone** (not shared) because `onBeforeCompile` * and `customProgramCacheKey` are set on it. * * Bounding box of the geometry determines coordinate normalization: the * texture tiles once across the largest dimension with uniform scale, * preserving aspect ratio. `textureRepeat` on the material's textures * (if set) is respected via the triplanarRepeat uniform. * * @param material - Material clone to modify * @param geometry - Geometry for bounding box computation */ export declare function applyTriplanarMapping(material: THREE.MeshPhysicalMaterial, geometry: THREE.BufferGeometry): void;