Revision 0f011027
Added by Leszek Koltunski almost 7 years ago
src/main/java/org/distorted/library/DistortedNode.java | ||
---|---|---|
266 | 266 |
if( input.setAsInput() ) |
267 | 267 |
{ |
268 | 268 |
int quality = effects.getQuality(); |
269 |
DistortedFramebuffer buffer1 = surface.mBuffer1[quality]; |
|
270 |
DistortedFramebuffer buffer2 = surface.mBuffer2[quality]; |
|
269 |
DistortedFramebuffer buffer = surface.mBuffer[quality]; |
|
271 | 270 |
float w = mSurface.getWidth() /2.0f; |
272 | 271 |
float h = mSurface.getHeight()/2.0f; |
272 |
buffer.setAsOutput(); |
|
273 | 273 |
|
274 | 274 |
// Draw the color buffer of the object. |
275 |
buffer1.setAsOutput(); |
|
276 | 275 |
mState.apply(); |
277 |
mEffects.drawPriv(w, h, mMesh, buffer1, currTime, 0);
|
|
276 |
mEffects.drawPriv(w, h, mMesh, buffer, currTime, 0); |
|
278 | 277 |
|
279 | 278 |
// Draw stencil + depth buffers of the object enlarged by HALO pixels around. |
280 |
buffer2.setAsOutput(); |
|
281 | 279 |
DistortedRenderState.setUpStencilMark(); |
282 |
mEffects.drawPriv(w, h, mMesh, buffer2, currTime, effects.getHalo()*buffer2.mMipmap);
|
|
280 |
mEffects.drawPriv(w, h, mMesh, buffer, currTime, effects.getHalo()*buffer.mMipmap);
|
|
283 | 281 |
DistortedRenderState.unsetUpStencilMark(); |
284 | 282 |
|
285 | 283 |
return 1; |
Also available in: Unified diff
Major speedup, BLUR fully optimized now.
Multiblur app, worst case (all 8 cubes blurred with max radius, HIGHEST quality: Nexus5X: 46.7 FPS, Nexus 4: 29.7 FPS.