Hi all, I apologize in advance for the "wordy" post! I've recently ventured down the path of learning about the use of PBO's in GL. I've come to the conclusion that we could probably use this functionality in some of our texture-based pipelines. Anyway, I've run into an issue when trying to use them with 3D textures and I think it's just because 3D textures aren't used nearly as much as 2d textures in this community(at least until recently!). I think the problem we're facing is that currently,the PixelBufferObject class only updates based on data set to an osg::Image. However, for our 3D texture pipelines, we update our textures via a subloadcallback. We eventually call glTexSubImage3D to update the texture data with external data similar to below:
*void cfdUpdateTextureCallback::subload( const osg::Texture3D& texture, osg::State& state ) const { if( !textureDataHolder ) { return; } if( **textureDataHolder**->TimeToUpdateTextureData() ) { texture.getExtensions( state.getContextID(), false )->glTexSubImage3D( GL_TEXTURE_3D, 0, 0, 0, 0, _textureWidth, _textureHeight, _textureDepth, GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE, ( unsigned char* )**textureDataHolder**->GetTextureData() ); } } } *I looked at osg::Texture::applyTexImage2D_subload for an example of how to use PBO's with textures and implemented this in my subload callback but my data only displays the original image data. Looking in the function for PixelBufferObject::compileBuffer, I found that the buffer data is only updated on the data in the image that the PBO is associated with. Sooooo...how do I update the image data or the PBO? Ideally, I'd like to be able to set the data to use for updating the PBO. We were using the subload callback to manage the data in the texture but now it seems like somehow we'll have to manipulate the data in image but I don't see an interface for that. Am I missing something or has this situation not been addressed? I have some ideas on how to fix it but they all seem like a hack so any input/advice there would be greatly appreciated. biv
_______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org