Sign in to follow this  
data2

OpenGL How to identify supported render target formats?

Recommended Posts

Hi there, I'm currently implementing an offline rendering and would like to know if there is a way to check whether a certain texture format is supported as render target by the computer's graphics card. I know that in directx there is a check. How does the corresponding thing look like in opengl?? Thanks, data

Share this post


Link to post
Share on other sites
Uh, you hit the real GL problem - you cannot.
Understanding is half-float render targets are supported is rather trivial - it just takes an extension check for the format itself and building the FBO for the RT support.
Understanding if 32bit-float blending is supported is more involved. As far as I've understood, performance analisys is the only way to go.

In general, GL doesn't allow you to know if FEATURE_X is supported in HW or thuru driver provided machinery, it's a part of the design.

For less extreme cases however this isn't really a problem especially now that the HW is very orthogonal.

Share this post


Link to post
Share on other sites
Hmm. But if I cannot find out, does the driver at least guarantee that the rendering will be correct -- either in HW or software? Say, if I take a RGBA16F or L8 or whatever format, can I render into the texture, the driver does whatever it like and in the end, my texture contains the expected result in any case? That'd be ok with me.

Share this post


Link to post
Share on other sites
u can query this with glGet..() commands check the back of the opengl spec for specifics.

Share this post


Link to post
Share on other sites
Quote:
Original post by data2
Hmm. But if I cannot find out, does the driver at least guarantee that the rendering will be correct
Absolutely! GL doesn't care if it's HW or SW but it does guarantee the results. They will be "correct" but don't expect them to be pixel perfect.
Quote:
Original post by data2
Say, if I take a RGBA16F or L8 or whatever format, can I render into the texture, the driver does whatever it like and in the end, my texture contains the expected result in any case?
Doing a more relistic scenario: if you ask for RGBA32F, you'll get it and everything will be ok. If you call Enable(BLEND) the SW rasterization will kick in. The performance will be ugly but it will work as expected.
With RGBA16F on NV4x and later you get completely orthogonal pipelines, same with R32F.

For L8 what will probably happen is that the driver tricks you in using RGBA8 or maybe RG...

Share this post


Link to post
Share on other sites
Well, i try to use framebuffer objects for the rendering. With RGBA8 and RGBA16 everything works fine, but with RGBA32F I get a GL_FRAMEBUFFER_UNSUPPORTED_EXT error. Why? Does it mean that the graphics card (a Quadro 550) doesn't support float textures? That would be funny, because I'm pretty sure that it does (at least as source texture).

Cheers,
Felix

Share this post


Link to post
Share on other sites
Quote:
Original post by data2
Well, i try to use framebuffer objects for the rendering. With RGBA8 and RGBA16 everything works fine
It's surprising, I was rather sure GeForces didn't allow RGBA16 rendering.
Quote:
Original post by data2
but with RGBA32F I get a GL_FRAMEBUFFER_UNSUPPORTED_EXT error. Why? Does it mean that the graphics card (a Quadro 550) doesn't support float textures? That would be funny, because I'm pretty sure that it does (at least as source texture).
If memory serves, Quadro 550 is based on the FX. FX did have a few quirks with float textures in general - they must be texture rectangles and I'm not sure they worked smoothly.

I suppose you're mixing ATI_texture_float functionality with NV_float_buffer. NV3x supports the only the latter. So, if you're using RGBA_FLOAT32 (ATI) try changing to FLOAT_RGBA32 (NV, rectangular).
I don't figure out how could you manage to make it work as source that way but maybe it's worth a try.

Additionally, they may have decided to iron RGBA32 out.
Quote:
EXT_FBO
Although GL defines a wide variety of internal formats for framebuffer-attachable images, such as texture images and renderbuffer images, some implementations may not support rendering to particular combinations of internal formats. If the combination of formats of the images attached to a framebuffer object are not supported by the implementation, then the framebuffer is not complete under the clause labeled FRAMEBUFFER_UNSUPPORTED_EXT. There must exist, however, at least one combination of internal formats for which the framebuffer cannot be FRAMEBUFFER_UNSUPPORTED_EXT.


I believe someone more experienced with NV3x should reply about that.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this