Note that there are some explanatory texts on larger screens.

plurals
  1. POiOS / GLES2: How to programmatically determine maximum available texture units?
    text
    copied!<p>Determining maximum texture size is no problem: <a href="https://stackoverflow.com/questions/3240636/how-to-detect-maximum-texture-resolution-on-iphone">How to detect maximum texture resolution on iPhone?</a></p> <hr> <p>Also, the documentation specifies the maximum number of samplers that a fragment shader can handle, <a href="http://developer.apple.com/library/ios/#documentation/3DDrawing/Conceptual/OpenGLES_ProgrammingGuide/OpenGLESPlatforms/OpenGLESPlatforms.html" rel="nofollow noreferrer"><strong>here</strong></a></p> <p>That link specifies under the heading </p> <blockquote> <p><strong>OpenGL ES 2.0 on the PowerVR SGX</strong><br> You can use <em>up to 8 textures</em> in a fragment shader</p> </blockquote> <p>you load textures eg:</p> <pre><code>// bind gem texture to slot #0, and inform shader via uniform glActiveTexture( GL_TEXTURE0 ); glBindTexture( GL_TEXTURE_2D, texId_dull ); glUniform1i( [ self.program idForUniform: "U1_sampId_Gem" ], (GLuint)0 ); // ... similarly for texture #1 glActiveTexture( GL_TEXTURE1 ); glBindTexture( GL_TEXTURE_2D, texId_sparkle ); glUniform1i( [ self.program idForUniform: "U2_sampId_Sparkle" ], (GLuint)1 ); </code></pre> <p>and COMMAND+click on GL_TEXTURE1 reveals constants all the way to GL_TEXTURE31, so it looks like they are preparing a couple of generations ahead.</p> <hr> <p>But where can I find the maximum number of textures that can be created.</p> <pre><code>glGenTextures( n, pTexID ); // what is max n? </code></pre> <p>Is this only limited by the physical amount of memory available for video on the device? (I read there is no actual physical distinction between VRAM and RAM, it is the same memory). Or can some lower limit be guaranteed?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload