I\'m using modern OpenGL 4.3 core.
I just realized that 1024p x 1024p tileset is too small for my needs. So, I replaced it with 1024p x 1024p x 4p 3D texture. (I kno
That's because 0 is the "leftmost" part of the left texel and 1 is the rightmost point in the rightmost texel. Assume we have 4 texels, than the coordinates are as follows:
0 1/4 1/2 3/4 1
| tx1 | tx2 | tx3 | tx4 |
since you need to hit exactly the center of a voxel, you have to use addresses that are 1/2 voxel higher then you expected (+0.25/2 = +0.125), thus the voxel centers are as described in the bottom line of the following diagram.
| tx1 | tx2 | tx3 | tx4 |
| | | |
0.125 0.375 0.625 0.875