@cesium/engine 20.0.2-ion.0 → 21.0.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.
Files changed (182) hide show
  1. package/Build/ThirdParty/Workers/zip-web-worker.js +637 -0
  2. package/Build/Workers/{chunk-WZKTQZUW.js → chunk-2T4WAVWX.js} +6 -6
  3. package/Build/Workers/{chunk-6LULWCX3.js → chunk-3G5XEUPY.js} +1 -1
  4. package/Build/Workers/{chunk-OIMV4OE5.js → chunk-3MSNTCHW.js} +9 -9
  5. package/Build/Workers/{chunk-VZNF2GT7.js → chunk-3OPG2FGI.js} +4 -4
  6. package/Build/Workers/{chunk-MTBXKKSQ.js → chunk-3PUG3T2H.js} +12 -12
  7. package/Build/Workers/{chunk-XWRUYDF6.js → chunk-4PH27XAL.js} +2 -2
  8. package/Build/Workers/{chunk-P2V7PVDH.js → chunk-4VJYMLR6.js} +8 -8
  9. package/Build/Workers/{chunk-MFXTB5I4.js → chunk-5B3PGBQW.js} +11 -11
  10. package/Build/Workers/{chunk-USK6ZAY2.js → chunk-5GHCWGC4.js} +1 -1
  11. package/Build/Workers/{chunk-AHFTST3Q.js → chunk-5PEQUMCB.js} +12 -12
  12. package/Build/Workers/{chunk-23B3EYUM.js → chunk-64WSG7AT.js} +4 -4
  13. package/Build/Workers/{chunk-CEA3L7M7.js → chunk-6J6WGCWP.js} +4 -4
  14. package/Build/Workers/{chunk-VSMKMGX4.js → chunk-75B34CC6.js} +5 -5
  15. package/Build/Workers/{chunk-IS5FETN7.js → chunk-7PLX65MV.js} +5 -5
  16. package/Build/Workers/{chunk-FNUSHLOY.js → chunk-AR2FUSG6.js} +1 -1
  17. package/Build/Workers/{chunk-VLGVUVJY.js → chunk-ARYRHDEB.js} +6 -6
  18. package/Build/Workers/{chunk-FHLPYFIW.js → chunk-B7INTBBB.js} +13 -13
  19. package/Build/Workers/{chunk-BHAATGZA.js → chunk-BDPSQXLX.js} +5 -5
  20. package/Build/Workers/{chunk-QZGZIAK2.js → chunk-BU4CGMHO.js} +6 -6
  21. package/Build/Workers/{chunk-YNPZU55A.js → chunk-BUBVUXDO.js} +6 -6
  22. package/Build/Workers/{chunk-LS63ERFB.js → chunk-CF72FAKC.js} +4 -4
  23. package/Build/Workers/{chunk-D4XRQNUO.js → chunk-DJ4ROETJ.js} +5 -5
  24. package/Build/Workers/{chunk-ABTG74AR.js → chunk-E5XCZVIY.js} +1 -1
  25. package/Build/Workers/{chunk-AFKNTEMH.js → chunk-EAYW4CFP.js} +16 -16
  26. package/Build/Workers/{chunk-YXTWHLJA.js → chunk-EHFMZFVC.js} +4 -4
  27. package/Build/Workers/{chunk-H7HFDM3G.js → chunk-FFCKCQPK.js} +5 -5
  28. package/Build/Workers/{chunk-V6ZGOX4I.js → chunk-GKCZ2G36.js} +7 -7
  29. package/Build/Workers/{chunk-VODCZKV2.js → chunk-HJ7IZBEI.js} +4 -4
  30. package/Build/Workers/{chunk-66MGJQFZ.js → chunk-JJZWDROM.js} +2 -2
  31. package/Build/Workers/{chunk-F4PS6RFF.js → chunk-JUOEBO4F.js} +10 -10
  32. package/Build/Workers/{chunk-WORBFT5H.js → chunk-K4IDXMIZ.js} +9 -9
  33. package/Build/Workers/{chunk-Q3OWKSC5.js → chunk-LL6HN3W4.js} +10 -10
  34. package/Build/Workers/{chunk-YUHWFX5H.js → chunk-LNTUIO55.js} +2 -2
  35. package/Build/Workers/{chunk-VA7LWA5Q.js → chunk-LWOCFJEH.js} +9 -9
  36. package/Build/Workers/{chunk-5DF5RVIO.js → chunk-MMUISYW4.js} +16 -16
  37. package/Build/Workers/{chunk-K6THSIDU.js → chunk-MXYW4BQ3.js} +2 -2
  38. package/Build/Workers/{chunk-X55ZOYMS.js → chunk-N6DVKXZD.js} +12 -12
  39. package/Build/Workers/{chunk-NKKNQMEH.js → chunk-NP46ZIBY.js} +3 -3
  40. package/Build/Workers/{chunk-QID3DXQA.js → chunk-OW6F6CPZ.js} +7 -7
  41. package/Build/Workers/{chunk-CYC7JX3P.js → chunk-P6OAOFBU.js} +8 -8
  42. package/Build/Workers/{chunk-FYYP46TF.js → chunk-PXDMWXO5.js} +2 -2
  43. package/Build/Workers/{chunk-TZDR2BAP.js → chunk-QS7623NH.js} +6 -6
  44. package/Build/Workers/{chunk-D5X2LOJ2.js → chunk-ROH45IXJ.js} +7 -7
  45. package/Build/Workers/{chunk-UR36KLNW.js → chunk-S2P6LCIB.js} +4 -4
  46. package/Build/Workers/{chunk-Z2W7ZIGV.js → chunk-S4NZVXU6.js} +2 -2
  47. package/Build/Workers/{chunk-YSDOO7AG.js → chunk-SGGO5WVA.js} +5 -5
  48. package/Build/Workers/{chunk-H5IQLAJP.js → chunk-TG7N7TPY.js} +47 -50
  49. package/Build/Workers/{chunk-XIDMFHR4.js → chunk-TUZQG4RW.js} +14 -14
  50. package/Build/Workers/{chunk-JVG6T2WE.js → chunk-UHVE7V65.js} +12 -12
  51. package/Build/Workers/{chunk-FAQ2XNFV.js → chunk-UY2HVPDL.js} +5 -5
  52. package/Build/Workers/{chunk-CUU3WGXJ.js → chunk-YNLPRFUQ.js} +6 -6
  53. package/Build/Workers/{chunk-X6GXYB3M.js → chunk-ZYOHBCCE.js} +1 -1
  54. package/Build/Workers/combineGeometry.js +21 -21
  55. package/Build/Workers/createBoxGeometry.js +15 -15
  56. package/Build/Workers/createBoxOutlineGeometry.js +13 -13
  57. package/Build/Workers/createCircleGeometry.js +23 -23
  58. package/Build/Workers/createCircleOutlineGeometry.js +16 -16
  59. package/Build/Workers/createCoplanarPolygonGeometry.js +30 -30
  60. package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +28 -28
  61. package/Build/Workers/createCorridorGeometry.js +26 -26
  62. package/Build/Workers/createCorridorOutlineGeometry.js +25 -25
  63. package/Build/Workers/createCylinderGeometry.js +17 -17
  64. package/Build/Workers/createCylinderOutlineGeometry.js +15 -15
  65. package/Build/Workers/createEllipseGeometry.js +23 -23
  66. package/Build/Workers/createEllipseOutlineGeometry.js +16 -16
  67. package/Build/Workers/createEllipsoidGeometry.js +16 -16
  68. package/Build/Workers/createEllipsoidOutlineGeometry.js +15 -15
  69. package/Build/Workers/createFrustumGeometry.js +15 -15
  70. package/Build/Workers/createFrustumOutlineGeometry.js +15 -15
  71. package/Build/Workers/createGeometry.js +21 -21
  72. package/Build/Workers/createGroundPolylineGeometry.js +19 -19
  73. package/Build/Workers/createPlaneGeometry.js +13 -13
  74. package/Build/Workers/createPlaneOutlineGeometry.js +12 -12
  75. package/Build/Workers/createPolygonGeometry.js +29 -29
  76. package/Build/Workers/createPolygonOutlineGeometry.js +27 -27
  77. package/Build/Workers/createPolylineGeometry.js +22 -22
  78. package/Build/Workers/createPolylineVolumeGeometry.js +28 -28
  79. package/Build/Workers/createPolylineVolumeOutlineGeometry.js +24 -24
  80. package/Build/Workers/createRectangleGeometry.js +24 -24
  81. package/Build/Workers/createRectangleOutlineGeometry.js +17 -17
  82. package/Build/Workers/createSimplePolylineGeometry.js +20 -20
  83. package/Build/Workers/createSphereGeometry.js +16 -16
  84. package/Build/Workers/createSphereOutlineGeometry.js +15 -15
  85. package/Build/Workers/createTaskProcessorWorker.js +3 -3
  86. package/Build/Workers/createVectorTileClampedPolylines.js +12 -12
  87. package/Build/Workers/createVectorTileGeometries.js +21 -21
  88. package/Build/Workers/createVectorTilePoints.js +11 -11
  89. package/Build/Workers/createVectorTilePolygons.js +19 -19
  90. package/Build/Workers/createVectorTilePolylines.js +12 -12
  91. package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +19 -19
  92. package/Build/Workers/createVerticesFromHeightmap.js +19 -19
  93. package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +16 -16
  94. package/Build/Workers/createWallGeometry.js +21 -21
  95. package/Build/Workers/createWallOutlineGeometry.js +20 -20
  96. package/Build/Workers/decodeDraco.js +10 -10
  97. package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +5 -5
  98. package/Build/Workers/decodeI3S.js +9 -9
  99. package/Build/Workers/gaussianSplatSorter.js +4 -4
  100. package/Build/Workers/gaussianSplatTextureGenerator.js +4 -4
  101. package/Build/Workers/transcodeKTX2.js +6 -6
  102. package/Build/Workers/transferTypedArrayTest.js +1 -1
  103. package/Build/Workers/upsampleQuantizedTerrainMesh.js +19 -19
  104. package/Source/Core/Event.js +41 -49
  105. package/Source/Core/GoogleMaps.js +2 -2
  106. package/Source/Core/Ion.js +1 -1
  107. package/Source/Core/IonResource.js +30 -4
  108. package/Source/Core/Resource.js +5 -1
  109. package/Source/DataSources/KmlDataSource.js +62 -63
  110. package/Source/DataSources/exportKml.js +27 -30
  111. package/Source/Scene/ArcGisMapService.js +1 -1
  112. package/Source/Scene/Azure2DImageryProvider.js +308 -0
  113. package/Source/Scene/Billboard.js +4 -0
  114. package/Source/Scene/BillboardCollection.js +9 -2
  115. package/Source/Scene/ClippingPlaneCollection.js +3 -3
  116. package/Source/Scene/ClippingPolygon.js +91 -2
  117. package/Source/Scene/CreditDisplay.js +1 -1
  118. package/Source/Scene/GaussianSplat3DTileContent.js +54 -9
  119. package/Source/Scene/GaussianSplatPrimitive.js +49 -50
  120. package/Source/Scene/Google2DImageryProvider.js +614 -0
  121. package/Source/Scene/IonImageryProvider.js +22 -1
  122. package/Source/Scene/LabelCollection.js +1 -0
  123. package/Source/Scene/Material.js +248 -80
  124. package/Source/Scene/Primitive.js +6 -0
  125. package/Source/Scene/PrimitiveState.js +123 -0
  126. package/Source/Scene/Scene.js +2 -2
  127. package/Source/Scene/VoxelBoundsCollection.js +494 -0
  128. package/Source/Scene/VoxelBoxShape.js +236 -101
  129. package/Source/Scene/VoxelCylinderShape.js +315 -204
  130. package/Source/Scene/VoxelEllipsoidShape.js +402 -119
  131. package/Source/Scene/VoxelPrimitive.js +119 -84
  132. package/Source/Scene/VoxelRenderResources.js +17 -10
  133. package/Source/Scene/VoxelShape.js +21 -6
  134. package/Source/Scene/buildVoxelDrawCommands.js +61 -20
  135. package/Source/Scene/createGooglePhotorealistic3DTileset.js +1 -1
  136. package/Source/Scene/getClippingFunction.js +79 -88
  137. package/Source/Shaders/BillboardCollectionVS.glsl +2 -0
  138. package/Source/Shaders/BillboardCollectionVS.js +2 -0
  139. package/Source/Shaders/Voxels/IntersectBox.glsl +20 -33
  140. package/Source/Shaders/Voxels/IntersectBox.js +20 -33
  141. package/Source/Shaders/Voxels/IntersectCylinder.glsl +28 -32
  142. package/Source/Shaders/Voxels/IntersectCylinder.js +28 -32
  143. package/Source/Shaders/Voxels/IntersectDepth.glsl +1 -4
  144. package/Source/Shaders/Voxels/IntersectDepth.js +1 -4
  145. package/Source/Shaders/Voxels/IntersectEllipsoid.glsl +12 -20
  146. package/Source/Shaders/Voxels/IntersectEllipsoid.js +12 -20
  147. package/Source/Shaders/Voxels/IntersectLongitude.glsl +21 -9
  148. package/Source/Shaders/Voxels/IntersectLongitude.js +21 -9
  149. package/Source/Shaders/Voxels/{IntersectClippingPlanes.glsl → IntersectPlane.glsl} +5 -3
  150. package/Source/Shaders/Voxels/{IntersectClippingPlanes.js → IntersectPlane.js} +5 -3
  151. package/Source/Shaders/Voxels/Intersection.glsl +3 -3
  152. package/Source/Shaders/Voxels/Intersection.js +3 -3
  153. package/Source/Shaders/Voxels/Octree.glsl +46 -51
  154. package/Source/Shaders/Voxels/Octree.js +46 -51
  155. package/Source/Shaders/Voxels/VoxelFS.glsl +50 -48
  156. package/Source/Shaders/Voxels/VoxelFS.js +50 -48
  157. package/Source/Shaders/Voxels/VoxelUtils.glsl +0 -19
  158. package/Source/Shaders/Voxels/VoxelUtils.js +0 -19
  159. package/Source/Shaders/Voxels/convertLocalToBoxUv.glsl +30 -0
  160. package/Source/Shaders/Voxels/convertLocalToBoxUv.js +32 -0
  161. package/Source/Shaders/Voxels/convertLocalToCylinderUv.glsl +97 -0
  162. package/Source/Shaders/Voxels/convertLocalToCylinderUv.js +99 -0
  163. package/Source/Shaders/Voxels/convertLocalToEllipsoidUv.glsl +193 -0
  164. package/Source/Shaders/Voxels/convertLocalToEllipsoidUv.js +195 -0
  165. package/Source/ThirdParty/Workers/zip-web-worker.js +1 -0
  166. package/Source/ThirdParty/zip-module.wasm +0 -0
  167. package/index.d.ts +317 -14
  168. package/index.js +141 -139
  169. package/package.json +2 -2
  170. package/Build/ThirdParty/Workers/pako_deflate.min.js +0 -503
  171. package/Build/ThirdParty/Workers/pako_inflate.min.js +0 -698
  172. package/Build/ThirdParty/Workers/z-worker-pako.js +0 -601
  173. package/Source/Core/defaultValue.js +0 -48
  174. package/Source/Shaders/Voxels/convertUvToBox.glsl +0 -45
  175. package/Source/Shaders/Voxels/convertUvToBox.js +0 -46
  176. package/Source/Shaders/Voxels/convertUvToCylinder.glsl +0 -99
  177. package/Source/Shaders/Voxels/convertUvToCylinder.js +0 -101
  178. package/Source/Shaders/Voxels/convertUvToEllipsoid.glsl +0 -139
  179. package/Source/Shaders/Voxels/convertUvToEllipsoid.js +0 -141
  180. package/Source/ThirdParty/Workers/pako_deflate.min.js +0 -2
  181. package/Source/ThirdParty/Workers/pako_inflate.min.js +0 -2
  182. package/Source/ThirdParty/Workers/z-worker-pako.js +0 -1
