Project

General

Profile

« Previous | Next » 

Revision 687263cc

Added by Leszek Koltunski about 4 years ago

Move the 'pre-multiply mesh before applying any effects' thing from [(Xsize of texture, Ysize of texture) x Mesh's zFactor] to Effects.setStretch(sx,sy,sz)

View differences:

src/main/java/org/distorted/examples/differenteffects/DifferentEffectsRenderer.java
83 83

  
84 84
      mEffects = new DistortedEffects[NUM];
85 85

  
86
      for(int i=0; i<NUM; i++) mEffects[i] = new DistortedEffects();
86
      for(int i=0; i<NUM; i++) mEffects[i] = new DistortedEffects(1);
87 87

  
88 88
      Dynamic1D sink = new Dynamic1D(2000,0.0f);
89 89
      sink.add(new Static1D( 1));
......
173 173
     bmpHeight = bitmap.getHeight();
174 174
     bmpWidth  = bitmap.getWidth();
175 175

  
176
      for(int i=0; i<NUM; i++)
177
        {
178
        mEffects[i].setStretch(bmpWidth, bmpHeight, 0);
179
        }
180

  
176 181
     if( mMesh==null ) mMesh = new MeshRectangles(30,30*bmpHeight/bmpWidth);
177
     if( mTexture==null ) mTexture  = new DistortedTexture(bmpWidth,bmpHeight);
182
     if( mTexture==null ) mTexture  = new DistortedTexture();
178 183
     mTexture.setTexture(bitmap);
179 184

  
180 185
     mScreen.detachAll();

Also available in: Unified diff