From guest  Fri Jun 17 06:09:05 1994
From: "Marc SIMON Presales support" <smarc@girl.paris.sgi.com>
Message-Id: <9406171514.ZM20930@girl.paris.sgi.com>
Date: Fri, 17 Jun 1994 15:14:06 -0600
X-Mailer: Z-Mail (3.1.0 22feb94 MediaMail)
To: info-performer@sgi.sgi.com
Subject: Fog on RE
Cc: mtj@giraffe
Content-Type: text/plain; charset=us-ascii
Mime-Version: 1.0
Status: OR

Testing some customers codes using fog with perforemr 1.2 seems to show a
problem with the resolution of the fog table on the RE2.

When using FG_PIX_LIN or FG_PIX_EXP or FG_PIX_EXP2 with a far fog of 1000
m for instance and when drawing an object at 1100 m it is still visible.
I known that it is of course related to the range of Z value defining by
the near and far clipping plane and the lsetdepth value.But it works fine
on a Indigo2 Extreme...

You can try :

	- perfly enterprise.flt
		The model appear at ~ 2600 m from the viewer
	- fog on (Exponential or linear)
	- move the far fog to 2500 m .

	- You could see that the Mister Spoke ears are always visible...

Try to do the same on Extreme GFX ... It works fine.

Thanks to explain to me what's happend . Is it a bug ?? Is there a way to
avoid this ??

My customer is today waiting for an answer to decide to continue or to
stop with Performer .

Thanks to help me quickly.



-- 
-- Marc --		   Marc SIMON Presales support
			   ===========================
     
    ---------    //////  //     //    //////    ///////    ///////   -----------
               //       // /  / //  //     //  /      /  //               
  ---------    /////   //   /  //  /////////  ///////   //         -----------    
                  //  //      //  //     //  ///       //                 
---------   ///////  //      //  //     //  /  ///     ///////   ---------- 

	Silicon Graphics France
	21 Rue Albert Calmette
	Jouy-en-Josas 78350 FRANCE
	Tel (33) 1 34-88-80-00
	email : smarc@paris.sgi.com

++++++++++++++++++++++++++++  smarc@paris.sgi.com  ****************************






From guest  Fri Jun 17 08:12:56 1994
From: "Michael Jones" <mtj@babar>
Message-Id: <9406170812.ZM3996@babar.asd.sgi.com>
Date: Fri, 17 Jun 1994 08:12:48 -0700
In-Reply-To: "Marc SIMON Presales support" <smarc@girl.paris.sgi.com>
        "Fog on RE" (Jun 17,  3:14pm)
References: <9406171514.ZM20930@girl.paris.sgi.com>
X-Mailer: Z-Mail (3.1.0 22feb94 MediaMail)
To: "Marc SIMON Presales support" <smarc@girl.paris.sgi.com>,
        info-performer@sgi.sgi.com
Subject: Re: Fog on RE
Cc: mtj@giraffe
Content-Type: text/plain; charset=us-ascii
Mime-Version: 1.0
Status: OR

On Jun 17,  3:14pm, Marc SIMON Presales support wrote:
> Subject: Fog on RE

:Testing some customers codes using fog with perforemr 1.2 seems to show a
:problem with the resolution of the fog table on the RE2.
  :
:Thanks to explain to me what's happend . Is it a bug ?? Is there a way to
:avoid this ??

We'll check into this.

:My customer is today waiting for an answer to decide to continue or to
:stop with Performer .

If your customer thinks the problem is in the RE2, then why would
they think that not using Performer (while still using the RE) could
make the situation better?

Several fog-related questions have come up lately. Perhaps we need
to expand the Programming Guide's section on pfFog control and
operation in the next release of the manual.

-- 

Be seeing you,      Phone:415.390.1455  Fax:415.390.2658 M/S:9U-590
Michael T. Jones    Silicon Graphics, Advanced Graphics Division
mtj@sgi.com         2011 N. Shoreline Blvd., Mtn. View, CA 94039-7311






