Results 1 to 2 of 2

Thread: OpenGL transfer pixel layout

  1. #1
    Newbie Newbie
    Join Date
    Dec 2013
    Posts
    1

    OpenGL transfer pixel layout

    I'd like to get some clarification as to how OpenGL arranges and stores pixels when using methods like glReadPixels() and glGetTexImage(), and whether than can be altered. I've been working in the Blender Game Engine, using PyOpenGL to perform some render-to-texture operations, and I'd like to be able to take these products and use them in the BGE. It seems that Blender's native methods for reading an image from a buffer require the pixel data to be stored in a single-dimensional array, like so:
    Code :
    [r1, g1, b1, a1, ... rN, gN, bN, aN]
    Unfortunately, PyOpenGL seems to store pixel data using multi-dimensional arrays, which are accessed something like this:
    Code :
    pixelData[R, G, B or A][location_x][location_y]
    Is this arrangement of data particular to PyOpenGL's implementation of these methods, or is this how OpenGL structures it's data?
    Also, is there a way to get OpenGL to conform to Blender's requirements for a one-dimensional array of data?

  2. #2
    Senior Member Regular Contributor
    Join Date
    Sep 2013
    Posts
    186
    Maybe reading these pages will help you:
    http://www.opengl.org/sdk/docs/man4/...ReadPixels.xml

    http://www.opengl.org/sdk/docs/man4/...PixelStore.xml

    The first describes how pixels are fetched using glReadPixels. The next one gives you some information on the pixel store.

Similar Threads

  1. Programmability in the Pixel Transfer Pipeline?
    By outofsync in forum OpenGL: Advanced Coding
    Replies: 2
    Last Post: 12-29-2010, 04:07 AM
  2. Replies: 10
    Last Post: 07-02-2009, 11:20 AM
  3. Starting a DMA Pixel Buffer transfer and then?
    By Bruce Wheaton in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 06-02-2008, 05:23 PM
  4. glTexSubImage Pixel Transfer Options
    By jtipton in forum OpenGL: Advanced Coding
    Replies: 2
    Last Post: 07-31-2006, 11:12 AM
  5. Textures and Pixel Transfer Operations
    By asmartin in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 10-30-2000, 03:52 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean