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 8 of 8

Thread: What is the minimum Texture size for OpenGL?

  1. #1
    Junior Member Newbie
    Join Date
    Nov 2016
    Posts
    5

    What is the minimum Texture size for OpenGL?

    Is there minimum size restriction in texture size or is there any recommended minimum size to use for texture size.

  2. #2
    Senior Member OpenGL Pro
    Join Date
    Jan 2007
    Posts
    1,687
    There is no minimum, you can create a 1x1 texture if you wish.

  3. #3
    Junior Member Newbie
    Join Date
    Nov 2016
    Posts
    5
    Thank you for the reply.

    Is there any restrictions on OpenGL ES 2.0 for minimum texture size.

  4. #4
    Senior Member OpenGL Guru
    Join Date
    Jun 2013
    Posts
    2,411
    Again, no. You can have a 1x1 texture.

  5. #5
    Senior Member OpenGL Pro
    Join Date
    Jan 2007
    Posts
    1,687
    This line of questioning suggests that you have something specific in mind. If so, it might help you more if you said what that something was.

  6. #6
    Junior Member Newbie
    Join Date
    Nov 2016
    Posts
    5
    I'm trying to implement shadow mapping and its working fine when the texture size is above 64.
    When it is below 64 I'm expecting pixelated shadow but what I am getting is random round shape dark patch as the shadow. I am trying to understand reason for this behaviour.
    I am using OpenGL ES 2.0.

    Is there any possible reason for this kind of behavour.

  7. #7
    Senior Member OpenGL Guru Dark Photon's Avatar
    Join Date
    Oct 2004
    Location
    Druidia
    Posts
    4,124
    That could be a number of things.

    After rendering to your shadow map, you might try rendering it to the screen in orthographic so you can see the contents of it. That might give you some clues as to what is going on. Alternatively (or in addition), you could read back the shadow map texel values with glReadPixels() and inspect them on the CPU.

    If you fail to get any leads, you might post a little code with the creation of your shadow map texture and FBO (including all your TexParameter settings), setup for your shadow map generation pass (incl. viewport/projection/viewing matrix setup), and setup for your scene render pass as pertains to your shadow map.

    You might also post a picture of your scene using the smallest shadow map size that works properly, and then one with the next power-of-two-smaller shadow map size which doesn't render properly.

    (Here's one blindfolded shot-over-the-shoulder for you to check: Do you have the GL_TEXTURE_MIN_FILTER on your shadow map set to GL_NEAREST or GL_LINEAR, and if you are using anisotropic texture filtering, do you have MAX_ANISOTROPY nailed to 1?)
    Last edited by Dark Photon; 06-28-2017 at 05:25 AM.

  8. #8
    Junior Member Newbie
    Join Date
    Nov 2016
    Posts
    5
    Thank you for the reply.
    I got problem when inspect the shadow map values in CPU. As I am using OpenGL ES glReadPixels() cannot read values from the GL_DEPTH_COMPONENT.

    I tried the GL_TEXTURE_MIN_FILTER value. I tried with both GL_NEAREST or GL_LINEAR, but getting the same output I previously mentioned.
    Also checked MAX_ANISOTROPY it set to 1.
    Is there any other things I need to check?

Posting Permissions

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