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/DistortedOutputSurface.java
237 237
    DistortedNode child;
238 238
    DistortedEffectsPostprocess lastP=null, currP;
239 239
    long lastB=0, currB;
240
    int quality;
240
    int bucketChange=0;
241
    int lastQ=0, currQ;
241 242

  
242 243
    for(int i=0; i<num; i++)
243 244
      {
244 245
      child = children.get(i);
245 246
      currP = child.getEffectsPostprocess();
246 247
      currB = currP==null ? 0 : currP.getBucket();
247

  
248
      if( lastB!=currB && lastB!=0 )
249
        {
250
        quality = lastP.getQuality();
251
        numRenders += lastP.postprocess(time, this);
252
        numRenders += blitWithDepth(quality,time);
253
        }
248
      currQ = currP==null ? 0 : currP.getQuality();
254 249

  
255 250
      if( currB==0 ) numRenders += child.draw(time,this);
256 251
      else
257 252
        {
258 253
        if( mBuffer[0]==null ) createBuffers();
259
        numRenders += child.markStencilAndDraw(time,this,currP);
254

  
255
        if( lastB!=currB )
256
          {
257
          if( lastB!=0 )
258
            {
259
            for(int j=bucketChange; j<i; j++)
260
              {
261
              child = children.get(j);
262
              numRenders += child.markStencilAndDepth(time,mBuffer[lastQ],lastP);
263
              }
264

  
265
            numRenders += lastP.postprocess(time, this);
266
            numRenders += blitWithDepth(lastQ,time);
267
            }
268

  
269
          bucketChange = i;
270
          }
271

  
272
        numRenders += child.draw(time,mBuffer[currQ]);
273

  
260 274
        if( i==num-1 )
261 275
          {
262
          quality = currP.getQuality();
276
          for(int j=bucketChange; j<num; j++)
277
            {
278
            child = children.get(j);
279
            numRenders += child.markStencilAndDepth(time,mBuffer[currQ],currP);
280
            }
281

  
263 282
          numRenders += currP.postprocess(time,this);
264
          numRenders += blitWithDepth(quality,time);
283
          numRenders += blitWithDepth(currQ,time);
265 284
          }
266 285
        }
267 286

  
287
      lastQ = currQ;
268 288
      lastP = currP;
269 289
      lastB = currB;
270 290
      }

Also available in: Unified diff