@takram/three-clouds 0.7.1 → 0.7.3
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/CHANGELOG.md +6 -0
- package/build/shared.cjs +8 -16
- package/build/shared.cjs.map +1 -1
- package/build/shared.js +38 -46
- package/build/shared.js.map +1 -1
- package/package.json +4 -4
- package/src/shaders/clouds.frag +2 -10
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@takram/three-clouds",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.3",
|
|
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.
|
|
49
|
-
"@takram/three-geospatial": "0.7.
|
|
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.
|
|
56
|
+
"postprocessing": ">=6.36.7",
|
|
57
57
|
"react": ">=19.0",
|
|
58
58
|
"three": ">=0.170.0"
|
|
59
59
|
},
|
package/src/shaders/clouds.frag
CHANGED
|
@@ -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,9 @@ vec2 getHazeRayNearFar(const IntersectionResult intersections) {
|
|
|
818
810
|
#endif // HAZE
|
|
819
811
|
|
|
820
812
|
float getRayDistanceToScene(const vec3 rayDirection, out float viewZ) {
|
|
821
|
-
float depth =
|
|
822
|
-
depth = reverseLogDepth(depth, cameraNear, cameraFar);
|
|
813
|
+
float depth = readDepthValue(depthBuffer, vUv * targetUvScale + temporalJitter);
|
|
823
814
|
if (depth < 1.0 - 1e-7) {
|
|
815
|
+
depth = reverseLogDepth(depth, cameraNear, cameraFar);
|
|
824
816
|
viewZ = getViewZ(depth);
|
|
825
817
|
return -viewZ / dot(rayDirection, vCameraDirection);
|
|
826
818
|
}
|