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/DistortedRenderState.java
459 459

  
460 460
///////////////////////////////////////////////////////////////////////////////////////////////////
461 461

  
462
  static void setUpStencilMark()
462
  static void setUpStencilMark(boolean color)
463 463
    {
464 464
    sState.stencilTest = cState.stencilTest;
465 465

  
......
501 501
    sState.colorMaskB = cState.colorMaskB;
502 502
    sState.colorMaskA = cState.colorMaskA;
503 503

  
504
    if( cState.colorMaskR!=0 || cState.colorMaskG!=0 || cState.colorMaskB!=0 || cState.colorMaskA!=0 )
504
    int clr = color ? 1:0;
505

  
506
    if( cState.colorMaskR!=clr || cState.colorMaskG!=clr || cState.colorMaskB!=clr || cState.colorMaskA!=clr )
505 507
      {
506
      cState.colorMaskR = 0;
507
      cState.colorMaskG = 0;
508
      cState.colorMaskB = 0;
509
      cState.colorMaskA = 0;
508
      cState.colorMaskR = clr;
509
      cState.colorMaskG = clr;
510
      cState.colorMaskB = clr;
511
      cState.colorMaskA = clr;
510 512
      //android.util.Log.d("State", "switch off color writing");
511
      GLES31.glColorMask(false,false,false,false);
513
      GLES31.glColorMask(color,color,color,color);
512 514
      }
513 515

  
514 516
    sState.depthMask = cState.depthMask;

Also available in: Unified diff