I have a slight problem with my tries to get some post processing working with osgCompute (most recent trunk version from today).
I have several textures attached to my cameras in a RTT manner, e.g. like this:
textures.colorTex = new osgCuda::Texture2D;
All textures have the same format (GL_RGBA32F_ARB). What i want to do is the following: Put all textures in a osgCompute::Computation and use this to pass everything to our CUDA-based post-processing framework. Everything is rendered to a single screen-filling quad with an according target texture in the end.
Now to first check if everything works as it should, I just tried to play around a little with the memory mapping, but they didn't quite work as I expected them to do. To make this more clear: If I map something with MAP_XXX_TARGET, it seems to work alright (I can write to it and the result is also displayed later on). The problem arises when mapping as source, e.g. like this:
float* d_srcBuffer_color = (float*) _m_srcBuffer_color->map(osgCompute::MAP_HOST_SOURCE);
When I try to copy the values over to the target buffer (mapped with MAP_HOST_TARGET), it turns out that the whole d_srcBuffer_color seems to be filled with zeroes. I also tried to loop over the source buffer and tell me if there's any non-zero value, but no, there isn't.
So maybe you guys have some idea what's going wrong here. Could it also be a version conflict? Here are the versions I am currently using:
- OpenSceneGraph 3.0.1
- CUDA 5.0.35
- latest osgCompute trunk version (rev 509)
The examples work flawlessly, btw.
Thanks in advance :)
Read this topic online here:
Post generated by Mail2Forum