Hi all,
I am trying to render on a FBOViewport using a shader. The texture 
attached to that FBO is a GL_TEXTURE_RECTANGLE_ARB and the image format 
is RGBA 32 F . What i need is to write a generic floating point value 
(not clamped from 0 to 1) in the RGBA channels. A snap of the code is

             beginEditCP(_img);
                _img->set(OSG::Image::OSG_RGBA_PF, _sizeX, _sizeY, 1, 1, 
1, 0, NULL, OSG::Image::OSG_FLOAT32_IMAGEDATA);                        
            
            endEditCP(_img);
            beginEditCP(_texPtr);
                _texPtr->setImage(_img);               
                _texPtr->setInternalFormat(GL_RGBA32F_ARB);               
                _texPtr->setTarget(GL_TEXTURE_RECTANGLE_ARB);
                _texPtr->setMinFilter(GL_NEAREST);
                _texPtr->setMagFilter(GL_NEAREST);                    
       
                _texPtr->setWrapS( GL_CLAMP_TO_EDGE );
                _texPtr->setWrapT( GL_CLAMP_TO_EDGE );               
            endEditCP(_texPtr);                
            ....
            f = OSG::FBOViewport::create();
            beginEditCP(f);
                f->setRoot(_Node);
                f->setCamera(_Camera);   
                f->setBackground(_Background);
                f->setParent(getWindowPtr());       
                f->setStorageWidth(_sizeX);
                f->setStorageHeight(_sizeY);       
                f->setSize(0, 0, _sizeX- 1, _sizeY- 1);       
                f->setReadBuffer(true);               
            endEditCP(f);      
            f->initialize(getWindow());
             ....
            beginEditCP(f);
                f->getTextures().push_back(_texPtr); //0
                f->getForegrounds().push_back(_polyFG);     //the shader 
is correctly attached to a polygonForeground
                f->setDirty(true);
                f->setReadBuffer(true);
                f->setFboOn(true);
                f->setEnabled(true);
                f->activate();   
            endEditCP(f);
             ...
             f->render(rAct);         
           
I am trying to find a method to understand if the shader has been 
corrected executed so, I would like to know if in your opinion:
1) is the previous code correct or i miss something regarding 
GL_TEXTURE_RECTANGLE_ARB setup?
2) is there any method to easily  view the content of the image attached 
to the fbo? I can't use "write" method because of its depth ("Invalid 
pixeldepth, cannot store data").

Any clue about?

Thank you very much!


------------------------------------------------------------------------------
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to