Clouds?...Sounds easy enough.

New Message Reply Date view Thread view Subject view Author view

Darin C. Partridge (darin++at++paradox.idec.sdl.usu.edu)
Wed, 8 Jun 1994 14:02:48 -0600


I'm a beginner with performer, however, I've imported several satellite
terrain data sets. I usually hack on the Wavefront loader and perfly
to accomplish this. It's worked good so far but now I would like
to have clouds over the terrain. Since clouds are not included in
the environment menu used in perfly I tried to add it. I realize I
could be out to lunch since I still haven't got my man pages installed
correctly, but here is the perfly module I modified:

perfly/gui.c:

static pfuGUIString ESky_strs[] = {"Sky/Clear","Overcast","Sky/Grnd","Sky",
"Clear","PFES_SKY","Tag"};
static long ESky_vals[] = {
PFES_SKY_CLEAR,PFES_OVERCAST,PFES_SKY_GRND,PFES_SKY,
                           PFES_FAST, PFES_SKY, PFES_TAG};

common/env.c:

void
updateEnvironment(void)
{
    pfEarthSky *es = ViewState->eSky;
    static long eSkyMode = -1;
    static long fogType = -1;
    static float fogNear = 0.0f, fogFar = 0.0f;

    if ((eSkyMode == ViewState->earthSkyMode) &&
        (fogType == ViewState->fog) &&
        (fogNear == ViewState->nearFogRange) &&
        (fogFar == ViewState->farFogRange))
        return;

    if (ViewState->fog != PFFOG_OFF)
    {
        pfFogType(fog, ViewState->fog);
        pfFogRange(fog, ViewState->nearFogRange, ViewState->farFogRange);
        pfESkyFog(es, PFES_GENERAL, fog);
    }
    else
        pfESkyFog(es, PFES_GENERAL, NULL);

    if( ViewState->earthSkyMode == PFES_OVERCAST )
    {
      pfESkyMode(es, PFES_CLOUDS, ViewState->earthSkyMode);
      pfESkyAttr(es, PFES_CLOUD_TOP, 30.0f );
      pfESkyAttr(es, PFES_CLOUD_BOT, 20.0f );
      pfESkyColor(es, PFES_CLOUD_TOP, 0.1f, 0.1f, 0.2f, 1.0f);
      pfESkyColor(es, PFES_CLOUD_BOT, 0.2f, 0.2f, 0.1f, 1.0f);
    }
    else
      pfESkyMode(es, PFES_BUFFER_CLEAR, ViewState->earthSkyMode);

    /* update static values */
    fogType = ViewState->fog;
    fogFar = ViewState->farFogRange;
    eSkyMode = ViewState->earthSkyMode;
}

Thanks for any help,
Darin
(darin++at++paradox.idec.sdl.usu.edu)


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:50:19 PDT

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