here is the scenario: I pass an 3D OpenGL Texture to CUDA by cudaBindTextureToArray transforming it with a non rigid transformation and writed it to a 3d surface and then I want to pass it by a texture to GLSL shader for volume rendering. and GLSL only knows texture id?how I use this 3d surface as an ordinary OpenGL texture?
pseudo code
craete a texture with opengl like this
glTexImage3D(GL_TEXTURE_3D, 0,............);
pass it to cuda
create and fill a surface with
cutilSafeCall(cudaBindSurfaceToArray(volumeTexOut, outTexture->content));
......
..
cutilSafeCall( cudaMalloc3DArray(&vol->content, &vol->channelDesc, dataSize, cudaArraySurfaceLoadStore ) );
after transformation,..
surf3Dwrite(short(voxel), volumeTexOut, sizeof(short)*x1,y1, z1);
and now i want to use this surface as an opengl Texture and pass it to GLSL