From guest  Wed Mar 30 08:05:38 1994
From: "pierre VERCRUYSSE" <pierre@cathy.rennes.sgi.com>
Message-Id: <9403301606.ZM9943@cathy.rennes.sgi.com>
Date: Wed, 30 Mar 1994 16:06:22 +0100
X-Mailer: Z-Mail (3.1.0 22feb94 MediaMail)
To: info-performer@sgi.sgi.com
Subject: fog problem on RE2
Content-Type: text/plain; charset=us-ascii
Mime-Version: 1.0
Status: OR

I, can some body can help?

I'm in Performer 1.2a151preMR IRIX 5.2 MR on an Onyx RE2. And when i initialize
a fog with

   EarthSky = pfNewESky();       /* creation du modele horizon/meteo */
   pfChanESky(Channel,EarthSky); /* attachement au modele horizon/meteo */
   Fog = pfNewFog(NULL);         /* creation du modele brume */
   pfFogType(Fog,PFFOG_VTX_EXP2);/* attenuation de type expo**2 sur sommets */
   /* attachement du modele brouillard au modele horizon/meteo */
   pfESkyFog(EarthSky,PFES_GENERAL,Fog);
   Soleil = pfNewLight(NULL);    /* on cree, positionne une nouvelle source */
   pfApplyLModel(SoleilModel = pfNewLModel(NULL));

My fog are very cloud, i don't see the scene.

In advance thanks for your help,

pierre@rennes.sgi.com







From guest  Wed Jun  8 13:18:20 1994
From: "Drew Hess" <dhess@vision.arc.nasa.gov>
Message-Id: <9406081318.ZM7401@airy.arc.nasa.gov>
Date: Wed, 8 Jun 1994 13:18:15 -0700
X-Mailer: Z-Mail (3.1.0 22feb94 MediaMail)
To: info-performer@sgi.sgi.com
Subject: pfFog again
Content-Type: text/plain; charset=us-ascii
Mime-Version: 1.0
Status: OR

When I enable fog in perfly and then take a screen snapshot using the
pfuSaveImage function, with readsource() set to SRC_FRONT, the captured image
has a much different fog density than the on-screen image.  How is fog
implemented on the RE2, and what is the proper way to get the same image in a
snapshot that I see on the screen?  Do I need to readsource() and lrectread()
from multiple buffers and somehow blend the images?

Thanks

-dwh-
dhess@vision.arc.nasa.gov
dhess@cs.stanford.edu



From guest  Mon Jun  6 15:44:54 1994
From: "Drew Hess" <dhess@vision.arc.nasa.gov>
Message-Id: <9406061346.ZM4341@airy.arc.nasa.gov>
Date: Mon, 6 Jun 1994 13:46:20 -0700
X-Mailer: Z-Mail (3.1.0 22feb94 MediaMail)
To: info-performer@sgi.sgi.com
Subject: pfFog and fog density
Content-Type: text/plain; charset=us-ascii
Mime-Version: 1.0
Status: OR

I need to explicitly set the fog density parameter of Performer fog.  As far as
I can tell the only way to do this is with PFFOG_PIX_SPLINE, but what I'd
actually like to do is use PFFOG_PIX_EXP or PFFOG_VTX_EXP.

Basically I need the extra parameter that fogvertex(3G) uses for density, but
in looking at the Performer documentation it's not clear how to do this without
going to the GL, which I'd like to avoid if possible.

It appears that the only controls over fog, besides with the SPLINE type, are
color and the near and far fog planes.  Am I missing something obvious?  How
does Performer calculate the density parameter for fog by default?

Thanks

-dwh-
dhess@vision.arc.nasa.gov



From guest  Mon Jun  6 16:20:58 1994
From: "Michael Jones" <mtj@babar>
Message-Id: <9406061620.ZM4967@babar.asd.sgi.com>
Date: Mon, 6 Jun 1994 16:20:46 -0700
In-Reply-To: "Drew Hess" <dhess@vision.arc.nasa.gov>
        "pfFog and fog density" (Jun  6,  1:46pm)
References: <9406061346.ZM4341@airy.arc.nasa.gov>
X-Mailer: Z-Mail (3.1.0 22feb94 MediaMail)
To: "Drew Hess" <dhess@vision.arc.nasa.gov>, info-performer@sgi.sgi.com
Subject: Re: pfFog and fog density
Content-Type: text/plain; charset=us-ascii
Mime-Version: 1.0
Status: O