@@ -38,66 +38,61 @@ function getClippingFunction(clippingPlaneCollection, context) {
38
38
  }
39
39
 
40
40
  function clippingFunctionUnion(clippingPlanesLength) {
41
- const functionString =
42
- `${
43
- "float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix)\n" +
44
- "{\n" +
45
- " vec4 position = czm_windowToEyeCoordinates(fragCoord);\n" +
46
- " vec3 clipNormal = vec3(0.0);\n" +
47
- " vec3 clipPosition = vec3(0.0);\n" +
48
- " float clipAmount;\n" + // For union planes, we want to get the min distance. So we set the initial value to the first plane distance in the loop below.
49
- " float pixelWidth = czm_metersPerPixel(position);\n" +
50
- " bool breakAndDiscard = false;\n" +
51
- " for (int i = 0; i < "
52
- }${clippingPlanesLength}; ++i)\n` +
53
- ` {\n` +
54
- ` vec4 clippingPlane = getClippingPlane(clippingPlanes, i, clippingPlanesMatrix);\n` +
55
- ` clipNormal = clippingPlane.xyz;\n` +
56
- ` clipPosition = -clippingPlane.w * clipNormal;\n` +
57
- ` float amount = dot(clipNormal, (position.xyz - clipPosition)) / pixelWidth;\n` +
58
- ` clipAmount = czm_branchFreeTernary(i == 0, amount, min(amount, clipAmount));\n` +
59
- ` if (amount <= 0.0)\n` +
60
- ` {\n` +
61
- ` breakAndDiscard = true;\n` +
62
- ` break;\n` + // HLSL compiler bug if we discard here: https://bugs.chromium.org/p/angleproject/issues/detail?id=1945#c6
63
- ` }\n` +
64
- ` }\n` +
65
- ` if (breakAndDiscard) {\n` +
66
- ` discard;\n` +
67
- ` }\n` +
68
- ` return clipAmount;\n` +
69
- `}\n`;
70
- return functionString;
41
+ return `float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix)
42
+ {
43
+ vec4 position = czm_windowToEyeCoordinates(fragCoord);
44
+ vec3 clipNormal = vec3(0.0);
45
+ vec3 clipPosition = vec3(0.0);
46
+ float clipAmount;
47
+ float pixelWidth = czm_metersPerPixel(position);
48
+ bool breakAndDiscard = false;
49
+ for (int i = 0; i < ${clippingPlanesLength}; ++i)
50
+ {
51
+ vec4 clippingPlane = getClippingPlane(clippingPlanes, i, clippingPlanesMatrix);
52
+ clipNormal = clippingPlane.xyz;
53
+ clipPosition = -clippingPlane.w * clipNormal;
54
+ float amount = dot(clipNormal, (position.xyz - clipPosition)) / pixelWidth;
55
+ clipAmount = czm_branchFreeTernary(i == 0, amount, min(amount, clipAmount));
56
+ if (amount <= 0.0)
57
+ {
58
+ breakAndDiscard = true;
59
+ // HLSL compiler bug if we discard here: https://bugs.chromium.org/p/angleproject/issues/detail?id=1945#c6
60
+ break;
61
+ }
62
+ }
63
+ if (breakAndDiscard) {
64
+ discard;
65
+ }
66
+ return clipAmount;
67
+ }
68
+ `;
71
69
  }
