Re: Stenciling help needed

New Message Reply Date view Thread view Subject view Author view

Brian Furtaw (brian++at++dingbat.clubfed.sgi.com)
Thu, 15 May 1997 08:07:18 -0400


TO check out the visual characteristics try adding
pfuPrintPWinFBConfig(pw, NULL); to your code right after pw->select(). That
will tell you if your missing stencil planes or not. When you see the checker
board do you see the scene through it or is just a bunch of colors in blocks?

Brian

On May 14, 3:22pm, Scott McMillan wrote:
> Subject: Stenciling help needed
> Back in January Angus Dorbie posted a StencilHUD function which I have used
> successfully on my High Impact (R4400, IRIX 6.2, pf 2.0.2/4, N32, and a
> gazillion patches) to cut a circular endoscopic view in my main pfChannel (I
> use 2 channels).
>
> When I tried to run a statically linked version of the app on an IR R10000
> the main channel is completely black (I know things are running based on post
> DRAW openGL output on top of the channel). When I recompiled using a
> Performer 2.2 beta (dynamic link this time) I got the same result.
>
> More recently I have tried to run the code (again statically like on my High
> Impact) on another Impact (an R4400 running Irix 6.2 for Impact R10000 -
> needed for ICO drivers, with not so many patches) with two different results.
> One time I got the completely black channel and other times I have gotten a
> crosshatch pattern over the entire channel (sorta like a chess board with
> 100s of squares.
>
> Can anyone venture a guess as to problems??
>
> Could it be a lack of patches? If so, which ones are pertinent...I am afraid
> to install patches "willy-nilly" on the second Impact for fear that the HMD
> will stop working again!
>
> Could it be a failure to set up the visual with stencil bits (I just happens
> to default to something adequate on my High Impact)?
>
>
> Any advice or pointers are GREATLY appreciated,
> scott
>
>
> P.S. As a reminder here is the stencil function again (I modified for 1 bit
> of stencil and had to comment out two lines b/c I could not figure out what
> Visual_Mode was for). I call this the first time through the DRAW.
>
> //----------------------------------------------------------------------------
> static void StencilHUD(pfPipeWindow *pw)
> {
> double f;
> static int mapped = 0;
> float new_x = 0.0f, new_y = 0.0f;
> // if(Visual_Mode != VISUAL_OPTICAL)
> // return;
>
> pw->select(); //pfSelectPWin(pw);
>
> glPushMatrix();
> glLoadIdentity();
> glMatrixMode(GL_PROJECTION);
> glPushMatrix();
> glLoadIdentity();
> glOrtho(-1.0, 1.0, -1.0, 1.0, -1.0, 1.0);
> glMatrixMode(GL_MODELVIEW);
>
> glDisable(GL_CULL_FACE);
> glDisable(GL_DEPTH_TEST);
> glEnable(GL_STENCIL_TEST);
>
> glOrtho(-1.0, 1.0, -1.0, 1.0, -1.0, 1.0);
>
> glClearColor(1.0f, 0.0f, 0.0f, 1.0f);
> glClear(GL_COLOR_BUFFER_BIT);
> glColor3f(0.0f, 0.0f, 0.0f);
>
> /* Clear stencil planes to one over entire window */
> glClearStencil(0);
> glClear(GL_STENCIL_BUFFER_BIT);
> /* were a drawin' */
> glStencilFunc(GL_ALWAYS, 0x1, 0x1);
> glStencilOp(GL_REPLACE, GL_REPLACE, GL_REPLACE);
>
>
> glBegin(GL_TRIANGLE_FAN);
> for(f = 0.0; f< 359.5; f+=1.0)
> {
> pfSinCos((float)f, &new_x, &new_y);
> glVertex2f(new_x, new_y);
> }
> glEnd();
>
> glEnable(GL_CULL_FACE);
> glEnable(GL_DEPTH_TEST);
>
> // reset framebuffer
> glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
> glClear(GL_COLOR_BUFFER_BIT);
>
> glMatrixMode(GL_PROJECTION);
> glPopMatrix();
> glMatrixMode(GL_MODELVIEW);
> glPopMatrix();
>
> glClearColor(1.0f, 0.0f, 0.0f, 1.0f);
> }
>
> //----------------------------------------------------------------------------
>
> I call the following just before pfDraw():
>
> glStencilFunc(GL_EQUAL, 0x1, 0x1);
> glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP);
> glEnable(GL_STENCIL_TEST);
>
> //----------------------------------------------------------------------------
>
> I call the following just after pfDraw():
>
> glDisable(GL_STENCIL_TEST);
>
> --
> Scott McMillan | HT Medical, Inc. | Developing medical VE's
> scott++at++ht.com | http://www.ht.com | surgical simulations
> Ph: 301-984-3706 |6001 Montrose Rd., #902| and surgery simulation
> Fax: 301-984-2104 | Rockville, MD 20852 | creation tools.
>
> =======================================================================
> List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/
> Submissions: info-performer++at++sgi.com
> Admin. requests: info-performer-request++at++sgi.com
>
>-- End of excerpt from Scott McMillan

-- 
    ----oOOo----    ----oOOo----    ----oOOo----    ----oOOo----

Brian Furtaw (brian++at++sgi.com) VisSim Technical Consultant 12200-G Plum Orchard Drive Office:(410)796-0394 Fax: (301)872-3293 Silver Spring, Maryland 20904 OpenGL/ImageVision/OpenInventor/Performer

======================================================================= List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/ Submissions: info-performer++at++sgi.com Admin. requests: info-performer-request++at++sgi.com


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:55:14 PDT

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.