How to multisample with FBObject

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

How to multisample with FBObject

Peter F
Hello!

I've been looking into anti-aliasing techniques etc & need to use MSAA FBObjects in my app.

I've seen code hinting at creating multi-sampled FBObjects, but can't find enough information about how to correctly set one up & use it.

I'm familiar enough with the MSAA technique e.g. the restrictions about how to use a texture on an offscreen multisampled FBO.

I've even implemented my own bare-bones FBO with multisampled textures & depth stencil buffer.

What I want to know is how to create the same with the JOGL FBObject API.

Thanks for your help!
Reply | Threaded
Open this post in threaded view
|

Re: How to multisample with FBObject

Peter F
I've found I can call

FBObject.init( final GL gl, final int newWidth, final int newHeight, final int newSamples )

and pass in the number of samples I want,  but then I receive an error when trying to call

FBObject.attachTexture2D( final GL gl, final int attachmentPoint, final boolean alpha )

with the following exception:

Caused by: com.jogamp.opengl.GLException: Texture2D not supported w/ MSAA. If you have enabled MSAA with exisiting texture attachments, you may want to detach them via detachAllTexturebuffer(gl).
        at com.jogamp.opengl.FBObject.attachColorbufferImpl(FBObject.java:1524)
        at com.jogamp.opengl.FBObject.attachColorbuffer(FBObject.java:1507)
        at com.jogamp.opengl.FBObject.attachTexture2D(FBObject.java:1347)

I guess Texture2D doesn't support multisamples? What should I do instead to create a texture backed FBO with the JOGL API? I also need to attach a multi-sampled packed depth-stencil render buffer.

As I mentioned in my first post I've been able to implement this 'manually' using the base JOGL bindings so I understand the concept, I'm after some JOGL API help more than anything.

Cheers.
Reply | Threaded
Open this post in threaded view
|

Re: How to multisample with FBObject

gouessej
Administrator
Why not calling detachAllTexturebuffer then?
Julien Gouesse | Personal blog | Website