72
70
 
73
71
  function clippingFunctionIntersect(clippingPlanesLength) {
74
- const functionString =
75
- `${
76
- "float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix)\n" +
77
- "{\n" +
78
- " bool clipped = true;\n" +
79
- " vec4 position = czm_windowToEyeCoordinates(fragCoord);\n" +
80
- " vec3 clipNormal = vec3(0.0);\n" +
81
- " vec3 clipPosition = vec3(0.0);\n" +
82
- " float clipAmount = 0.0;\n" +
83
- " float pixelWidth = czm_metersPerPixel(position);\n" +
84
- " for (int i = 0; i < "
85
- }${clippingPlanesLength}; ++i)\n` +
86
- ` {\n` +
87
- ` vec4 clippingPlane = getClippingPlane(clippingPlanes, i, clippingPlanesMatrix);\n` +
88
- ` clipNormal = clippingPlane.xyz;\n` +
89
- ` clipPosition = -clippingPlane.w * clipNormal;\n` +
90
- ` float amount = dot(clipNormal, (position.xyz - clipPosition)) / pixelWidth;\n` +
91
- ` clipAmount = max(amount, clipAmount);\n` +
92
- ` clipped = clipped && (amount <= 0.0);\n` +
93
- ` }\n` +
94
- ` if (clipped)\n` +
95
- ` {\n` +
96
- ` discard;\n` +
97
- ` }\n` +
98
- ` return clipAmount;\n` +
99
- `}\n`;
100
- return functionString;
72
+ return `float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix)
73
+ {
74
+ bool clipped = true;
75
+ vec4 position = czm_windowToEyeCoordinates(fragCoord);
76
+ vec3 clipNormal = vec3(0.0);
77
+ vec3 clipPosition = vec3(0.0);
78
+ float clipAmount = 0.0;
79
+ float pixelWidth = czm_metersPerPixel(position);
80
+ for (int i = 0; i < ${clippingPlanesLength}; ++i)
81
+ {
82
+ vec4 clippingPlane = getClippingPlane(clippingPlanes, i, clippingPlanesMatrix);
83
+ clipNormal = clippingPlane.xyz;
84
+ clipPosition = -clippingPlane.w * clipNormal;
85
+ float amount = dot(clipNormal, (position.xyz - clipPosition)) / pixelWidth;
86
+ clipAmount = max(amount, clipAmount);
87
+ clipped = clipped && (amount <= 0.0);
88
+ }
89
+ if (clipped)
90
+ {
91
+ discard;
92
+ }
93
+ return clipAmount;
94
+ }
95
+ `;
101
96
  }
