Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 9 of 9

Thread: Loading Images with TR - OpenGL Tile Rendering library?

  1. #1
    Intern Contributor
    Join Date
    Jun 2009
    Posts
    85

    Loading Images with TR - OpenGL Tile Rendering library?

    Hello,

    Does anyone here know how to get large image rendering using TR library?

    Thanks & Regards

  2. #2
    Intern Contributor
    Join Date
    Jun 2009
    Posts
    85
    To be more specific, how can I load an image with resolution more than 2kx2k.?? Currently I display the image as texture by rendering them as quads. The reading of the image file works fine. But the glTexImage2D function is having limitation on the size of an image file. So I get a white rectangle displayed on my screen. So other than TR library, is there any other alternative to load high resolution image using opengl?

    Thanks

  3. #3
    Senior Member OpenGL Pro
    Join Date
    Jan 2012
    Location
    Australia
    Posts
    1,098
    glTexImage2D function is having limitation


    The function does not have limitations, the graphics hardware has limits. You cannot create a image buffer greater than the hardware limit. This can be 2kx2k or 8kx8k on different hardware. So if you wish to render an image bigger than the hardware limit you have to tile it.

  4. #4
    Intern Contributor
    Join Date
    Jun 2009
    Posts
    85
    I couldn't put it in proper words. And that's the reason why I switched over to TR library. I'm failing to break the large image into tiles. Then second thing is how to render the tiled image? A suitable example consisting of reading the image and break them to tiles is what i'm looking for.

  5. #5
    Member Regular Contributor
    Join Date
    Jun 2013
    Posts
    474
    Quote Originally Posted by rakeshthp View Post
    Does anyone here know how to get large image rendering using TR library?
    Quote Originally Posted by rakeshthp View Post
    To be more specific, how can I load an image with resolution more than 2kx2k.??
    The TR library isn't about using large textures, it's about creating an image which is larger than the largest supported framebuffer by rendering the scene multiple times, with the projection matrix adjusted to render a single "tile" of the final image in each step.

    If you need to use textures which are larger than the maximum supported texture size, first you need to break up your image data into multiple textures (or multiple levels of an array texture). You can use glPixelStore() with GL_UNPACK_ROW_LENGTH to avoid having to copy the image data to smaller, packed arrays.

    Then, you either need to break up your polygons along tile boundaries, or use a fragment shader which maps texture coordinates to a specific tile and coordinates within that tile.

  6. #6
    Intern Contributor
    Join Date
    Jun 2009
    Posts
    85
    Hi GClements,

    Thanks for your reply. Any reference or link or a small example with regards to your explanation, if available, will be helpful for me.

    Thanks

  7. #7
    Intern Contributor
    Join Date
    Jun 2009
    Posts
    85
    Hi,

    How can I break up image data into multiple textures as explained by GCelements above?

    Thanks

  8. #8
    Intern Contributor
    Join Date
    Jun 2009
    Posts
    85
    Hello,

    I tried the solution given by GClements. First I got the max texture size (say max_tsize) supported by the machine. Then I divide the image width and height by the max_tsize. By doing so I get the m*n subimages of max size 'max_tsize'. Then using the earlier way of rendering, I perform the rendering of each sub-image.

    But then, there's again a limit of max size of texture stack, which is 10 on my machine. And probably due to this stack size limit, some images are not rendered properly. (i.e. when the number of subimages go more than the stack size.

    Any alternative for this? Also the rendering speed is very bool, though the rendering I do is with the help of display list. Any suggestions are welcome.

    Thanks
    Regards
    Rakesh Patil

  9. #9
    Intern Contributor
    Join Date
    Jun 2009
    Posts
    85
    No one...? No comments...? No suggestions....?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •