title: GLKit blend two textures
body: <p>I'm trying to convert OGL ES 1.1. code to GLKit. GLKit offers a pair of texture slots:</p>
  
  <ol>
  <li>texture2d0</li>
  <li>texture2d1</li>
  </ol>
  
  <p>Each texture has an env mode:</p>
  
  <ol>
  <li>GLKTextureEnvModeReplace,</li>
  <li>GLKTextureEnvModeModulate,</li>
  <li>GLKTextureEnvModeDecal</li>
  </ol>
  
  <p>Normally, you leave texture2d1 blank, and just set texture2d0. I assumed - from reading Apple's docs - that 2d1 was for blending/combining/modifying textures. Since GLKit is "merely" sitting on top of shaders, and it's standard for each shader to have a pair of texture slots - the "incoming" slot representing what's already on the material, and the "modification" slot representing the stuff that the shader is going to use as parameter to modiffy the material.</p>
  
  <p>But that doesn't seem to work.</p>
  
  <p>I tried:</p>
  
  <pre><code>self.baseEffect.texture2d0.envMode = GLKTextureEnvModeReplace;
  self.baseEffect.texture2d0.target = GLKTextureTarget2D;
  self.baseEffect.texture2d0.name = [earthTextureDefault name];
  
  self.baseEffect.texture2d1.envMode =  GLKTextureEnvModeModulate;
  self.baseEffect.texture2d1.target = GLKTextureTarget2D;
  self.baseEffect.texture2d1.enabled = TRUE;
  self.baseEffect.texture2d1.name = [textureClouds name];
  </code></pre>
  
  <p>...and all I got was a black non-texture. Either texture, placed into 0 (with nothing in 1), works fine. The second texture is shaded alpha-to-white, where the first texture is all opaque, but with a fairly rich pallette.</p>
  
  <p>What I'd really like to do is start applying dynamicly-generated / updated blends, efficiently. e.g.:</p>
  
  <ol>
  <li>load a base texture</li>
  <li>load a second texture</li>
  <li>load a blend-mask that blends between them</li>
  <li>...update the blend-mask frame-by-frame. Without having to re-upload the first two textures</li>
  </ol>
  
  <p>NB: I'm not looking to throw-away GLKit and write custom shaders for this instead. I want to understand how GLKit works - and by the looks of things it should be a LOT easier to maintain for simple things like this than if I go around writing a bunch of shaders.</p>