Re: [osg-users] problem with blending when using floating point FBO

2009-07-07 Thread Jonathan Richard
Glad you got it working! Is there a reason you didn't just attach an osg::Texture to your camera and set the number of samples greater than 1 in the attach call? Well I did attach a texture to my camera and set the number of samples greater than 1...see: osg::ref_ptrosg::TextureRectangle

Re: [osg-users] problem with blending when using floating point FBO

2009-07-07 Thread Thrall, Bryan
Jonathan Richard wrote on Tuesday, July 07, 2009 7:28 AM: Glad you got it working! Is there a reason you didn't just attach an osg::Texture to your camera and set the number of samples greater than 1 in the attach call? Well I did attach a texture to my camera and set

Re: [osg-users] problem with blending when using floating point FBO

2009-07-06 Thread Jonathan Richard
Ok I was able to get it working by getting the resolved fbo using the RenderStage::getMultisampleResolveFramebufferObject method. Here a subset of my code in the draw callback: osgViewer::Renderer * renderer = static_castosgViewer::Renderer*(renderInfo.getCurrentCamera()-getRenderer());

Re: [osg-users] problem with blending when using floating point FBO

2009-07-06 Thread Thrall, Bryan
Jonathan Richard wrote on Monday, July 06, 2009 4:04 PM: Ok I was able to get it working by getting the resolved fbo using the RenderStage::getMultisampleResolveFramebufferObject method. Here a subset of my code in the draw callback: osgViewer::Renderer * renderer =

Re: [osg-users] problem with blending when using floating point FBO

2009-06-30 Thread Jonathan Richard
glReadPixels does not work with a multisample FBO (check glGetError after your glReadPixels to see); yes you are right, I get a GL_INVALID_OPERATION after the call of glReadPixels you have to use glBlitFramebuffer to copy the multisample FBO to a FBO without multisampling to resolve the samples

Re: [osg-users] problem with blending when using floating point FBO

2009-06-30 Thread Thrall, Bryan
Jonathan Richard wrote on Tuesday, June 30, 2009 10:36 AM: you have to use glBlitFramebuffer to copy the multisample FBO to a FBO without multisampling to resolve the samples to a texture; this is what osgUtil::RenderStage does when you attach an osg::Texture and set the samples to 1. I'm

Re: [osg-users] problem with blending when using floating point FBO

2009-06-30 Thread Jonathan Richard
The result is an FBO without multisampling whose buffers are filled by combining the multiple samples from the multisample FBO together. Ok so the FBO multisampling is supported but not directly as it said on http://www.opengl.org/wiki/GL_EXT_framebuffer_object_More_about_FBOs Are multisample

Re: [osg-users] problem with blending when using floating point FBO

2009-06-30 Thread Thrall, Bryan
Jonathan Richard wrote on Tuesday, June 30, 2009 3:09 PM: The result is an FBO without multisampling whose buffers are filled by combining the multiple samples from the multisample FBO together. Ok so the FBO multisampling is supported but not directly as it said on

Re: [osg-users] problem with blending when using floating point FBO

2009-06-29 Thread Jonathan Richard
How did you test that setting both to 4 didn't work? This is how I tested it: // Reading back the FBO does not work when it is disabled after render -- set this property of the // renderStage to false. A workaround is to enable glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, frameBufferObjectID) in

Re: [osg-users] problem with blending when using floating point FBO

2009-06-29 Thread Thrall, Bryan
Jonathan Richard wrote on Monday, June 29, 2009 2:19 PM: How did you test that setting both to 4 didn't work? This is how I tested it: ... // code in MyCameraDrawCallback glReadBuffer(GL_COLOR_ATTACHMENT0_EXT); float* tempbuf32Bits = NULL; tempbuf32Bits = new float[500*500];

Re: [osg-users] problem with blending when using floating point FBO

2009-06-26 Thread Jonathan Richard
Hi, I set the color by using a fragment shader and the 32 bits floating point blending seems to be working now. I would like to use multisampling in my FBO. How can I configure that? Is it only by setting the method: Camera::attach(BufferComponent buffer, osg::Texture* texture, unsigned int

Re: [osg-users] problem with blending when using floating point FBO

2009-06-26 Thread Thrall, Bryan
Jonathan Richard wrote on Friday, June 26, 2009 3:30 PM: Hi, I set the color by using a fragment shader and the 32 bits floating point blending seems to be working now. I would like to use multisampling in my FBO. How can I configure that? Is it only by setting the method:

Re: [osg-users] problem with blending when using floating point FBO

2009-05-26 Thread J.P. Delport
Hi, I've quickly looked through the code, two lines bugged me: // Tell to sort the mesh before displaying it AFAIK OSG does not sort at the triangle level, there is an option to make the sorting happen at a primitive level, but I think the default is sorting on bounding sphere.

Re: [osg-users] problem with blending when using floating point FBO

2009-05-26 Thread J.P. Delport
Hi, Jonathan Richard wrote: |// Tell to sort the mesh before displaying it |AFAIK OSG does not sort at the triangle level, there is an option to make the sorting happen at a primitive level, but I think the default is sorting on bounding sphere. I take this line (and the comment) from

Re: [osg-users] problem with blending when using floating point FBO

2009-05-26 Thread Jonathan Richard
Ok thank you for the advice. I'm not very familiar with the shader programming yet, but I'm suppose to get into it soon. The problem that I see is how to get access to the facet from the shader. If I'm into a fragment shader I'll probably have no idea from which facet come each fragment. Is it

[osg-users] problem with blending when using floating point FBO

2009-05-25 Thread Jonathan . Richard0
Hi, I'm using the osgViewer ::Viewer to perform floating point rendering in an FBO and I have a problem when blending is enabled. My blending function is defined by GL_ONE_MINUS_SRC_ALPHA for destination and GL_ONE for source. The problem occurs when I draw a facet with a small color in

Re: [osg-users] problem with blending when using floating point FBO

2009-05-25 Thread J.P. Delport
Hi, are you sure your hardware supports 32-bit blending? What card/drivers are you using? We've tried identifying the effective resolution of blending on various cards. I don't have the results handy, will try to get them. jp jonathan.richa...@gmail.com wrote: Hi, I’m using the osgViewer

Re: [osg-users] problem with blending when using floating point FBO

2009-05-25 Thread J.P. Delport
Hi, posting some code would prob be best. How are you attaching the colours to your facets? Texture? Shader? A few things on my checklist normally: Lighting off Background Render order MRT enabled gl_FragData in shaders Texture mode jp jonathan.richa...@gmail.com wrote: Hi, my card is a

Re: [osg-users] problem with blending when using floating point FBO

2009-05-25 Thread Jonathan . Richard0
Hi, The colors are attached by setting the ColorArray of the drawables of each Geode like this: int geodesNb = m_entityVectorOfGeodeVector[0].size(); osg::Geode* aGeode; int drawablesNb; osg::Drawable* aDrawable; osg::Geometry* aDrawableGeometry; osg::Vec4Array* aDrawableColor; for (int