Drew Hess (dhess++at++vision.arc.nasa.gov)
Wed, 8 Jun 1994 21:47:40 -0700
In case you're actually following along, here's the basic problem: if I render
a scene with pfFog turned on, and then take a snapshot of the scene using the
Performer pfuSaveImage() function, the snapshot as displayed by imgview(1) is
visibly different than the scene rendered by Performer. The difference is that
the far fog plane, that is the distance at which all pixels fade to fog color,
appears to be missing in the snapshot, and the effect is that you have a much
greater visible range in the snapshot than you do in the rendered Performer
scene.
Here's what I've established so far:
a) this problem occurs when running Performer in full-screen GL mode on an
Indigo2 with an XL framebuffer as well as on an Onyx with an RE2.
b) this problem does *not* occur when a GUI panel is being displayed; that is,
both Performer and the snapshot show the GUI, but the scene looks *exactly* the
same in Performer as it does when I use imgview(1) to view the snapshot.
c) if I create a smaller window, using the -W x,y parameter to perfly, for
instance, the snapshot fades to the far fog plane properly, so visible range is
the same in both images; but strangely, the fog color in the snapshot is always
white (1.0, 1.0, 1.0) despite the fact that the fog color in the Performer
scene is, say, grey (0.7, 0.7, 0.7). I don't think this is a gamma correction
effect because when I set the fog color in the Performer scene to pure white,
the fog colors are identical (both pure white).
d) if I create a less-than-fullscreen GLX window (-x in perfly), the snapshot
is exactly the same as the Performer scene (except that I need to tweak the
window sizes that get passed to lrectread() in pfuSaveImage a bit because it
captures part of the window manager border around the GLX window -- note this
does not occur in a small window where I don't specify the -x option to
perfly). (I also get the overlay plane in my snapshot in this case, evident by
the "IRIS Performer" label in the upper right-hand corner of the snapshot.)
Anyway, originally I figured that the RE^2 was doing some funky buffering to
generate hardware fog that caused readsource(SRC_FRONT) to miss part of the fog
layers; now I know that it's not just the RE^2 since the XL produces a similar
(though not identical) effect. Still it would be nice if some kind soul at SGI
who's bothered to read this far could explain how the RE^2 produces fog :)
The pfuSaveImage routine produces a 24-bit RGB image and basically strips off
anything but the first 24bits of the pixel, as far as I can tell; but I don't
think it's a pixel-depth problem because I'm getting bad results on the XL,
which is purely 24-bit, as well as on the variable-depth RE^2. I don't know
what mode Performer operates in on such a beast.
I've also noticed that playing with the pfESkyMode settings has an effect on
the way fog is rendered; I might look into this next if no one has a simple
answer for me.
Sorry I'm so long-winded, but it's a very curious problem and I thought I
should accurately document what I'm talking about. The bottom line is that I
want to make snapshots of foggy scenes in any mode I want on any machine (ok,
I'll settle for full-screen GL-mode snapshots on the RE^2 only at this point :)
) for image processing, and I want the snapshot to look identical to the
rendered scene in Performer. What am I doing wrong?
Thanks again to the Performer people,
-dwh-
dhess++at++vision.arc.nasa.gov
dhess++at++cs.stanford.edu
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:50:20 PDT