I am new to CUDA and I am trying to build a volume renderer. I have looked at the sample from the SDK as a starting point.
I am currently rendering volume data from a .raw file (one of the free ones available on the internet) very similiar to how the SDK renders “bucky”.
The next step for me is to implement an octree to help speed up my program.
However I am not too sure how to go about this.
I have an octree structure and some functions within my (only) CUDA file (ok to have it in this file?) but there are two things I don’t understand that I hope somebody can help with.
To build an octree you need to give it the positions (x, y z) in 3D space of data that you want space subdivided around. If I have a .raw file (256x256x256) how can I get the coordinates to do this from my 3D texture that holds the .raw file data???
The only function I know of is tex3D(…) but you need to give it the x,y,z values in order to sample the texture. I want to do this later with the actually x,y, z values of the data in 3D space after Ive built an octree.
If I build and use the octree within the CUDA file (.cu file) how can I visualise the tree with for example OpenGL as I can’t call OpenGL code within the .cu file…or can I???
I hope I have explained this sufficiently.