Project

General

Profile

« Previous | Next » 

Revision 8392dc7b

Added by Leszek Koltunski over 4 years ago

Convert the third app, Transparency, to the new MeshBase.setStretch-less API ( use VertexEffectScale instead )

View differences:

src/main/java/org/distorted/examples/transparency/TransparencyRenderer.java
26 26
import org.distorted.library.effect.MatrixEffectQuaternion;
27 27
import org.distorted.library.effect.MatrixEffectScale;
28 28
import org.distorted.library.effect.PostprocessEffectBlur;
29
import org.distorted.library.effect.VertexEffectScale;
29 30
import org.distorted.library.main.DistortedLibrary;
30 31
import org.distorted.library.main.DistortedEffects;
31 32
import org.distorted.library.main.DistortedNode;
......
75 76
      mView = v;
76 77

  
77 78
      MeshRectangles mesh = new MeshRectangles(1,1);
78
      mesh.setStretch(OBJ_SIZE,OBJ_SIZE,0);
79 79

  
80 80
      mQuat1 = new Static4D(0,0,0,1);  // unity
81 81
      mQuat2 = new Static4D(0,0,0,1);  // quaternions
......
111 111
        mEffects[i]      = new DistortedEffects();
112 112
        mEffects[i].apply(mBlur[i]);
113 113
        mEffects[i].apply(alpha[i]);
114
        mEffects[i].apply( new VertexEffectScale(new Static3D(OBJ_SIZE,OBJ_SIZE,0) ) );
114 115
        mEffects[i].apply(new MatrixEffectMove(mMoveVector[i]));
115 116
        mEffects[i].apply(quatEffect2);
116 117
        mEffects[i].apply(quatEffect1);
......
192 193
        mTex[i].setColor(OBJECTS[NUM * i + 3]);
193 194
        }
194 195

  
196
      VertexEffectScale.enable();
195 197
      PostprocessEffectBlur.enable();
196 198
      FragmentEffectAlpha.enable();
197 199

  
......
210 212
    public void onSurfaceChanged(GL10 glUnused, int width, int height)
211 213
      {
212 214
      float size= 0.02f*OBJ_SIZE;
213
      mScreenMin = width<height ? width:height;
215
      mScreenMin = Math.min(width, height);
214 216

  
215 217
      float factor = 0.65f*mScreenMin/OBJ_SIZE;
216 218
      mScale.set(factor,factor,factor);
src/main/java/org/distorted/examples/triblur/TriblurActivity.java
81 81
      Spinner typeSpinner  = findViewById(R.id.triblur_spinnerQuality);
82 82
      typeSpinner.setOnItemSelectedListener(this);
83 83

  
84
      String[] objectType = new String[] {"Quality Highiest", "Quality High", "Quality Medium", "Quality Low"};
84
      String[] objectType = new String[] {"Quality Highest", "Quality High", "Quality Medium", "Quality Low"};
85 85

  
86 86
      ArrayAdapter<String> adapterType = new ArrayAdapter<>(this, android.R.layout.simple_spinner_item, objectType);
87 87
      adapterType.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);

Also available in: Unified diff