Jump to content
  • Advertisement
Sign in to follow this  
MARS_999

OpenGL FBO questions

This topic is 4496 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Well I have been working with FBO's for awhile now. I have a few questions I have not found answers for on the extension page. 1. Can you use FP texture formats as RTT types? If so what are the limitations? Do I need to use the ARB_texture_rectangle or with OpenGL2.0 hardware can I just do without the texture_rectangle extension? 2. For mipmapping and FBO's can I use the GL_LINEAR_MIPMAP_LINEAR type for filtering or is it LINEAR/NEAREST only? 3. When used with a depth buffer to RTT for a shadowmap, can I use a FP texture type to render to e.g. GL_LUMINANCE32F_ARB to get better precision copying to my texture from the depth buffer? Thanks for any help on clearing up my confusion...

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by MARS_999
Well I have been working with FBO's for awhile now. I have a few questions I have not found answers for on the extension page.

1. Can you use FP texture formats as RTT types? If so what are the limitations? Do I need to use the ARB_texture_rectangle or with OpenGL2.0 hardware can I just do without the texture_rectangle extension?


I believe this is card specific. In recent architectures, the answer is definitely yes. On older cards, the answer is maybe.

Quote:

2. For mipmapping and FBO's can I use the GL_LINEAR_MIPMAP_LINEAR type for filtering or is it LINEAR/NEAREST only?

Yes, but you'll have to use a different extension than the traditional SGIS extension that people used back in the days of pBuffers. Instead, you'll have to use glGenerateMipmapsEXT().

Quote:

3. When used with a depth buffer to RTT for a shadowmap, can I use a FP texture type to render to e.g. GL_LUMINANCE32F_ARB to get better precision copying to my texture from the depth buffer?

Thanks for any help on clearing up my confusion...


Sorry, I don't know the answer to that one.

Share this post


Link to post
Share on other sites
Thanks Cwhite I am already using the glGenerateMipmapsEXT() so that should be fine. My other question on the FP textures with FBO's do you know of a weblink that has the specs on ATI/Nvidia hardware that support FP in FBO's? Thanks

Share this post


Link to post
Share on other sites
MARS_999: my understanding is that it has nothing (within reason) to do with hardware and everything to do with driver version. If everyone has a fairly recent driver they SHOULD to the best of my knowledge, have the extension.

hope that helps
-Dan

Share this post


Link to post
Share on other sites
Quote:
Original post by Ademan555
MARS_999: my understanding is that it has nothing (within reason) to do with hardware and everything to do with driver version. If everyone has a fairly recent driver they SHOULD to the best of my knowledge, have the extension.

hope that helps
-Dan


thanks Dan, I am shooting for OpenGL2.0 hardware so thats not an issue, I am more concerned with the limitations of the FBO for FP textures and FP depth textures? I thought it would be nice to see a chart to show what hardware and/or drivers have support for all these newer extensions and features/limitations e.g. 16bit depth buffer <- I think on ATI the render target can't be 24/32 for depth textures on anything but x1600, x1900 hardware... Don't quote me but Humus said of the x1300,x1800,x1600 the x1600 had 24bit support. I am assuming the new 1900 series has it also now.

Share this post


Link to post
Share on other sites
I think this is the most recent document about FBO support on nVidia cards.

Maybe it helps a little.

HellRaiZer

EDIT:
Quote:

When used with a depth buffer to RTT for a shadowmap, can I use a FP texture type to render to e.g. GL_LUMINANCE32F_ARB to get better precision copying to my texture from the depth buffer?

I don't think this is possible. Render-to-depth-texture can only be done with DEPTH_COMPONENT texture formats and the format of GL_LUMINANCE32F_ARB isn't a DEPTH_COMPONENT one. Maybe i'm completely wrong on that, but i think you have to render the depth manually to such a texture format.

Share this post


Link to post
Share on other sites
Thanks HellRaizer for the link. Yeah when I try GL_FLOAT_R16_NV or any ARB FP texture type for internal types I get a black filled RTT. So what I am assuming is no FP values for RTT types for the depth buffer... :(

Share this post


Link to post
Share on other sites
You could set up a 4 channel floating point render target with full precision, and then render depth into one of the color channels. This will give you greater precision, but has the downside of not running at 2x speed because color writes aren't disabled and can also run into issues of hardware accidentally trying to gamma correct the depth value. This is the technique that was used for variance shadow maps, which require both the depth and the depth squared.

Share this post


Link to post
Share on other sites
4 channel floating point render target with full precision would that be like this in my FBO


glTexImage2D(texture_target, 0, GL_RGBA32F_ARB, texWidth, texHeight, 0, GL_RGBA, GL_FLOAT, NULL);



I have that set in my renderbuffer and is set to GL_DEPTH_ATTACHMENT_EXT do I need to change this to a color attachment? Thanks again.

Share this post


Link to post
Share on other sites
Quote:
Original post by MARS_999
4 channel floating point render target with full precision would that be like this in my FBO

*** Source Snippet Removed ***

I have that set in my renderbuffer and is set to GL_DEPTH_ATTACHMENT_EXT do I need to change this to a color attachment? Thanks again.


yes

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!