102
97
 
103
98
  function getClippingPlaneFloat(width, height) {
@@ -113,19 +108,17 @@ function getClippingPlaneFloat(width, height) {
113
108
  pixelHeightString += ".0";
114
109
  }
115
110
 
116
- const functionString =
117
- `${
118
- "vec4 getClippingPlane(highp sampler2D packedClippingPlanes, int clippingPlaneNumber, mat4 transform)\n" +
119
- "{\n" +
120
- " int pixY = clippingPlaneNumber / "
121
- }${width};\n` +
122
- ` int pixX = clippingPlaneNumber - (pixY * ${width});\n` +
123
- ` float u = (float(pixX) + 0.5) * ${pixelWidthString};\n` + // sample from center of pixel
124
- ` float v = (float(pixY) + 0.5) * ${pixelHeightString};\n` +
125
- ` vec4 plane = texture(packedClippingPlanes, vec2(u, v));\n` +
126
- ` return czm_transformPlane(plane, transform);\n` +
127
- `}\n`;
128
- return functionString;
111
+ return `vec4 getClippingPlane(highp sampler2D packedClippingPlanes, int clippingPlaneNumber, mat4 transform)
112
+ {
113
+ int pixY = clippingPlaneNumber / ${width};
114
+ int pixX = clippingPlaneNumber - (pixY * ${width});
115
+ // Sample from center of pixel
116
+ float u = (float(pixX) + 0.5) * ${pixelWidthString};
117
+ float v = (float(pixY) + 0.5) * ${pixelHeightString};
118
+ vec4 plane = texture(packedClippingPlanes, vec2(u, v));
119
+ return czm_transformPlane(plane, transform);
120
+ }
121
+ `;
129
122
  }
130
123
 