On Jun 6,  1:46pm, Drew Hess wrote:
> Subject: pfFog and fog density

:I need to explicitly set the fog density parameter of Performer fog.  As far
as
:I can tell the only way to do this is with PFFOG_PIX_SPLINE, but what I'd
:actually like to do is use PFFOG_PIX_EXP or PFFOG_VTX_EXP.

No problem. To quote from the new IRIS Performer 1.2 Programming Guide:

"You can set the near and far edges of the fog with pfFogRange(). For
exponential fog functions, the near edge of fog is always zero in eye
coordinates. The near edge is where the onset of fog blending occurs,
and the far edge is where all pixels are 100% fog color."

:Basically I need the extra parameter that fogvertex(3G) uses for density, but
:in looking at the Performer documentation it's not clear how to do this
without
:going to the GL, which I'd like to avoid if possible.

The opaque distance is (in a sense) equivalent to the density. Since fog
density
is a function of distance, it's possible to define fog as a (density, distance)
pair. It was decided to use an implied density=1 in the IRIS Performer API
such that "at the opaque fog range, the fog density is 1.0". Given this, only
the distance need be specified.

If f = 1 - e**(-k*d), and you want to specify the general (f,d) pair, just
solve for the appropriate f=1 case and use the new d' in your IRIS Performer
calls. The only problem here is that you can't really solve for f=1 above
and need to accept 255/256th's or so.

:It appears that the only controls over fog, besides with the SPLINE type, are
:color and the near and far fog planes.  Am I missing something obvious?  How
:does Performer calculate the density parameter for fog by default?

