@takram/three-clouds 0.1.2 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@takram/three-clouds",
3
- "version": "0.1.2",
3
+ "version": "0.2.0",
4
4
  "description": "A Three.js and R3F implementation of geospatial volumetric clouds",
5
5
  "keywords": [
6
6
  "three",
@@ -45,16 +45,16 @@
45
45
  "README.md"
46
46
  ],
47
47
  "dependencies": {
48
- "@takram/three-atmosphere": "0.10.1",
49
- "@takram/three-geospatial": "0.1.0",
48
+ "@takram/three-atmosphere": "0.11.0",
49
+ "@takram/three-geospatial": "0.2.0",
50
50
  "tiny-invariant": "^1.3.3",
51
51
  "type-fest": "^4.34.1"
52
52
  },
53
53
  "peerDependencies": {
54
- "@react-three/fiber": ">=8.17.10",
55
- "@react-three/postprocessing": ">=2.16.3",
56
- "postprocessing": ">=6.36.4",
57
- "react": ">=18.0",
54
+ "@react-three/fiber": ">=9.0.4",
55
+ "@react-three/postprocessing": ">=3.0.4",
56
+ "postprocessing": ">=6.36.7",
57
+ "react": ">=19.0",
58
58
  "three": ">=0.170.0"
59
59
  },
