Project

General

Profile

« Previous | Next » 

Revision 89de975c

Added by Leszek Koltunski almost 7 years ago

Add possibility to create FBOs with combined DEPTH/STENCIL.

View differences:

src/main/java/org/distorted/library/DistortedNode.java
245 245
      }
246 246
    else if( createNewFBO )
247 247
      {
248
      newData.mFBO = new DistortedFramebuffer(true, DistortedSurface.TYPE_TREE, mSurface.getWidth(),mSurface.getHeight());
248
      newData.mFBO = new DistortedFramebuffer(DistortedFramebuffer.DEPTH_NO_STENCIL, DistortedSurface.TYPE_TREE, mSurface.getWidth(),mSurface.getHeight());
249 249
      //android.util.Log.d("NODE", "creating new FBO "+newData.mFBO.getID() );
250 250
      }
251 251

  
......
289 289

  
290 290
      if( mData.mFBO==null )
291 291
        {
292
        mData.mFBO = new DistortedFramebuffer(true, DistortedSurface.TYPE_TREE, mSurface.getWidth(),mSurface.getHeight());
292
        mData.mFBO = new DistortedFramebuffer(DistortedFramebuffer.DEPTH_NO_STENCIL, DistortedSurface.TYPE_TREE, mSurface.getWidth(),mSurface.getHeight());
293 293
        }
294 294

  
295 295
      mData.mFBO.setAsOutput(currTime);
......
402 402
        }
403 403
      else if( node.mSurface instanceof DistortedFramebuffer )
404 404
        {
405
        boolean hasDepth = ((DistortedFramebuffer) node.mSurface).hasDepth();
406
        mSurface = new DistortedFramebuffer(hasDepth,DistortedSurface.TYPE_TREE,w,h);
405
        int depthStencil = DistortedFramebuffer.NO_DEPTH_STENCIL;
406

  
407
        if( ((DistortedFramebuffer) node.mSurface).hasDepth() )
408
          {
409
          boolean hasStencil = ((DistortedFramebuffer) node.mSurface).hasStencil();
410
          depthStencil = (hasStencil ? DistortedFramebuffer.BOTH_DEPTH_STENCIL:DistortedFramebuffer.DEPTH_NO_STENCIL);
411
          }
412

  
413
        mSurface = new DistortedFramebuffer(depthStencil,DistortedSurface.TYPE_TREE,w,h);
407 414
        }
408 415
      }
409 416
    if( (flags & Distorted.CLONE_CHILDREN) != 0 )

Also available in: Unified diff