@takram/three-clouds
Version:
A Three.js and R3F implementation of geospatial volumetric clouds
92 lines (91 loc) • 3.99 kB
TypeScript
import { Matrix4, Uniform, Vector2, BufferGeometry, Camera, Data3DTexture, DataArrayTexture, Group, Object3D, Scene, Texture, WebGLRenderer } from 'three';
import { AtmosphereMaterialBase, AtmosphereParameters, AtmosphereMaterialBaseUniforms } from '@takram/three-atmosphere';
import { AtmosphereUniforms, CloudLayerUniforms, CloudParameterUniforms } from './uniforms';
declare module 'three' {
interface Camera {
isPerspectiveCamera?: boolean;
}
}
export interface CloudsMaterialParameters {
parameterUniforms: CloudParameterUniforms;
layerUniforms: CloudLayerUniforms;
atmosphereUniforms: AtmosphereUniforms;
}
export interface CloudsMaterialUniforms extends CloudParameterUniforms, CloudLayerUniforms, AtmosphereUniforms {
depthBuffer: Uniform<Texture | null>;
viewMatrix: Uniform<Matrix4>;
inverseProjectionMatrix: Uniform<Matrix4>;
inverseViewMatrix: Uniform<Matrix4>;
reprojectionMatrix: Uniform<Matrix4>;
viewReprojectionMatrix: Uniform<Matrix4>;
resolution: Uniform<Vector2>;
cameraNear: Uniform<number>;
cameraFar: Uniform<number>;
cameraHeight: Uniform<number>;
frame: Uniform<number>;
temporalJitter: Uniform<Vector2>;
targetUvScale: Uniform<Vector2>;
mipLevelScale: Uniform<number>;
stbnTexture: Uniform<Data3DTexture | null>;
skyLightScale: Uniform<number>;
groundBounceScale: Uniform<number>;
powderScale: Uniform<number>;
powderExponent: Uniform<number>;
maxIterationCount: Uniform<number>;
minStepSize: Uniform<number>;
maxStepSize: Uniform<number>;
maxRayDistance: Uniform<number>;
perspectiveStepScale: Uniform<number>;
minDensity: Uniform<number>;
minExtinction: Uniform<number>;
minTransmittance: Uniform<number>;
maxIterationCountToSun: Uniform<number>;
maxIterationCountToGround: Uniform<number>;
minSecondaryStepSize: Uniform<number>;
secondaryStepScale: Uniform<number>;
shadowBuffer: Uniform<DataArrayTexture | null>;
shadowTexelSize: Uniform<Vector2>;
shadowIntervals: Uniform<Vector2[]>;
shadowMatrices: Uniform<Matrix4[]>;
shadowFar: Uniform<number>;
maxShadowFilterRadius: Uniform<number>;
maxShadowLengthIterationCount: Uniform<number>;
minShadowLengthStepSize: Uniform<number>;
maxShadowLengthRayDistance: Uniform<number>;
hazeDensityScale: Uniform<number>;
hazeExponent: Uniform<number>;
hazeScatteringCoefficient: Uniform<number>;
hazeAbsorptionCoefficient: Uniform<number>;
}
export declare class CloudsMaterial extends AtmosphereMaterialBase {
uniforms: AtmosphereMaterialBaseUniforms & CloudsMaterialUniforms;
temporalUpscale: boolean;
private previousProjectionMatrix?;
private previousViewMatrix?;
constructor({ parameterUniforms, layerUniforms, atmosphereUniforms }: CloudsMaterialParameters, atmosphere?: AtmosphereParameters);
onBeforeRender(renderer: WebGLRenderer, scene: Scene, camera: Camera, geometry: BufferGeometry, object: Object3D, group: Group): void;
copyCameraSettings(camera: Camera): void;
copyReprojectionMatrix(camera: Camera): void;
setSize(width: number, height: number, targetWidth?: number, targetHeight?: number): void;
setShadowSize(width: number, height: number): void;
get depthBuffer(): Texture | null;
set depthBuffer(value: Texture | null);
depthPacking: number;
localWeatherChannels: string;
shapeDetail: boolean;
turbulence: boolean;
shadowLength: boolean;
haze: boolean;
multiScatteringOctaves: number;
/** @deprecated Use accurateSunSkyLight instead. */
get accurateSunSkyIrradiance(): boolean;
/** @deprecated Use accurateSunSkyLight instead. */
set accurateSunSkyIrradiance(value: boolean);
accurateSunSkyLight: boolean;
accuratePhaseFunction: boolean;
shadowCascadeCount: number;
shadowSampleCount: number;
scatterAnisotropy1: number;
scatterAnisotropy2: number;
scatterAnisotropyMix: number;
}