Revision 8aac2acc
Added by Leszek Koltunski over 9 years ago
| src/main/java/org/distorted/library/EffectQueueMatrix.java | ||
|---|---|---|
| 43 | 43 |
private static float[] mMVPMatrix= new float[16]; |
| 44 | 44 |
private static float[] mTmpMatrix= new float[16]; |
| 45 | 45 |
|
| 46 |
private static int mBmpDH; // This is a handle to half a bitmap dimensions
|
|
| 46 |
private static int mObjDH; // This is a handle to half a Object dimensions
|
|
| 47 | 47 |
private static int mDepthH; // Handle to the max Depth, i.e (farplane-nearplane)/2 |
| 48 | 48 |
private static int mMVPMatrixH; // pass in the transformation matrix |
| 49 | 49 |
private static int mMVMatrixH; // pass in the modelview matrix. |
| ... | ... | |
| 89 | 89 |
|
| 90 | 90 |
static void getUniforms(int mProgramH) |
| 91 | 91 |
{
|
| 92 |
mBmpDH = GLES20.glGetUniformLocation(mProgramH, "u_objD");
|
|
| 92 |
mObjDH = GLES20.glGetUniformLocation(mProgramH, "u_objD");
|
|
| 93 | 93 |
mDepthH = GLES20.glGetUniformLocation(mProgramH, "u_Depth"); |
| 94 | 94 |
mMVPMatrixH= GLES20.glGetUniformLocation(mProgramH, "u_MVPMatrix"); |
| 95 | 95 |
mMVMatrixH = GLES20.glGetUniformLocation(mProgramH, "u_MVMatrix"); |
| ... | ... | |
| 227 | 227 |
Matrix.translateM(viewMatrix, 0, mObjHalfX,-mObjHalfY, -mObjHalfZ); |
| 228 | 228 |
Matrix.multiplyMM(mMVPMatrix, 0, dp.projectionMatrix, 0, viewMatrix, 0); |
| 229 | 229 |
|
| 230 |
GLES20.glUniform3f( mBmpDH , mObjHalfX, mObjHalfY, mObjHalfZ);
|
|
| 230 |
GLES20.glUniform3f( mObjDH , mObjHalfX, mObjHalfY, mObjHalfZ);
|
|
| 231 | 231 |
GLES20.glUniform1f( mDepthH, dp.depth); |
| 232 | 232 |
GLES20.glUniformMatrix4fv(mMVMatrixH , 1, false, viewMatrix, 0); |
| 233 | 233 |
GLES20.glUniformMatrix4fv(mMVPMatrixH, 1, false, mMVPMatrix, 0); |
| ... | ... | |
| 242 | 242 |
Matrix.translateM(mTmpMatrix, 0, mObjHalfX-dp.width/2, dp.height/2-mObjHalfY, mObjHalfZ-dp.distance); |
| 243 | 243 |
Matrix.multiplyMM(mMVPMatrix, 0, dp.projectionMatrix, 0, mTmpMatrix, 0); |
| 244 | 244 |
|
| 245 |
GLES20.glUniform3f( mBmpDH , mObjHalfX, mObjHalfY, mObjHalfZ);
|
|
| 245 |
GLES20.glUniform3f( mObjDH , mObjHalfX, mObjHalfY, mObjHalfZ);
|
|
| 246 | 246 |
GLES20.glUniform1f( mDepthH, dp.depth); |
| 247 | 247 |
GLES20.glUniformMatrix4fv(mMVMatrixH , 1, false, mTmpMatrix, 0); |
| 248 | 248 |
GLES20.glUniformMatrix4fv(mMVPMatrixH, 1, false, mMVPMatrix, 0); |
Also available in: Unified diff
minor