Project

General

Profile

« Previous | Next » 

Revision c5369f1b

Added by Leszek Koltunski about 7 years ago

Major: change of API.

Split DFramebuffer into Framebuffer and Screen; introduce the 'DistortedInputSurface' and 'DistortedOutputSurface' interfaces.

View differences:

src/main/java/org/distorted/library/EffectQueueMatrix.java
107 107
///////////////////////////////////////////////////////////////////////////////////////////////////
108 108
// here construct the ModelView and the ModelViewProjection Matrices
109 109

  
110
  void constructMatrices(DistortedFramebuffer df, float halfX, float halfY)
110
  void constructMatrices(DistortedProjection projection, float halfX, float halfY)
111 111
    {
112 112
    Matrix.setIdentityM(mViewMatrix, 0);
113
    Matrix.translateM(mViewMatrix, 0, -df.mWidth/2, df.mHeight/2, -df.mDistance);
113
    Matrix.translateM(mViewMatrix, 0, -projection.mWidth/2, projection.mHeight/2, -projection.mDistance);
114 114

  
115 115
    float x,y,z, sx,sy,sz;
116 116

  
......
184 184
      }
185 185

  
186 186
    Matrix.translateM(mViewMatrix, 0, halfX,-halfY, 0);
187
    Matrix.multiplyMM(mMVPMatrix, 0, df.mProjectionMatrix, 0, mViewMatrix, 0);
187
    Matrix.multiplyMM(mMVPMatrix, 0, projection.mProjectionMatrix, 0, mViewMatrix, 0);
188 188
    }
189 189

  
190 190
///////////////////////////////////////////////////////////////////////////////////////////////////
......
284 284

  
285 285
///////////////////////////////////////////////////////////////////////////////////////////////////
286 286

  
287
  synchronized void send(DistortedFramebuffer df, float halfX, float halfY, float halfZ)
287
  synchronized void send(DistortedProjection projection, float halfX, float halfY, float halfZ)
288 288
    {
289
    constructMatrices(df,halfX,halfY);
289
    constructMatrices(projection,halfX,halfY);
290 290

  
291 291
    GLES30.glUniform3f( mObjDH , halfX, halfY, halfZ);
292
    GLES30.glUniform1f( mDepthH, df.mDepth);
292
    GLES30.glUniform1f( mDepthH, projection.mDepth);
293 293
    GLES30.glUniformMatrix4fv(mMVMatrixH , 1, false, mViewMatrix, 0);
294 294
    GLES30.glUniformMatrix4fv(mMVPMatrixH, 1, false, mMVPMatrix , 0);
295 295
    }
......
297 297
///////////////////////////////////////////////////////////////////////////////////////////////////
298 298
// here construct the ModelView Matrix, but without any effects
299 299

  
300
  synchronized static void sendZero(DistortedFramebuffer df, float halfX, float halfY, float halfZ)
300
  synchronized static void sendZero(DistortedProjection projection, float halfX, float halfY, float halfZ)
301 301
    {
302 302
    Matrix.setIdentityM(mTmpMatrix, 0);
303
    Matrix.translateM(mTmpMatrix, 0, halfX-df.mWidth/2, df.mHeight/2-halfY, -df.mDistance);
304
    Matrix.multiplyMM(mMVPMatrix, 0, df.mProjectionMatrix, 0, mTmpMatrix, 0);
303
    Matrix.translateM(mTmpMatrix, 0, halfX-projection.mWidth/2, projection.mHeight/2-halfY, -projection.mDistance);
304
    Matrix.multiplyMM(mMVPMatrix, 0, projection.mProjectionMatrix, 0, mTmpMatrix, 0);
305 305
    
306 306
    GLES30.glUniform3f( mObjDH , halfX, halfY, halfZ);
307
    GLES30.glUniform1f( mDepthH, df.mDepth);
307
    GLES30.glUniform1f( mDepthH, projection.mDepth);
308 308
    GLES30.glUniformMatrix4fv(mMVMatrixH , 1, false, mTmpMatrix, 0);
309 309
    GLES30.glUniformMatrix4fv(mMVPMatrixH, 1, false, mMVPMatrix, 0);
310 310
    }

Also available in: Unified diff