Revision 9becf30e
Added by Leszek Koltunski over 3 years ago
src/main/java/org/distorted/library/effectqueue/EffectQueueVertex.java | ||
---|---|---|
67 | 67 |
mUniformsH[variant] = GLES30.glGetUniformLocation( mProgramH, "vUniforms"); |
68 | 68 |
} |
69 | 69 |
|
70 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
71 |
/** |
|
72 |
* Not part of public API, do not document (public only because has to be called from DistortedEffects) |
|
73 |
* |
|
74 |
* @y.exclude |
|
75 |
*/ |
|
76 |
public void setAssociation(long effectID) |
|
77 |
{ |
|
78 |
for(int j=0; j<mNumEffects; j++) |
|
79 |
{ |
|
80 |
if (mEffects[j].getID() == effectID) |
|
81 |
{ |
|
82 |
mEffects[j].writeAssociations(mIntUniforms, NUM_INT_UNIFORMS*j+1, NUM_INT_UNIFORMS*j+3); |
|
83 |
} |
|
84 |
} |
|
85 |
} |
|
86 |
|
|
70 | 87 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
71 | 88 |
/** |
72 | 89 |
* Not part of public API, do not document (public only because has to be used in Meshes) |
... | ... | |
81 | 98 |
|
82 | 99 |
for(int i=0; i<mNumEffects; i++) |
83 | 100 |
{ |
84 |
mEffects[i].writeAssociations(mIntUniforms, NUM_INT_UNIFORMS*i+1, NUM_INT_UNIFORMS*i+3); |
|
85 |
|
|
86 | 101 |
if( mEffects[i].compute(mFloatUniforms, NUM_FLOAT_UNIFORMS*i, currTime, step) ) |
87 | 102 |
{ |
88 | 103 |
EffectMessageSender.newMessage(mEffects[i]); |
Also available in: Unified diff
Speedup: remember the mesh associations of VertexEffects only once, when they actually change, and not every time we compute() a VertexQueue.