The opaque and opaqueOffest parameters are used to define the density
in the fogvertex() command as shown in this code extract (from IRIS
Performer's fog application code):

    switch (fog->type)
    {
    case PFFOG_VTX_LIN:
    case PFFOG_PIX_LIN:
        props[0] = fog->onset  + fog->onsetOffset;
        props[1] = fog->opaque + fog->opaqueOffset;
        if (props[1] < props[0])
            props[1] = props[0];
        props[2] = fog->color[0];
        props[3] = fog->color[1];
        props[4] = fog->color[2];
        break;

    case PFFOG_VTX_EXP:
    case PFFOG_PIX_EXP:
    case PFFOG_VTX_EXP2:
    case PFFOG_PIX_EXP2:
        props[0] = 1.0f/(fog->opaque + fog->opaqueOffset);
        props[1] = fog->color[0];
        props[2] = fog->color[1];
        props[3] = fog->color[2];
        break;

-- 

Be seeing you,      Phone:415.390.1455  Fax:415.390.2658 M/S:9U-590
Michael T. Jones    Silicon Graphics, Advanced Graphics Division
mtj@sgi.com         2011 N. Shoreline Blvd., Mtn. View, CA 94039-7311






From guest  Wed Jun  8 21:47:57 1994
From: "Drew Hess" <dhess@vision.arc.nasa.gov>
Message-Id: <9406082147.ZM8523@airy.arc.nasa.gov>
Date: Wed, 8 Jun 1994 21:47:40 -0700
X-Mailer: Z-Mail (3.1.0 22feb94 MediaMail)
To: info-performer@sgi.sgi.com
Subject: more pfFog fun
Content-Type: text/plain; charset=us-ascii
Mime-Version: 1.0
Status: OR

I've done some playing around since I posted my last message stating that I was
having problems with scenes with fog not looking the same as snapshots of those
scenes taken using pfuSaveImage().

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@vision.arc.nasa.gov
dhess@cs.stanford.edu



From guest  Tue May 10 08:44:10 1994
From: "pierre VERCRUYSSE" <pierre@cathy.rennes.sgi.com>
Message-Id: <9405101645.ZM594@cathy.rennes.sgi.com>
Date: Tue, 10 May 1994 16:45:05 -0600
X-Mailer: Z-Mail (3.1.0 22feb94 MediaMail)
To: info-performer@sgi.sgi.com
Subject: (Fwd) Fog implementation
Content-Type: text/plain; charset=us-ascii
Mime-Version: 1.0
Status: OR

Hi

I have a customer who have some difficulties to implement the Fog.

I have an Onyx RE2 with 2 RM in Irix 5.2 and performer 1.2.

He have watch the difference with the his application and perfly and he has
conclude this summary and a lot of question ?

type of fog		Near		far		status

VtxLin,PixLin or	[1.0,1000.0]	1000.0		no problem, it'ok
spline			if > 1000.0	8000.0		Problem why ??

VtxExp/VtxExp2		no variation of the fog when we change the near
PixExp/PixExp2

1. We don't seen what kind of value we can put on near ? and what is the
minimum distance that i can define for the value "NEAR" of the interval for the
fog ?

2. How can i optimise the drawing of the image by manipulating the clipping
plan "Far"    pfFogRange(fog,1.0f,distance of visibility);
	 pfChanNearFar(channel,1.0f,distance of visibility+alpha);

3. Thus he exist a relation between the distance of visibility, the dynnamic in
z of the system and the dynamic about the BDD (step of discretisation) ?

My customer goes to the preparation of the ITEC and he told me that during the
preparation about the demo of the shared database, He hav'nt seen a demo of
performer with fog. Is it true or not ?

In advance Thanks for your answerd .

pierre@rennes.sgi.com





From guest  Tue May 10 09:10:32 1994
From: marrou@vsl.ist.ucf.edu (Lance Marrou)
Message-Id: <9405101610.AA01612@sg1.vsl.ist.ucf.edu>
To: "pierre VERCRUYSSE" <pierre@cathy.rennes.sgi.com>,
        info-performer@sgi.sgi.com
Subject: Re:  (Fwd) Fog implementation
Status: OR

I have also had trouble implementing spline fog on RE and RE2 systems,
but I had not figured it was worth a lot of trouble (therefore I did not
spend a bunch of time with it).  I stuck with the regular pix mode on
fog and it works fine enough for some neat effects (quick & cheap).
We had it running on our demos at I/ITSEC last year.

Of course, fog will become a cheap rendition of any fog/cloud simulations
currently being developed, but it is a cool source of visual effects;
thanks, SGI! :)
_______________________________________________________
IST         __           E-mail: marrou@vsl.ist.ucf.edu
Visual     / /   ______  /\____ ______ ______          
Systems   / /   / _   / / __  // ____// ____/          
Lab      / /__ / /_/ / / / / // /___ / __/_   R. Marrou
________/____//____/\\/_/ /_//_____//_____/____________



From guest  Fri May 20 09:35:46 1994
From: jrohlf@tubes (John Rohlf)
Message-Id: <9405201542.AA01190@tubes.asd.sgi.com>
Subject: Re: (Fwd) Fog implementation
To: guest (pierre VERCRUYSSE)
Date: Fri, 20 May 94 8:42:41 PDT
Cc: info-performer@sgi.sgi.com
In-Reply-To: <9405101645.ZM594@cathy.rennes.sgi.com>; from "pierre VERCRUYSSE" at May 10, 94 4:45 pm
X-Mailer: ELM [version 2.3 PL8]
Status: OR

> 
> He have watch the difference with the his application and perfly and he has
> conclude this summary and a lot of question ?
> 
> type of fog		Near		far		status
> 
> VtxLin,PixLin or	[1.0,1000.0]	1000.0		no problem, it'ok
> spline			if > 1000.0	8000.0		Problem why ??
> 
> VtxExp/VtxExp2		no variation of the fog when we change the near
> PixExp/PixExp2
> 
> 1. We don't seen what kind of value we can put on near ? and what is the
> minimum distance that i can define for the value "NEAR" of the interval for the
> fog ?

	Only linear and spline fog support a near fog distance.
I don't know why near > 1000 causes problems for spline fog.

> 
> 3. Thus he exist a relation between the distance of visibility, the dynnamic in
> z of the system and the dynamic about the BDD (step of discretisation) ?
> 
> My customer goes to the preparation of the ITEC and he told me that during the
> preparation about the demo of the shared database, He hav'nt seen a demo of
> performer with fog. Is it true or not ?

	perfly uses fog and has sliders for near/far distances and a 
menu button for fog type.  Try it. 





From guest  Thu Mar 10 03:38:21 1994
From: "Ran Yakir" <rany@bvr.co.il>
Message-Id: <9403101337.ZM10354@rea1.bvr.co.il>
Date: Thu, 10 Mar 1994 13:37:02 +0000
X-Mailer: Z-Mail (3.1b.0 09feb94 MediaMail)
To: info-performer@sgi.sgi.com
Subject: Fog
Content-Type: text/plain; charset=us-ascii
Mime-Version: 1.0
Status: OR

Hi All

I'm using spline fog on Performer 1.2, and have 2 questions

1. The spline fog doesn't work on every RealityEngine machine. Furthermore, on
our dual-headed ONYX, it works on the zeroth head but not on the other one. By
'doesn't work' I mean that you set the fog, but see no fog whatsoever.

2. Is it expensive to set the fog ranges and ramp each frame ? Is it better to
create several fogs and just switch between them when necesary ?

Here is the code fragement that generates the fog :


/*
 * init_fog() is called once at the beginning of time
 */
void init_fog (nrt_fog *fog)
{
	fog->is_fog = 0;

	fog->fog = pfNewFog (pfGetSharedArena());

	fog->fog_type = PFFOG_PIX_SPLINE;

	pfFogType (fog->fog, fog->fog_type);

	pfFogColor (fog->fog, 1.0, 1.0, 1.0);

	fog->onset_range = 20000.0;
	fog->opaque_range = 50000.0;
	pfFogRange (fog->fog, fog->onset_range, fog->opaque_range);

	pfGetFogRamp (fog->fog,
				&fog->nof_points,
				fog->ramp_range,
				fog->ramp_density,
				&fog->ramp_bias);
}


/*
 * update_env() is called each frame and updates the fog among other things
 */
void update_env (pfChannel *chan, nrt_environment *env)
{

	/*
	 * do other things
	 */
	....

	/*
	 * do fog
	 */
	pfFogType (env->fog.fog, env->fog.fog_type);

	pfFogRange (env->fog.fog, env->fog.onset_range, env->fog.opaque_range);

	pfFogRamp (env->fog.fog,
				env->fog.nof_points,
				env->fog.ramp_range,
				env->fog.ramp_density,
				env->fog.ramp_bias);

	if (env->fog.is_fog)
		pfESkyFog (esky, PFES_GENERAL, env->fog.fog);
	else
		pfESkyFog (esky, PFES_GENERAL, NULL);

	pfChanESky (chan, esky);

	/*
	 * do more other things
	 */
	....

}


Thanks

Ran Yakir


-- 
 __                                  | Ran Yakir
 /_)  _  __   \  / _   / o __        | Phone :
