Revision 835b197e
Added by Leszek Koltunski almost 3 years ago
src/main/java/org/distorted/library/main/DistortedNode.java | ||
---|---|---|
52 | 52 |
private int mFboW, mFboH, mFboDepthStencil; |
53 | 53 |
private boolean mRenderWayOIT; |
54 | 54 |
private float mFOV, mNear; |
55 |
private long mLastTime; |
|
55 | 56 |
|
56 | 57 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
57 | 58 |
|
... | ... | |
160 | 161 |
{ |
161 | 162 |
mState.apply(); |
162 | 163 |
GLES30.glDisable(GLES30.GL_BLEND); |
163 |
DistortedLibrary.drawPriv(mEffects, mMesh, surface, currTime); |
|
164 |
if( mLastTime==0 ) mLastTime=currTime; |
|
165 |
DistortedLibrary.drawPriv(mEffects, mMesh, surface, currTime, (currTime-mLastTime)); |
|
166 |
mLastTime = currTime; |
|
164 | 167 |
GLES30.glEnable(GLES30.GL_BLEND); |
165 | 168 |
return 1; |
166 | 169 |
} |
... | ... | |
178 | 181 |
if( input.setAsInput() ) |
179 | 182 |
{ |
180 | 183 |
mState.apply(); |
181 |
DistortedLibrary.drawPrivOIT(mEffects, mMesh, surface, currTime); |
|
184 |
if( mLastTime==0 ) mLastTime=currTime; |
|
185 |
DistortedLibrary.drawPrivOIT(mEffects, mMesh, surface, currTime, (currTime-mLastTime)); |
|
186 |
mLastTime = currTime; |
|
182 | 187 |
return 1; |
183 | 188 |
} |
184 | 189 |
|
... | ... | |
195 | 200 |
if( input.setAsInput() ) |
196 | 201 |
{ |
197 | 202 |
mState.apply(); |
198 |
DistortedLibrary.drawPriv(mEffects, mMesh, surface, currTime); |
|
203 |
if( mLastTime==0 ) mLastTime=currTime; |
|
204 |
DistortedLibrary.drawPriv(mEffects, mMesh, surface, currTime, (currTime-mLastTime)); |
|
205 |
mLastTime = currTime; |
|
199 | 206 |
return 1; |
200 | 207 |
} |
201 | 208 |
|
... | ... | |
294 | 301 |
*/ |
295 | 302 |
public DistortedNode(InternalSurface surface, DistortedEffects effects, MeshBase mesh) |
296 | 303 |
{ |
304 |
mLastTime = 0; |
|
297 | 305 |
mSurface = surface; |
298 | 306 |
mEffects = effects; |
299 | 307 |
mMesh = mesh; |
... | ... | |
324 | 332 |
*/ |
325 | 333 |
public DistortedNode(DistortedNode node, int flags) |
326 | 334 |
{ |
335 |
mLastTime = 0; |
|
327 | 336 |
mEffects = new DistortedEffects(node.mEffects,flags); |
328 | 337 |
mMesh = node.mMesh; |
329 | 338 |
mState = new InternalRenderState(); |
Also available in: Unified diff
Move the information when was a EffectQueue last time evaluated from the EffectQueues all the way up to the Node which contains them.
The point: we need to reset this time back to 0 every time we attach the Node (and thus start evaluating the Queues inside)