Revision 79921db2
Added by Leszek Koltunski about 7 years ago
src/main/java/org/distorted/library/EffectQueueMatrix.java | ||
---|---|---|
46 | 46 |
private static float[] mTmpMatrix = new float[16]; |
47 | 47 |
private static float[] mViewMatrix= new float[16]; |
48 | 48 |
|
49 |
private static int[] mObjDH = new int[DistortedEffects.NUM_PROGRAMS];
|
|
50 |
private static int[] mMVPMatrixH = new int[DistortedEffects.NUM_PROGRAMS];
|
|
51 |
private static int[] mMVMatrixH = new int[DistortedEffects.NUM_PROGRAMS];
|
|
49 |
private static int mObjDH;
|
|
50 |
private static int mMVPMatrixH;
|
|
51 |
private static int mMVMatrixH;
|
|
52 | 52 |
|
53 | 53 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
54 | 54 |
|
... | ... | |
191 | 191 |
|
192 | 192 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
193 | 193 |
|
194 |
static void getUniforms(int index,int mProgramH)
|
|
194 |
static void getUniforms(int mProgramH) |
|
195 | 195 |
{ |
196 |
mObjDH[index] = GLES30.glGetUniformLocation(mProgramH, "u_objD");
|
|
197 |
mMVPMatrixH[index]= GLES30.glGetUniformLocation(mProgramH, "u_MVPMatrix");
|
|
198 |
mMVMatrixH[index] = GLES30.glGetUniformLocation(mProgramH, "u_MVMatrix");
|
|
196 |
mObjDH = GLES30.glGetUniformLocation(mProgramH, "u_objD"); |
|
197 |
mMVPMatrixH= GLES30.glGetUniformLocation(mProgramH, "u_MVPMatrix"); |
|
198 |
mMVMatrixH = GLES30.glGetUniformLocation(mProgramH, "u_MVMatrix"); |
|
199 | 199 |
} |
200 | 200 |
|
201 | 201 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
259 | 259 |
|
260 | 260 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
261 | 261 |
|
262 |
synchronized void send(int index,DistortedOutputSurface projection, float halfX, float halfY, float halfZ)
|
|
262 |
synchronized void send(DistortedOutputSurface projection, float halfX, float halfY, float halfZ) |
|
263 | 263 |
{ |
264 | 264 |
constructMatrices(projection,halfX,halfY,halfZ); |
265 | 265 |
|
266 |
GLES30.glUniform3f( mObjDH[index] , halfX, halfY, halfZ);
|
|
267 |
GLES30.glUniformMatrix4fv(mMVMatrixH[index] , 1, false, mViewMatrix, 0);
|
|
268 |
GLES30.glUniformMatrix4fv(mMVPMatrixH[index], 1, false, mMVPMatrix , 0);
|
|
266 |
GLES30.glUniform3f( mObjDH , halfX, halfY, halfZ); |
|
267 |
GLES30.glUniformMatrix4fv(mMVMatrixH , 1, false, mViewMatrix, 0); |
|
268 |
GLES30.glUniformMatrix4fv(mMVPMatrixH, 1, false, mMVPMatrix , 0); |
|
269 | 269 |
} |
270 | 270 |
|
271 | 271 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
272 | 272 |
|
273 |
synchronized void sendFeedback(int index,DistortedOutputSurface projection, float halfX, float halfY, float halfZ)
|
|
273 |
synchronized void sendZero()
|
|
274 | 274 |
{ |
275 |
constructMatrices(projection,halfX,halfY,halfZ); |
|
276 |
|
|
277 |
GLES30.glUniform3f( mObjDH[index] , 0.5f, 0.5f, 0.5f); |
|
278 |
GLES30.glUniformMatrix4fv(mMVMatrixH[index] , 1, false, mViewMatrix, 0); |
|
279 |
GLES30.glUniformMatrix4fv(mMVPMatrixH[index], 1, false, mMVPMatrix , 0); |
|
275 |
Matrix.setIdentityM(mTmpMatrix, 0); |
|
276 |
GLES30.glUniform3f( mObjDH , 0.5f, 0.5f, 0.5f); |
|
277 |
GLES30.glUniformMatrix4fv(mMVMatrixH , 1, false, mTmpMatrix , 0); |
|
278 |
GLES30.glUniformMatrix4fv(mMVPMatrixH, 1, false, mMVPMatrix , 0); |
|
280 | 279 |
} |
281 | 280 |
|
282 | 281 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
Also available in: Unified diff
Some progress with Transform Feedback. Still many bugs all over.