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

  • SEARCH
  • Home
  • 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 6142413
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T18:22:58+00:00 2026-05-23T18:22:58+00:00

I am confused as to how OpenGL stores single component textures(like GL_RED). The GL

  • 0

I am confused as to how OpenGL stores single component textures(like GL_RED).

The GL converts it to floating point and assembles it into an RGBA element by attaching 0 for green and blue, and 1 for alpha.

Does this mean that my texture will take 32 bpp in graphic memory even though I only give 8 bpp?

Also I would like to know how OpenGL converts bytes to float for operations in the shader. It doesn’t seem logical to simply divide by 255..

  • 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. Editorial Team
    Editorial Team
    2026-05-23T18:22:59+00:00Added an answer on May 23, 2026 at 6:22 pm

    You don’t know, and you have no way of knowing (ok ok, I kind of lied… there exists documentation which tells you those details for some particular hardware. But in general you have no way of knowing, because you don’t know in advance what hardware your program will run on).

    OpenGL stores textures somewhat following your request, but it finally chooses something that the hardware supports. If that means that it converts your input data to something completely different, it does that silently.

    For example, most implementations convert RGB to RGBA because that’s more convenient for memory accesses. The same goes for 5-5-5 data being converted to 8-8-8 and similar.

    Usually, a 8 bpp texture will take only 1 byte per pixel nowadays (since pretty much every card supports that, and for software implementations it does not matter), though this is not something you can 100% rely on. You should not worry either, though… it will make sure that it somehow works.

    Similar can happen with non-power-of-two textures too, by the way. On all modern versions of OpenGL, this is supported (beginning with 2.0 if I remember right). Though, at least in theory, some older cards might not support this feature.
    In that case, OpenGL would just silently make the texture the next bigger power-of-two size and only use a part of it (without telling you!).

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

Sidebar

Related Questions

I'm looking into linux and Graphical API's, however I'm confused at how opengl is
I confused when i want to take single pointer and when should i take
I'm a little confused as to the proper usage of VBOs in an OpenGL
In OpenGL, one often writes code like this: glPushMatrix(); // modify the current matrix
Im confused, I passed a matrix datatype into the this.graphics.beginBitmapFill(); and i get Implicit
I'm a bit confused about new OpenGL extensions, what hardware they require and what
I'm really confused about OpenGL's modelview transformation. I understand all the transformation processes, but
I've done a little opengl programming on android but I'm a little confused on
I'm confused. I've been trying to start out with OpenGL, and I haven't had
I'm new to OpenGL ES and developing a simple 2D game. However, I'm confused

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.