131
124
  function getClippingPlaneUint8(width, height) {
@@ -141,23 +134,21 @@ function getClippingPlaneUint8(width, height) {
141
134
  pixelHeightString += ".0";
142
135
  }
143
136
 
144
- const functionString =
145
- `${
146
- "vec4 getClippingPlane(highp sampler2D packedClippingPlanes, int clippingPlaneNumber, mat4 transform)\n" +
147
- "{\n" +
148
- " int clippingPlaneStartIndex = clippingPlaneNumber * 2;\n" + // clipping planes are two pixels each
149
- " int pixY = clippingPlaneStartIndex / "
150
- }${width};\n` +
151
- ` int pixX = clippingPlaneStartIndex - (pixY * ${width});\n` +
152
- ` float u = (float(pixX) + 0.5) * ${pixelWidthString};\n` + // sample from center of pixel
153
- ` float v = (float(pixY) + 0.5) * ${pixelHeightString};\n` +
154
- ` vec4 oct32 = texture(packedClippingPlanes, vec2(u, v)) * 255.0;\n` +
155
- ` vec2 oct = vec2(oct32.x * 256.0 + oct32.y, oct32.z * 256.0 + oct32.w);\n` +
156
- ` vec4 plane;\n` +
157
- ` plane.xyz = czm_octDecode(oct, 65535.0);\n` +
158
- ` plane.w = czm_unpackFloat(texture(packedClippingPlanes, vec2(u + ${pixelWidthString}, v)));\n` +
159
- ` return czm_transformPlane(plane, transform);\n` +
160
- `}\n`;
161
- return functionString;
137
+ return `vec4 getClippingPlane(highp sampler2D packedClippingPlanes, int clippingPlaneNumber, mat4 transform)
138
+ {
139
+ int clippingPlaneStartIndex = clippingPlaneNumber * 2;
140
+ int pixY = clippingPlaneStartIndex / ${width};
141
+ int pixX = clippingPlaneStartIndex - (pixY * ${width});
142
+ // Sample from center of pixel
143
+ float u = (float(pixX) + 0.5) * ${pixelWidthString};
144
+ float v = (float(pixY) + 0.5) * ${pixelHeightString};
145
+ vec4 oct32 = texture(packedClippingPlanes, vec2(u, v)) * 255.0;
146
+ vec2 oct = vec2(oct32.x * 256.0 + oct32.y, oct32.z * 256.0 + oct32.w);
147
+ vec4 plane;
148
+ plane.xyz = czm_octDecode(oct, 65535.0);
149
+ plane.w = czm_unpackFloat(texture(packedClippingPlanes, vec2(u + ${pixelWidthString}, v)));
150
+ return czm_transformPlane(plane, transform);
151
+ }
152
+ `;
162
153
  }
163
154
  export default getClippingFunction;
@@ -165,9 +165,11 @@ void main()
165
165
 
166
166
  temp = compressedAttribute0.z * SHIFT_RIGHT8;
167
167
  translate.x = floor(temp) - UPPER_BOUND;
168
+ translate.x *= SHIFT_RIGHT2; // undo translateX scaling (helps preserve subpixel precision, see BillboardCollection.js attribute writer for more info)
168
169
 
169
170
  translate.y += (temp - floor(temp)) * SHIFT_LEFT8;
170
171
  translate.y -= UPPER_BOUND;
172
+ translate.y *= SHIFT_RIGHT2;
171
173
 
172
174
  temp = compressedAttribute1.x * SHIFT_RIGHT8;
173
175
  float temp2 = floor(compressedAttribute2.w * SHIFT_RIGHT2);
@@ -166,9 +166,11 @@ void main()\n\
166
166
  \n\
167
167
  temp = compressedAttribute0.z * SHIFT_RIGHT8;\n\
168
168
  translate.x = floor(temp) - UPPER_BOUND;\n\
169
+ translate.x *= SHIFT_RIGHT2; // undo translateX scaling (helps preserve subpixel precision, see BillboardCollection.js attribute writer for more info)\n\
169
170
  \n\
170
171
  translate.y += (temp - floor(temp)) * SHIFT_LEFT8;\n\
171
172
  translate.y -= UPPER_BOUND;\n\
173
+ translate.y *= SHIFT_RIGHT2;\n\
172
174
  \n\
173
175
  temp = compressedAttribute1.x * SHIFT_RIGHT8;\n\
174
176
  float temp2 = floor(compressedAttribute2.w * SHIFT_RIGHT2);\n\
@@ -5,43 +5,30 @@
5
5
  #define BOX_INTERSECTION_INDEX ### // always 0
6
6
  */
7
7
 
