title: Interpolation in texture3D in OpenGL ES 3.0 on iOS
body: <p>I am passing a GL_TEXTURE_3D to the fragment shader in an iOS application. I am using minification and magnification filters as GL_LINEAR for this texture. However, the resulting texture rendered in the app has blocks instead of having a smooth transition of colors, which implies that it is using GL_NEAREST interpolation.
  Here are the screenshots of the expected vs received output image
  <a href="https://i.stack.imgur.com/LmDMe.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LmDMe.png" alt="expected output"></a>
  <a href="https://i.stack.imgur.com/wSDqp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wSDqp.png" alt="output received"></a></p>
  
  <p>PS: If I use a 2D texture instead, pass in the 3D texture as a flattened 2D texture and do the interpolation manually in the shader, it works all fine and I get the expected output.</p>
  
  <p>Here is the code for setting up <code>GL_LINEAR</code>:</p>
  
  <pre><code>GLenum target, minificationFilter, magnificationFilter;
  target = GL_TEXTURE_3D;
  minificationFilter = GL_LINEAR;
  magnificationFilter = GL_LINEAR;
  glTexParameteri(target, GL_TEXTURE_MIN_FILTER, minificationFilter);
  glTexParameteri(target, GL_TEXTURE_MAG_FILTER, magnificationFilter);
  </code></pre>