deeptwins-cesium-engine 0.1.2 → 0.1.4

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 (219) hide show
  1. package/Build/Workers/chunk-2HWLF3FT.js +837 -0
  2. package/Build/Workers/chunk-2KXMJ5XS.js +3792 -0
  3. package/Build/Workers/chunk-2NPCLB3H.js +56 -0
  4. package/Build/Workers/chunk-2ZHQTIBH.js +1483 -0
  5. package/Build/Workers/chunk-3GLYOW63.js +352 -0
  6. package/Build/Workers/chunk-3L22KMPU.js +219 -0
  7. package/Build/Workers/chunk-3Q6V2B2I.js +73 -0
  8. package/Build/Workers/chunk-3QOKKRIG.js +387 -0
  9. package/Build/Workers/chunk-44YZFGRH.js +1800 -0
  10. package/Build/Workers/chunk-45VV4SBO.js +2342 -0
  11. package/Build/Workers/chunk-4EJ4AA2S.js +368 -0
  12. package/Build/Workers/chunk-4IJFHUL6.js +414 -0
  13. package/Build/Workers/chunk-4K3V5CGW.js +454 -0
  14. package/Build/Workers/chunk-4M4QL6KJ.js +305 -0
  15. package/Build/Workers/chunk-4YNRIEQ6.js +288 -0
  16. package/Build/Workers/chunk-56CVDPH5.js +352 -0
  17. package/Build/Workers/chunk-5CTAAPXH.js +1483 -0
  18. package/Build/Workers/chunk-5ISZ6NJD.js +102 -0
  19. package/Build/Workers/chunk-5SDHYIOS.js +56 -0
  20. package/Build/Workers/chunk-66TGUMCU.js +2719 -0
  21. package/Build/Workers/chunk-6EJMTDQJ.js +163 -0
  22. package/Build/Workers/chunk-6VWXYSMH.js +959 -0
  23. package/Build/Workers/chunk-6VZ7VB2Q.js +241 -0
  24. package/Build/Workers/chunk-7AMRE57Q.js +301 -0
  25. package/Build/Workers/chunk-7DH6C33H.js +398 -0
  26. package/Build/Workers/chunk-7VUS3FVE.js +38 -0
  27. package/Build/Workers/chunk-7Y3ZA6H3.js +198 -0
  28. package/Build/Workers/chunk-A6BMHZNA.js +38 -0
  29. package/Build/Workers/chunk-A7XY2MN7.js +171 -0
  30. package/Build/Workers/chunk-AC7ND63S.js +57 -0
  31. package/Build/Workers/chunk-AHCZ757M.js +9230 -0
  32. package/Build/Workers/chunk-ANOA7E7F.js +56 -0
  33. package/Build/Workers/chunk-AYO5HHV6.js +789 -0
  34. package/Build/Workers/chunk-BE2N56VZ.js +1344 -0
  35. package/Build/Workers/chunk-BR3BPM64.js +9230 -0
  36. package/Build/Workers/chunk-BVMRWGOK.js +455 -0
  37. package/Build/Workers/chunk-BXEL2NX7.js +455 -0
  38. package/Build/Workers/chunk-C5BO2JCG.js +278 -0
  39. package/Build/Workers/chunk-CIRQNZVR.js +301 -0
  40. package/Build/Workers/chunk-CM67CQME.js +305 -0
  41. package/Build/Workers/chunk-D3QIW4DH.js +630 -0
  42. package/Build/Workers/chunk-E5W7QIGZ.js +511 -0
  43. package/Build/Workers/chunk-E6CYGUJI.js +1054 -0
  44. package/Build/Workers/chunk-EIZ23IOX.js +414 -0
  45. package/Build/Workers/chunk-EIZJUMQY.js +101 -0
  46. package/Build/Workers/chunk-EXTMZJXB.js +82 -0
  47. package/Build/Workers/chunk-EYOOSIBW.js +682 -0
  48. package/Build/Workers/chunk-F37WADVC.js +1054 -0
  49. package/Build/Workers/chunk-FIWPJFHX.js +101 -0
  50. package/Build/Workers/chunk-FM32TNGT.js +198 -0
  51. package/Build/Workers/chunk-FOMYIEIB.js +476 -0
  52. package/Build/Workers/chunk-FWYDLSVQ.js +97 -0
  53. package/Build/Workers/chunk-HGZR6CZF.js +1067 -0
  54. package/Build/Workers/chunk-HIXHDABG.js +288 -0
  55. package/Build/Workers/chunk-HMCCZZWE.js +97 -0
  56. package/Build/Workers/chunk-HW54WHGM.js +2719 -0
  57. package/Build/Workers/chunk-IHYAI7GF.js +973 -0
  58. package/Build/Workers/chunk-INLQ7LVK.js +837 -0
  59. package/Build/Workers/chunk-IQMESTCB.js +124 -0
  60. package/Build/Workers/chunk-J4PISUNT.js +2342 -0
  61. package/Build/Workers/chunk-JSWU557I.js +693 -0
  62. package/Build/Workers/chunk-KHONDSQ7.js +693 -0
  63. package/Build/Workers/chunk-KLUL2SOE.js +352 -0
  64. package/Build/Workers/chunk-KMBLKQCC.js +1992 -0
  65. package/Build/Workers/chunk-KOTWWQN7.js +171 -0
  66. package/Build/Workers/chunk-KWV6ZTF4.js +163 -0
  67. package/Build/Workers/chunk-LSEFPQHG.js +476 -0
  68. package/Build/Workers/chunk-M66X4O24.js +44 -0
  69. package/Build/Workers/chunk-M6IXKBC7.js +1992 -0
  70. package/Build/Workers/chunk-MFUC3D5C.js +162 -0
  71. package/Build/Workers/chunk-MRMNELAH.js +82 -0
  72. package/Build/Workers/chunk-N3NUA5H2.js +3792 -0
  73. package/Build/Workers/chunk-NFB2NXJN.js +138 -0
  74. package/Build/Workers/chunk-NQAXBK4K.js +789 -0
  75. package/Build/Workers/chunk-NUGQWV6S.js +352 -0
  76. package/Build/Workers/chunk-O7S7WL7K.js +278 -0
  77. package/Build/Workers/chunk-ODZYB26X.js +1287 -0
  78. package/Build/Workers/chunk-OEHJY463.js +3201 -0
  79. package/Build/Workers/chunk-OMMRNMXF.js +44 -0
  80. package/Build/Workers/chunk-OZ3CQDO3.js +138 -0
  81. package/Build/Workers/chunk-PNXBG64I.js +219 -0
  82. package/Build/Workers/chunk-PYR35GK4.js +973 -0
  83. package/Build/Workers/chunk-Q4CXGW74.js +57 -0
  84. package/Build/Workers/chunk-QGISLKCW.js +147 -0
  85. package/Build/Workers/chunk-QQHVOJW6.js +497 -0
  86. package/Build/Workers/chunk-QWCMMRJW.js +58 -0
  87. package/Build/Workers/chunk-RDEZCHF4.js +398 -0
  88. package/Build/Workers/chunk-SJTE7FVN.js +778 -0
  89. package/Build/Workers/chunk-SM5T67LR.js +162 -0
  90. package/Build/Workers/chunk-T27NNXEU.js +58 -0
  91. package/Build/Workers/chunk-T4J5BWUO.js +511 -0
  92. package/Build/Workers/chunk-T6JS4BRN.js +140 -0
  93. package/Build/Workers/chunk-UH6DUQBW.js +140 -0
  94. package/Build/Workers/chunk-UJAH6XKF.js +73 -0
  95. package/Build/Workers/chunk-UKSTJ2PH.js +454 -0
  96. package/Build/Workers/chunk-UQCDCCZ7.js +368 -0
  97. package/Build/Workers/chunk-UXIFNEA3.js +1287 -0
  98. package/Build/Workers/chunk-UXJ6J5L7.js +56 -0
  99. package/Build/Workers/chunk-V4VUAZXI.js +1800 -0
  100. package/Build/Workers/chunk-VQH2YXO2.js +497 -0
  101. package/Build/Workers/chunk-VXKCLSE4.js +241 -0
  102. package/Build/Workers/chunk-W3U6YBEI.js +280 -0
  103. package/Build/Workers/chunk-W75ZVFKP.js +778 -0
  104. package/Build/Workers/chunk-WCDFJYFB.js +1344 -0
  105. package/Build/Workers/chunk-WME5M6W3.js +630 -0
  106. package/Build/Workers/chunk-XDQBQB64.js +1067 -0
  107. package/Build/Workers/chunk-Y6HOIWE5.js +959 -0
  108. package/Build/Workers/chunk-YEMC2ZOR.js +147 -0
  109. package/Build/Workers/chunk-YWNF3TPE.js +682 -0
  110. package/Build/Workers/chunk-Z55VGWJP.js +280 -0
  111. package/Build/Workers/chunk-Z5YWP24C.js +124 -0
  112. package/Build/Workers/chunk-ZHXCWUJB.js +387 -0
  113. package/Build/Workers/chunk-ZIMPUF2I.js +102 -0
  114. package/Build/Workers/chunk-ZKDWYQKC.js +3201 -0
  115. package/Build/Workers/combineGeometry.js +24 -22
  116. package/Build/Workers/createBoxGeometry.js +18 -16
  117. package/Build/Workers/createBoxOutlineGeometry.js +23 -25
  118. package/Build/Workers/createCircleGeometry.js +29 -27
  119. package/Build/Workers/createCircleOutlineGeometry.js +22 -20
  120. package/Build/Workers/createCoplanarPolygonGeometry.js +43 -43
  121. package/Build/Workers/createCoplanarPolygonOutlineGeometry.js +37 -35
  122. package/Build/Workers/createCorridorGeometry.js +46 -49
  123. package/Build/Workers/createCorridorOutlineGeometry.js +40 -43
  124. package/Build/Workers/createCylinderGeometry.js +20 -18
  125. package/Build/Workers/createCylinderOutlineGeometry.js +27 -25
  126. package/Build/Workers/createEllipseGeometry.js +28 -25
  127. package/Build/Workers/createEllipseOutlineGeometry.js +21 -18
  128. package/Build/Workers/createEllipsoidGeometry.js +19 -17
  129. package/Build/Workers/createEllipsoidOutlineGeometry.js +18 -16
  130. package/Build/Workers/createFrustumGeometry.js +18 -16
  131. package/Build/Workers/createFrustumOutlineGeometry.js +21 -21
  132. package/Build/Workers/createGeometry.js +31 -26
  133. package/Build/Workers/createGroundPolylineGeometry.js +188 -135
  134. package/Build/Workers/createPlaneGeometry.js +22 -21
  135. package/Build/Workers/createPlaneOutlineGeometry.js +15 -13
  136. package/Build/Workers/createPolygonGeometry.js +51 -52
  137. package/Build/Workers/createPolygonOutlineGeometry.js +43 -44
  138. package/Build/Workers/createPolylineGeometry.js +37 -40
  139. package/Build/Workers/createPolylineVolumeGeometry.js +41 -44
  140. package/Build/Workers/createPolylineVolumeOutlineGeometry.js +36 -39
  141. package/Build/Workers/createRectangleGeometry.js +47 -53
  142. package/Build/Workers/createRectangleOutlineGeometry.js +32 -33
  143. package/Build/Workers/createSimplePolylineGeometry.js +33 -34
  144. package/Build/Workers/createSphereGeometry.js +20 -20
  145. package/Build/Workers/createSphereOutlineGeometry.js +19 -19
  146. package/Build/Workers/createTaskProcessorWorker.js +3 -3
  147. package/Build/Workers/createVectorTileClampedPolylines.js +16 -14
  148. package/Build/Workers/createVectorTileGeometries.js +24 -22
  149. package/Build/Workers/createVectorTilePoints.js +15 -13
  150. package/Build/Workers/createVectorTilePolygons.js +24 -21
  151. package/Build/Workers/createVectorTilePolylines.js +16 -14
  152. package/Build/Workers/createVerticesFromCesium3DTilesTerrain.js +25 -25
  153. package/Build/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +29 -27
  154. package/Build/Workers/createVerticesFromHeightmap.js +42 -63
  155. package/Build/Workers/createVerticesFromQuantizedTerrainMesh.js +26 -280
  156. package/Build/Workers/createWallGeometry.js +35 -36
  157. package/Build/Workers/createWallOutlineGeometry.js +33 -34
  158. package/Build/Workers/decodeDraco.js +10 -11
  159. package/Build/Workers/decodeGoogleEarthEnterprisePacket.js +5 -5
  160. package/Build/Workers/decodeI3S.js +16 -20
  161. package/Build/Workers/gaussianSplatSorter.js +4 -4
  162. package/Build/Workers/gaussianSplatTextureGenerator.js +4 -4
  163. package/Build/Workers/incrementallyBuildTerrainPicker.js +20 -12
  164. package/Build/Workers/transcodeKTX2.js +42 -14
  165. package/Build/Workers/transferTypedArrayTest.js +1 -1
  166. package/Build/Workers/upsampleQuantizedTerrainMesh.js +24 -21
  167. package/Build/Workers/upsampleVerticesFromCesium3DTilesTerrain.js +25 -25
  168. package/Source/Shaders/BillboardCollectionFS.js +85 -81
  169. package/Source/Shaders/BillboardCollectionVS.js +60 -118
  170. package/Source/Shaders/Builtin/Constants/passCesium3DTile.js +1 -1
  171. package/Source/Shaders/Builtin/Constants/passCesium3DTileClassification.js +1 -1
  172. package/Source/Shaders/Builtin/Constants/passCesium3DTileClassificationIgnoreShow.js +1 -1
  173. package/Source/Shaders/Builtin/Constants/passCesium3DTileEdges.js +12 -0
  174. package/Source/Shaders/Builtin/Constants/passCesium3DTileEdgesDirect.js +11 -0
  175. package/Source/Shaders/Builtin/Constants/passGaussianSplats.js +11 -0
  176. package/Source/Shaders/Builtin/Constants/passOpaque.js +1 -1
  177. package/Source/Shaders/Builtin/Constants/passOverlay.js +1 -1
  178. package/Source/Shaders/Builtin/Constants/passTranslucent.js +1 -1
  179. package/Source/Shaders/Builtin/Constants/passVoxels.js +1 -1
  180. package/Source/Shaders/Builtin/CzmBuiltins.js +12 -0
  181. package/Source/Shaders/Builtin/Functions/columbusViewMorph.js +8 -1
  182. package/Source/Shaders/Builtin/Functions/computeTextureTransform.js +25 -0
  183. package/Source/Shaders/Builtin/Functions/decodeRGB8.js +24 -0
  184. package/Source/Shaders/Builtin/Functions/modelToWindowCoordinates.js +2 -1
  185. package/Source/Shaders/Builtin/Functions/unpackTexture.js +37 -0
  186. package/Source/Shaders/Builtin/Functions/windowToEyeCoordinates.js +0 -1
  187. package/Source/Shaders/EllipsoidVS.js +4 -4
  188. package/Source/Shaders/FXAA3_11.js +2 -0
  189. package/Source/Shaders/GlobeFS.js +22 -0
  190. package/Source/Shaders/GlobeVS.js +3 -2
  191. package/Source/Shaders/Model/MaterialStageFS.js +50 -20
  192. package/Source/Shaders/Model/MetadataStageFS.js +2 -1
  193. package/Source/Shaders/Model/MetadataStageVS.js +2 -1
  194. package/Source/Shaders/Model/ModelFS.js +32 -2
  195. package/Source/Shaders/Model/ModelVS.js +15 -1
  196. package/Source/Shaders/Model/PointCloudStylingStageVS.js +2 -1
  197. package/Source/Shaders/Model/PrimitiveOutlineStageFS.js +0 -1
  198. package/Source/Shaders/PointPrimitiveCollectionVS.js +8 -39
  199. package/Source/Shaders/PolygonSignedDistanceFS.js +64 -33
  200. package/Source/Shaders/PolylineCommon.js +1 -1
  201. package/Source/Shaders/ShadowVolumeAppearanceFS.js +7 -15
  202. package/Source/Shaders/SkyAtmosphereVS.js +2 -1
  203. package/Source/Shaders/Voxels/IntersectBox.js +20 -33
  204. package/Source/Shaders/Voxels/IntersectCylinder.js +28 -32
  205. package/Source/Shaders/Voxels/IntersectDepth.js +10 -6
  206. package/Source/Shaders/Voxels/IntersectEllipsoid.js +12 -20
  207. package/Source/Shaders/Voxels/IntersectLongitude.js +21 -9
  208. package/Source/Shaders/Voxels/Intersection.js +3 -5
  209. package/Source/Shaders/Voxels/IntersectionUtils.js +2 -1
  210. package/Source/Shaders/Voxels/Megatexture.js +15 -83
  211. package/Source/Shaders/Voxels/Octree.js +53 -61
  212. package/Source/Shaders/Voxels/VoxelFS.js +67 -52
  213. package/Source/Shaders/Voxels/VoxelUtils.js +0 -19
  214. package/index.js +346 -261
  215. package/package.json +1 -1
  216. package/Source/Shaders/Voxels/IntersectClippingPlanes.js +0 -80
  217. package/Source/Shaders/Voxels/convertUvToBox.js +0 -46
  218. package/Source/Shaders/Voxels/convertUvToCylinder.js +0 -101
  219. package/Source/Shaders/Voxels/convertUvToEllipsoid.js +0 -141