8
- uniform vec3 u_renderMinBounds;
9
- uniform vec3 u_renderMaxBounds;
10
-
11
- RayShapeIntersection intersectBox(in Ray ray, in vec3 minBound, in vec3 maxBound)
12
- {
13
- // Consider the box as the intersection of the space between 3 pairs of parallel planes
14
- // Compute the distance along the ray to each plane
15
- vec3 t0 = (minBound - ray.pos) / ray.dir;
16
- vec3 t1 = (maxBound - ray.pos) / ray.dir;
17
-
18
- // Identify candidate entries/exits based on distance from ray.pos
19
- vec3 entries = min(t0, t1);
20
- vec3 exits = max(t0, t1);
21
-
22
- vec3 directions = sign(ray.dir);
23
-
24
- // The actual intersection points are the furthest entry and the closest exit
25
- float lastEntry = maxComponent(entries);
26
- bvec3 isLastEntry = equal(entries, vec3(lastEntry));
27
- vec3 entryNormal = -1.0 * vec3(isLastEntry) * directions;
28
- vec4 entry = vec4(entryNormal, lastEntry);
29
-
30
- float firstExit = minComponent(exits);
31
- bvec3 isFirstExit = equal(exits, vec3(firstExit));
32
- vec3 exitNormal = vec3(isLastEntry) * directions;
33
- vec4 exit = vec4(exitNormal, firstExit);
34
-
35
- if (entry.w > exit.w) {
36
- entry.w = NO_HIT;
37
- exit.w = NO_HIT;
8
+ uniform sampler2D u_renderBoundPlanesTexture;
9
+
10
+ RayShapeIntersection intersectBoundPlanes(in Ray ray) {
11
+ vec4 lastEntry = vec4(ray.dir, -INF_HIT);
12
+ vec4 firstExit = vec4(-ray.dir, +INF_HIT);
13
+ for (int i = 0; i < 6; i++) {
14
+ vec4 boundPlane = getBoundPlane(u_renderBoundPlanesTexture, i);
15
+ vec4 intersection = intersectPlane(ray, boundPlane);
16
+ if (dot(ray.dir, boundPlane.xyz) < 0.0) {
17
+ lastEntry = intersection.w > lastEntry.w ? intersection : lastEntry;
18
+ } else {
19
+ firstExit = intersection.w < firstExit.w ? intersection: firstExit;
20
+ }
38
21
  }
39
22
 
40
- return RayShapeIntersection(entry, exit);
23
+ if (lastEntry.w < firstExit.w) {
24
+ return RayShapeIntersection(lastEntry, firstExit);
25
+ } else {
26
+ return RayShapeIntersection(vec4(-ray.dir, NO_HIT), vec4(ray.dir, NO_HIT));
27
+ }
41
28
  }
42
29
 
43
- void intersectShape(in Ray ray, inout Intersections ix)
30
+ void intersectShape(in Ray rayUV, in Ray rayEC, inout Intersections ix)
44
31
  {
45
- RayShapeIntersection intersection = intersectBox(ray, u_renderMinBounds, u_renderMaxBounds);
32
+ RayShapeIntersection intersection = intersectBoundPlanes(rayEC);
46
33
  setShapeIntersection(ix, BOX_INTERSECTION_INDEX, intersection);
47
34
  }
@@ -6,44 +6,31 @@ export default "// See IntersectionUtils.glsl for the definitions of Ray, RaySha
6
6
  #define BOX_INTERSECTION_INDEX ### // always 0\n\
7
7
  */\n\
8
8
  \n\
9
- uniform vec3 u_renderMinBounds;\n\
10
- uniform vec3 u_renderMaxBounds;\n\
11
- \n\
12
- RayShapeIntersection intersectBox(in Ray ray, in vec3 minBound, in vec3 maxBound)\n\
13
- {\n\
14
- // Consider the box as the intersection of the space between 3 pairs of parallel planes\n\
15
- // Compute the distance along the ray to each plane\n\
16
- vec3 t0 = (minBound - ray.pos) / ray.dir;\n\
17
- vec3 t1 = (maxBound - ray.pos) / ray.dir;\n\
18
- \n\
19
- // Identify candidate entries/exits based on distance from ray.pos\n\
20
- vec3 entries = min(t0, t1);\n\
21
- vec3 exits = max(t0, t1);\n\
22
- \n\
23
- vec3 directions = sign(ray.dir);\n\
24
- \n\
25
- // The actual intersection points are the furthest entry and the closest exit\n\
26
- float lastEntry = maxComponent(entries);\n\
27
- bvec3 isLastEntry = equal(entries, vec3(lastEntry));\n\
28
- vec3 entryNormal = -1.0 * vec3(isLastEntry) * directions;\n\
29
- vec4 entry = vec4(entryNormal, lastEntry);\n\
30
- \n\
31
- float firstExit = minComponent(exits);\n\
32
- bvec3 isFirstExit = equal(exits, vec3(firstExit));\n\
33
- vec3 exitNormal = vec3(isLastEntry) * directions;\n\
34
- vec4 exit = vec4(exitNormal, firstExit);\n\
35
- \n\
36
- if (entry.w > exit.w) {\n\
37
- entry.w = NO_HIT;\n\
38
- exit.w = NO_HIT;\n\
9
+ uniform sampler2D u_renderBoundPlanesTexture;\n\
10
+ \n\
11
+ RayShapeIntersection intersectBoundPlanes(in Ray ray) {\n\
12
+ vec4 lastEntry = vec4(ray.dir, -INF_HIT);\n\
13
+ vec4 firstExit = vec4(-ray.dir, +INF_HIT);\n\
14
+ for (int i = 0; i < 6; i++) {\n\
15
+ vec4 boundPlane = getBoundPlane(u_renderBoundPlanesTexture, i);\n\
16
+ vec4 intersection = intersectPlane(ray, boundPlane);\n\
17
+ if (dot(ray.dir, boundPlane.xyz) < 0.0) {\n\
18
+ lastEntry = intersection.w > lastEntry.w ? intersection : lastEntry;\n\
19
+ } else {\n\
20
+ firstExit = intersection.w < firstExit.w ? intersection: firstExit;\n\
21
+ }\n\
39
22
  }\n\
40
23
  \n\
41
- return RayShapeIntersection(entry, exit);\n\
24
+ if (lastEntry.w < firstExit.w) {\n\
25
+ return RayShapeIntersection(lastEntry, firstExit);\n\
26
+ } else {\n\
27
+ return RayShapeIntersection(vec4(-ray.dir, NO_HIT), vec4(ray.dir, NO_HIT));\n\
28
+ }\n\
42
29
  }\n\
43
30
  \n\
44
- void intersectShape(in Ray ray, inout Intersections ix)\n\
31
+ void intersectShape(in Ray rayUV, in Ray rayEC, inout Intersections ix)\n\
45
32
  {\n\
46
- RayShapeIntersection intersection = intersectBox(ray, u_renderMinBounds, u_renderMaxBounds);\n\
33
+ RayShapeIntersection intersection = intersectBoundPlanes(rayEC);\n\
47
34
  setShapeIntersection(ix, BOX_INTERSECTION_INDEX, intersection);\n\
48
35
  }\n\
49
36
  ";
@@ -19,32 +19,30 @@
19
19
 
20
20
  // Cylinder uniforms
21
21
  uniform vec2 u_cylinderRenderRadiusMinMax;
22
- uniform vec2 u_cylinderRenderHeightMinMax;
23
22
  #if defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE)
24
23
  uniform vec2 u_cylinderRenderAngleMinMax;
25
24
  #endif
26
25
 
27
- /**
28
- * Find the intersection of a ray with the volume defined by two planes of constant z
29
- */
30
- RayShapeIntersection intersectHeightBounds(in Ray ray, in vec2 minMaxHeight, in bool convex)
31
- {
32
- float zPosition = ray.pos.z;
33
- float zDirection = ray.dir.z;
34
-
35
- float tmin = (minMaxHeight.x - zPosition) / zDirection;
36
- float tmax = (minMaxHeight.y - zPosition) / zDirection;
37
-
38
- // Normals point outside the volume
39
- float signFlip = convex ? 1.0 : -1.0;
40
- vec4 intersectMin = vec4(0.0, 0.0, -1.0 * signFlip, tmin);
41
- vec4 intersectMax = vec4(0.0, 0.0, 1.0 * signFlip, tmax);
42
-
43
- bool topEntry = zDirection < 0.0;
44
- vec4 entry = topEntry ? intersectMax : intersectMin;
45
- vec4 exit = topEntry ? intersectMin : intersectMax;
26
+ uniform sampler2D u_renderBoundPlanesTexture;
27
+
28
+ RayShapeIntersection intersectBoundPlanes(in Ray ray) {
29
+ vec4 lastEntry = vec4(ray.dir, -INF_HIT);
30
+ vec4 firstExit = vec4(-ray.dir, +INF_HIT);
31
+ for (int i = 0; i < 2; i++) {
32
+ vec4 boundPlane = getBoundPlane(u_renderBoundPlanesTexture, i);
33
+ vec4 intersection = intersectPlane(ray, boundPlane);
34
+ if (dot(ray.dir, boundPlane.xyz) < 0.0) {
35
+ lastEntry = intersection.w > lastEntry.w ? intersection : lastEntry;
36
+ } else {
37
+ firstExit = intersection.w < firstExit.w ? intersection: firstExit;
38
+ }
39
+ }
46
40
 
47
- return RayShapeIntersection(entry, exit);
41
+ if (lastEntry.w < firstExit.w) {
42
+ return RayShapeIntersection(lastEntry, firstExit);
43
+ } else {
44
+ return RayShapeIntersection(vec4(-ray.dir, NO_HIT), vec4(ray.dir, NO_HIT));
45
+ }
48
46
  }
49
47
 
50
48
  /**
@@ -70,8 +68,11 @@ RayShapeIntersection intersectCylinder(in Ray ray, in float radius, in bool conv
70
68
  float t1 = (-b - determinant) / a;
71
69
  float t2 = (-b + determinant) / a;
72
70
  float signFlip = convex ? 1.0 : -1.0;
73
- vec4 intersect1 = vec4(normalize(position + t1 * direction) * signFlip, 0.0, t1);
74
- vec4 intersect2 = vec4(normalize(position + t2 * direction) * signFlip, 0.0, t2);
71
+ vec3 normal1 = vec3((position + t1 * direction) * signFlip, 0.0);
72
+ vec3 normal2 = vec3((position + t2 * direction) * signFlip, 0.0);
73
+ // Return normals in eye coordinates
74
+ vec4 intersect1 = vec4(normalize(czm_normal * normal1), t1);
75
+ vec4 intersect2 = vec4(normalize(czm_normal * normal2), t2);
75
76
 
76
77
  return RayShapeIntersection(intersect1, intersect2);
77
78
  }
@@ -80,21 +81,16 @@ RayShapeIntersection intersectCylinder(in Ray ray, in float radius, in bool conv
80
81
  * Find the intersection of a ray with a right cylindrical solid of given
81
82
  * radius and height bounds. NOTE: The shape is assumed to be convex.
82
83
  */
83
- RayShapeIntersection intersectBoundedCylinder(in Ray ray, in float radius, in vec2 minMaxHeight)
84
+ RayShapeIntersection intersectBoundedCylinder(in Ray ray, in Ray rayEC, in float radius)
84
85
  {
85
86
  RayShapeIntersection cylinderIntersection = intersectCylinder(ray, radius, true);
86
- RayShapeIntersection heightBoundsIntersection = intersectHeightBounds(ray, minMaxHeight, true);
87
+ RayShapeIntersection heightBoundsIntersection = intersectBoundPlanes(rayEC);
87
88
  return intersectIntersections(ray, cylinderIntersection, heightBoundsIntersection);
88
89
  }
89
90
 
90
- void intersectShape(Ray ray, inout Intersections ix)
91
+ void intersectShape(in Ray ray, in Ray rayEC, inout Intersections ix)
91
92
  {
92
- // Position is converted from [0,1] to [-1,+1] because shape intersections assume unit space is [-1,+1].
93
- // Direction is scaled as well to be in sync with position.
94
- ray.pos = ray.pos * 2.0 - 1.0;
95
- ray.dir *= 2.0;
96
-
97
- RayShapeIntersection outerIntersect = intersectBoundedCylinder(ray, u_cylinderRenderRadiusMinMax.y, u_cylinderRenderHeightMinMax);
93
+ RayShapeIntersection outerIntersect = intersectBoundedCylinder(ray, rayEC, u_cylinderRenderRadiusMinMax.y);
98
94
 
99
95
  setShapeIntersection(ix, CYLINDER_INTERSECTION_INDEX_RADIUS_MAX, outerIntersect);
100
96
 
@@ -20,32 +20,30 @@ export default "// See IntersectionUtils.glsl for the definitions of Ray, NO_HIT
20
20
  \n\
21
21
  // Cylinder uniforms\n\
22
22
  uniform vec2 u_cylinderRenderRadiusMinMax;\n\
23
- uniform vec2 u_cylinderRenderHeightMinMax;\n\
24
23
  #if defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE)\n\
25
24
  uniform vec2 u_cylinderRenderAngleMinMax;\n\
26
25
  #endif\n\
27
26
  \n\
28
- /**\n\
29
- * Find the intersection of a ray with the volume defined by two planes of constant z\n\
30
- */\n\
31
- RayShapeIntersection intersectHeightBounds(in Ray ray, in vec2 minMaxHeight, in bool convex)\n\
32
- {\n\
33
- float zPosition = ray.pos.z;\n\
34
- float zDirection = ray.dir.z;\n\
35
- \n\
36
- float tmin = (minMaxHeight.x - zPosition) / zDirection;\n\
37
- float tmax = (minMaxHeight.y - zPosition) / zDirection;\n\
38
- \n\
39
- // Normals point outside the volume\n\
40
- float signFlip = convex ? 1.0 : -1.0;\n\
41
- vec4 intersectMin = vec4(0.0, 0.0, -1.0 * signFlip, tmin);\n\
42
- vec4 intersectMax = vec4(0.0, 0.0, 1.0 * signFlip, tmax);\n\
43
- \n\
44
- bool topEntry = zDirection < 0.0;\n\
45
- vec4 entry = topEntry ? intersectMax : intersectMin;\n\
46
- vec4 exit = topEntry ? intersectMin : intersectMax;\n\
27
+ uniform sampler2D u_renderBoundPlanesTexture;\n\
28
+ \n\
29
+ RayShapeIntersection intersectBoundPlanes(in Ray ray) {\n\
30
+ vec4 lastEntry = vec4(ray.dir, -INF_HIT);\n\
31
+ vec4 firstExit = vec4(-ray.dir, +INF_HIT);\n\
32
+ for (int i = 0; i < 2; i++) {\n\
33
+ vec4 boundPlane = getBoundPlane(u_renderBoundPlanesTexture, i);\n\
34
+ vec4 intersection = intersectPlane(ray, boundPlane);\n\
35
+ if (dot(ray.dir, boundPlane.xyz) < 0.0) {\n\
36
+ lastEntry = intersection.w > lastEntry.w ? intersection : lastEntry;\n\
37
+ } else {\n\
38
+ firstExit = intersection.w < firstExit.w ? intersection: firstExit;\n\
39
+ }\n\
40
+ }\n\
47
41
  \n\
48
- return RayShapeIntersection(entry, exit);\n\
42
+ if (lastEntry.w < firstExit.w) {\n\
43
+ return RayShapeIntersection(lastEntry, firstExit);\n\
44
+ } else {\n\
45
+ return RayShapeIntersection(vec4(-ray.dir, NO_HIT), vec4(ray.dir, NO_HIT));\n\
46
+ }\n\
49
47
  }\n\
50
48
  \n\
51
49
  /**\n\
@@ -71,8 +69,11 @@ RayShapeIntersection intersectCylinder(in Ray ray, in float radius, in bool conv
71
69
  float t1 = (-b - determinant) / a;\n\
72
70
  float t2 = (-b + determinant) / a;\n\
73
71
  float signFlip = convex ? 1.0 : -1.0;\n\
74
- vec4 intersect1 = vec4(normalize(position + t1 * direction) * signFlip, 0.0, t1);\n\
75
- vec4 intersect2 = vec4(normalize(position + t2 * direction) * signFlip, 0.0, t2);\n\
72
+ vec3 normal1 = vec3((position + t1 * direction) * signFlip, 0.0);\n\
73
+ vec3 normal2 = vec3((position + t2 * direction) * signFlip, 0.0);\n\
74
+ // Return normals in eye coordinates\n\
75
+ vec4 intersect1 = vec4(normalize(czm_normal * normal1), t1);\n\
76
+ vec4 intersect2 = vec4(normalize(czm_normal * normal2), t2);\n\
76
77
  \n\
77
78
  return RayShapeIntersection(intersect1, intersect2);\n\
78
79
  }\n\
@@ -81,21 +82,16 @@ RayShapeIntersection intersectCylinder(in Ray ray, in float radius, in bool conv
81
82
  * Find the intersection of a ray with a right cylindrical solid of given\n\
82
83
  * radius and height bounds. NOTE: The shape is assumed to be convex.\n\
83
84
  */\n\
84
- RayShapeIntersection intersectBoundedCylinder(in Ray ray, in float radius, in vec2 minMaxHeight)\n\
85
+ RayShapeIntersection intersectBoundedCylinder(in Ray ray, in Ray rayEC, in float radius)\n\
85
86
  {\n\
86
87
  RayShapeIntersection cylinderIntersection = intersectCylinder(ray, radius, true);\n\
87
- RayShapeIntersection heightBoundsIntersection = intersectHeightBounds(ray, minMaxHeight, true);\n\
88
+ RayShapeIntersection heightBoundsIntersection = intersectBoundPlanes(rayEC);\n\
88
89
  return intersectIntersections(ray, cylinderIntersection, heightBoundsIntersection);\n\
89
90
  }\n\
90
91
  \n\
91
- void intersectShape(Ray ray, inout Intersections ix)\n\
92
+ void intersectShape(in Ray ray, in Ray rayEC, inout Intersections ix)\n\
92
93
  {\n\
93
- // Position is converted from [0,1] to [-1,+1] because shape intersections assume unit space is [-1,+1].\n\
94
- // Direction is scaled as well to be in sync with position.\n\
95
- ray.pos = ray.pos * 2.0 - 1.0;\n\
96
- ray.dir *= 2.0;\n\
97
- \n\
98
- RayShapeIntersection outerIntersect = intersectBoundedCylinder(ray, u_cylinderRenderRadiusMinMax.y, u_cylinderRenderHeightMinMax);\n\
94
+ RayShapeIntersection outerIntersect = intersectBoundedCylinder(ray, rayEC, u_cylinderRenderRadiusMinMax.y);\n\
99
95
  \n\
100
96
  setShapeIntersection(ix, CYLINDER_INTERSECTION_INDEX_RADIUS_MAX, outerIntersect);\n\
101
97
  \n\
@@ -5,8 +5,6 @@
5
5
  #define DEPTH_INTERSECTION_INDEX ###
6
6
  */
7
7
 
8
- uniform mat4 u_transformPositionViewToUv;
9
-
10
8
  void intersectDepth(in vec2 screenCoord, in Ray ray, inout Intersections ix) {
11
9
  float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, screenCoord));
12
10
  float entry;
@@ -15,8 +13,7 @@ void intersectDepth(in vec2 screenCoord, in Ray ray, inout Intersections ix) {
15
13
  // Calculate how far the ray must travel before it hits the depth buffer.
16
14
  vec4 eyeCoordinateDepth = czm_screenToEyeCoordinates(screenCoord, logDepthOrDepth);
17
15
  eyeCoordinateDepth /= eyeCoordinateDepth.w;
18
- vec3 depthPositionUv = vec3(u_transformPositionViewToUv * eyeCoordinateDepth);
19
- entry = dot(depthPositionUv - ray.pos, ray.dir);
16
+ entry = dot(eyeCoordinateDepth.xyz - ray.pos, ray.dir);
20
17
  exit = +INF_HIT;
21
18
  } else {
22
19
  // There's no depth at this location.
@@ -6,8 +6,6 @@ export default "// See IntersectionUtils.glsl for the definitions of Ray, Inters
6
6
  #define DEPTH_INTERSECTION_INDEX ###\n\
7
7
  */\n\
8
8
  \n\
9
- uniform mat4 u_transformPositionViewToUv;\n\
10
- \n\
11
9
  void intersectDepth(in vec2 screenCoord, in Ray ray, inout Intersections ix) {\n\
12
10
  float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, screenCoord));\n\
13
11
  float entry;\n\
@@ -16,8 +14,7 @@ void intersectDepth(in vec2 screenCoord, in Ray ray, inout Intersections ix) {\n
16
14
  // Calculate how far the ray must travel before it hits the depth buffer.\n\
17
15
  vec4 eyeCoordinateDepth = czm_screenToEyeCoordinates(screenCoord, logDepthOrDepth);\n\
18
16
  eyeCoordinateDepth /= eyeCoordinateDepth.w;\n\
19
- vec3 depthPositionUv = vec3(u_transformPositionViewToUv * eyeCoordinateDepth);\n\
20
- entry = dot(depthPositionUv - ray.pos, ray.dir);\n\
17
+ entry = dot(eyeCoordinateDepth.xyz - ray.pos, ray.dir);\n\
21
18
  exit = +INF_HIT;\n\
22
19
  } else {\n\
23
20
  // There's no depth at this location.\n\