Jeremy Friesner (jaf++at++chem.ucsd.edu)
Tue, 11 Mar 1997 18:17:10 -0800 (PST)
In my app I'm using pfFog to try to reduce scenery pop-up. What I
want is for the fog's onset to be 95% of the distance to the far
clipping plane, and for the fog to be opaque at 99% of the distance.
This works great on our RE2, but on our Maximum Impact Indigo2, the fog does
not appear correctly. Depending on the values I give to pfFog::setRange(),
I can get no fog, all fog (no scenery), or a very light fog, but never the
effect I want. Here's a code snippet:
... (in the draw process)
pfOverride(PFSTATE_FOG | PFSTATE_ENFOG, PF_OFF);
fog->setFogType(PFFOG_PIX_LIN);
fog->setColor(0.0, 0.0, 0.6); // blue fog, to make it more apparent
float farclip=300.; // setNearFar(300./500., 300.) was done in the app process earlier
fog->setRange(farclip*0.95, farclip*0.99); // no fog visible
//fog->setRange(farclip*0.50, farclip*0.90); // STILL no fog visible
//fog->setRange(farclip*0.50, farclip*0.50); // all fog, no scenery visible(!!)
//fog->setRange(farclip*0.50, farclip*1.00); // no fog visible(!!)
fog->apply();
pfEnable(PFEN_FOG);
pfOverride(PFSTATE_FOG | PFSTATE_ENFOG, PF_ON);
...
This is with a far-clip-plane-distance/near-clip-plane-distance ratio
of 500:1. If I lower the ratio to 10:1, then the fog starts to appear
correctly, but of course then nearby objects disappear.
Surely there must be something wrong here? Doing a pfWindow::QUERY(PFQWIN_DEPTH_BITS)
says that my pfWindow has a 24-bit z-buffer (vs. 32-bits on the RE2). Should this
be making such a vast difference?
I'll be very grateful for any hints! This is under Irix6.2, Performer2.02, btw.
-Jeremy
=======================================================================
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:53 PDT