Ran Yakir (rany++at++++at++sgi.sgi.com)
Sun, 15 Dec 1996 09:35:02 +0000
Ran
On Dec 13, 9:14am, Olivier Schreiber wrote:
> Subject: Accmulation buffer with OpenGL
> Hi,
> I might have missed on the december mailings about this topic
> but after checking the previous months in the archive I cannot
> yet find an example of accumulation buffer with OpenGL performer.
>
> With help from Nicolas Gauvin, I have a working callback in Iris GL
> but converting it to OpenGL does not yield any result.
> Any hint at what I am doing wrong?
> (I am running on IR 6.2, performer 2.1
> Thanks in advance.
> Here is the Callback both in OpenGL and Iris GL:
>
> #include <stdlib.h>
> #include <Performer/pf.h>
> #include <gl.h>
> void printvis(Display*,XVisualInfo*);
>
> #ifdef OPENGL
> void DrawFunc(pfChannel *chan, void *data)
> {
> static long count = 0;
> float multiplier,geom;
> int attribList[]={GLX_RGBA,GLX_DOUBLEBUFFER,
> GLX_ACCUM_RED_SIZE,12,
> GLX_ACCUM_GREEN_SIZE,12,
> GLX_ACCUM_BLUE_SIZE,12,
> GLX_ACCUM_ALPHA_SIZE,12,
> None};
> Display *dpy;
> XVisualInfo *vis;
> if (count==0) {
> dpy = pfGetCurWSConnection();
> printf("dpy=pfGetCurWSConnection=0x%x\n",dpy);
> vis=glXChooseVisual(dpy,0,attribList );
> printf("vis=0x%x\n",vis);
> printvis(dpy,vis);
> glClear(GL_ACCUM_BUFFER_BIT);
> }
> /* glDrawBuffer(GL_FRONT); */
> /* glReadBuffer(GL_FRONT); */
> glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
> pfDraw();
> /* post-draw */
> multiplier = 0.8f;
> glAccum( GL_MULT, multiplier );
> glAccum( GL_ACCUM, 1.0f );
> glAccum( GL_ACCUM, multiplier );
> geom = geom*multiplier + 1.0f;
> glAccum(GL_RETURN, 1.0f/geom);
> count+=1;
> }
> void printvis(Display *dpy,XVisualInfo *vis){
> int value ;
> glXGetConfig(dpy,vis,GLX_DOUBLEBUFFER,&value );
> printf("GLX_DOUBLEBUFFER=%d\n",value);
> glXGetConfig(dpy,vis,GLX_RED_SIZE,&value );
> printf("GLX_RED_SIZE=%d\n",value);
> glXGetConfig(dpy,vis,GLX_GREEN_SIZE,&value );
> printf("GLX_GREEN_SIZE=%d\n",value);
> glXGetConfig(dpy,vis,GLX_BLUE_SIZE,&value );
> printf("GLX_BLUE_SIZE=%d\n",value);
> glXGetConfig(dpy,vis,GLX_ALPHA_SIZE,&value );
> printf("GLX_ALPHA_SIZE=%d\n",value);
> glXGetConfig(dpy,vis,GLX_ACCUM_RED_SIZE,&value );
> printf("GLX_ACCUM_RED_SIZE=%d\n",value);
> glXGetConfig(dpy,vis,GLX_ACCUM_GREEN_SIZE,&value );
> printf("GLX_ACCUM_GREEN_SIZE=%d\n",value);
> glXGetConfig(dpy,vis,GLX_ACCUM_BLUE_SIZE,&value );
> printf("GLX_ACCUM_BLUE_SIZE=%d\n",value);
> glXGetConfig(dpy,vis,GLX_ACCUM_ALPHA_SIZE,&value );
> printf("GLX_ACCUM_ALPHA_SIZE=%d\n",value);
> glXGetConfig(dpy,vis,GLX_DEPTH_SIZE,&value );
> printf("GLX_DEPTH_SIZE=%d\n",value);
> }
> #else
> void DrawFunc(pfChannel *chan, void *data)
> {
> float multiplier,geom;
> static int first = TRUE;
> if (first) {
> acsize( 12 );
> gconfig();
> acbuf( AC_CLEAR, 0.0f );
> first = FALSE;
> }
> clear();
> pfDraw();
> /* post-draw */
> multiplier = 0.8f;
> acbuf( AC_MULT, multiplier );
> acbuf( AC_ACCUMULATE, 1.0f );
> geom = geom*multiplier + 1.0f;
> acbuf(AC_RETURN, 1.0f/geom);
> acbuf(AC_RETURN, 1.0f);
> }
> #endif
>
> --
--
__ | Ran Yakir
/_) _ __ \ / _ / o __ | RT-SET Ltd.
/ )_ (_(_) ) \/ (_(_/<_(_)( |
_/ |
-------------------------------------+--------------------------------
Phone : | E-mail : rany++at++rtset.co.il
Work : 972-9-9552236 | rany++at++netvision.net.il
Res. : 972-9-7489974 |
Fax : 972-9-9552239 |
=======================================================================
List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/
Submissions: info-performer++at++sgi.com
Admin. requests: info-performer-request++at++sgi.com
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:54:09 PDT