PDA

View Full Version : repainting a part of a Displaylist ---- Stencil buffer



Timmi
11-13-2000, 11:16 AM
Hello..
In my Screensaver a Bird flys over the ground. When he moves i have to repaint the part of the Displaylist (ground) which is overlapped by the Bird. How can i do this ???

I think i missunderstand how the stencilbuffer works .. this is my attempt..

INIT:
glClearStencil(0);
glEnable(GL_STENCIL_TEST);
glClear(GL_STENCIL_BUFFER_BIT);

REPAINT:
glStencilMask(bird);
glStencilFunc(GL_EQUAL,1,1);
glStencilOp(GL_KEEP,GL_KEEP,GL_KEEP);
glCallList(ground);

bird and ground are Displaylists

RandyU
11-13-2000, 12:40 PM
glStencil is used to restrict painting to a region. It is used in some special effects like mirror and magnifying glass. It decreases speed of rendering due to testing.
Why not you just glClear and then re-render the scene?