Re: [osg-users] Disable all antialiasing

2012-02-22 Thread Aurelien Albert
Hi,

I'm facing a problem when creating my FBO :


Code:
Warning: detected OpenGL error 'invalid operation' at After Renderer::compile
RenderStage::runCameraSetUp(), FBO setup failed, FBO status= 0x8cd6
Warning: FrameBufferObject: could not create the FBO
RenderStage::runCameraSetUp(), FBO setup failed, FBO status= 0x0
Warning: detected OpenGL error 'invalid value' at after RenderBin::draw(..)
Warning: FrameBufferObject: could not create the FBO
RenderStage::runCameraSetUp(), FBO setup failed, FBO status= 0x0
PixelBufferWin32::bindPBufferToTextureImplementation, wglBindTexImageARB error: 
LÆopÚration a rÚussi.

Warning: detected OpenGL error 'invalid operation' at after RenderBin::draw(..)
Warning: detected OpenGL error 'invalid operation' at end of SceneView::draw()
Warning: detected OpenGL error 'invalid operation' at start of 
State::apply(StateSet*)
Warning: detected OpenGL error 'invalid operation' at end of 
State::apply(StateSet*)



My code :


Code:
p_renderTexture = new osg::Texture2D();
p_renderTexture-setTextureSize(200, 200);
p_renderTexture-setInternalFormat(GL_RGBA_INTEGER_EXT);
p_renderTexture-setSourceFormat(GL_RGBA32I_EXT);
p_renderTexture-setSourceType(GL_BYTE);
p_renderTexture-setFilter(osg::Texture2D::MIN_FILTER, osg::Texture2D::NEAREST);
p_renderTexture-setFilter(osg::Texture2D::MAG_FILTER, osg::Texture2D::NEAREST);
p_renderTexture-setWrap(osg::Texture::WRAP_S, osg::Texture::CLAMP_TO_EDGE);
p_renderTexture-setWrap(osg::Texture::WRAP_T, osg::Texture::CLAMP_TO_EDGE);
p_renderTexture-setDataVariance(osg::Object::DYNAMIC); 
p_renderTexture-setUseHardwareMipMapGeneration(false);
p_renderTexture-setResizeNonPowerOfTwoHint(false);




I think there is something wrong with that :

Code:
p_renderTexture-setInternalFormat(GL_RGBA_INTEGER_EXT);
p_renderTexture-setSourceFormat(GL_RGBA32I_EXT);
p_renderTexture-setSourceType(GL_BYTE);




For another application, I use :


Code:
p_renderTexture-setInternalFormat(GL_RGBA32F_ARB);
p_renderTexture-setSourceFormat(GL_RGBA);
p_renderTexture-setSourceType(GL_FLOAT);




which works well to render to a floating point FBO


Thanks for your help !

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





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


Re: [osg-users] Disable all antialiasing

2012-02-22 Thread Aurelien Albert
Hum... I think I'm swapped two parameters.

The following seems to work :


Code:
p_renderTexture-setInternalFormat(GL_RGBA32I_EXT);
p_renderTexture-setSourceFormat(GL_RGBA_INTEGER_EXT);
p_renderTexture-setSourceType(GL_BYTE);




Could you explain me the difference between these 3 parameters ?

setInternalFormat = is it the data storage format ? so here, R, G, B and A 
components stored as a single 32 bit integer ?

setSourceFormat= I don't really understand this parameter...


setSourceType= I don't really understand this parameter...

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





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


Re: [osg-users] Disable all antialiasing

2012-02-22 Thread Sergey Polischuk
Internal format is storage format, it specifies channels number, optionally: 
data type, number of bits per channel etc
Source format is specification of components number, meaning and order
Source type is storage data type in image used to load texture from image

