From: Brian Furtaw (brian++at++sgi.com)
Date: 12/18/2001 06:31:04
Yves,
Apply() is more of rendering command then a scenegraph command. You can
add your fog object to an instance of pfEarthSky which gets attached to
your channel.This will apply the fog for you to the entire scene every
frame. But what you have done, I assume you are doing this in some sort
of draw callback, should work just fine.You have to call apply() every
frame in the draw callback in order to fog your scene. So their is no
UnApply or Apply(NULL) because if you don't call apply() you won't get
fog. Try that and see if it works. As far as deleteing the pfFog object
I am not sure why you can't. Did you attach it to anything? Or are you
simply keeping a global pointer to it in the draw callback so you can
call apply() every frame. If you have a pfEarthSky you might want to use
the getFog(int which=PFES_GENERAL) method to see if a pfFog object is
attached.
Brian
Yves Strube wrote:
> Hi all,
>
> How can I 'unapply' a light model or a fog object? I use pfFog::apply()
> to apply a fog object m_pFog to the whole scene like this:
>
> // Override off so that changes are accepted
> pfOverride(PFSTATE_FOG | PFSTATE_ENFOG, PF_OFF);
>
> // Change fog properties
> pfEnable(PFEN_FOG);
> m_pFog->apply();
>
> // Override on to apply changes
> pfOverride(PFSTATE_FOG | PFSTATE_ENFOG, PF_ON);
>
> Now I would like to delete the fog object but calling
> pfDelete(m_pFog) does not succeed since the fog object m_pFog is still
> referenced by someone (reference count 1).
>
> So how do I get the reference count to zero? There is no
> pfFog::unapply(). I also thought that calling pfApplyFog(NULL) might
> help but this function seems not to be available when using the C++ fog
> API?
>
> Thanks for any answers,
> Yves
>
>
--
----oOOo---- ----oOOo---- ----oOOo---- ----oOOo----
Brian Furtaw (brian++at++sgi.com) Mailstop: DSE-2612
Graphics Guru Office:(301)572-3293 Fax: (253)323-8182
12200-G Plum Orchard Drive OpenGL/Performer/OpenInventor/ImageVision
Silver Spring, Maryland 20904 Volumizer/Optimizer/React/PCI Device Drivers
This archive was generated by hypermail 2b29 : Tue Dec 18 2001 - 06:35:27 PST