Part of the Khronos Group

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 2 of 2

Thread: Stretching to cover the viewport in Opengl ES 2.0 with glTexSubImage2D

  1. #1
    Junior Member Newbie
    Join Date
    Jun 2012

    Stretching to cover the viewport in Opengl ES 2.0 with glTexSubImage2D

    -I have a texture quad which is smaller than the device screen.

    -The viewport is set to actually match the device screen, though as said, the texture size is smaller.

    -I'm rendering the texture quad with glTexImage2D.

    At this point the expected behaviour is the correct one, which is when rendering even though the texture is smaller than the viewport, the final render stretches to cover the full viewport.

    The problem is when I use the glTexSubImage2D. The data being pushed into the GPU is still the same as it was with glTexImage2D, which is smaller than the Viewport. But differently of what glTexImage2D did, now the render does not cover the full viewport, only the real texture size leaving most of the screen empty.

    How can I render with glTexSubImage2D, and make it to stretch the full viewport?


  2. #2
    Junior Member Regular Contributor
    Join Date
    Sep 2013
    glTexImage2D and glTexSubImage2D do not render anything. Read the documentation for these methods, they are used to transport texel data from client side memory to the graphics card.
    Rendering is done with glDrawArrays, glDrawElements or glBegin / glEnd or similar methods.

Tags for this Thread

Posting Permissions

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