22.02.2012, 17:14, Aurelien Albert aurelien.alb...@alyotech.fr:
 Hum... I think I'm swapped two parameters.

 The following seems to work :

 Code:
 p_renderTexture-setInternalFormat(GL_RGBA32I_EXT);
 p_renderTexture-setSourceFormat(GL_RGBA_INTEGER_EXT);
 p_renderTexture-setSourceType(GL_BYTE);

 Could you explain me the difference between these 3 parameters ?

 setInternalFormat = is it the data storage format ? so here, R, G, B and A 
 components stored as a single 32 bit integer ?

 setSourceFormat= I don't really understand this parameter...

 setSourceType= I don't really understand this parameter...

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

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


[osg-users] Disable all antialiasing

2012-02-21 Thread Aurelien Albert
Hi,

In my application, I need to render 2 buffers :
- color buffer
- object-code buffer

I obtain the color-buffer by normal rendering to an FBO.

For some algorithms purpose (object tracking, objects statisitics, etc...) I 
need also an object-code buffer with, for each pixel, an int value 
corresponding to the object.

 I can do this with a shader in another FBO, but I need this buffer to be not 
antialiased at all.

For example, if the background code is 0, and there are 2 objects in the 
scene (codes 10 and 20) the final object-code buffer must be filled with 
0, 10 and 20 but no other value.

How can I configure my rendering to do so ? Maybe using the stencil buffer as a 
object-code buffer (I don't know if antialiasing such as MSAA affect stencil 
buffer) ?

Thank you!

Cheers,
Aurelien

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





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


Re: [osg-users] Disable all antialiasing

2012-02-21 Thread Robert Osfield
Hi Aurelien,

You have to explicitly enable multisampling for FBO's when settting up
the RTT Camera, so should it be off by default.

Robert.

On 21 February 2012 08:44, Aurelien Albert aurelien.alb...@alyotech.fr wrote:
 Hi,

 In my application, I need to render 2 buffers :
 - color buffer
 - object-code buffer

 I obtain the color-buffer by normal rendering to an FBO.

 For some algorithms purpose (object tracking, objects statisitics, etc...) I 
 need also an object-code buffer with, for each pixel, an int value 
 corresponding to the object.

  I can do this with a shader in another FBO, but I need this buffer to be not 
 antialiased at all.

 For example, if the background code is 0, and there are 2 objects in the 
 scene (codes 10 and 20) the final object-code buffer must be filled 
 with 0, 10 and 20 but no other value.

 How can I configure my rendering to do so ? Maybe using the stencil buffer as 
 a object-code buffer (I don't know if antialiasing such as MSAA affect 
 stencil buffer) ?

 Thank you!

 Cheers,
 Aurelien

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





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


Re: [osg-users] Disable all antialiasing

2012-02-21 Thread Sergey Polischuk
Hi

All antialiasing is disabled in opengl by default.
If you mean you should be able to read values as you write them in shader - you 
should choose appropriate render target texture attachment type. I'm not sure 
if it is possible to render to unnormalized integer type color textures in osg, 
you could try to attach texture with format GL_RGBA32UI and internal format 
GL_RGBA_INTEGER_EXT (also there are 8\16 bit formats with different channels 
count, check out GL_EXT_texture_integer extension specification ) to camera to 
check if it works in osg (as it works with this formats in opengl).

Cheers,
Sergey

21.02.2012, 12:44, Aurelien Albert aurelien.alb...@alyotech.fr:
 Hi,

 In my application, I need to render 2 buffers :
 - color buffer
 - object-code buffer

 I obtain the color-buffer by normal rendering to an FBO.

 For some algorithms purpose (object tracking, objects statisitics, etc...) I 
 need also an object-code buffer with, for each pixel, an int value 
 corresponding to the object.

  I can do this with a shader in another FBO, but I need this buffer to be not 
 antialiased at all.

 For example, if the background code is 0, and there are 2 objects in the 
 scene (codes 10 and 20) the final object-code buffer must be filled 
 with 0, 10 and 20 but no other value.

 How can I configure my rendering to do so ? Maybe using the stencil buffer as 
 a object-code buffer (I don't know if antialiasing such as MSAA affect 
 stencil buffer) ?

 Thank you!

 Cheers,
 Aurelien

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

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