/ )_ (_(_) )   \/ (_(_/<_(_)(        |   Work : 972-3-5715671
              _/                     |   Res. : 972-3-6995364
                                     | E-mail : rany@bvr.co.il





From guest  Wed Jun 29 09:10:13 1994
From: "Ran Yakir" <rany@bvr.co.il>
Message-Id: <9406291909.ZM9676@amcor.bvr.co.il>
Date: Wed, 29 Jun 1994 19:09:07 +0000
X-Mailer: Z-Mail (3.1.0 22feb94 MediaMail)
To: info-performer@sgi.sgi.com
Subject: pfFog
Content-Type: text/plain; charset=us-ascii
Mime-Version: 1.0
Status: O

Hi

What is the reason for the exsitance of fog-offsets ? Is there any difference
(in performance or other) between setting fog-ranges or fog-offsets ?

Ran

-- 
 __                                  | Ran Yakir
 /_)  _  __   \  / _   / o __        | Graphics App. Chief Engineer
/ )_ (_(_) )   \/ (_(_/<_(_)(        | BVR Technologies Ltd.
              _/                     |   
-------------------------------------+--------------------------------
Phone :                              | E-mail : rany@bvr.co.il
  Work : 972-3-5715671               |
  Res. : 972-3-6995364               |
Fax    : 972-3-5715668               |






