Hi Michael,
GMan wrote:
> So on to the next hurdle... It seems that the post process example only works
> for a single render....
> I'm looking into the cause right now but maybe this is something obvious for
> you guys.
additionally, you need to call unmap onto srcArray after you have called the
kernel/filter:
Code:
void TexStreamer::launch( const osgCompute::Context& context ) const
{
if( isClear() )
return;
_trgBuffer->setMemory( context, 0x0, osgCompute::MAP_DEVICE_TARGET );
// map params
void* srcArray = _srcArray->map( context, osgCompute::MAP_DEVICE_SOURCE
);
void* trgBuffer = _trgBuffer->map( context,
osgCompute::MAP_DEVICE_TARGET );
// KERNEL CALL 0
filter( _numBlocks,
_numThreads,
trgBuffer,
srcArray,
_srcArray->getByteSize(),
_filter );
_srcArray->unmap( context );
}
The unmap function ensures that the texture will be mapped back from the
computation context into the render (GL) context. This is necessary for render
targets and has to be done manually since in OSG you don't know when a camera
has updated a texture object. We are sorry for the lack of documentation up to
now - but we are working on it :-)
Best regards,
Mick
------------------------
SVT Group
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=17882#17882
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org