Project

General

Profile

« Previous | Next » 

Revision af4cc5db

Added by Leszek Koltunski about 7 years ago

Simplify yesterday's refactoring.

View differences:

src/main/java/org/distorted/library/EffectQueuePostprocess.java
233 233
    {
234 234
    mBlurProgram.useProgram();
235 235

  
236
    DistortedProjection inputP  = mBufferFBO.getProjection();
237
    DistortedProjection outputP = surface.getProjection();
238

  
239 236
    int radius = (int)mUniforms[0];
240 237
    if( radius>=MAX_BLUR ) radius = MAX_BLUR-1;
241 238
    computeGaussianKernel(radius);
......
255 252
    GLES30.glViewport(0, 0, (int)w, (int)h);
256 253

  
257 254
    Matrix.setIdentityM(mTmpMatrix, 0);
258
    Matrix.translateM(mTmpMatrix, 0, 0, 0, -inputP.mDistance);
259
    Matrix.multiplyMM(mMVPMatrix, 0, inputP.mProjectionMatrix, 0, mTmpMatrix, 0);
255
    Matrix.translateM(mTmpMatrix, 0, 0, 0, -mBufferFBO.mDistance);
256
    Matrix.multiplyMM(mMVPMatrix, 0, mBufferFBO.mProjectionMatrix, 0, mTmpMatrix, 0);
260 257

  
261 258
    // horizontal blur
262 259
    GLES30.glUniform1fv( mOffsetsH ,radius+1, mOffsets,0);
......
268 265
    mBufferFBO.setAsInput();
269 266
    surface.setAsOutput();
270 267

  
271
    GLES30.glViewport(0, 0, outputP.mWidth, outputP.mHeight);
268
    GLES30.glViewport(0, 0, surface.mWidth, surface.mHeight);
272 269

  
273 270
    for(int i=0; i<=radius; i++) mOffsets[i] = offsetsCache[offset+i]/w;
274 271

  

Also available in: Unified diff