import { mat4, vec3 } from 'gl-matrix'; import type { StructureProvider } from '../core/index.js'; import type { Color } from '../index.js'; import type { Resources } from './Resources.js'; type SunDiscOptions = { size?: number; distance?: number; coreColor?: Color; glowColor?: Color; coreIntensity?: number; glowIntensity?: number; softness?: number; }; type FogOptions = { color?: Color; density?: number; heightFalloff?: number; }; type EmissiveOptions = { range?: number; intensity?: number; tint?: Color; }; type StarsOptions = { enabled?: boolean; density?: number; brightness?: number; }; type SkyOptions = { zenithColor?: Color; horizonColor?: Color; groundColor?: Color; sunGlowColor?: Color; sunGlowIntensity?: number; sunGlowExponent?: number; stars?: StarsOptions; }; type ShadowOptions = { enabled?: boolean; mapSize?: number; bias?: number; normalBias?: number; intensity?: number; softness?: number; frustumSize?: number; }; type PostProcessOptions = { enabled?: boolean; ao?: { enabled?: boolean; intensity?: number; radius?: number; samples?: number; }; bloom?: { enabled?: boolean; threshold?: number; intensity?: number; radius?: number; }; godRays?: { enabled?: boolean; intensity?: number; decay?: number; density?: number; samples?: number; }; }; type SunlightOptions = { direction?: vec3; color?: Color; ambientColor?: Color; fillColor?: Color; rimColor?: Color; intensity?: number; ambientIntensity?: number; fillIntensity?: number; rimIntensity?: number; horizonFalloff?: number; exposure?: number; sky?: SkyOptions; disc?: SunDiscOptions; fog?: FogOptions; shadow?: ShadowOptions; postProcess?: PostProcessOptions; emissive?: EmissiveOptions; }; type ThreeStructureRendererOptions = { chunkSize?: number; useInvisibleBlockBuffer?: boolean; drawDistance?: number; debug?: boolean; preserveDrawingBuffer?: boolean; antialias?: boolean; sunlight?: SunlightOptions; asyncBuild?: boolean; asyncChunkBuildTimeMs?: number; }; type CameraVector = vec3 | [number, number, number]; export type ThreeStructureCameraState = { position: vec3; target: vec3; up: vec3; fov: number; }; export type ThreeStructureCameraOptions = { position?: CameraVector; target?: CameraVector; up?: CameraVector; fov?: number; }; export declare class ThreeStructureRenderer { private structure; private readonly resources; private readonly renderer; private readonly structureScene; private readonly skyScene; private readonly overlayScene; private readonly camera; private readonly skyCamera; private readonly atlasTexture; private opaqueMaterial; private transparentMaterial; private coloredMaterial; private readonly lineMaterial; private readonly skyMaterial; private readonly shadowDepthMaterial; private shadowMap; private emissiveLightDataTex; private emissiveLightColorTex; private readonly shadowCamera; private sunlight; private skyMesh?; private sunDisc?; private shadowDirty; private emissiveSelectionDirty; private lastEmissiveCameraPos; private lastEmissiveLightCount; private sceneTarget; private depthTarget; private bloomBrightTarget; private bloomBlurTarget1; private bloomBlurTarget2; private godRaysTarget; private aoTarget; private postProcessQuad; private ssaoMaterial; private bloomBrightMaterial; private bloomBlurMaterial; private godRaysMaterial; private compositeMaterial; private readonly chunkBuilder; private readonly asyncBuild; private readonly asyncChunkBuildTimeMs; private buildPromise; private buildToken; private chunkMeshes; private grid?; private invisibleBlocks?; private outline?; private readonly chunkSize; private targetCenter; private cameraPosition; private cameraTarget; private cameraUp; private readonly cameraViewMatrix; useInvisibleBlocks: boolean; private readonly drawDistance?; private pixelSize; private readonly maxEmissiveTextureSize; private readonly debug; constructor(canvas: HTMLCanvasElement, structure: StructureProvider, resources: Resources, options?: ThreeStructureRendererOptions); setViewport(x: number, y: number, width: number, height: number, pixelRatio?: number): void; setFOV(fov: number): void; setCamera(options: ThreeStructureCameraOptions): this; getCamera(): ThreeStructureCameraState; getViewMatrix(): mat4; lookAt(position: CameraVector, target: CameraVector, up?: CameraVector): this; setCameraPosition(position: CameraVector): this; setCameraTarget(target: CameraVector): this; resetCamera(): this; setStructure(structure: StructureProvider): void; updateStructureBuffers(chunkPositions?: vec3[]): void; updateStructureBuffersAsync(chunkPositions?: vec3[]): Promise; whenReady(): Promise; drawStructure(viewMatrix?: mat4): void; drawColoredStructure(viewMatrix?: mat4): void; drawGrid(viewMatrix?: mat4): void; drawInvisibleBlocks(viewMatrix?: mat4): void; drawOutline(viewMatrix: mat4, pos: vec3): void; drawOutline(pos: vec3): void; dispose(): void; private prepareCamera; private rebuildChunkObjects; private rebuildChunksAsync; private rebuildChunkObjectsAsync; private updateEmissiveLightUniforms; private updateEmissiveLightsForCamera; private cameraMovedEnough; private pickNearestEmissiveLights; private rebuildOverlay; private createStructureMaterial; private createStructureUniforms; setSunlight(sunlight?: SunlightOptions): void; private syncShadowResources; private syncPostProcessingResources; private applyPostProcessUniforms; private applySunDiscUniforms; private applySkyUniforms; private applySunlightUniforms; private createColoredMaterial; private createGrid; private createOutline; private createInvisibleBlocks; private setOverlayVisibility; private createAtlasTexture; private getCameraPosition; private updateStoredViewMatrix; private applyDrawDistance; private now; private yieldControl; private positionSunDisc; private createSunDisc; private createSkyMaterial; private createSkyMesh; private updateSkyUniforms; private createShadowDepthMaterial; private initShadowMap; private updateShadowCamera; private renderShadowPass; private initPostProcessing; private resizePostProcessTargets; private createSSAOMaterial; private createBloomBrightMaterial; private createBloomBlurMaterial; private createGodRaysMaterial; private createCompositeMaterial; private getSunScreenPosition; private renderPostProcessing; } export {}; //# sourceMappingURL=ThreeStructureRenderer.d.ts.map