Hi,

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:

Code:

  textures.colorTex = new osgCuda::Texture2D;
  textures.colorTex->setName("color texture");
  textures.colorTex->setTextureWidth(__m_width);
  textures.colorTex->setTextureHeight(__m_height);
  textures.colorTex->setInternalFormat(GL_RGBA32F_ARB);
  textures.colorTex->setSourceFormat(GL_RGBA);
  textures.colorTex->setSourceType(GL_FLOAT);
  textures.colorTex->addIdentifier("SRC_COLORTEX");
  imageCamera->attach(osg::Camera::COLOR_BUFFER0, textures.colorTex);




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:

Code:

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 :)

...


Thank you!

Cheers,
Thorsten

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=51537#51537





_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to