Project

General

Profile

« Previous | Next » 

Revision a13dde77

Added by Leszek Koltunski almost 6 years ago

Progress with a more generic 'preprocess' stage of Postprocessing Effects.

View differences:

src/main/java/org/distorted/library/main/DistortedNode.java
239 239
    if( mParent!=null ) mParent.adjustIsomorphism();
240 240
    }
241 241

  
242
///////////////////////////////////////////////////////////////////////////////////////////////////
243

  
244
  int markStencilAndDepth(long currTime, DistortedOutputSurface surface, EffectQueuePostprocess queue)
245
    {
246
    DistortedSurface input = mNumChildren[0]==0 ? mSurface : mData.mFBO;
247

  
248
    if( input.setAsInput() )
249
      {
250
      DistortedRenderState.setUpStencilMark();
251
      mEffects.drawPriv(mSurface.getWidth() /2.0f, mSurface.getHeight()/2.0f, mMesh, surface, currTime, queue.getHalo()*surface.mMipmap);
252
      DistortedRenderState.unsetUpStencilMark();
253

  
254
      return 1;
255
      }
256
    return 0;
257
    }
258

  
259 242
///////////////////////////////////////////////////////////////////////////////////////////////////
260 243
// return the total number of render calls issued
261 244

  
......
267 250
      {
268 251
      mState.apply();
269 252
      GLES31.glDisable(GLES31.GL_BLEND);
270
      mEffects.drawPriv(mSurface.getWidth()/2.0f, mSurface.getHeight()/2.0f, mMesh, surface, currTime, 0);
253
      mEffects.drawPriv(mSurface.getWidth()/2.0f, mSurface.getHeight()/2.0f, mMesh, surface, currTime);
271 254
      GLES31.glEnable(GLES31.GL_BLEND);
272 255
      return 1;
273 256
      }
......
285 268
    if( input.setAsInput() )
286 269
      {
287 270
      mState.apply();
288
      mEffects.drawPrivOIT(mSurface.getWidth()/2.0f, mSurface.getHeight()/2.0f, mMesh, surface, currTime, 0);
271
      mEffects.drawPrivOIT(mSurface.getWidth()/2.0f, mSurface.getHeight()/2.0f, mMesh, surface, currTime);
289 272
      return 1;
290 273
      }
291 274

  
......
302 285
    if( input.setAsInput() )
303 286
      {
304 287
      mState.apply();
305
      mEffects.drawPriv(mSurface.getWidth()/2.0f, mSurface.getHeight()/2.0f, mMesh, surface, currTime, 0);
288
      mEffects.drawPriv(mSurface.getWidth()/2.0f, mSurface.getHeight()/2.0f, mMesh, surface, currTime);
306 289
      return 1;
307 290
      }
308 291

  
......
737 720

  
738 721
///////////////////////////////////////////////////////////////////////////////////////////////////
739 722
/**
740
 * Returns the DistortedInputSurface object that's in the Node.
723
 * Returns the DistortedSurface object that's in the Node.
741 724
 *
742
 * @return The DistortedInputSurface contained in the Node.
725
 * @return The DistortedSurface contained in the Node.
743 726
 */
744 727
  public DistortedSurface getSurface()
745 728
    {
746 729
    return mSurface;
747 730
    }
748 731

  
732
///////////////////////////////////////////////////////////////////////////////////////////////////
733
  /**
734
   * Returns the DistortedSurface object that's in the Node.
735
   *
736
   * @return The DistortedSurface contained in the Node (if a leaf), or the FBO (if an internal Node)
737
   */
738
  public DistortedSurface getInternalSurface()
739
    {
740
    return mNumChildren[0]==0 ? mSurface : mData.mFBO;
741
    }
742

  
749 743
///////////////////////////////////////////////////////////////////////////////////////////////////
750 744
/**
751 745
 * Returns the Mesh object that's in the Node.

Also available in: Unified diff