Jean-Luc Dery (dery++at++discreet.com)
Fri, 20 Nov 1998 12:10:26 -0500
I reversed engineer using glGetFoat( GL_FOG_DENSITY, &density ) while setting
fog with pfFog. Here's what I've figured out.
PFFOG_VTX_EXP and PFFOG_PIX_EXP uses:
density = log( 1/512 ) / opaque_range;
PFFOG_VTX_EXP2 and PFFOG_PIX_EXP2 uses:
density = sqrt( log( 1/16384 ) ) / opaque_range;
I can understand the EXP types but not the EXP2 types.
We need to find the density for which saturation of color will appear for a
give opaque range. Starting with the premise that color are defined from 0 to
255 (2^8), color will become saturated at 245.5 -> (255-245.5)/256 = 1/512.
This makes sense to me.
As for EXP2, I don't really get it. It appears that in that case, colors are
defined from 0 to 8191 (2^13) and ,in which case, saturation occurs at 8190.5
-> (8191-8190.5)/8192 = 1/16384.
Anyway, those conversion function are working just fine for any given opaque
range in our system.
Jean-Luc
-- _____________________________________________________________________________Jean-Luc Dery Discreet Logic Technical Leader 10 Duke Street 3-D Graphics Technology and Montreal (Quebec), Canada, H3C 2L7 Realtime Systems Tel: (514) 954-7239 Email: jean-lucD++at++discreet.com Fax: (514) 393-0110 _____________________________________________________________________________
This archive was generated by hypermail 2.0b2 on Fri Nov 20 1998 - 09:11:14 PST