Project

General

Profile

« Previous | Next » 

Revision 895d2f4f

Added by Leszek Koltunski about 7 years ago

Separate the Postprocessing Effects to their own DistortedEffectsPostprocess queue.
This partly breaks Multiblur (to be debugged)

View differences:

src/main/java/org/distorted/examples/blur/BlurRenderer.java
21 21

  
22 22
import android.graphics.Bitmap;
23 23
import android.graphics.BitmapFactory;
24
import android.opengl.GLES30;
25 24
import android.opengl.GLSurfaceView;
26 25

  
27 26
import org.distorted.examples.R;
28 27
import org.distorted.library.Distorted;
29 28
import org.distorted.library.DistortedEffects;
29
import org.distorted.library.DistortedEffectsPostprocess;
30
import org.distorted.library.DistortedNode;
30 31
import org.distorted.library.DistortedScreen;
31 32
import org.distorted.library.DistortedTexture;
32 33
import org.distorted.library.EffectNames;
......
48 49
{
49 50
    private GLSurfaceView mView;
50 51
    private DistortedEffects mEffects;
52
    private DistortedEffectsPostprocess mPostEffects;
51 53
    private DistortedScreen mScreen;
52 54
    private MeshFlat mMesh;
53 55
    private Static1D mRadiusSta;
......
57 59

  
58 60
   BlurRenderer(GLSurfaceView v)
59 61
      {
60
      mView    = v;
61
      mMesh    = new MeshFlat(1,1);
62
      mEffects = new DistortedEffects();
63
      mScreen  = new DistortedScreen();
62
      mView        = v;
63
      mMesh        = new MeshFlat(1,1);
64
      mEffects     = new DistortedEffects();
65
      mPostEffects = new DistortedEffectsPostprocess();
66
      mScreen      = new DistortedScreen();
64 67

  
65 68
      mRadiusSta = new Static1D(5);
66 69
      Dynamic1D radiusDyn = new Dynamic1D();
67 70
      radiusDyn.add(mRadiusSta);
68 71

  
69
      mEffects.blur(radiusDyn);
72
      mPostEffects.blur(radiusDyn);
70 73
      }
71 74

  
72 75
///////////////////////////////////////////////////////////////////////////////////////////////////
......
138 141
      texture.setTexture(bitmap);
139 142

  
140 143
      mScreen.detachAll();
141
      mScreen.attach(texture,mEffects,mMesh);
144
      DistortedNode node = new DistortedNode(texture,mEffects,mMesh);
145
      node.setPostprocessEffects(mPostEffects);
146
      mScreen.attach(node);
142 147

  
143 148
      DistortedEffects.enableEffect(EffectNames.BLUR);
144 149

  

Also available in: Unified diff