bravo13 at October 30th, 2011 11:09 — #1
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.
rouncer at October 30th, 2011 12:25 — #2
is this for raycasting hires voxel models?
bravo13 at October 30th, 2011 12:30 — #3
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.
rouncer at October 30th, 2011 13:50 — #4
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.
bravo13 at October 30th, 2011 14:17 — #5
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)
Octree is placed from [0,0,0] - [size.X, size.Y, size.Z]
Code for iterating octree (CUDA source):
rouncer at October 30th, 2011 14:43 — #6
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...
cua_grx at October 31st, 2011 04:42 — #7
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).
bravo13 at November 1st, 2011 07:41 — #8
Thank you...it was caused by wrong order of elements in stack. Instead of stack i have to use queue.