60
60
  "peerDependenciesMeta": {
@@ -776,14 +776,6 @@ export class CloudsEffect extends Effect {
776
776
  this.cloudsPass.currentMaterial.transmittanceTexture = value
777
777
  }
778
778
 
779
- /** @deprecated useHalfFloat is now always true */
780
- get useHalfFloat(): boolean {
781
- return true
782
- }
783
-
784
- /** @deprecated useHalfFloat is now always true */
785
- set useHalfFloat(value: boolean) {}
786
-
787
779
  get ellipsoid(): Ellipsoid {
788
780
  return this.cloudsPass.currentMaterial.ellipsoid
789
781
  }
@@ -1,4 +1,4 @@
1
- import { useFrame, useThree } from '@react-three/fiber'
1
+ import { useFrame, useThree, type ElementProps } from '@react-three/fiber'
2
2
  import { EffectComposerContext } from '@react-three/postprocessing'
3
3
  import {
4
4
  forwardRef,
@@ -27,10 +27,7 @@ import {
27
27
  parseUint8Array,
28
28
  STBNLoader
29
29
  } from '@takram/three-geospatial'
30
- import {
31
- type ExpandNestedProps,
32
- type PassThoughInstanceProps
33
- } from '@takram/three-geospatial/r3f'
30
+ import { type ExpandNestedProps } from '@takram/three-geospatial/r3f'
34
31
 
35
32
  import {
36
33
  CloudsEffect,
@@ -137,14 +134,11 @@ function useSTBNTextureState(
137
134
 
138
135
  export interface CloudsProps
139
136
  extends Omit<
140
- PassThoughInstanceProps<
141
- CloudsEffect,
142
- [],
143
- Partial<
144
- CloudsEffect &
145
- ExpandNestedProps<CloudsEffect, 'clouds'> &
146
- ExpandNestedProps<CloudsEffect, 'shadow'>
147
- >
137
+ ElementProps<
138
+ typeof CloudsEffect,
139
+ CloudsEffect &
140
+ ExpandNestedProps<CloudsEffect, 'clouds'> &
141
+ ExpandNestedProps<CloudsEffect, 'shadow'>
148
142
  >,
149
143
  | 'localWeatherTexture'
150
144
  | 'shapeTexture'
@@ -1,6 +1,5 @@
1
- import { FrustumSplitMode } from './helpers/splitFrustum';
2
1
  import { Matrix4, Vector2, Vector3, PerspectiveCamera } from 'three';
3
-
2
+ import { FrustumSplitMode } from './helpers/splitFrustum';
4
3
  export interface Cascade {
5
4
  readonly interval: Vector2;
6
5
  readonly matrix: Matrix4;
@@ -1,5 +1,4 @@
1
1
  import { DensityProfile, DensityProfileLike } from './DensityProfile';
2
-
3
2
  declare const paramKeys: readonly ["channel", "altitude", "height", "densityScale", "shapeAmount", "shapeDetailAmount", "weatherExponent", "shapeAlteringBias", "coverageFilterWidth", "shadow", "densityProfile"];
4
3
  export interface CloudLayerLike extends Partial<Pick<CloudLayer, Exclude<(typeof paramKeys)[number], 'densityProfile'>>> {
5
4
  densityProfile?: DensityProfileLike;
@@ -1,7 +1,6 @@
1
- import { DensityProfileLike } from './DensityProfile';
2
- import { CloudLayer, CloudLayerLike } from './CloudLayer';
3
1
  import { Vector3, Vector4 } from 'three';
4
-
2
+ import { CloudLayer, CloudLayerLike } from './CloudLayer';
3
+ import { DensityProfileLike } from './DensityProfile';
5
4
  type NumericKey = keyof {
6
5
  [P in keyof CloudLayer as number extends CloudLayer[P] ? P : never]: any;
7
6
  };
@@ -1,5 +1,4 @@
1
1
  import { Procedural3DTextureBase } from './Procedural3DTexture';
2
-
3
2
  export declare class CloudShape extends Procedural3DTextureBase {
4
3
  constructor();
5
4
  }
@@ -1,5 +1,4 @@
1
1
  import { Procedural3DTextureBase } from './Procedural3DTexture';
2
-
3
2
  export declare class CloudShapeDetail extends Procedural3DTextureBase {
4
3
  constructor();
5
4
  }
@@ -1,17 +1,16 @@
1
- import { ShadowPass } from './ShadowPass';
2
- import { ShadowMaterial } from './ShadowMaterial';
3
- import { QualityPreset } from './qualityPresets';
4
- import { ProceduralTexture } from './ProceduralTexture';
5
- import { Procedural3DTexture } from './Procedural3DTexture';
6
- import { CloudsPass } from './CloudsPass';
7
- import { CloudsMaterial } from './CloudsMaterial';
8
- import { CloudLayers } from './CloudLayers';
9
- import { CascadedShadowMaps } from './CascadedShadowMaps';
10
- import { UniformMap, Ellipsoid, PropertyShorthand, UniformShorthand } from '@takram/three-geospatial';
11
- import { AtmosphereParameters, AtmosphereOverlay, AtmosphereShadow, AtmosphereShadowLength } from '@takram/three-atmosphere';
12
- import { Camera, Data3DTexture, EventDispatcher, Matrix4, Texture, Uniform, Vector2, Vector3, DataTexture, DepthPackingStrategies, TextureDataType, WebGLRenderer, WebGLRenderTarget } from 'three';
13
1
  import { Effect, Resolution } from 'postprocessing';
14
-
2
+ import { Camera, Data3DTexture, EventDispatcher, Matrix4, Texture, Uniform, Vector2, Vector3, DataTexture, DepthPackingStrategies, TextureDataType, WebGLRenderer, WebGLRenderTarget } from 'three';
3
+ import { AtmosphereParameters, AtmosphereOverlay, AtmosphereShadow, AtmosphereShadowLength } from '@takram/three-atmosphere';
4
+ import { UniformMap, Ellipsoid, PropertyShorthand, UniformShorthand } from '@takram/three-geospatial';
5
+ import { CascadedShadowMaps } from './CascadedShadowMaps';
6
+ import { CloudLayers } from './CloudLayers';
7
+ import { CloudsMaterial } from './CloudsMaterial';
8
+ import { CloudsPass } from './CloudsPass';
9
+ import { Procedural3DTexture } from './Procedural3DTexture';
10
+ import { ProceduralTexture } from './ProceduralTexture';
11
+ import { QualityPreset } from './qualityPresets';
12
+ import { ShadowMaterial } from './ShadowMaterial';
13
+ import { ShadowPass } from './ShadowPass';
15
14
  declare const cloudsUniformKeys: ["maxIterationCount", "minStepSize", "maxStepSize", "maxRayDistance", "perspectiveStepScale", "minDensity", "minExtinction", "minTransmittance", "maxIterationCountToSun", "maxIterationCountToGround", "minSecondaryStepSize", "secondaryStepScale", "maxShadowFilterRadius", "maxShadowLengthIterationCount", "minShadowLengthStepSize", "maxShadowLengthRayDistance", "hazeDensityScale", "hazeExponent"];
16
15
  declare const cloudsMaterialParameterKeys: ["multiScatteringOctaves", "accurateSunSkyIrradiance", "accuratePhaseFunction"];
17
16
  declare const shadowUniformKeys: ["maxIterationCount", "minStepSize", "maxStepSize", "minDensity", "minExtinction", "minTransmittance", "opticalDepthTailScale"];
@@ -158,10 +157,6 @@ export declare class CloudsEffect extends Effect {
158
157
  set scatteringTexture(value: Data3DTexture | null);
159
158
  get transmittanceTexture(): DataTexture | null;
160
159
  set transmittanceTexture(value: DataTexture | null);
161
- /** @deprecated useHalfFloat is now always true */
162
- get useHalfFloat(): boolean;
163
- /** @deprecated useHalfFloat is now always true */
164
- set useHalfFloat(value: boolean);
165
160
  get ellipsoid(): Ellipsoid;
166
161
  set ellipsoid(value: Ellipsoid);
167
162
  get photometric(): boolean;
@@ -1,7 +1,6 @@
1
- import { AtmosphereUniforms, CloudLayerUniforms, CloudParameterUniforms } from './uniforms';
2
- import { AtmosphereMaterialBase, AtmosphereParameters, AtmosphereMaterialBaseUniforms } from '@takram/three-atmosphere';
3
1
  import { Matrix4, Uniform, Vector2, Vector3, BufferGeometry, Camera, Data3DTexture, DataArrayTexture, Group, Object3D, Scene, Texture, WebGLRenderer } from 'three';
4
-
2
+ import { AtmosphereMaterialBase, AtmosphereParameters, AtmosphereMaterialBaseUniforms } from '@takram/three-atmosphere';
3
+ import { AtmosphereUniforms, CloudLayerUniforms, CloudParameterUniforms } from './uniforms';
5
4
  declare module 'three' {
6
5
  interface Camera {
7
6
  isPerspectiveCamera?: boolean;
@@ -1,11 +1,10 @@
1
- import { AtmosphereUniforms, CloudLayerUniforms, CloudParameterUniforms } from './uniforms';
2
- import { PassBase, PassBaseOptions } from './PassBase';
3
- import { CloudsResolveMaterial } from './CloudsResolveMaterial';
4
- import { CloudsMaterial } from './CloudsMaterial';
5
- import { AtmosphereParameters } from '@takram/three-atmosphere';
6
- import { Camera, DataArrayTexture, DepthPackingStrategies, Texture, TextureDataType, WebGLRenderer } from 'three';
7
1
  import { ShaderPass } from 'postprocessing';
8
-
2
+ import { Camera, DataArrayTexture, DepthPackingStrategies, Texture, TextureDataType, WebGLRenderer } from 'three';
3
+ import { AtmosphereParameters } from '@takram/three-atmosphere';
4
+ import { CloudsMaterial } from './CloudsMaterial';
5
+ import { CloudsResolveMaterial } from './CloudsResolveMaterial';
6
+ import { PassBase, PassBaseOptions } from './PassBase';
7
+ import { AtmosphereUniforms, CloudLayerUniforms, CloudParameterUniforms } from './uniforms';
9
8
  export interface CloudsPassOptions extends PassBaseOptions {
10
9
  parameterUniforms: CloudParameterUniforms;
11
10
  layerUniforms: CloudLayerUniforms;
@@ -1,5 +1,4 @@
1
1
  import { RawShaderMaterial, Uniform, Vector2, BufferGeometry, Camera, Group, Object3D, Scene, Texture, WebGLRenderer } from 'three';
2
-
3
2
  export interface CloudsResolveMaterialParameters {
4
3
  colorBuffer?: Texture | null;
5
4
  depthVelocityBuffer?: Texture | null;
@@ -1,5 +1,4 @@
1
1
  import { ProceduralTextureBase } from './ProceduralTexture';
2
-
3
2
  export declare class LocalWeather extends ProceduralTextureBase {
4
3
  constructor();
5
4
  }
@@ -1,7 +1,6 @@
1
- import { CascadedShadowMaps } from './CascadedShadowMaps';
2
- import { Camera } from 'three';
3
1
  import { Pass } from 'postprocessing';
4
-
2
+ import { Camera } from 'three';
3
+ import { CascadedShadowMaps } from './CascadedShadowMaps';
5
4
  export interface PassBaseOptions {
6
5
  shadow: CascadedShadowMaps;
7
6
  }
@@ -1,6 +1,5 @@
1
- import { ProceduralTexture } from './ProceduralTexture';
2
1
  import { Data3DTexture, WebGLRenderer } from 'three';
3
-
2
+ import { ProceduralTexture } from './ProceduralTexture';
4
3
  export type Procedural3DTexture = ProceduralTexture<Data3DTexture>;
5
4
  export interface Procedural3DTextureBaseParameters {
6
5
  size: number;
@@ -1,5 +1,4 @@
1
1
  import { Texture, WebGLRenderer } from 'three';
2
-
3
2
  export interface ProceduralTexture<T extends Texture = Texture> {
4
3
  readonly size: number;
5
4
  readonly texture: T;
@@ -1,6 +1,5 @@
1
- import { WebGLArrayRenderTarget, WebGLRenderer, WebGLRenderTarget } from 'three';
2
1
  import { ShaderPass } from 'postprocessing';
3
-
2
+ import { WebGLArrayRenderTarget, WebGLRenderer, WebGLRenderTarget } from 'three';
4
3
  export declare class ShaderArrayPass extends ShaderPass {
5
4
  input: string;
6
5
  render(renderer: WebGLRenderer, inputBuffer: WebGLRenderTarget | null, outputBuffer: WebGLArrayRenderTarget, deltaTime?: number, stencilTest?: boolean): void;
@@ -1,6 +1,5 @@
1
- import { AtmosphereUniforms, CloudLayerUniforms, CloudParameterUniforms } from './uniforms';
2
1
  import { Matrix4, RawShaderMaterial, Uniform, Vector2, Data3DTexture } from 'three';
3
-
2
+ import { AtmosphereUniforms, CloudLayerUniforms, CloudParameterUniforms } from './uniforms';
4
3
  export interface ShadowMaterialParameters {
5
4
  parameterUniforms: CloudParameterUniforms;
6
5
  layerUniforms: CloudLayerUniforms;
@@ -1,10 +1,9 @@
1
- import { AtmosphereUniforms, CloudLayerUniforms, CloudParameterUniforms } from './uniforms';
2
- import { ShadowResolveMaterial } from './ShadowResolveMaterial';
3
- import { ShadowMaterial } from './ShadowMaterial';
4
- import { ShaderArrayPass } from './ShaderArrayPass';
5
- import { PassBase, PassBaseOptions } from './PassBase';
6
1
  import { DataArrayTexture, TextureDataType, WebGLRenderer } from 'three';
7
-
2
+ import { PassBase, PassBaseOptions } from './PassBase';
3
+ import { ShaderArrayPass } from './ShaderArrayPass';
4
+ import { ShadowMaterial } from './ShadowMaterial';
5
+ import { ShadowResolveMaterial } from './ShadowResolveMaterial';
6
+ import { AtmosphereUniforms, CloudLayerUniforms, CloudParameterUniforms } from './uniforms';
8
7
  export interface ShadowPassOptions extends PassBaseOptions {
9
8
  parameterUniforms: CloudParameterUniforms;
10
9
  layerUniforms: CloudLayerUniforms;
@@ -1,5 +1,4 @@
1
1
  import { RawShaderMaterial, Uniform, Vector2, DataArrayTexture } from 'three';
2
-
3
2
  export interface ShadowResolveMaterialParameters {
4
3
  inputBuffer?: DataArrayTexture | null;
5
4
  historyBuffer?: DataArrayTexture | null;
@@ -1,5 +1,4 @@
1
1
  import { ProceduralTextureBase } from './ProceduralTexture';
2
-
3
2
  export declare class Turbulence extends ProceduralTextureBase {
4
3
  constructor();
5
4
  }
package/types/bayer.d.ts CHANGED
@@ -1,4 +1,3 @@
1
1
  import { Vector2 } from 'three';
2
-
3
2
  export declare const bayerIndices: number[];
4
3
  export declare const bayerOffsets: Vector2[];
@@ -1,5 +1,4 @@
1
1
  import { Vector3, Camera, Matrix4 } from 'three';
2
-
3
2
  declare module 'three' {
4
3
  interface Camera {
5
4
  isOrthographicCamera?: boolean;
@@ -1,3 +1,2 @@
1
1
  import { WebGLArrayRenderTarget, WebGLRenderer } from 'three';
2
-
3
2
  export declare function setArrayRenderTargetLayers(renderer: WebGLRenderer, outputBuffer: WebGLArrayRenderTarget): void;
@@ -1,7 +1,6 @@
1
- import { CloudsEffect } from './CloudsEffect';
2
- import { SharedUnionFieldsDeep } from 'type-fest';
3
1
  import { Vector2 } from 'three';
4
-
2
+ import { SharedUnionFieldsDeep } from 'type-fest';
3
+ import { CloudsEffect } from './CloudsEffect';
5
4
  export type QualityPreset = 'low' | 'medium' | 'high' | 'ultra';
6
5
  declare const values: {
7
6
  resolutionScale: number;
@@ -1,6 +1,5 @@
1
- import { CloudLayer as CloudLayerImpl, CloudLayerLike } from '../CloudLayer';
2
1
  import { ExpandNestedProps } from '@takram/three-geospatial/r3f';
3
-
2
+ import { CloudLayer as CloudLayerImpl, CloudLayerLike } from '../CloudLayer';
4
3
  export interface CloudLayerProps extends CloudLayerLike, ExpandNestedProps<CloudLayerLike, 'densityProfile'> {
5
4
  index?: number;
6
5
  }
@@ -1,6 +1,5 @@
1
- import { CloudLayers as CloudLayersImpl } from '../CloudLayers';
2
1
  import { FC, ReactNode } from 'react';
3
-
2
+ import { CloudLayers as CloudLayersImpl } from '../CloudLayers';
4
3
  export interface CloudLayersContextValue {
5
4
  layers: CloudLayersImpl;
6
5
  indexPool: number[];
@@ -1,11 +1,10 @@
1
- import { ProceduralTexture } from '../ProceduralTexture';
2
- import { Procedural3DTexture } from '../Procedural3DTexture';
3
- import { CloudsEffect } from '../CloudsEffect';
4
- import { ExpandNestedProps, PassThoughInstanceProps } from '@takram/three-geospatial/r3f';
1
+ import { ElementProps } from '@react-three/fiber';
5
2
  import { Data3DTexture, Texture } from 'three';
6
-
7
- export interface CloudsProps extends Omit<PassThoughInstanceProps<CloudsEffect, [
8
- ], Partial<CloudsEffect & ExpandNestedProps<CloudsEffect, 'clouds'> & ExpandNestedProps<CloudsEffect, 'shadow'>>>, 'localWeatherTexture' | 'shapeTexture' | 'shapeDetailTexture' | 'turbulenceTexture' | 'stbnTexture'> {
3
+ import { ExpandNestedProps } from '@takram/three-geospatial/r3f';
4
+ import { CloudsEffect } from '../CloudsEffect';
5
+ import { Procedural3DTexture } from '../Procedural3DTexture';
6
+ import { ProceduralTexture } from '../ProceduralTexture';
7
+ export interface CloudsProps extends Omit<ElementProps<typeof CloudsEffect, CloudsEffect & ExpandNestedProps<CloudsEffect, 'clouds'> & ExpandNestedProps<CloudsEffect, 'shadow'>>, 'localWeatherTexture' | 'shapeTexture' | 'shapeDetailTexture' | 'turbulenceTexture' | 'stbnTexture'> {
9
8
  disableDefaultLayers?: boolean;
10
9
  localWeatherTexture?: Texture | ProceduralTexture | string;
11
10
  shapeTexture?: Data3DTexture | Procedural3DTexture | string;
@@ -1,8 +1,7 @@
1
- import { CloudLayers } from './CloudLayers';
2
- import { AtmosphereParameters } from '@takram/three-atmosphere';
3
- import { Primitive } from 'type-fest';
4
1
  import { Uniform, Vector3, Vector4, Data3DTexture, Matrix4, Texture, Vector2 } from 'three';
5
-
2
+ import { Primitive } from 'type-fest';
3
+ import { AtmosphereParameters } from '@takram/three-atmosphere';
4
+ import { CloudLayers } from './CloudLayers';
6
5
  export interface CloudParameterUniforms {
7
6
  scatteringCoefficient: Uniform<number>;
8
7
  absorptionCoefficient: Uniform<number>;