vec3 box_min = floor(samplePos / boxsize) * boxsize;
vec3 box_max = box_min + vec3(boxsize,boxsize,boxsize);
Currently I calculate the distance vector between the sample position and box_max. Then I take the smallest component of this vector. Then this distance is devided by the size of a ray increment (t => r = r0 +t * dir). This gives me the
number of samples I can skip and reaches the next sub cube.
But this doesnt work. I guess the calculated "t" is too small. Sometime I see nothing and then the raycasted picture
is distorted. I tried a ray-aabb intersection with slabs.
But actually with respect to the current sample position, the
rays origin is always inside of a cube.
Can anyone help me ?
I tried this one, but that doesnt seem to work. And I also wonder about the ns = min(1, nsi) line on the right side.
Hope there is someone who can help me