Project

General

Profile

« Previous | Next » 

Revision 406e2f6b

Added by Leszek Koltunski almost 6 years ago

Give users API to render OutputSerfaces and attached Nodes in either the 'normal' way of OIT way.

View differences:

src/main/java/org/distorted/library/main/DistortedNode.java
63 63
  private static HashMap<ArrayList<Long>,NodeData> mMapNodeID = new HashMap<>();
64 64
  private static long mNextNodeID =0;
65 65

  
66
  private boolean mRenderWayOIT;
66 67
  private DistortedNode mParent;
67 68
  private DistortedOutputSurface mSurfaceParent;
68 69
  private MeshObject mMesh;
......
340 341
        DistortedEffects.blitPriv(mData.mFBO);
341 342
        }
342 343

  
343
      numRenders += mData.mFBO.renderChildren(currTime,mNumChildren[0],mChildren,0);
344
      numRenders += mData.mFBO.renderChildren(currTime,mNumChildren[0],mChildren,0, mRenderWayOIT);
344 345
      }
345 346

  
346 347
    return numRenders;
......
403 404
    mNumChildren[0]= 0;
404 405
    mParent        = null;
405 406
    mSurfaceParent = null;
407
    mRenderWayOIT  = false;
406 408

  
407 409
    mFboW            = 0;  // i.e. take this from
408 410
    mFboH            = 0;  // mSurface's dimensions
......
444 446
    mState        = new DistortedRenderState();
445 447
    mParent       = null;
446 448
    mSurfaceParent= null;
449
    mRenderWayOIT = false;
447 450

  
448 451
    mFboW            = node.mFboW;
449 452
    mFboH            = node.mFboH;
......
509 512
    mEffects.newNode(this);
510 513
    }
511 514

  
515
///////////////////////////////////////////////////////////////////////////////////////////////////
516
  /**
517
   * When rendering this Node, should we use the Order Independent Transparency render more?
518
   * <p>
519
   * There are two modes of rendering: the fast 'normal' way, which however renders transparent
520
   * fragments in different ways depending on which fragments get rendered first, or the slower
521
   * 'oit' way, which renders transparent fragments correctly regardless of their order.
522
   *
523
   * @param oit True if we want to render more slowly, but in a way which accounts for transparency.
524
   */
525
  public void setOrderIndependentTransparency(boolean oit)
526
    {
527
    mRenderWayOIT = oit;
528
    }
529

  
512 530
///////////////////////////////////////////////////////////////////////////////////////////////////
513 531
/**
514 532
 * Adds a new child to the last position in the list of our Node's children.

Also available in: Unified diff