Project

General

Profile

« Previous | Next » 

Revision d1016920

Added by Leszek Koltunski over 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/effects/win/WinEffectGlow.java
23 23
import org.distorted.library.effect.PostprocessEffectGlow;
24 24
import org.distorted.library.effect.VertexEffectSink;
25 25
import org.distorted.library.type.Dynamic1D;
26
import org.distorted.library.type.Dynamic2D;
26 27
import org.distorted.library.type.Dynamic4D;
27 28
import org.distorted.library.type.Static1D;
29
import org.distorted.library.type.Static2D;
28 30
import org.distorted.library.type.Static3D;
29 31
import org.distorted.library.type.Static4D;
30 32

  
......
42 44
    mNodeEffectPosition = new int[] {-1, -1};
43 45
    mNodeEffects        = new Effect[mNodeEffectPosition.length];
44 46

  
45
    Dynamic1D radiusDyn = new Dynamic1D(duration,1.0f);
46
    radiusDyn.add(new Static1D( 0));
47
    radiusDyn.add(new Static1D(12));
48
    radiusDyn.add(new Static1D( 0));
47
    Dynamic2D haloRadiusDyn = new Dynamic2D(duration,1.0f);
48
    haloRadiusDyn.add(new Static2D( 0, 0));
49
    haloRadiusDyn.add(new Static2D(20,50));
50
    haloRadiusDyn.add(new Static2D( 0, 0));
49 51

  
50 52
    Dynamic4D color= new Dynamic4D(duration,1.0f);
51 53
    Static4D P1    = new Static4D(colors[3*INDEX],colors[3*INDEX+1], colors[3*INDEX+2], 0.0f);
......
54 56
    color.add(P2);
55 57
    color.add(P1);
56 58

  
57
    mNodeEffects[0] = new PostprocessEffectGlow(radiusDyn,color);
59
    mNodeEffects[0] = new PostprocessEffectGlow(haloRadiusDyn,color);
58 60

  
59 61
    Dynamic1D degreeDyn= new Dynamic1D(duration,1.0f);
60 62
    degreeDyn.add(new Static1D(1.0f));

Also available in: Unified diff