Project

General

Profile

« Previous | Next » 

Revision 2386a081

Added by Leszek Koltunski almost 6 years ago

1. Hide internalQuality inside Postprocess effects.
2. First step to turn markStencilAndDepth into a more generic Postprocessing 'preprocess'.

View differences:

src/main/java/org/distorted/library/main/DistortedOutputSurface.java
400 400

  
401 401
  int renderChildren(long time, int numChildren, ArrayList<DistortedNode> children, int fbo, boolean oit)
402 402
    {
403
    int quality=0, internalQuality = 0, numRenders = 0, bucketChange = 0;
404
    DistortedNode child1, child2;
403
    int quality=0, numRenders=0, bucketChange=0;
404
    DistortedNode child;
405 405
    EffectQueuePostprocess lastQueue=null, currQueue;
406 406
    long lastBucket=0, currBucket;
407 407

  
......
422 422

  
423 423
    for(int i=0; i<numChildren; i++)
424 424
      {
425
      child1 = children.get(i);
426
      currQueue = child1.getPostprocessQueue();
425
      child = children.get(i);
426
      currQueue = child.getPostprocessQueue();
427 427
      currBucket= currQueue.getID();
428 428

  
429 429
      if( currBucket==0 )
......
432 432

  
433 433
        if( oit )
434 434
          {
435
          numRenders += child1.drawOIT(time, this);
435
          numRenders += child.drawOIT(time, this);
436 436
          GLES31.glMemoryBarrier(GLES31.GL_SHADER_STORAGE_BARRIER_BIT | GLES31.GL_ATOMIC_COUNTER_BARRIER_BIT);
437 437
          }
438 438
        else
439 439
          {
440
          numRenders += child1.draw(time, this);
440
          numRenders += child.draw(time, this);
441 441
          }
442 442
        }
443 443
      else
......
460 460
            }
461 461
          else
462 462
            {
463
            for(int j=bucketChange; j<i; j++)
464
              {
465
              child2 = children.get(j);
466
              mBuffer[internalQuality].setAsOutput();
467
              numRenders += child2.markStencilAndDepth(time,mBuffer[internalQuality],lastQueue);
468
              }
469

  
463
            for(int j=bucketChange; j<i; j++) numRenders += lastQueue.preprocess( mBuffer,children.get(j), time);
470 464
            numRenders += lastQueue.postprocess(mBuffer);
471 465

  
472 466
            if( oit )
......
481 475
            mBuffer[quality].clearBuffer(fbo);
482 476
            }
483 477

  
484
          internalQuality = currQueue.getInternalQuality();
485
          quality         = currQueue.getQuality();
486
          bucketChange    = i;
478
          quality     = currQueue.getQuality();
479
          bucketChange= i;
487 480
          }
488 481

  
489 482
        mBuffer[quality].setAsOutput(time);
490
        child1.drawNoBlend(time,mBuffer[quality]);
483
        child.drawNoBlend(time,mBuffer[quality]);
491 484

  
492 485
        if( i==numChildren-1 )
493 486
          {
494
          for(int j=bucketChange; j<numChildren; j++)
495
            {
496
            child2 = children.get(j);
497
            mBuffer[internalQuality].setAsOutput();
498
            numRenders += child2.markStencilAndDepth(time,mBuffer[internalQuality],currQueue);
499
            }
500

  
487
          for(int j=bucketChange; j<numChildren; j++) numRenders += currQueue.preprocess(mBuffer,children.get(j), time);
501 488
          numRenders += currQueue.postprocess(mBuffer);
502 489

  
503 490
          if( oit )

Also available in: Unified diff