Fog with projected textures.

New Message Reply Date view Thread view Subject view Author view

Robert Webb (robertw++at++wormald.COM.AU)
Thu, 3 Aug 1995 12:42:59 +1000 (EST)


Hi guys,

It's me again, and I'm still trying to get my projected textures working
properly. Just one problem left! (I think).

I am doing two passes of pfDraw() in the one draw traversal callback. The
first pfDraw draws everything in a grey colour that represents the colour of
the ambient light, and resolves the zbuffer in preparation for the second
pass.

The second pass uses zfunction(ZF_EQUAL) to ensure that each pixel is
touched only once, and also uses this:
    blendfunction(BF_DC, BF_ZERO);
instead of the usual:
    blendfunction(BF_ONE, BF_ZERO);

This means instead of each pixel getting set to the SOURCE colour, it is set
to SOURCE*DEST, ie it is multiplied by the colour which is already there
(and represents the ambient lighting).

HOWEVER! It seems the SOURCE colour includes the colour adjustment caused
by the fog, even though I really want fog to be added later. This means
that the fog colour is also being multiplied by the DEST colour, hence
making my fog seem darker for the geometry which goes through this projected
texture process (lightpoints etc do not, and hence have the normal fog,
making them appear light grey while everything else is a darker grey, for
very thick fog).

HELP! Someone must have tackled this before. Someone must have used fog
with projected textures successfully. How is it done?

Many thanks,
Rob.

------------------------------------------------------------------------------
 _
|_) _ |_ _ ._ _|_ \ / _ |_ |_ robertw++at++wormald.com.au
| \(_)|_)(/_| |_ \/\/ (/_|_)|_)o

"Informer, you no say daddy me Snow me I'll go blame, a licky boom boom down"
                                                                - Snow.

------------------------------------------------------------------------------


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:51:45 PDT

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