 uniform vec2 uScale;
 
 varying vec2 vCoordinate;
+
+#pragma glslify: import('../chunks/common.glsl')
+#pragma glslify: decodeFloatRGB = require(../utils/decode-float-rgb.glsl)
 
 // cube corners
 const vec3 c0 = vec3(0., 0., 0.);

vec4 voxel(vec3 pos) {
    return texture3dFrom2dNearest(tVolumeData, pos, uGridDim, uGridTexDim.xy);
}

#pragma glslify: decodeFloatRGB = require(../utils/decode-float-rgb.glsl)

void main(void) {
    // get 1D index

    return posXYZ;
}

vec4 texture3dFrom2dNearest(sampler2D tex, vec3 pos, vec3 gridDim, vec2 texDim) {
    float zSlice = floor(pos.z * gridDim.z + 0.5); // round to nearest z-slice
    float column = intMod(zSlice * gridDim.x, texDim.x) / gridDim.x;
