Project

General

Profile

« Previous | Next » 

Revision 5c84d9c2

Added by Leszek Koltunski over 2 years ago

Set possibility for the Postprocessing effects to eclipse the whole object or only work at the edges.

View differences:

src/main/java/org/distorted/library/effectqueue/EffectQueuePostprocess.java
53 53
  private static final int INDEX = EffectType.POSTPROCESS.ordinal();
54 54

  
55 55
  private int mHalo;
56
  private boolean mUseHaloDepth;
56 57
  private float mR, mG, mB, mA;
57 58

  
58 59
  private static DistortedProgram mPreProgram;
......
90 91
      // that (see preprocess())
91 92
      array[NUM_FLOAT_UNIFORMS*i+5]=0.0f;
92 93

  
93
      if( mEffects[i].compute(array, NUM_FLOAT_UNIFORMS*i, currTime, step) )
94
      PostprocessEffect effect = (PostprocessEffect)mEffects[i];
95

  
96
      if( effect.compute(array, NUM_FLOAT_UNIFORMS*i, currTime, step) )
94 97
        {
95 98
        EffectMessageSender.newMessage(mEffects[i]);
96 99
        }
97 100

  
98 101
      halo = (int)array[NUM_FLOAT_UNIFORMS*i];
99 102
      if( halo>mHalo ) mHalo = halo;
103

  
104
      // TODO  (now only really works in case of 1 effect!)
105
      mUseHaloDepth = effect.getHaloDepth();
100 106
      }
101 107

  
102 108
    // TODO  (now only really works in case of 1 effect!)
......
173 179

  
174 180
    InternalRenderState.setUpStencilMark(mA!=0.0f);
175 181
    InternalRenderState.disableBlending();
182
    if( !mUseHaloDepth ) GLES30.glDepthMask(false);
176 183

  
177 184
    GLES30.glViewport(0, 0, width, height );
178 185

  
......
198 205

  
199 206
    InternalRenderState.restoreBlending();
200 207
    InternalRenderState.unsetUpStencilMark();
208
    if( !mUseHaloDepth ) GLES30.glDepthMask(true);
201 209

  
202 210
    return 1;
203 211
    }

Also available in: Unified diff