Project

General

Profile

« Previous | Next » 

Revision 885b9cca

Added by Leszek Koltunski over 7 years ago

Move all the knowledge about Vertex and Fragment effects to their respective classes.

View differences:

src/main/java/org/distorted/examples/aroundtheworld/AroundTheWorldRenderer.java
26 26
import org.distorted.examples.R;
27 27
import org.distorted.library.effect.EffectName;
28 28
import org.distorted.library.effect.EffectType;
29
import org.distorted.library.effect.FragmentEffectChroma;
30
import org.distorted.library.effect.FragmentEffectContrast;
29 31
import org.distorted.library.effect.MatrixEffectMove;
30 32
import org.distorted.library.effect.MatrixEffectScale;
33
import org.distorted.library.effect.VertexEffectDistort;
34
import org.distorted.library.effect.VertexEffectPinch;
35
import org.distorted.library.effect.VertexEffectSink;
36
import org.distorted.library.effect.VertexEffectSwirl;
31 37
import org.distorted.library.main.Distorted;
32 38
import org.distorted.library.main.DistortedEffects;
33 39
import org.distorted.library.main.DistortedScreen;
......
142 148
      mScreen.detachAll();
143 149
      mScreen.attach(mTexture, mEffects, mMesh);
144 150

  
145
      DistortedEffects.enableEffect(EffectName.DISTORT);
146
      DistortedEffects.enableEffect(EffectName.SINK);
147
      DistortedEffects.enableEffect(EffectName.PINCH);
148
      DistortedEffects.enableEffect(EffectName.SWIRL);
149
      DistortedEffects.enableEffect(EffectName.CHROMA);
150
      DistortedEffects.enableEffect(EffectName.SMOOTH_CHROMA);
151
      DistortedEffects.enableEffect(EffectName.CONTRAST);
151
      VertexEffectDistort.enable();
152
      VertexEffectSink.enable();
153
      VertexEffectPinch.enable();
154
      VertexEffectSwirl.enable();
155
      FragmentEffectChroma.enable();
156
      FragmentEffectContrast.enable();
152 157

  
153 158
      try
