Project

General

Profile

« Previous | Next » 

Revision 8dccc3c2

Added by Leszek Koltunski about 6 years ago

Disable blending during postprocessing.

View differences:

src/main/java/org/distorted/library/effect/PostprocessEffectGlow.java
223 223
      {
224 224
      inBuffer.setAsOutput();
225 225
      outBuffer.setAsInput(0);
226
      GLES31.glEnable(GLES31.GL_BLEND);
226 227
      DistortedEffects.blitPriv(inBuffer);
228
      GLES31.glDisable(GLES31.GL_BLEND);
227 229
      return 3;
228 230
      }
229 231

  
src/main/java/org/distorted/library/main/DistortedNode.java
19 19

  
20 20
package org.distorted.library.main;
21 21

  
22
import android.opengl.GLES31;
23

  
22 24
import java.util.ArrayList;
23 25
import java.util.Collections;
24 26
import java.util.HashMap;
......
272 274
    return 0;
273 275
    }
274 276

  
277
///////////////////////////////////////////////////////////////////////////////////////////////////
278
// return the total number of render calls issued
279

  
280
  int drawNoBlend(long currTime, DistortedOutputSurface surface)
281
    {
282
    DistortedInputSurface input = mNumChildren[0]==0 ? mSurface : mData.mFBO;
283

  
284
    if( input.setAsInput() )
285
      {
286
      surface.setAsOutput(currTime);
287
      mState.apply();
288
      GLES31.glDisable(GLES31.GL_BLEND);
289
      mEffects.drawPriv(mSurface.getWidth()/2.0f, mSurface.getHeight()/2.0f, mMesh, surface, currTime, 0);
290
      GLES31.glEnable(GLES31.GL_BLEND);
291
      return 1;
292
      }
293

  
294
    return 0;
295
    }
296

  
275 297
///////////////////////////////////////////////////////////////////////////////////////////////////
276 298
// return the total number of render calls issued
277 299

  
src/main/java/org/distorted/library/main/DistortedOutputSurface.java
453 453
          cloneViewport(this);
454 454
          }
455 455

  
456
        child1.draw(time,mBuffer[quality]);
456
        child1.drawNoBlend(time,mBuffer[quality]);
457 457

  
458 458
        if( i==numChildren-1 )
459 459
          {
src/main/java/org/distorted/library/main/EffectQueuePostprocess.java
19 19

  
20 20
package org.distorted.library.main;
21 21

  
22
import android.opengl.GLES31;
23

  
22 24
import org.distorted.library.effect.EffectType;
23 25
import org.distorted.library.effect.PostprocessEffect;
24 26
import org.distorted.library.message.EffectMessage;
......
103 105
    {
104 106
    int numRenders = 0;
105 107

  
108
    GLES31.glDisable(GLES31.GL_BLEND);
109

  
106 110
    for(int i=0; i<mNumEffects; i++)
107 111
      {
108 112
      numRenders += ((PostprocessEffect)mEffects[i]).apply(mUniforms,NUM_UNIFORMS*i, buffers);
109 113
      }
110 114

  
115
    GLES31.glEnable(GLES31.GL_BLEND);
116

  
111 117
    return numRenders;
112 118
    }
113 119
  }

Also available in: Unified diff