Revision b7074bc6
Added by Leszek Koltunski about 4 years ago
src/main/java/org/distorted/library/effectqueue/EffectQueueMatrix.java | ||
---|---|---|
19 | 19 |
|
20 | 20 |
package org.distorted.library.effectqueue; |
21 | 21 |
|
22 |
import android.opengl.GLES31;
|
|
22 |
import android.opengl.GLES30;
|
|
23 | 23 |
import android.opengl.Matrix; |
24 | 24 |
|
25 | 25 |
import org.distorted.library.effect.EffectType; |
... | ... | |
58 | 58 |
|
59 | 59 |
static void uniforms(int mProgramH, int variant) |
60 | 60 |
{ |
61 |
mBoundingH[variant] = GLES31.glGetUniformLocation(mProgramH, "u_Bounding");
|
|
62 |
mStretchH[variant] = GLES31.glGetUniformLocation(mProgramH, "u_Stretch");
|
|
63 |
mMVPMatrixH[variant]= GLES31.glGetUniformLocation(mProgramH, "u_MVPMatrix");
|
|
64 |
mMVMatrixH[variant] = GLES31.glGetUniformLocation(mProgramH, "u_MVMatrix");
|
|
61 |
mBoundingH[variant] = GLES30.glGetUniformLocation(mProgramH, "u_Bounding");
|
|
62 |
mStretchH[variant] = GLES30.glGetUniformLocation(mProgramH, "u_Stretch");
|
|
63 |
mMVPMatrixH[variant]= GLES30.glGetUniformLocation(mProgramH, "u_MVPMatrix");
|
|
64 |
mMVMatrixH[variant] = GLES30.glGetUniformLocation(mProgramH, "u_MVMatrix");
|
|
65 | 65 |
} |
66 | 66 |
|
67 | 67 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
164 | 164 |
// combined Model-View-Projection matrix |
165 | 165 |
Matrix.multiplyMM(mMVPMatrix, 0, projection, 0, mModelViewMatrix, 0); |
166 | 166 |
|
167 |
GLES31.glUniform3f( mBoundingH[variant] , mesh.getBoundingX(), mesh.getBoundingY(), mesh.getBoundingZ());
|
|
168 |
GLES31.glUniform3f( mStretchH[variant] , mesh.getStretchX() , mesh.getStretchY() , mesh.getStretchZ() );
|
|
169 |
GLES31.glUniformMatrix4fv(mMVMatrixH[variant] , 1, false, mModelViewMatrix, 0);
|
|
170 |
GLES31.glUniformMatrix4fv(mMVPMatrixH[variant], 1, false, mMVPMatrix , 0);
|
|
167 |
GLES30.glUniform3f( mBoundingH[variant] , mesh.getBoundingX(), mesh.getBoundingY(), mesh.getBoundingZ());
|
|
168 |
GLES30.glUniform3f( mStretchH[variant] , mesh.getStretchX() , mesh.getStretchY() , mesh.getStretchZ() );
|
|
169 |
GLES30.glUniformMatrix4fv(mMVMatrixH[variant] , 1, false, mModelViewMatrix, 0);
|
|
170 |
GLES30.glUniformMatrix4fv(mMVPMatrixH[variant], 1, false, mMVPMatrix , 0);
|
|
171 | 171 |
} |
172 | 172 |
} |
Also available in: Unified diff
Lower requirements - now only OpenGL ES 3.0 is required; if running on such platform, OIT part of the API ( which is the only one which actually requires 3.1) is switched off.