zbuffer() & zwritemask in Performer

New Message Reply Date view Thread view Subject view Author view

Jorge Valencia Loera (valencia_jorge++at++hotmail.com)
Tue, 20 Jul 1999 16:01:33 EDT


Hi pf's,

my configuration:

Onyx
12 x R4440 CPUs
2 x RE2 w/ MCO on each pipe
IRIX 6.5.3
PF 2.2.4
I use multiple processes, multiple channels, multiple pipes & I link my app
using Iris GL.

Does anybody know about performer functions (Libpr routines I guess) that
can do the same work as the GL functions zbuffer() & zwritemask() ???

I am working on a space simulation and I am trying to draw a background
first (the sun, moon & earth) without writing into the depth buffer (to
avoid problems w/ the shadow map when casting shadows) & on top of that draw
a foreground (the space station)

my scene graph is something like this:
(use a regular font to see the scene graph)

      SCENE
       / \
      / \
     BG FG
     /\ \
    / |\ \
   / | \ \
  / | \ \
STARS SUN MOON SPACE
                STATION

The "background - foreground" effect is working fine but when I try to cast
shadows I have some color corruption (there is some transparency appearing
on the space station so that I can see my background through some objects)
and the shadows are completely wrong!!! (I only see some sort of big
randomized shadow on the screen)

I guess it's because my background is still blowing up my depth buffer. If I
remove the BG sub-tree from my scene graph then everything works fine.

I use the following node callbacks for my BG node:

// This function is called during traversal just before drawing a
// celestial body node. Its purpose is to disable the writing to
// the Z buffer.
int
BGPreDrawCB(pfTraverser *_trav, void *_data)
{
  zbuffer( FALSE );
  zwritemask( 0 );

  return PFTRAV_CONT;
}

// This function is called during traversal just after drawing a
// celestial body node. Its purpose is to enable the writing to
// the Z buffer.
int
BGPostDrawCB(pfTraverser *_trav, void *_data)
{
  zbuffer( TRUE );
  zwritemask( 0xFFFFFFFF );

  return PFTRAV_CONT;
}

I think that the internal libpr record concerning the graphics state is not
updated due to the fact that I set the graphics state directly through the
GL so may be libpr is making incorrect assumptions about the current
graphics state.

or am I doing something wrong?
Is there a better way to do what I want to do?
Does anybody know about something related to my problem

Any help, comment,... will be really appreciated.
Thank you.

Jorge.

______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Tue Jul 20 1999 - 13:01:44 PDT

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