Project

General

Profile

« Previous | Next » 

Revision bb4755e2

Added by Leszek Koltunski almost 4 years ago

Change the Postprocessing effects: separate the radius and the halo.
Reason: we needed a way to specify the size of the halo around a postprocessed object; before it was automatically (and not very correctly) computed from the radius - before we knew the size of the object's bounding box, so this automatic computation was possible. Now we're removing the MashBase.getBounding(0 API, so the size of the halo has to be explicitly given by the user. This way is more correct anyway and gives the user more control (as the Multiblur app proves!)

Warning: here for the first time I can see that the 2 Examples (PostprocessingTree and MovingGlow) sometimes would not appear (black screen). Maybe this commit introduces such a bug - investigate.

View differences:

src/main/java/org/distorted/library/effectqueue/EffectQueuePostprocess.java
83 83
      // first zero out the 'alpha' because BLUR effect will not overwrite this (it is a 1D effect)
84 84
      // and if previously there was a GLOW effect here then mA would be non-zero and we don't want
85 85
      // that (see preprocess())
86
      mUniforms[NUM_UNIFORMS*i+4]=0.0f;
86
      mUniforms[NUM_UNIFORMS*i+5]=0.0f;
87 87

  
88 88
      if( mEffects[i].compute(mUniforms, NUM_UNIFORMS*i, mCurrentDuration[i], step) )
89 89
        {
......
97 97
    // TODO  (now only really works in case of 1 effect!)
98 98
    if( mNumEffects>0 )
99 99
      {
100
      mR = mUniforms[1];
101
      mG = mUniforms[2];
102
      mB = mUniforms[3];
103
      mA = mUniforms[4];
100
      mR = mUniforms[2];
101
      mG = mUniforms[3];
102
      mB = mUniforms[4];
103
      mA = mUniforms[5];
104 104
      }
105 105

  
106 106
    mTime = currTime;

Also available in: Unified diff