float getSlicedWorley(in vec3 coord, in float size, in vec3 offset) {
    coord *= size*0.00415;
    coord += offset*0.04;

    const int tiles = 8;
    const int slices = 64;

    vec2 xyCoord    = fract(coord.xy)/vec2(tiles);

    float zCoord    = fract(coord.z);

    int sliceIndex  = int(floor(zCoord*slices));

    int evenIndex   = int(floor(sliceIndex/2))*2;
    int evenColumn  = int(floor(fract(evenIndex/8.0)*tiles));
    int evenRow     = int(floor(evenIndex/8.0));

    int unevenIndex = int(floor((sliceIndex+1)/2))*2;
    int unevenColumn = int(floor(fract(unevenIndex/8.0)*tiles));
    int unevenRow   = int(floor(unevenIndex/8.0));

    float evenWeight = saturate(fract(coord.z*slices*0.5+0.5));
    float unevenWeight = saturate(1.0-fract(coord.z*slices*0.5+0.5));

    float weight    = abs(fract(zCoord*slices*0.5)-0.5)*2.0;

    vec2 evenCoord  = xyCoord + vec2(float(evenColumn)/tiles, float(evenRow)/tiles);
    vec2 unevenCoord = xyCoord + vec2(float(unevenColumn)/tiles, float(unevenRow)/tiles);

    float evenSample = texture(worleyNoiseTex, evenCoord).x;
    float unevenSample = texture(worleyNoiseTex, unevenCoord).x;

    /*if (sliceIndex%2 == 0) return evenSample;
    else return unevenSample;*/
    return (mix(evenSample, unevenSample, (weight)));
}