An Efficient Parametric Algorithm for Octree Traversal

1310641866a3bbd1ef2527414d6a7b6c
0
bravo13 101 Oct 30, 2011 at 15:09

Has anyone experience with this algorithm: “An Efficient Parametric Algorithm for Octree Traversal”…

I can get it working correctly. I included corrected version of tables, that are wrong in paper, but still… if i cast ray results voxels are in incorrect order. First voxels from back, than front… so rendering is incorrect.

7 Replies

Please log in or register to post a reply.

Fd80f81596aa1cf809ceb1c2077e190b
0
rouncer 103 Oct 30, 2011 at 16:25

is this for raycasting hires voxel models?

1310641866a3bbd1ef2527414d6a7b6c
0
bravo13 101 Oct 30, 2011 at 16:30

Should be. I have implemented it on CUDA… so far i run it only on small models… except the problem with voxel order it runs fine…
There could be problem with Octree, but I think, than that more model would be messed-up completly and not only the way I described.

Fd80f81596aa1cf809ceb1c2077e190b
0
rouncer 103 Oct 30, 2011 at 17:50

check your ray origins, camera settings, ray creation… thats all I can think of, maybe posting the shaders could help shine a light on it, it sounds like it could be a small mistake someone might spot if it really is mostly coming out right.

1310641866a3bbd1ef2527414d6a7b6c
0
bravo13 101 Oct 30, 2011 at 18:17

Error looks like this:
Left is OK (3D texture and ray goes through iterating samples)
Right is WRONG (Top of the arc is visible over pedestal. Its hard to image how should it look correct… left image is pretty much taken from same position.. ray, camera and everything is same)

perry.cz/files/error_ok.png

Octree is placed from [0,0,0] - [size.X, size.Y, size.Z]

Code for iterating octree (CUDA source):
http://pastebin.com/GYngQX7p

Fd80f81596aa1cf809ceb1c2077e190b
0
rouncer 103 Oct 30, 2011 at 18:43

Your right about it looking like its mostly working.

Code looks nice and small, comon someone help us out!! :)
I sorta understand, but cuda is mostly new to me, ill give it a hard look…

9ab572038684810378abb98d73a1817a
0
cua_grx 101 Oct 31, 2011 at 08:42

I cannot test the source right now, but it looks like you are pushing-poping nodes in the stack in the wrong order, you push nodes in the same order you find then, so when you pop the last one, you first check farther voxels. This is the first thing I would check. Original paper included pseudocode for a recursive version of the algorithm, it didn’t use a stack, but I assume CUDA does not allows for it (it would be simpler).

1310641866a3bbd1ef2527414d6a7b6c
0
bravo13 101 Nov 01, 2011 at 11:41

Thank you…it was caused by wrong order of elements in stack. Instead of stack i have to use queue.