@jdultra/threedtiles 13.3.2 → 13.3.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/dist/threedtiles.cjs.js +13 -11
- package/dist/threedtiles.cjs.js.map +1 -1
- package/dist/threedtiles.es.js +13 -11
- package/dist/threedtiles.es.js.map +1 -1
- package/dist/threedtiles.umd.js +13 -11
- package/dist/threedtiles.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/threedtiles.cjs.js
CHANGED
|
@@ -100,19 +100,21 @@ void getVertexData(out vec3 position, out mat3 covariance) {
|
|
|
100
100
|
int( (y + 0.5) ), // y pixel
|
|
101
101
|
int( sliceIndex + 0.5 ) ); // z slice */
|
|
102
102
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
float sliceIndex = floor(index / pixelsPerSlice);
|
|
106
|
-
float slicePixelIndex = mod(index,pixelsPerSlice);
|
|
103
|
+
|
|
104
|
+
highp uint uOrder = order; // Use a local uint copy
|
|
107
105
|
|
|
108
|
-
|
|
109
|
-
|
|
106
|
+
// It's good practice to ensure textureSize is treated as uint for these calcs
|
|
107
|
+
uint uTextureSize = uint(textureSize); // textureSize uniform is float
|
|
108
|
+
uint uPixelsPerSlice = uTextureSize * uTextureSize;
|
|
110
109
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
110
|
+
uint sliceIndexVal = uOrder / uPixelsPerSlice;
|
|
111
|
+
uint slicePixelIndex = uOrder % uPixelsPerSlice; // umod(uOrder, uPixelsPerSlice) also works
|
|
112
|
+
|
|
113
|
+
uint xVal = slicePixelIndex % uTextureSize; // umod(slicePixelIndex, uTextureSize)
|
|
114
|
+
uint yVal = slicePixelIndex / uTextureSize;
|
|
115
|
+
|
|
116
|
+
// texelFetch takes ivec3 for coordinates, no +0.5 needed as these are direct integer indices
|
|
117
|
+
ivec3 coord = ivec3(xVal, yVal, sliceIndexVal);
|
|
116
118
|
|
|
117
119
|
// Position
|
|
118
120
|
highp uvec4 positionColor = texelFetch(positionColorTexture, coord,0);
|