Even if i did that, i still had cracks, but then after a lot of testing of different sample types, i finally got it work. It worked when i used this sampler:
__constant sampler_t randomVolumeSampler = CLK_NORMALIZED_COORDS_TRUE | CLK_ADDRESS_MIRRORED_REPEAT | CLK_FILTER_LINEAR; float4 realGridPos; realGridPos.x = gridPos.x * voxelSize; realGridPos.y = gridPos.y * voxelSize; realGridPos.z = gridPos.z * voxelSize; density.x += read_imagef(randomVolume, randomVolumeSampler, realGridPos).x * 0.8f;
realGridPos is the same as the local position in terms of a block, which in this case range from [0.0, 2.0] for each block.
Here is the result:
Thanks for the help!