154 159
        {
src/main/java/org/distorted/examples/bean/BeanRenderer.java
156 156
     mScreen.detachAll();
157 157
     mScreen.attach(mTexture,mEffects,mMesh);
158 158

  
159
     DistortedEffects.enableEffect(EffectName.DISTORT);
159
     VertexEffectDistort.enable();
160 160

  
161 161
     try
162 162
       {
src/main/java/org/distorted/examples/bitmaptree/BitmapTreeRenderer.java
32 32
import org.distorted.library.effect.MatrixEffectMove;
33 33
import org.distorted.library.effect.MatrixEffectRotate;
34 34
import org.distorted.library.effect.MatrixEffectScale;
35
import org.distorted.library.effect.VertexEffectDistort;
35 36
import org.distorted.library.effect.VertexEffectSink;
36 37
import org.distorted.library.main.DistortedEffects;
37 38
import org.distorted.library.main.DistortedFramebuffer;
......
213 214
      VertexEffectSink sink = new VertexEffectSink(sinkDyn, new Static3D(gridWidth/2,gridHeight/2, 0));
214 215
      gridEffects.apply(sink);
215 216

  
216
      DistortedEffects.enableEffect(EffectName.SINK);
217
      DistortedEffects.enableEffect(EffectName.CHROMA);
217
      VertexEffectSink.enable();
218
      FragmentEffectChroma.enable();
218 219

  
219 220
      try
220 221
        {
src/main/java/org/distorted/examples/blur/BlurRenderer.java
145 145
     mScreen.detachAll();
146 146
     mScreen.attach(new DistortedNode(mTexture,mEffects,mMesh));
147 147

  
148
     DistortedEffects.enableEffect(EffectName.BLUR);
148
     PostprocessEffectBlur.enable();
149 149

  
150 150
     try
151 151
       {
src/main/java/org/distorted/examples/catanddog/CatAndDogRenderer.java
146 146
      mScreen.detachAll();
147 147
      mScreen.attach(mTexture,mEffects,mMesh);
148 148

  
149
      DistortedEffects.enableEffect(EffectName.SMOOTH_CHROMA);
150
      DistortedEffects.enableEffect(EffectName.ALPHA);
149
      FragmentEffectChroma.enable();
150
      FragmentEffectAlpha.enable();
151 151

  
152 152
      try
153 153
        {
src/main/java/org/distorted/examples/check/CheckRenderer.java
80 80

  
81 81
      DistortedEffects.setMax(EffectType.VERTEX  ,act.getMaxV());
82 82
      DistortedEffects.setMax(EffectType.FRAGMENT,act.getMaxF());
83
      DistortedEffects.enableEffect(EffectName.SWIRL);
84
      DistortedEffects.enableEffect(EffectName.DEFORM);
85
      DistortedEffects.enableEffect(EffectName.CHROMA);
83
      VertexEffectSwirl.enable();
84
      VertexEffectDeform.enable();
85
      FragmentEffectChroma.enable();
86 86

  
87 87
      mSwirl1 = new Static3D(0,0,0);
88 88
      mSwirl2 = new Static3D(0,0,0);
src/main/java/org/distorted/examples/deform/DeformRenderer.java
214 214
    
215 215
   public void onSurfaceCreated(GL10 glUnused, EGLConfig config)
216 216
     {
217
     DistortedEffects.enableEffect(EffectName.DISTORT);
218
     DistortedEffects.enableEffect(EffectName.DEFORM);
217
     VertexEffectDistort.enable();
218
     VertexEffectDeform.enable();
219 219

  
220 220
     try
221 221
       {
src/main/java/org/distorted/examples/differentbitmaps/DifferentBitmapsRenderer.java
192 192
     mScreen.detachAll();
193 193
     for(int i=NUM-1; i>=0; i--) mScreen.attach(mTexture[i], mEffects[i], mMesh);
194 194

  
195
     DistortedEffects.enableEffect(EffectName.SINK);
196
     DistortedEffects.enableEffect(EffectName.DISTORT);
195
     VertexEffectSink.enable();
196
     VertexEffectDistort.enable();
197 197

  
198 198
     try
199 199
       {
src/main/java/org/distorted/examples/differenteffects/DifferentEffectsRenderer.java
190 190
     mScreen.detachAll();
191 191
     for(int i=NUM-1; i>=0; i--) mScreen.attach(mTexture, mEffects[i], mMesh);
192 192

  
193
     DistortedEffects.enableEffect(EffectName.SINK);
194
     DistortedEffects.enableEffect(EffectName.DISTORT);
195
     DistortedEffects.enableEffect(EffectName.CHROMA);
193
     VertexEffectSink.enable();
194
     VertexEffectDistort.enable();
195
     FragmentEffectChroma.enable();
196 196

  
197 197
     try
198 198
       {
src/main/java/org/distorted/examples/effectqueue/EffectQueueRenderer.java
29 29
import android.opengl.GLSurfaceView;
30 30

  
31 31
import org.distorted.library.effect.EffectName;
32
import org.distorted.library.effect.FragmentEffectAlpha;
33
import org.distorted.library.effect.FragmentEffectChroma;
34
import org.distorted.library.effect.FragmentEffectSaturation;
32 35
import org.distorted.library.effect.MatrixEffectScale;
36
import org.distorted.library.effect.VertexEffectDistort;
37
import org.distorted.library.effect.VertexEffectSink;
33 38
import org.distorted.library.main.DistortedEffects;
34 39
import org.distorted.library.main.DistortedScreen;
35 40
import org.distorted.library.main.MeshFlat;
......
110 115
    mScreen.detachAll();
111 116
    mScreen.attach(mTexture,mEffects,mMesh);
112 117

  
113
    DistortedEffects.enableEffect(EffectName.DISTORT);
114
    DistortedEffects.enableEffect(EffectName.SINK);
115
    DistortedEffects.enableEffect(EffectName.SMOOTH_ALPHA);
116
    DistortedEffects.enableEffect(EffectName.SATURATION);
117
    DistortedEffects.enableEffect(EffectName.SMOOTH_CHROMA);
118
    VertexEffectDistort.enable();
119
    VertexEffectSink.enable();
120
    FragmentEffectAlpha.enable();
121
    FragmentEffectChroma.enable();
122
    FragmentEffectSaturation.enable();
118 123

  
119 124
    try
120 125
      {
src/main/java/org/distorted/examples/effects3d/Effects3DRenderer.java
26 26
import org.distorted.examples.R;
27 27
import org.distorted.library.effect.EffectName;
28 28
import org.distorted.library.effect.EffectType;
29
import org.distorted.library.effect.FragmentEffectAlpha;
30
import org.distorted.library.effect.FragmentEffectBrightness;
31
import org.distorted.library.effect.FragmentEffectChroma;
32
import org.distorted.library.effect.FragmentEffectContrast;
33
import org.distorted.library.effect.FragmentEffectSaturation;
29 34
import org.distorted.library.effect.MatrixEffectMove;
30 35
import org.distorted.library.effect.MatrixEffectQuaternion;
31 36
import org.distorted.library.effect.MatrixEffectScale;
37
import org.distorted.library.effect.VertexEffectDeform;
38
import org.distorted.library.effect.VertexEffectDistort;
39
import org.distorted.library.effect.VertexEffectPinch;
40
import org.distorted.library.effect.VertexEffectSink;
41
import org.distorted.library.effect.VertexEffectSwirl;
42
import org.distorted.library.effect.VertexEffectWave;
32 43
import org.distorted.library.main.Distorted;
33 44
import org.distorted.library.main.DistortedEffects;
34 45
import org.distorted.library.main.DistortedNode;
......
272 283
      mCenterTexture.setTexture(bitmapC);
273 284
      mRegionTexture.setTexture(bitmapR);
274 285

  
275
      EffectType type;
276

  
277
      for( EffectName name : EffectName.values() )
278
        {
279
        type = name.getType();
280

  
281
        if( type== EffectType.VERTEX || type==EffectType.FRAGMENT )
282
          {
283
          DistortedEffects.enableEffect(name);
284
          }
285
        }
286
      VertexEffectDeform.enable();
287
      VertexEffectDistort.enable();
288
      VertexEffectPinch.enable();
289
      VertexEffectSink.enable();
290
      VertexEffectSwirl.enable();
291
      VertexEffectWave.enable();
292

  
293
      FragmentEffectAlpha.enable();
294
      FragmentEffectBrightness.enable();
295
      FragmentEffectChroma.enable();
296
      FragmentEffectContrast.enable();
297
      FragmentEffectSaturation.enable();
286 298

  
287 299
      try
288 300
        {
src/main/java/org/distorted/examples/flag/FlagRenderer.java
183 183
      
184 184
      mTexture.setTexture(bitmap);
185 185

  
186
      DistortedEffects.enableEffect(EffectName.WAVE);
186
      VertexEffectWave.enable();
187 187

  
188 188
      try
189 189
        {
src/main/java/org/distorted/examples/girl/GirlRenderer.java
219 219
     mScreen.detachAll();
220 220
     mScreen.attach(mTexture,mEffects,mMesh);
221 221

  
222
     DistortedEffects.enableEffect(EffectName.DISTORT);
223
     DistortedEffects.enableEffect(EffectName.SINK);
224
     DistortedEffects.enableEffect(EffectName.SWIRL);
222
     VertexEffectDistort.enable();
223
     VertexEffectSink.enable();
224
     VertexEffectSwirl.enable();
225 225

  
226 226
     try
227 227
       {
src/main/java/org/distorted/examples/glow/GlowRenderer.java
206 206
      
207 207
     mLeaf.setTexture(leaf);
208 208

  
209
     DistortedEffects.enableEffect(EffectName.CHROMA);
210
     DistortedEffects.enableEffect(EffectName.GLOW);
209
     FragmentEffectChroma.enable();
210
     PostprocessEffectGlow.enable();
211 211

  
212 212
     try
213 213
       {
src/main/java/org/distorted/examples/listener/ListenerRenderer.java
173 173

  
174 174
     for(int i=0; i<NUM_BUBBLES; i++) randomizeNewBubble();
175 175

  
176
     DistortedEffects.enableEffect(EffectName.DISTORT);
176
     VertexEffectDistort.enable();
177 177

  
178 178
     try
179 179
       {
src/main/java/org/distorted/examples/mirror/MirrorRenderer.java
195 195
      mTextureMirror.setTexture(bitmapM);
196 196
      mTextureHead.setTexture(bitmapH);
197 197

  
198
      DistortedEffects.enableEffect(EffectName.BRIGHTNESS);
198
      FragmentEffectBrightness.enable();
199 199

  
200 200
      try
201 201
        {
src/main/java/org/distorted/examples/monalisa/MonaLisaRenderer.java
156 156
      mScreen.detachAll();
157 157
      mScreen.attach(mTexture,mEffects,mMesh);
158 158

  
159
      DistortedEffects.enableEffect(EffectName.DISTORT);
159
      VertexEffectDistort.enable();
160 160

  
161 161
      try
162 162
        {
src/main/java/org/distorted/examples/movingeffects/MovingEffectsRenderer.java
29 29
import android.opengl.GLSurfaceView;
30 30

  
31 31
import org.distorted.library.effect.EffectName;
32
import org.distorted.library.effect.FragmentEffectAlpha;
33
import org.distorted.library.effect.FragmentEffectChroma;
34
import org.distorted.library.effect.VertexEffectDistort;
35
import org.distorted.library.effect.VertexEffectSink;
36
import org.distorted.library.effect.VertexEffectSwirl;
32 37
import org.distorted.library.main.DistortedScreen;
33 38
import org.distorted.library.main.DistortedTexture;
34 39
import org.distorted.library.main.DistortedEffects;
......
109 114

  
110 115
   public void onSurfaceCreated(GL10 glUnused, EGLConfig config) 
111 116
     {
112
     DistortedEffects.enableEffect(EffectName.SWIRL);
113
     DistortedEffects.enableEffect(EffectName.SMOOTH_ALPHA);
114
     DistortedEffects.enableEffect(EffectName.SMOOTH_CHROMA);
115
     DistortedEffects.enableEffect(EffectName.DISTORT);
116
     DistortedEffects.enableEffect(EffectName.SINK);
117
     VertexEffectSwirl.enable();
118
     VertexEffectDistort.enable();
119
     VertexEffectSink.enable();
120
     FragmentEffectChroma.enable();
121
     FragmentEffectAlpha.enable();
117 122

  
118 123
     try
119 124
       {
src/main/java/org/distorted/examples/multiblur/MultiblurRenderer.java
201 201
      mTex1.setTexture(bitmap1);
202 202
      mTex2.setTexture(bitmap2);
203 203

  
204
      DistortedEffects.enableEffect(EffectName.BLUR);
204
      PostprocessEffectBlur.enable();
205 205

  
206 206
      try
207 207
        {
src/main/java/org/distorted/examples/olimpic/OlimpicRenderer.java
210 210
      
211 211
     mLeaf.setTexture(leaf);
212 212

  
213
     DistortedEffects.enableEffect(EffectName.CHROMA);
213
     FragmentEffectChroma.enable();
214 214

  
215 215
     try
216 216
       {
src/main/java/org/distorted/examples/plainmonalisa/RenderThread.java
271 271
    mScreen.detachAll();
272 272
    mScreen.attach(mTexture,mEffects,mMesh);
273 273

  
274
    DistortedEffects.enableEffect(EffectName.DISTORT);
274
    VertexEffectDistort.enable();
275 275

  
276 276
    try
277 277
      {
src/main/java/org/distorted/examples/projection/ProjectionRenderer.java
152 152
    
153 153
   public void onSurfaceCreated(GL10 glUnused, EGLConfig config) 
154 154
      {
155
      DistortedEffects.enableEffect(EffectName.DISTORT);
155
      VertexEffectDistort.enable();
156 156

  
157 157
      try
158 158
        {
src/main/java/org/distorted/examples/save/SaveRenderer.java
257 257
    mScreen.detachAll();
258 258
    mScreen.attach(mTexture,mEffects,mMesh);
259 259

  
260
    DistortedEffects.enableEffect(EffectName.SINK);
260
    VertexEffectSink.enable();
261 261

  
262 262
    try
263 263
      {
src/main/java/org/distorted/examples/sink/SinkRenderer.java
137 137
    mScreen.detachAll();
138 138
    mScreen.attach(mTexture,mEffects,mMesh);
139 139

  
140
    DistortedEffects.enableEffect(EffectName.SINK);
140
    VertexEffectSink.enable();
141 141

  
142 142
    try
143 143
      {
src/main/java/org/distorted/examples/starwars/StarWarsRenderer.java
188 188
    {
189 189
    setupBitmaps();
190 190

  
191
    DistortedEffects.enableEffect(EffectName.SMOOTH_ALPHA);
192
    DistortedEffects.enableEffect(EffectName.ALPHA);
191
    FragmentEffectAlpha.enable();
193 192

  
194 193
    try
195 194
      {
src/main/java/org/distorted/examples/stencil/StencilRenderer.java
261 261
      mCubeTex.setTexture(bitmap);
262 262
      mFloorTex.setColor(0xff000000);  // ARGB
263 263

  
264
      DistortedEffects.enableEffect(EffectName.BRIGHTNESS);
264
      FragmentEffectBrightness.enable();
265 265

  
266 266
      try
267 267
        {
src/main/java/org/distorted/examples/wind/WindRenderer.java
28 28
import org.distorted.library.effect.MatrixEffectMove;
29 29
import org.distorted.library.effect.MatrixEffectRotate;
30 30
import org.distorted.library.effect.MatrixEffectScale;
31
import org.distorted.library.effect.VertexEffectDeform;
32
import org.distorted.library.effect.VertexEffectWave;
31 33
import org.distorted.library.main.Distorted;
32 34
import org.distorted.library.main.DistortedScreen;
33 35
import org.distorted.library.main.MeshCubes;
......
131 133

  
132 134
      mTexture.setTexture(bitmap);
133 135

  
134
      DistortedEffects.enableEffect(EffectName.DEFORM);
135
      DistortedEffects.enableEffect(EffectName.WAVE);
136
      VertexEffectDeform.enable();
137
      VertexEffectWave.enable();
136 138

  
137 139
      try
138 140
        {

Also available in: Unified diff