import { Texture, Material } from "three"; import { MeshPhysicalNodeMaterial } from "three/webgpu"; import { LayeredMaterialOptions, LayerConfig } from "../types"; /** * Context for terrain material creation * Mirrors TerrainMaterialContext from three-terrain-lod */ export interface TerrainContext { heightMap: Texture; diffuseTexture: Texture | null; maxHeight: number; worldSize: number; resolution: number; wireframe: boolean; showChunkBorders: boolean; } /** * Provider interface for terrain materials * Mirrors TerrainMaterialProvider from three-terrain-lod */ export interface TerrainProviderInterface { createMaterial(context: TerrainContext): Material; setWireframe?(enabled: boolean): void; setMaxHeight?(height: number): void; setShowChunkBorders?(enabled: boolean): void; dispose?(): void; onHeightMapUpdate?(heightMap: Texture): void; } /** * Configuration for LayeredTerrainMaterial */ export interface LayeredTerrainConfig extends LayeredMaterialOptions { /** Use blended height from layers for displacement (vs heightmap only) */ useLayerHeightBlending?: boolean; /** How much layer heights affect displacement (0-1) */ layerHeightInfluence?: number; /** Displacement scale multiplier */ displacementScale?: number; } /** * LayeredTerrainMaterialProvider * * An adapter that combines LayeredMaterial's layer blending system with * terrain vertex displacement. This allows using the full layered material * system (edge wear, blending, parallax, etc.) on terrain meshes. * * Compatible with three-terrain-lod's TerrainMaterialProvider interface. * * @example * ```typescript * import { LayeredTerrainMaterialProvider } from '@interverse/three-layered-material'; * import { TerrainLOD } from '@interverse/three-terrain-lod'; * * const layeredProvider = new LayeredTerrainMaterialProvider({ * layers: [ * { name: 'Grass', map: { color: grassTex, height: grassHeight } }, * { name: 'Rock', map: { color: rockTex, height: rockHeight }, mask: { useSlope: true } } * ], * useLayerHeightBlending: true * }); * * const terrain = new TerrainLOD({ ... }); * terrain.setMaterialProvider(layeredProvider); * ``` */ export declare class LayeredTerrainMaterialProvider implements TerrainProviderInterface { private config; private material; private maxHeightUniform; private showBordersUniform; private context; constructor(config?: LayeredTerrainConfig); /** * Create the terrain material with layered features + displacement */ createMaterial(context: TerrainContext): Material; /** * Build layer blending and return the blended result including height */ private buildLayerBlendingWithHeight; /** * Create chunk border overlay for debugging */ private createChunkBorderOverlay; /** * Set wireframe mode */ setWireframe(enabled: boolean): void; /** * Set maximum height */ setMaxHeight(height: number): void; /** * Set chunk border visibility */ setShowChunkBorders(enabled: boolean): void; /** * Clean up resources */ dispose(): void; /** * Update the layers configuration */ updateLayers(layers: LayerConfig[]): void; /** * Get the underlying material */ getMaterial(): MeshPhysicalNodeMaterial | null; } //# sourceMappingURL=LayeredTerrainMaterialProvider.d.ts.map