gzz.gfx.gl
Class Stencil

java.lang.Object
  |
  +--gzz.gfx.gl.Stencil

public class Stencil
extends java.lang.Object

Simple encapsulation of stenciling methods for OpenGL. XXX Make recursive by using stencils greater than 1, and making this an object, attached to a GLVobMap (?).


Field Summary
static Vob exit
           
static Vob exitBackplane
           
static Vob initBackplane
           
static Vob initContents_depth
           
static Vob initContents_nodepth
           
static Vob initOutside
           
static Vob initStencil
           
static Vob initZero
           
 
Constructor Summary
Stencil()
           
 
Method Summary
static void drawStenciled(VobScene vs, java.lang.Runnable drawStencil, java.lang.Runnable drawOverStencil, java.lang.Runnable drawOutside, java.lang.Runnable drawContents, boolean needDepth)
          Draw something stenciled Assumes that stencil buffer is all zeroes when called; leaves it zeroed if contract of drawOverStencil is met.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

initStencil

public static Vob initStencil

initOutside

public static Vob initOutside

initBackplane

public static Vob initBackplane

exitBackplane

public static Vob exitBackplane

initContents_depth

public static Vob initContents_depth

initContents_nodepth

public static Vob initContents_nodepth

initZero

public static Vob initZero

exit

public static Vob exit
Constructor Detail

Stencil

public Stencil()
Method Detail

drawStenciled

public static void drawStenciled(VobScene vs,
                                 java.lang.Runnable drawStencil,
                                 java.lang.Runnable drawOverStencil,
                                 java.lang.Runnable drawOutside,
                                 java.lang.Runnable drawContents,
                                 boolean needDepth)
Draw something stenciled Assumes that stencil buffer is all zeroes when called; leaves it zeroed if contract of drawOverStencil is met.

Parameters:
vs - The VobScene to draw into
drawStencil - The routine which causes exactly those fragments to be drawn that need to be in the stencil. The colormask is set to zero so the fragments won't be drawn into the framebuffer; XXX do we need more API for this? Is it possible to want them to be drawn?
drawOverStencil - (may be null): the routine to draw at least those fragments in the stencil and possibly more: e.g. if drawStencil uses textures, this can draw the same polygons without to save time.
drawOutside - (may be null): if desired, something that will be rendered only in the area OUTSIDE the stencil
drawContents - (may be null): the contents of the stencil.
needDepth - Whether depth tests will be used inside the stencil.