Revision 96e3b88a
Added by Leszek Koltunski over 3 years ago
src/main/java/org/distorted/library/effectqueue/EffectQueueMatrix.java | ||
---|---|---|
29 | 29 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
30 | 30 |
|
31 | 31 |
class EffectQueueMatrix extends EffectQueue |
32 |
{ |
|
33 |
private static final int NUM_UNIFORMS = MatrixEffect.NUM_UNIFORMS; |
|
32 |
{ |
|
33 |
private static final int NUM_FLOAT_UNIFORMS = MatrixEffect.NUM_FLOAT_UNIFORMS; |
|
34 |
private static final int NUM_INT_UNIFORMS = MatrixEffect.NUM_INT_UNIFORMS; |
|
35 |
|
|
34 | 36 |
private static final int INDEX = EffectType.MATRIX.ordinal(); |
35 | 37 |
|
36 | 38 |
private static float[] mMVPMatrix = new float[16]; |
... | ... | |
45 | 47 |
|
46 | 48 |
EffectQueueMatrix() |
47 | 49 |
{ |
48 |
super(NUM_UNIFORMS,INDEX );
|
|
50 |
super(NUM_FLOAT_UNIFORMS, NUM_INT_UNIFORMS, INDEX);
|
|
49 | 51 |
} |
50 | 52 |
|
51 | 53 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
... | ... | |
74 | 76 |
|
75 | 77 |
for(int i=0; i<mNumEffects; i++) |
76 | 78 |
{ |
77 |
if( mEffects[i].compute(mUniforms, NUM_UNIFORMS*i, currTime, step) )
|
|
79 |
if( mEffects[i].compute(mFloatUniforms, NUM_FLOAT_UNIFORMS*i, currTime, step) )
|
|
78 | 80 |
{ |
79 | 81 |
EffectMessageSender.newMessage(mEffects[i]); |
80 | 82 |
} |
... | ... | |
115 | 117 |
// the 'Model' part of the MV matrix |
116 | 118 |
for(int i=mNumEffects-1; i>=0; i--) |
117 | 119 |
{ |
118 |
((MatrixEffect)mEffects[i]).apply(mModelViewMatrixP,mModelViewMatrixV,mUniforms,i); |
|
120 |
((MatrixEffect)mEffects[i]).apply(mModelViewMatrixP,mModelViewMatrixV,mFloatUniforms,i);
|
|
119 | 121 |
} |
120 | 122 |
|
121 | 123 |
// combined Model-View-Projection matrix |
Also available in: Unified diff
Introducing UBO to Effect Queues: step 1.