@@ -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
  ";
@@ -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\
@@ -6,20 +6,24 @@ 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\
11
+ float entry;\n\
12
+ float exit;\n\
13
13
  if (logDepthOrDepth != 0.0) {\n\
14
14
  // Calculate how far the ray must travel before it hits the depth buffer.\n\
15
15
  vec4 eyeCoordinateDepth = czm_screenToEyeCoordinates(screenCoord, logDepthOrDepth);\n\
16
16
  eyeCoordinateDepth /= eyeCoordinateDepth.w;\n\
17
- vec3 depthPositionUv = vec3(u_transformPositionViewToUv * eyeCoordinateDepth);\n\
18
- float t = dot(depthPositionUv - ray.pos, ray.dir);\n\
19
- setIntersectionPair(ix, DEPTH_INTERSECTION_INDEX, vec2(t, +INF_HIT));\n\
17
+ entry = dot(eyeCoordinateDepth.xyz - ray.pos, ray.dir);\n\
18
+ exit = +INF_HIT;\n\
20
19
  } else {\n\
21
20
  // There's no depth at this location.\n\
22
- setIntersectionPair(ix, DEPTH_INTERSECTION_INDEX, vec2(NO_HIT));\n\
21
+ entry = NO_HIT;\n\
22
+ exit = NO_HIT;\n\
23
23
  }\n\
