hello,
does anyone have succefully used stencil buffer with GEM?
here is what i'm trying to do, without succes...
thanks
cyrille
#N canvas 0 0 911 552 10; #X obj 54 112 gemhead 44; #X obj 54 403 translateXYZ 0 0 -1; #X obj 54 90 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1 ; #X obj 54 374 GEMglStencilOp; #X obj 54 295 GEMglStencilFunc; #X floatatom 194 367 5 0 0 0 - - -; #X obj 147 340 GLdefine GL_KEEP; #X obj 148 319 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X floatatom 196 236 5 0 0 0 - - -; #X obj 188 191 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 188 212 GLdefine GL_NEVER; #X msg 161 269 1; #X obj 54 230 GEMglEnable; #X floatatom 137 184 5 0 0 0 - - -; #X obj 126 140 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 126 163 GLdefine GL_STENCIL_TEST; #X obj 316 189 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 316 212 GLdefine GL_ALWAYS; #X obj 585 153 gemhead 31; #X obj 585 129 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1; #X obj 585 220 GEMglClear; #X obj 650 198 GLdefine GL_STENCIL_BUFFER_BIT; #X obj 650 177 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X floatatom 659 220 5 0 0 0 - - -; #X obj 585 269 GEMglStencilMask; #X msg 692 246 1; #X obj 585 369 GEMglStencilFunc; #X msg 692 344 1; #X floatatom 634 335 5 0 0 0 - - -; #X obj 620 289 bng 15 250 50 0 empty empty empty 0 -6 0 8 -262144 -1 -1; #X obj 620 312 GLdefine GL_ALWAYS; #X obj 713 62 loadbang; #X obj 188 132 loadbang; #X msg 585 107 0; #X text 621 127 to draw in the stencil buffer; #X obj 54 454 square 3; #X obj 54 428 color 1 0 0; #X text 219 282 enable the stencil buffer; #X text 220 303 the red square should not be seen. (?); #X obj 396 90 gemwin; #X msg 396 42 create , 1; #X msg 404 67 0 , destroy; #X obj 585 397 square 1; #X connect 0 0 12 0; #X connect 1 0 36 0; #X connect 2 0 0 0; #X connect 3 0 1 0; #X connect 4 0 3 0; #X connect 6 0 5 0; #X connect 6 0 3 1; #X connect 6 0 3 2; #X connect 6 0 3 3; #X connect 7 0 6 0; #X connect 9 0 10 0; #X connect 10 0 8 0; #X connect 10 0 4 1; #X connect 11 0 4 3; #X connect 11 0 4 2; #X connect 12 0 4 0; #X connect 14 0 15 0; #X connect 15 0 13 0; #X connect 15 0 12 1; #X connect 16 0 17 0; #X connect 17 0 4 1; #X connect 18 0 20 0; #X connect 19 0 18 0; #X connect 20 0 24 0; #X connect 21 0 20 1; #X connect 21 0 23 0; #X connect 22 0 21 0; #X connect 24 0 26 0; #X connect 25 0 24 1; #X connect 26 0 42 0; #X connect 27 0 26 3; #X connect 27 0 26 2; #X connect 29 0 30 0; #X connect 30 0 28 0; #X connect 30 0 26 1; #X connect 31 0 21 0; #X connect 31 0 25 0; #X connect 31 0 30 0; #X connect 31 0 27 0; #X connect 31 0 33 0; #X connect 32 0 10 0; #X connect 32 0 15 0; #X connect 32 0 6 0; #X connect 32 0 11 0; #X connect 33 0 19 0; #X connect 36 0 35 0; #X connect 40 0 39 0; #X connect 41 0 39 0;
hey cyrille,
On Mar 3, 2006, at 8:54 AM, cyrille henry wrote:
does anyone have succefully used stencil buffer with GEM?
here is what i'm trying to do, without succes...
...this is easy: it's not working because the gemwindow creation doesn't request a stencil buffer (at least on osx and linux)! However, I just committed a small change to the osx code that indeed does enable the stencil buffer, and it should be just as easy to do for linux and windows...after doing so, the patch works as expected...
...this does bring up an issue: should we always create the additional buffers (ie. depth, stencil, accumulation, aux), or should we create a message for gemwin to selectively enable/disable these before window creation? Currently on osx, 24bit depth and 8bit stencil buffers are created, and on linux it just creates a 16bit depth buffer...
time to go out, jamie
james tittle a écrit :
hey cyrille,
On Mar 3, 2006, at 8:54 AM, cyrille henry wrote:
does anyone have succefully used stencil buffer with GEM?
here is what i'm trying to do, without succes...
...this is easy: it's not working because the gemwindow creation doesn't request a stencil buffer (at least on osx and linux)! However, I just committed a small change to the osx code that indeed does enable the stencil buffer, and it should be just as easy to do for linux and windows...after doing so, the patch works as expected...
thanks. i'll look at your change.
...this does bring up an issue: should we always create the additional buffers (ie. depth, stencil, accumulation, aux), or should we create a message for gemwin to selectively enable/disable these before window creation? Currently on osx, 24bit depth and 8bit stencil buffers are created, and on linux it just creates a 16bit depth buffer...
i personnally don't know. what's the pros and cons?
thanks Cyrille
time to go out, jamie