Project

General

Profile

« Previous | Next » 

Revision c9a24bfb

Added by Leszek Koltunski almost 7 years ago

Bugfix in renderChildren (postprocess):

for each bucket, first render all the bucket members , only then render all of their Stencils+Depths (avoids this 'black ring' effect)

View differences:

src/main/java/org/distorted/library/DistortedNode.java
259 259

  
260 260
///////////////////////////////////////////////////////////////////////////////////////////////////
261 261

  
262
  int markStencilAndDraw(long currTime, DistortedOutputSurface surface, DistortedEffectsPostprocess effects)
262
  int markStencilAndDepth(long currTime, DistortedOutputSurface surface, DistortedEffectsPostprocess effects)
263 263
    {
264 264
    DistortedInputSurface input = mNumChildren[0]==0 ? mSurface : mData.mFBO;
265 265

  
266 266
    if( input.setAsInput() )
267 267
      {
268
      int quality = effects.getQuality();
269
      DistortedFramebuffer buffer = surface.mBuffer[quality];
270
      float w = mSurface.getWidth() /2.0f;
271
      float h = mSurface.getHeight()/2.0f;
272
      buffer.setAsOutput();
273

  
274
      // Draw the color buffer of the object.
275
      mState.apply();
276
      mEffects.drawPriv(w, h, mMesh, buffer, currTime, 0);
277

  
278
      // Draw stencil + depth buffers of the object enlarged by HALO pixels around.
268
      surface.setAsOutput();
279 269
      DistortedRenderState.setUpStencilMark();
280
      mEffects.drawPriv(w, h, mMesh, buffer, currTime, effects.getHalo()*buffer.mMipmap);
270
      mEffects.drawPriv(mSurface.getWidth() /2.0f, mSurface.getHeight()/2.0f, mMesh, surface, currTime, effects.getHalo()*surface.mMipmap);
281 271
      DistortedRenderState.unsetUpStencilMark();
282 272

  
283 273
      return 1;

Also available in: Unified diff