Re: background texture using glDrawPixels

New Message Reply Date view Thread view Subject view Author view

From: Angus Dorbie (dorbie++at++sgi.com)
Date: 10/13/2000 02:53:57


It has been pointed out to me by a benevolent list lurker that this is
not the only explanation and may not be the right answer.

The alternative and perhaps more likely explanation is that the draw
pixels if flickering because it is drawn EXACTLY at the far clip plane
is being z fragment clipped at the far plane due to rounding errors. The
solution is to position the image nearer the eye by multiplying
farPlaneLL[2] by 0.99999 or so.

Cheers,ANgus.

Angus Dorbie wrote:
>
> No clear in pfDraw, you are expected to clear if you have a draw
> callback on a channel.
>
> You may not need to clear if you set your depth test to always when you
> draw the image.
> Same thing goes for stencil test and write when drawing.
>
> In general your code should work I as far as I can tell. Are you sure
> you are double buffered?
>
> Cheers,Angus.
>
> Yoram Shahak wrote:
> >
> > Hi,
> >
> > I am trying to implement background texturing using glDrawPixels in my
> > draw call back.
> > my code looks something like this :
> >
> > void drawCallBack(pfChannel *chan, void *data)
> > {
> > preDraw(chan, data);
> > pfDraw();
> > }
> >
> > void preDraw()
> > {
> > chan->clear();
> > glClearStencil(0x0);
> > glClear(GL_STENCIL_BUFFER_BIT);
> >
> > pfVec3 farPlaneLL, dummy;
> > chan->getFar(farPlaneLL, dummy, dummy, dummy);
> >
> > glRasterPos3f(farPlaneLL[0], farPlaeLL[1], farPlaneLL[2]);
> > glDrawPixels(winWidth, winHeight, imageFormat,GL_UNSIGNED_INT,
> > imageBuffer);
> >
> > }
> >
> > As a result I get the background image flickering if at all seen.
> > Does performer clear the gl buffer in pfDraw ?
> > Am I going totally the wrong way about implementing this ?
> >
> > Please help .
> > Thanx.
> >
> > :o)
> >
> > Yoram Shahak
> > DreamTeam ltd.
> >
> > -----------------------------------------------------------------------
> > List Archives, FAQ, FTP: http://www.sgi.com/software/performer/
> > Submissions: info-performer++at++sgi.com
> > Admin. requests: info-performer-request++at++sgi.com
>
> --
> For Performer+OpenGL tutorials http://www.dorbie.com/
>
> "In the middle of difficulty lies opportunity."
> --Albert Einstein
> -----------------------------------------------------------------------
> List Archives, FAQ, FTP: http://www.sgi.com/software/performer/
> Submissions: info-performer++at++sgi.com
> Admin. requests: info-performer-request++at++sgi.com

-- 
For Performer+OpenGL tutorials http://www.dorbie.com/

"In the middle of difficulty lies opportunity." --Albert Einstein


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Fri Oct 13 2000 - 02:54:08 PDT

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