Hi,
I am creating an empty texture object as follows:
Code:
osg::ref_ptr< osgCuda::Texture2D > trgTexture = new osgCuda::Texture2D;
trgTexture->setName( "Target Texture" );
trgTexture->addIdentifier( "TRG_BUFFER" );
// Note: GL_RGBA8 Bit format is not yet supported by CUDA, use
GL_RGBA8UI_EXT instead.
// GL_RGBA8UI_EXT requires the additional work of scaling the fragment
shader
// output from 0-1 to 0-255.
trgTexture->setInternalFormat( GL_RGBA32F_ARB );
trgTexture->setSourceFormat( GL_RGBA );
trgTexture->setSourceType( GL_FLOAT );
// in case you choose a texture size which is not a multiple of the
alignment restriction CUDA
// will allocate more memory to fulfill the alignemnt requirements. To get
the
// actual pitch (bytes of a single row) call osgCompute::Memory::getPitch()
trgTexture->setTextureWidth( srcImage->s());
trgTexture->setTextureHeight( srcImage->t() );
Source image's width and height is assigned, but not the image data itself,
because there is no data yet. So the texture is empty. Is there any way to make
sure that the texture is complete or not ?
One more thing - is there any way within osg to initialize the texture with
the zero value ?
Cheers,
Sajjadul
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=57879#57879
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org