“integer constant overflow” with GLSL (OpenGL ES2)?

Actually, the newer iOS models that support OpenGL ES 2.0 have the ability to use non-power-of-two textures because that is provided for in the OpenGL ES 2.0 specification. These devices also allow for non-power-of-two textures to be used in OpenGL ES 1.1 via the GL_APPLE_texture_2D_limited_npot extension, which I describe in more detail in my answer here The restrictions Apple places on these non-power-of-two textures is that they must not be mipmapped and they must use GL_CLAMP_TO_EDGE for the wrapping: glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE) I use such textures in my OpenGL ES 2.0 sample application here You shouldn't need to find another way to pass your textures in to your shaders on these devices.

Actually, the newer iOS models that support OpenGL ES 2.0 have the ability to use non-power-of-two textures because that is provided for in the OpenGL ES 2.0 specification. These devices also allow for non-power-of-two textures to be used in OpenGL ES 1.1 via the GL_APPLE_texture_2D_limited_npot extension, which I describe in more detail in my answer here. The restrictions Apple places on these non-power-of-two textures is that they must not be mipmapped and they must use GL_CLAMP_TO_EDGE for the wrapping: glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); I use such textures in my OpenGL ES 2.0 sample application here.

You shouldn't need to find another way to pass your textures in to your shaders on these devices.

Thank you, very much. So I need to set the clamping parameters and it should work? At the moment my app requires iOS 4 or more and a camera.

What devices does this extension work for? – Matthew Mitchell Jan 26 at 22:52 I need to get something else to work before I'm able to test to see if the texture padding works. I may just use the padding method if it means I can support more devices.

– Matthew Mitchell Jan 26 at 22:53 I should be able to make it easily choose between using "npot" and "pot" but I will probably only bother if the padding technique is slow or something. At least for when I submit the next version to Apple. – Matthew Mitchell Jan 26 at 22:54 @Matthew - Yes, the clamping was the last thing I needed to get going to enable non-power-of-two textures in that sample application.

Again, you can check out my sample application to see how this works, because it does color-based object tracking from camera input (I tested it on an iPhone 4, but I believe it also works on the 3G S). It's my understanding that this extension works on all PowerVR SGX hardware, so anything that supports OpenGL ES 2.0. It's not guaranteed to be supported on future hardware, but I see no reason for them dropping support.

– Brad Larson Jan 26 at 22:56 @Matthew - Actually, now that I read into it, the OpenGL ES 2.0 specification provides for non-power-of-two textures by itself. That extension only applies for OpenGL ES 1.1, so all OpenGL ES 2.0 compatible devices should support non-power-of-two textures. I think the clamping might be a restriction that Apple applies on top of what the specification says.

Also, I think Apple still requires mipmapped textures to be power-of-two. – Brad Larson Jan 26 at 23:08.

The OpenGL/ES 2 spec only requires that GLSL integers are at least 17 bits (able to represent the range -2^16,2^16)), and integers are used for array indexes, so you can't reliably create an array with more than 65535 elements. You might not be able to create one that big in any case, as there are limits on the total amount of uniform data that may be much lower. If you want access to a larger amount of data, you need to use a texture.

This error is probably coming from your integer constant 172800 which is apparently too big for your platform's GLSL implementation.

Thank you. I will try the padding idea. It's stupid that you must have power of two textures.

The only reason why I found is mipmapping. I'm not even using mipmapping. Thanks to this I have to waste memory.

Apple need to fix this (Unless people are missing something? ). – Matthew Mitchell Jan 26 at 19:51.

There are non-power-of-2 texture targets, so no reason to do this. opengl.org/registry/specs/ARB/texture_re... Or you just pad your non-power-of-2 data into a power-of-2 frame.

Okay thank you. How do I use ARB_texture_rectangle? – Matthew Mitchell Jan 26 at 18:00 1 That's a OpenGL extension, and he seems to be using OpenGL ES.

– Matias Valdenegro Jan 26 at 19:13 I'll have to use padding then? Hmm. I'll have to allocate memory to fit the image into a power of two texture and use memcpy on each row.

I'm already copying data into a separate store, so I'll change that part slightly and I'll bring back feedback. Thank you everyone. – Matthew Mitchell Jan 26 at 19:48.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions