2012-01-16 60 views

回答

0

我終於找到了解決辦法。這裏的缺點是雙渲染,但我有我的效果!

  gl.glEnable(GL10.GL_NORMALIZE); 
      gl.glEnable(GL10.GL_TEXTURE_2D); 

      // texture 0 
      texture.bind(); // main texture 
      draw(); 

      // texture 1 
      gl.glColor4f(0,1,0,1); // desired color of the glow 
      gl.glDisable(GL10.GL_LIGHTING); // disable light for enabling glow in the shadow 
      gl.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA); 
      gl.glEnable(GL10.GL_BLEND); 
      mask.bind(); 
      draw(); 

      gl.glDisable(GL10.GL_BLEND); 
      gl.glEnable(GL10.GL_LIGHTING); //enable light again 
      gl.glColor4f(1,1,1,1); //restore color