@takram/three-clouds 0.7.1 → 0.7.2

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.7.1",
3
+ "version": "0.7.2",
4
4
  "description": "A Three.js and R3F implementation of geospatial volumetric clouds",
5
5
  "keywords": [
6
6
  "three",
@@ -45,15 +45,15 @@
45
45
  "README.md"
46
46
  ],
47
47
  "dependencies": {
48
- "@takram/three-atmosphere": "0.17.0",
49
- "@takram/three-geospatial": "0.7.0",
48
+ "@takram/three-atmosphere": "0.17.1",
49
+ "@takram/three-geospatial": "0.7.1",
50
50
  "tiny-invariant": "^1.3.3",
51
51
  "type-fest": "^5.4.4"
52
52
  },
53
53
  "peerDependencies": {
54
54
  "@react-three/fiber": ">=9.0.4",
55
55
  "@react-three/postprocessing": ">=3.0.4",
56
- "postprocessing": ">=6.38.0",
56
+ "postprocessing": ">=6.36.7",
57
57
  "react": ">=19.0",
58
58
  "three": ">=0.170.0"
59
59
  },
@@ -98,14 +98,6 @@ layout(location = 1) out vec3 outputDepthVelocity;
98
98
  layout(location = 2) out float outputShadowLength;
99
99
  #endif // SHADOW_LENGTH
100
100
 
101
- float readDepth(const vec2 uv) {
102
- #if DEPTH_PACKING == 3201
103
- return unpackRGBAToDepth(texture(depthBuffer, uv));
104
- #else // DEPTH_PACKING == 3201
105
- return texture(depthBuffer, uv).r;
106
- #endif // DEPTH_PACKING == 3201
107
- }
108
-
109
101
  float getViewZ(const float depth) {
110
102
  #ifdef PERSPECTIVE_CAMERA
111
103
  return perspectiveDepthToViewZ(depth, cameraNear, cameraFar);
@@ -818,9 +810,10 @@ vec2 getHazeRayNearFar(const IntersectionResult intersections) {
818
810
  #endif // HAZE
819
811
 
820
812
  float getRayDistanceToScene(const vec3 rayDirection, out float viewZ) {
821
- float depth = readDepth(vUv * targetUvScale + temporalJitter);
813
+ float depth = readDepthValue(depthBuffer, vUv * targetUvScale + temporalJitter);
822
814
  depth = reverseLogDepth(depth, cameraNear, cameraFar);
823
815
  if (depth < 1.0 - 1e-7) {
816
+ depth = reverseLogDepth(depth, cameraNear, cameraFar);
824
817
  viewZ = getViewZ(depth);
825
818
  return -viewZ / dot(rayDirection, vCameraDirection);
826
819
  }