--- ray/src/hd/rhd_glx.c 1997/12/26 21:56:43 3.8 +++ ray/src/hd/rhd_glx.c 1998/01/01 16:28:44 3.12 @@ -16,6 +16,10 @@ static char SCCSid[] = "$SunId$ SGI"; #include "x11icon.h" +#ifndef RAYQLEN +#define RAYQLEN 50000 /* max. rays to queue before flush */ +#endif + #ifndef FEQ #define FEQ(a,b) ((a)-(b) <= FTINY && (a)-(b) >= -FTINY) #endif @@ -100,6 +104,7 @@ char *id; XSizeHints oursizhints; /* set quadtree globals */ qtMinNodesiz = 3; + qtDepthEps = 0.07; /* open display server */ ourdisplay = XOpenDisplay(NULL); if (ourdisplay == NULL) @@ -162,9 +167,9 @@ char *id; XMapWindow(ourdisplay, gwind); dev_input(); /* sets size and view angles */ /* allocate our leaf pile */ - if (!qtAllocLeaves(2 * DisplayWidth(ourdisplay,ourscreen) * - DisplayHeight(ourdisplay,ourscreen) / - (qtMinNodesiz*qtMinNodesiz))) + if (!qtAllocLeaves(DisplayWidth(ourdisplay,ourscreen) * + DisplayHeight(ourdisplay,ourscreen) * 3 / + (qtMinNodesiz*qtMinNodesiz*2))) error(SYSTEM, "insufficient memory for value storage"); odev.name = id; odev.ifd = ConnectionNumber(ourdisplay); @@ -261,6 +266,7 @@ dev_flush() /* flush output */ { qtUpdate(); glFlush(); + rayqleft = RAYQLEN; return(XPending(ourdisplay)); } @@ -272,6 +278,9 @@ double rad; { register int ci, j; double apexh, basez; + /* is window mapped? */ + if (!mapped) + return; /* compute apex height (0. to 1.) */ if (ip[2] > 1e6) apexh = 1. - 1./DEPTHFACT; @@ -313,9 +322,9 @@ mytmflags() /* figure out tone mapping flags */ for (cp = tail; *cp && *cp != '.'; cp++) ; if (cp-tail == 3 && !strncmp(tail, "glx", 3)) - return(TM_F_CAMERA); + return(TM_F_CAMERA|TM_F_NOSTDERR); if (cp-tail == 4 && !strncmp(tail, "glxh", 4)) - return(TM_F_HUMAN); + return(TM_F_HUMAN|TM_F_NOSTDERR); error(USER, "illegal driver name"); }