Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 146175
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T08:33:18+00:00 2026-05-11T08:33:18+00:00

I generate a texture like this: GLuint id; glGenTextures(1, &id); glBindTexture(GL_TEXTURE_2D, id); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S,

  • 0

I generate a texture like this:

GLuint id;  glGenTextures(1, &id);  glBindTexture(GL_TEXTURE_2D, id);  glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);  glTexImage2D(     GL_TEXTURE_2D, 0,     GL_RGBA16,     //GL_RGBA16F_ARB, //< Won't work     256, 256, 0, GL_RGBA, GL_FLOAT, NULL );  glBindTexture(GL_TEXTURE_2D, 0); 

I attach it to a framebuffer object (FBO) for rendering to. All of this works like a charm when I set the internal format to GL_RGBA16. However, I need a higher dynamic range and was thinking that GL_RGBA16F_ARB might do the trick.

Unfortunately, if I replace GL_RGBA16 with GL_RGBA16F_ARB in the code given above, the texture seems to stop working. Nothing I try to render to the FBO/texture sticks, and when I use the texture it contains random garbage. (A lot of purple, as it turns out) This would not be so frustrating if I had gotten an error message hinting at what might be wrong, but I can’t seem to find one. In other words, glGetError() returns 0 after the glTexImage2D-call, and glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT) returns GL_FRAMEBUFFER_COMPLETE_EXT when I have attached the texture

I haven’t messed with glClampColorARB(...) … yet 🙂

  1. Have I forgotten to check for errors in a place/way that I haven’t thought of?
  2. Do GL_RGBA16F_ARB-textures require any special treatment that I haven’t given?
  3. Is there anything else that might be wrong?

I’m stumped, since everything works smoothly with GL_RGBA16… 🙁

EDIT: When using GL_RGBA16F_ARB, the first frame I try to render to screen doesn’t make it. Seems to me that I should be getting an error message somewhere..?

EDIT: By inspecting ShadowIce’s working code example I figured out that the problems disappeared if I changed the depth buffer on my FBO, and give glRenderBufferStorageEXT(...) GL_DEPTH_COMPONENT24 as its second parameter, rather than GL_DEPTH_COMPONENT16. I have no idea why this works, but apparently it does work.

Also, ShadowIce’s code breaks like mine if I do the opposite substitution there.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T08:33:19+00:00Added an answer on May 11, 2026 at 8:33 am

    There shouldn’t be anything special to do for setting up a framebuffer with float textures. Some things I would check:

    1. Is the FBO bound and the draw/read buffer set correctly before you call glCheckFramebufferStatusEXT? Also try testing it right before you draw to it.
    2. Does the texture look ok after a simple glClear with a specific clear color? If yes, there might be something wrong with your shaders (if you use any) or the way you draw to the FBO.
    3. Are your drivers up to date? And does the problem still exist on a PC with different hardware?
    4. How about GL_RGBA32F_ARB?

    Edit:

    1. Check the id of your framebuffer and texture, also check if the texture id matches the one attached to your fbo (with glGetFramebufferAttachmentParameteriv). Normally I would guess that everything is ok with that if it works with a RGBA texture but random data (especially purple) is a good sign that nothing was written to the texture or it wasn’t cleared properly.

    I have written a small example application that should work, maybe that helps. I have only tested it on windows, so for linux you might need to change it a bit: link

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 110k
  • Answers 110k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Some suggestions: For storing the data Encrypt the data (CryptoAPI… May 11, 2026 at 9:38 pm
  • Editorial Team
    Editorial Team added an answer It's like the images only refresh when control goes back… May 11, 2026 at 9:38 pm
  • Editorial Team
    Editorial Team added an answer I can think of a few options off the top… May 11, 2026 at 9:38 pm

Related Questions

I have a 320x480 PNG that I would like to texture map/manipulate on the
I'm developing a Flex 2 application, and I noticed that part of the library
I've seen well-textured balls, planets, and other spherical objects in couple of games, last
I want to texture a sphere with a cube map. So far my research

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.