Hi Tobi,

Tobias Kipfelsberger wrote:
> 
> It is not working! I only get crap! 

Hmpf. That would have been a nice and easy fix...

> Can you have a quick look over my code, just in case i screwed up somewhere?
> With OSG_UINT8_IMAGEDATA everything works fine. 
> By the way I'm using the most recent daily build (version 1.8) from today.
> 
> grabImage = Image::create();
> grabImage->set(       Image::OSG_RGBA_PF, 
>               m_imageWidth, m_imageHeight,
>               1,1,1,0.0,
>               0, Image::OSG_FLOAT32_IMAGEDATA);  // do i need to allocate 
> memory here?
> 
> GrabForegroundPtr grabber = GrabForeground::create();
> grabber->setImage(g_grabImage);            
> grabber->setActive(true);
> 
> MFForegroundPtr *foregrounds = g_window->getPort(0)->getMFForegrounds();
> foregrounds->push_back (grabber);
> 
> // check texture
> for (int h=0; h< grabImage->getHeight(); ++h) {
>     for (int w=0; w< grabImage->getWidth(); ++w)  {
>       float r = ((float*)(grabImage ->getData() + 
> width*h*Channels*ByteSize))[w*4];
>       float g = ((float*)(grabImage ->getData() + 
> width*h*Channels*ByteSize))[w*4+1];
>       float b = ((float*)(grabImage ->getData() + 
> width*h*Channels*ByteSize))[w*4+2];
>       float a = ((float*)(grabImage ->getData() + 
> width*h*Channels*ByteSize))[w*4+3];
>     }
> }

That looks ok. Do you have a simple test program that I could run here?

> There are no scatter operations for Shaders. Right now there is no easy way 
> to sum values of a texture.

Hm, summing up values is more a gather if I'm not mistaken. I know many people 
do that in multiple passes writing to successively smaller textures.

>> The id that's store in the TextureChunk is not th eactual GL id any more
>> (unless 
>> you use an old version).
> 
> So, where is the GL id now? :-)

In the Window:

win->getGLObjectId(fboViewport->getTextures(0)->getGLId());

Hope it helps

        Dirk

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to