Project

General

Profile

« Previous | Next » 

Revision 30949736

Added by Leszek Koltunski over 7 years ago

Postprocessing: take quality only from the first child in a bucket.

View differences:

src/main/java/org/distorted/library/main/DistortedOutputSurface.java
248 248

  
249 249
  int renderChildren(long time, int numChildren, ArrayList<DistortedNode> children)
250 250
    {
251
    int numRenders = 0, bucketChange = 0;
251
    int quality=0, numRenders = 0, bucketChange = 0;
252 252
    DistortedNode child1, child2;
253 253
    DistortedEffects lastEffects=null, currEffects;
254 254
    long lastBucket=0, currBucket;
255
    int lastQuality=0, currQuality;
256 255

  
257 256
sCurr = "";
258 257

  
......
261 260
      child1 = children.get(i);
262 261
      currEffects = child1.getEffects();
263 262
      currBucket  = currEffects==null ? 0 : currEffects.getBucket();
264
      currQuality = currEffects==null ? 0 : currEffects.getQuality();
265 263

  
266 264
sCurr += (" "+currBucket);
267 265

  
......
272 270

  
273 271
        if( lastBucket!=currBucket )
274 272
          {
273
          quality = currEffects==null ? 0 : currEffects.getQuality();
274
          bucketChange = i;
275

  
275 276
          if( lastBucket!=0 )
276 277
            {
277 278
            for(int j=bucketChange; j<i; j++)
278 279
              {
279 280
              child2 = children.get(j);
280
              numRenders += child2.markStencilAndDepth(time,mBuffer[lastQuality],lastEffects);
281
              numRenders += child2.markStencilAndDepth(time,mBuffer[quality],lastEffects);
281 282
              }
282 283

  
283 284
            numRenders += lastEffects.postprocess(time, this);
284
            numRenders += blitWithDepth(time, mBuffer[lastQuality]);
285
            numRenders += blitWithDepth(time, mBuffer[quality]);
285 286
            }
286

  
287
          bucketChange = i;
288 287
          }
289 288

  
290
        numRenders += child1.draw(time,mBuffer[currQuality]);
289
        numRenders += child1.draw(time,mBuffer[quality]);
291 290

  
292 291
        if( i==numChildren-1 )
293 292
          {
294 293
          for(int j=bucketChange; j<numChildren; j++)
295 294
            {
296 295
            child2 = children.get(j);
297
            numRenders += child2.markStencilAndDepth(time,mBuffer[currQuality],currEffects);
296
            numRenders += child2.markStencilAndDepth(time,mBuffer[quality],currEffects);
298 297
            }
299 298

  
300 299
          numRenders += currEffects.postprocess(time,this);
301
          numRenders += blitWithDepth(time,mBuffer[currQuality]);
300
          numRenders += blitWithDepth(time,mBuffer[quality]);
302 301
          }
303 302
        }
304 303

  
305
      lastQuality = currQuality;
306 304
      lastEffects = currEffects;
307 305
      lastBucket  = currBucket;
308 306
      }

Also available in: Unified diff