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 8998129
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T23:58:57+00:00 2026-06-15T23:58:57+00:00

I am now writing a program to generate textures using GPU with the help

  • 0

I am now writing a program to generate textures using GPU with the help of GL Shading Language. However, I am wondering whether it is possible for me to fetch the data stored in a texture and write it in an array?

  • 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-06-15T23:58:58+00:00Added an answer on June 15, 2026 at 11:58 pm

    This is not a big deal, if you have glGetTexImage*().

    In case glGetTexImage*() is not available, you have to render a textured quad to a renderbuffer, which is attached to an FBO (if supported), or to the backbuffer and use glReadPixels() to read it back from either render target. Should the render target have insufficient size, multiple tiles must be rendered and retrieved separately.

    When implementing either approach, pay attention to other states, which determine how and where pixels actually will be written to:

    • GL_PACK_ALIGNMENT (image line alignment; 1,2,4 or 8 bytes) requires appropriate memory allocation for the requested image size. For example, a 24bit DIB (.bmp) uses a line alignment of 4 bytes. Having 3 bytes per pixel, padding is required at the end if (image.width * 3) % 4 != 0.
      The total amount of additional padding bytes is:

      readSize.y * ((alignment - readSize.x % alignment) % alignment).

    • GL_PIXEL_PACK_BUFFER, the target buffer binding for pixel transfers (may be unused in your case and explicitly set to 0).

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

Sidebar

Related Questions

I'm writing a simple program to help generate orders for a game I'm a
Right now I am writing a program in OpenGl. I'm rendering some-what complex 3D
Right now I am writing a simulation program which output is formatted according to
I am writing a web-spider program with C. Now I am given a url's
I'm writing a program right now which produces four unsigned 32-bit integers as output
Right now I'm writing a program that will determine the value of a hand
I'm writing a program trying to implement a toy XML processor. Right now the
Right now I'm writing a C program that must execute a child process. I'm
I'm writing a program with a consumer thread and a producer thread, now it
I'm currently writing a program that (as of right now) utilizes about five linked

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.