Hi Harash,

Subsampling/Resampling:
Yes, the UnitInResampleOut, do resample the input texture to the size you want 
to have it. However it use the default hardware resampling algorithm, so 
GL_LINEAR. From your question, I thought you are thinking of some lagorithm 
wich do something better than just linear subsampling. However if you are fine 
with that, than you can of course use that unit.

Image:
Yes, you was faster than, I was able to answer :) Correct, I wanted to propose 
you to take a look into UnitOutCapture, which did exactly what you need. Of 
course you should consider that taking a texture back to the CPU would be 
probably a bottleneck in your performance. So maybe try to rewrite your 
algorithm, so that it make use of the mipmap structure to do the histogram 
computations you need. In this way you would not need to get the texture from 
the GPU to the CPU and your algorithm could still be fast.

UnitOutTextureTap:
I think you should post your contribution. This will help other if they stuck 
in the same problem. However check first if you could use the osg's built in 
functionality to take texture to image. You can attach an osg::Image to 
osg::Texture and this image will be used to download the texture to the image 
on the fly. Current implementation is just always create a new image and just 
do the download. However, in the other way around one may probably mark texture 
as dirty, so that image get downloaded only when needed. It could be that one 
might need to just call osg::Texture::apply() method in the 
noticeFinishRendering() method, so that the download is started. This would 
make the whole code clearer and will preserve future compatibility to osg's 
code. However, if you already doing that in this way, then just forget what I 
told ;)

Regards,
art

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





_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to