View Full Version : What is the minimum Texture size for OpenGL?

06-22-2017, 07:33 PM
Is there minimum size restriction in texture size or is there any recommended minimum size to use for texture size.

06-22-2017, 10:42 PM
There is no minimum, you can create a 1x1 texture if you wish.

06-27-2017, 03:00 AM
Thank you for the reply.

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

06-27-2017, 06:49 AM
Again, no. You can have a 1x1 texture.

06-27-2017, 07:34 AM
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.

06-28-2017, 02:34 AM
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.

Dark Photon
06-28-2017, 05:14 AM
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?)

06-30-2017, 01:43 AM
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?