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.
is this for raycasting hires voxel models?
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.
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.
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):
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...
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).
Thank you...it was caused by wrong order of elements in stack. Instead of stack i have to use queue.