24
+ ix.distanceToDepthBuffer = entry;\n\
25
+ #if defined(DEPTH_TEST)\n\
26
+ setIntersectionPair(ix, DEPTH_INTERSECTION_INDEX, vec2(entry, exit));\n\
27
+ #endif\n\
24
28
  }\n\
25
29
  ";
@@ -27,7 +27,7 @@ export default "// See IntersectionUtils.glsl for the definitions of Ray, NO_HIT
27
27
  #endif\n\
28
28
  uniform float u_eccentricitySquared;\n\
29
29
  uniform vec2 u_ellipsoidRenderLatitudeSinMinMax;\n\
30
- uniform vec2 u_clipMinMaxHeight;\n\
30
+ uniform vec2 u_clipMinMaxHeight; // Values are negative: clipHeight - maxShapeHeight\n\
31
31
  \n\
32
32
  RayShapeIntersection intersectZPlane(in Ray ray, in float z) {\n\
33
33
  float t = -ray.pos.z / ray.dir.z;\n\
@@ -45,11 +45,11 @@ RayShapeIntersection intersectZPlane(in Ray ray, in float z) {\n\
45
45
  }\n\
46
46
  }\n\
47
47
  \n\
48
- RayShapeIntersection intersectHeight(in Ray ray, in float relativeHeight, in bool convex)\n\
48
+ RayShapeIntersection intersectHeight(in Ray ray, in float height, in bool convex)\n\
49
49
  {\n\
50
50
  // Scale the ray by the ellipsoid axes to make it a unit sphere\n\
51
51
  // Note: approximating ellipsoid + height as an ellipsoid\n\
52
- vec3 radiiCorrection = u_ellipsoidRadiiUv / (u_ellipsoidRadiiUv + relativeHeight);\n\
52
+ vec3 radiiCorrection = vec3(1.0) / (u_ellipsoidRadii + height);\n\
53
53
  vec3 position = ray.pos * radiiCorrection;\n\
54
54
  vec3 direction = ray.dir * radiiCorrection;\n\
55
55
  \n\
@@ -75,10 +75,14 @@ RayShapeIntersection intersectHeight(in Ray ray, in float relativeHeight, in boo
75
75
  float tmax = max(t1, t2);\n\
76
76
  \n\
77
77
  float directionScale = convex ? 1.0 : -1.0;\n\
78
- vec3 d1 = directionScale * normalize(position + tmin * direction);\n\
79
- vec3 d2 = directionScale * normalize(position + tmax * direction);\n\
78
+ vec3 d1 = directionScale * (position + tmin * direction);\n\
79
+ vec3 d2 = directionScale * (position + tmax * direction);\n\
80
80
  \n\
81
- return RayShapeIntersection(vec4(d1, tmin), vec4(d2, tmax));\n\
81
+ // Return normals in eye coordinates. Use spherical approximation for the normal.\n\
82
+ vec3 normal1 = normalize(czm_normal * d1);\n\
83
+ vec3 normal2 = normalize(czm_normal * d2);\n\
84
+ \n\
85
+ return RayShapeIntersection(vec4(normal1, tmin), vec4(normal2, tmax));\n\
82
86
  }\n\
83
87
  \n\
84
88
  /**\n\
@@ -152,16 +156,13 @@ float getLatitudeConeShift(in float sinLatitude) {\n\
152
156
  // Find prime vertical radius of curvature: \n\
153
157
  // the distance along the ellipsoid normal to the intersection with the z-axis\n\
154
158
  float x2 = u_eccentricitySquared * sinLatitude * sinLatitude;\n\
155
- float primeVerticalRadius = inversesqrt(1.0 - x2);\n\
159
+ float primeVerticalRadius = u_ellipsoidRadii.x * inversesqrt(1.0 - x2);\n\
156
160
  \n\
157
161
  // Compute a shift from the origin to the intersection of the cone with the z-axis\n\
158
162
  return primeVerticalRadius * u_eccentricitySquared * sinLatitude;\n\
159
163
  }\n\
160
164
  \n\
161
165
  void intersectFlippedCone(in Ray ray, in float cosHalfAngle, out RayShapeIntersection intersections[2]) {\n\
162
- // Undo the scaling from ellipsoid to sphere\n\
163
- ray.pos = ray.pos * u_ellipsoidRadiiUv;\n\
164
- ray.dir = ray.dir * u_ellipsoidRadiiUv;\n\
165
166
  // Shift the ray to account for the latitude cone not being centered at the Earth center\n\
166
167
  ray.pos.z += getLatitudeConeShift(cosHalfAngle);\n\
167
168
  \n\
@@ -207,9 +208,6 @@ void intersectFlippedCone(in Ray ray, in float cosHalfAngle, out RayShapeInterse
207
208
  }\n\
208
209
  \n\
209
210
  RayShapeIntersection intersectRegularCone(in Ray ray, in float cosHalfAngle, in bool convex) {\n\
210
- // Undo the scaling from ellipsoid to sphere\n\
211
- ray.pos = ray.pos * u_ellipsoidRadiiUv;\n\
212
- ray.dir = ray.dir * u_ellipsoidRadiiUv;\n\
213
211
  // Shift the ray to account for the latitude cone not being centered at the Earth center\n\
214
212
  ray.pos.z += getLatitudeConeShift(cosHalfAngle);\n\
215
213
  \n\
@@ -246,13 +244,7 @@ RayShapeIntersection intersectRegularCone(in Ray ray, in float cosHalfAngle, in
246
244
  }\n\
247
245
  }\n\
248
246
  \n\
249
- void intersectShape(in Ray ray, inout Intersections ix) {\n\
250
- // Position is converted from [0,1] to [-1,+1] because shape intersections assume unit space is [-1,+1].\n\
251
- // Direction is scaled as well to be in sync with position.\n\
252
- ray.pos = ray.pos * 2.0 - 1.0;\n\
253
- ray.dir *= 2.0;\n\
254
- \n\
255
- // Outer ellipsoid\n\
247
+ void intersectShape(in Ray ray, in Ray rayEC, inout Intersections ix) { // Outer ellipsoid\n\
256
248
  RayShapeIntersection outerIntersect = intersectHeight(ray, u_clipMinMaxHeight.y, true);\n\
257
249
  setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX, outerIntersect);\n\
258
250
  \n\
@@ -2,6 +2,14 @@
2
2
  export default "// See IntersectionUtils.glsl for the definitions of Ray, NO_HIT, INF_HIT,\n\
3
3
  // RayShapeIntersection\n\
4
4
  \n\
5
+ vec4 transformNormalToEC(in vec4 intersection) {\n\
6
+ return vec4(normalize(czm_normal * intersection.xyz), intersection.w);\n\
7
+ }\n\
8
+ \n\
9
+ RayShapeIntersection transformNormalsToEC(in RayShapeIntersection ix) {\n\
10
+ return RayShapeIntersection(transformNormalToEC(ix.entry), transformNormalToEC(ix.exit));\n\
11
+ }\n\
12
+ \n\
5
13
  vec4 intersectLongitude(in Ray ray, in float angle, in bool positiveNormal) {\n\
6
14
  float normalSign = positiveNormal ? 1.0 : -1.0;\n\
7
15
  vec2 planeNormal = vec2(-sin(angle), cos(angle)) * normalSign;\n\
@@ -33,8 +41,8 @@ RayShapeIntersection intersectHalfSpace(in Ray ray, in float angle, in bool posi
33
41
  \n\
34
42
  void intersectFlippedWedge(in Ray ray, in vec2 minMaxAngle, out RayShapeIntersection intersections[2])\n\
35
43
  {\n\
36
- intersections[0] = intersectHalfSpace(ray, minMaxAngle.x, false);\n\
37
- intersections[1] = intersectHalfSpace(ray, minMaxAngle.y, true);\n\
44
+ intersections[0] = transformNormalsToEC(intersectHalfSpace(ray, minMaxAngle.x, false));\n\
45
+ intersections[1] = transformNormalsToEC(intersectHalfSpace(ray, minMaxAngle.y, true));\n\
38
46
  }\n\
39
47
  \n\
40
48
  bool hitPositiveHalfPlane(in Ray ray, in vec4 intersection, in bool positiveNormal) {\n\
@@ -47,14 +55,18 @@ bool hitPositiveHalfPlane(in Ray ray, in vec4 intersection, in bool positiveNorm
47
55
  void intersectHalfPlane(in Ray ray, in float angle, out RayShapeIntersection intersections[2]) {\n\
48
56
  vec4 intersection = intersectLongitude(ray, angle, true);\n\
49
57
  vec4 farSide = vec4(normalize(ray.dir), INF_HIT);\n\
58
+ bool hitPositiveSide = hitPositiveHalfPlane(ray, intersection, true);\n\
59
+ \n\
60
+ farSide = transformNormalToEC(farSide);\n\
50
61
  \n\
51
- if (hitPositiveHalfPlane(ray, intersection, true)) {\n\
62
+ if (hitPositiveSide) {\n\
63
+ intersection = transformNormalToEC(intersection);\n\
52
64
  intersections[0].entry = -1.0 * farSide;\n\
53
- intersections[0].exit = vec4(-1.0 * intersection.xy, 0.0, intersection.w);\n\
65
+ intersections[0].exit = vec4(-1.0 * intersection.xyz, intersection.w);\n\
54
66
  intersections[1].entry = intersection;\n\
55
67
  intersections[1].exit = farSide;\n\
56
68
  } else {\n\
57
- vec4 miss = vec4(normalize(ray.dir), NO_HIT);\n\
69
+ vec4 miss = vec4(normalize(czm_normal * ray.dir), NO_HIT);\n\
58
70
  intersections[0].entry = -1.0 * farSide;\n\
59
71
  intersections[0].exit = farSide;\n\
60
72
  intersections[1].entry = miss;\n\
@@ -89,16 +101,16 @@ RayShapeIntersection intersectRegularWedge(in Ray ray, in vec2 minMaxAngle)\n\
89
101
  \n\
90
102
  if (exitFromInside && enterFromOutside) {\n\
91
103
  // Ray crosses both faces of negative wedge, exiting then entering the positive shape\n\
92
- return RayShapeIntersection(first, last);\n\
104
+ return transformNormalsToEC(RayShapeIntersection(first, last));\n\
93
105
  } else if (!exitFromInside && enterFromOutside) {\n\
94
106
  // Ray starts inside wedge. last is in shadow wedge, and first is actually the entry\n\
95
- return RayShapeIntersection(-1.0 * farSide, first);\n\
107
+ return transformNormalsToEC(RayShapeIntersection(-1.0 * farSide, first));\n\
96
108
  } else if (exitFromInside && !enterFromOutside) {\n\
97
109
  // First intersection was in the shadow wedge, so last is actually the exit\n\
98
- return RayShapeIntersection(last, farSide);\n\
110
+ return transformNormalsToEC(RayShapeIntersection(last, farSide));\n\
99
111
  } else { // !exitFromInside && !enterFromOutside\n\
100
112
  // Both intersections were in the shadow wedge\n\
101
- return RayShapeIntersection(miss, miss);\n\
113
+ return transformNormalsToEC(RayShapeIntersection(miss, miss));\n\
102
114
  }\n\
103
115
  }\n\
104
116
  ";
@@ -12,9 +12,9 @@ export default "// Main intersection function for Voxel scenes.\n\
12
12
  #define INTERSECTION_COUNT ###\n\
13
13
  */\n\
14
14
  \n\
15
- RayShapeIntersection intersectScene(in vec2 screenCoord, in Ray ray, out Intersections ix) {\n\
15
+ RayShapeIntersection intersectScene(in vec2 screenCoord, in Ray ray, in Ray rayEC, out Intersections ix) {\n\
16
16
  // Do a ray-shape intersection to find the exact starting and ending points.\n\
17
- intersectShape(ray, ix);\n\
17
+ intersectShape(ray, rayEC, ix);\n\
18
18
  \n\
19
19
  // Exit early if the positive shape was completely missed or behind the ray.\n\
20
20
  RayShapeIntersection intersection = getFirstIntersection(ix);\n\
@@ -29,9 +29,7 @@ RayShapeIntersection intersectScene(in vec2 screenCoord, in Ray ray, out Interse
29
29
  #endif\n\
30
30
  \n\
31
31
  // Depth\n\
32
- #if defined(DEPTH_TEST)\n\
33
- intersectDepth(screenCoord, ray, ix);\n\
34
- #endif\n\
32
+ intersectDepth(screenCoord, rayEC, ix);\n\
35
33
  \n\
36
34
  // Find the first intersection that's in front of the ray\n\
37
35
  #if (INTERSECTION_COUNT > 1)\n\
@@ -57,6 +57,7 @@ struct Intersections {\n\
57
57
  // INTERSECTION_COUNT is the number of ray-*shape* (volume) intersections,\n\
58
58
  // so we need twice as many to track ray-*surface* intersections\n\
59
59
  vec4 intersections[INTERSECTION_COUNT * 2];\n\
60
+ float distanceToDepthBuffer;\n\
60
61
  \n\
61
62
  #if (INTERSECTION_COUNT > 1)\n\
62
63
  // Maintain state for future nextIntersection calls\n\
@@ -135,7 +136,7 @@ RayShapeIntersection nextIntersection(inout Intersections ix) {\n\
135
136
  surfaceIntersection = ix.intersections[i];\n\
136
137
  int intersectionType = int(length(surfaceIntersection.xyz) - 0.5);\n\
137
138
  bool currShapeIsPositive = intersectionType < 2;\n\
138
- bool enter = intMod(intersectionType, 2) == 0;\n\
139
+ bool enter = intersectionType % 2 == 0;\n\
139
140
  \n\
140
141
  ix.surroundCount += enter ? +1 : -1;\n\
141
142
  ix.surroundIsPositive = currShapeIsPositive ? enter : ix.surroundIsPositive;\n\
@@ -1,105 +1,37 @@
1
1
  //This file is automatically rebuilt by the Cesium build process.
2
- export default "// See Octree.glsl for the definitions of SampleData and intMod\n\
2
+ export default "// See Octree.glsl for the definitions of SampleData\n\
3
3
  \n\
4
4
  /* Megatexture defines (set in Scene/VoxelRenderResources.js)\n\
5
5
  #define SAMPLE_COUNT ###\n\
6
- #define NEAREST_SAMPLING\n\
7
6
  #define PADDING\n\
8
7
  */\n\
9
8
  \n\
10
- uniform ivec2 u_megatextureSliceDimensions; // number of slices per tile, in two dimensions\n\
11
- uniform ivec2 u_megatextureTileDimensions; // number of tiles per megatexture, in two dimensions\n\
12
- uniform vec2 u_megatextureVoxelSizeUv;\n\
13
- uniform vec2 u_megatextureSliceSizeUv;\n\
14
- uniform vec2 u_megatextureTileSizeUv;\n\
9
+ uniform ivec3 u_megatextureTileCounts; // number of tiles in the megatexture, along each axis\n\
15
10
  \n\
16
- // Integer min, max, clamp: For WebGL1 only\n\
17
- int intMin(int a, int b) {\n\
18
- return a <= b ? a : b;\n\
19
- }\n\
20
- int intMax(int a, int b) {\n\
21
- return a >= b ? a : b;\n\
22
- }\n\
23
- int intClamp(int v, int minVal, int maxVal) {\n\
24
- return intMin(intMax(v, minVal), maxVal);\n\
25
- }\n\
26
- \n\
27
- vec2 index1DTo2DTexcoord(int index, ivec2 dimensions, vec2 uvScale)\n\
11
+ vec3 index1DTo3DTexCoord(int index)\n\
28
12
  {\n\
29
- int indexX = intMod(index, dimensions.x);\n\
30
- int indexY = index / dimensions.x;\n\
31
- return vec2(indexX, indexY) * uvScale;\n\
13
+ int tilesPerZ = u_megatextureTileCounts.x * u_megatextureTileCounts.y;\n\
14
+ int iz = index / tilesPerZ;\n\
15
+ int remainder = index - iz * tilesPerZ;\n\
16
+ int iy = remainder / u_megatextureTileCounts.x;\n\
17
+ int ix = remainder - iy * u_megatextureTileCounts.x;\n\
18
+ return vec3(ix, iy, iz) / vec3(u_megatextureTileCounts);\n\
32
19
  }\n\
33
20
  \n\
34
- /*\n\
35
- How is 3D data stored in a 2D megatexture?\n\
36
- \n\
37
- In this example there is only one loaded tile and it has 2x2x2 voxels (8 voxels total).\n\
38
- The data is sliced by Z. The data at Z = 0 is placed in texels (0,0), (0,1), (1,0), (1,1) and\n\
39
- the data at Z = 1 is placed in texels (2,0), (2,1), (3,0), (3,1).\n\
40
- Note that there could be empty space in the megatexture because it's a power of two.\n\
41
- \n\
42
- 0 1 2 3\n\
43
- +---+---+---+---+\n\
44
- | | | | | 3\n\
45
- +---+---+---+---+\n\
46
- | | | | | 2\n\
47
- +-------+-------+\n\
48
- |010|110|011|111| 1\n\
49
- |--- ---|--- ---|\n\
50
- |000|100|001|101| 0\n\
51
- +-------+-------+\n\
52
- \n\
53
- When doing linear interpolation the megatexture needs to be sampled twice: once for\n\
54
- the Z slice above the voxel coordinate and once for the slice below. The two slices\n\
55
- are interpolated with fract(coord.z - 0.5). For example, a Z coordinate of 1.0 is\n\
56
- halfway between two Z slices so the interpolation factor is 0.5. Below is a side view\n\
57
- of the 3D voxel grid with voxel coordinates on the left side.\n\
58
- \n\
59
- 2 +---+\n\
60
- |001|\n\
61
- 1 +-z-+\n\
62
- |000|\n\
63
- 0 +---+\n\
64
- \n\
65
- When doing nearest neighbor the megatexture only needs to be sampled once at the closest Z slice.\n\
66
- */\n\
67
- \n\
68
21
  Properties getPropertiesFromMegatexture(in SampleData sampleData) {\n\
69
22
  int tileIndex = sampleData.megatextureIndex;\n\
70
23
  \n\
71
24
  vec3 voxelCoord = sampleData.inputCoordinate;\n\
72
- #if defined(NEAREST_SAMPLING)\n\
73
- // Round to the center of the nearest voxel\n\
74
- voxelCoord = floor(voxelCoord) + vec3(0.5);\n\
75
- #endif\n\
76
25
  \n\
77
- // Tile location\n\
78
- vec2 tileUvOffset = index1DTo2DTexcoord(tileIndex, u_megatextureTileDimensions, u_megatextureTileSizeUv);\n\
79
- \n\
80
- // Slice location\n\
81
- float slice = voxelCoord.z - 0.5;\n\
82
- int sliceIndex = int(floor(slice));\n\
83
- int sliceIndex0 = intClamp(sliceIndex, 0, u_inputDimensions.z - 1);\n\
84
- vec2 sliceUvOffset0 = index1DTo2DTexcoord(sliceIndex0, u_megatextureSliceDimensions, u_megatextureSliceSizeUv);\n\
26
+ // UV coordinate of the lower corner of the tile in the megatexture\n\
27
+ vec3 tileUvOffset = index1DTo3DTexCoord(tileIndex);\n\
85
28
  \n\
86
29
  // Voxel location\n\
87
- vec2 voxelUvOffset = clamp(voxelCoord.xy, vec2(0.5), vec2(u_inputDimensions.xy) - vec2(0.5)) * u_megatextureVoxelSizeUv;\n\
88
- \n\
89
- // Final location in the megatexture\n\
90
- vec2 uv0 = tileUvOffset + sliceUvOffset0 + voxelUvOffset;\n\
30
+ vec3 tileDimensions = vec3(u_inputDimensions);\n\
31
+ vec3 clampedVoxelCoord = clamp(voxelCoord, vec3(0.5), tileDimensions - vec3(0.5));\n\
32
+ vec3 voxelUv = clampedVoxelCoord / tileDimensions / vec3(u_megatextureTileCounts);\n\
91
33
  \n\
92
- #if defined(NEAREST_SAMPLING)\n\
93
- return getPropertiesFromMegatextureAtUv(uv0);\n\
94
- #else\n\
95
- float sliceLerp = fract(slice);\n\
96
- int sliceIndex1 = intMin(sliceIndex + 1, u_inputDimensions.z - 1);\n\
97
- vec2 sliceUvOffset1 = index1DTo2DTexcoord(sliceIndex1, u_megatextureSliceDimensions, u_megatextureSliceSizeUv);\n\
98
- vec2 uv1 = tileUvOffset + sliceUvOffset1 + voxelUvOffset;\n\
99
- Properties properties0 = getPropertiesFromMegatextureAtUv(uv0);\n\
100
- Properties properties1 = getPropertiesFromMegatextureAtUv(uv1);\n\
101
- return mixProperties(properties0, properties1, sliceLerp);\n\
102
- #endif\n\
34
+ return getPropertiesFromMegatextureAtUv(tileUvOffset + voxelUv);\n\
103
35
  }\n\
104
36
  \n\
105
37
  // Convert an array of sample datas to a final weighted properties.\n\