Fog.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /* Copyright (c) 2002-2012 Croteam Ltd.
  2. This program is free software; you can redistribute it and/or modify
  3. it under the terms of version 2 of the GNU General Public License as published by
  4. the Free Software Foundation
  5. This program is distributed in the hope that it will be useful,
  6. but WITHOUT ANY WARRANTY; without even the implied warranty of
  7. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  8. GNU General Public License for more details.
  9. You should have received a copy of the GNU General Public License along
  10. with this program; if not, write to the Free Software Foundation, Inc.,
  11. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */
  12. #ifndef SE_INCL_FOG_H
  13. #define SE_INCL_FOG_H
  14. #ifdef PRAGMA_ONCE
  15. #pragma once
  16. #endif
  17. #include <Engine/Math/Vector.h>
  18. enum AttenuationType {
  19. AT_LINEAR, // t*density
  20. AT_EXP, // 1-exp(-t*density)
  21. AT_EXP2, // 1-exp(-(t*density)^2)
  22. };
  23. enum FogGraduationType {
  24. FGT_CONSTANT, // constant density
  25. FGT_LINEAR, // h*graduation
  26. FGT_EXP, // 1-exp(-h*graduation)
  27. };
  28. class CFogParameters {
  29. public:
  30. FLOAT3D fp_vFogDir; // fog direction in absolute space
  31. FLOAT fp_fH0; // lowest point in LUT
  32. FLOAT fp_fH1; // bottom of fog in LUT
  33. FLOAT fp_fH2; // top of fog in LUT
  34. FLOAT fp_fH3; // highest point in LUT
  35. FLOAT fp_fFar; // farthest point in LUT
  36. INDEX fp_iSizeL; // LUT size in distance (must be pow2)
  37. INDEX fp_iSizeH; // LUT size in depth (must be pow2)
  38. COLOR fp_colColor; // fog color and alpha
  39. enum AttenuationType fp_atType; // type of attenuation
  40. FLOAT fp_fDensity; // attenuation parameter
  41. enum FogGraduationType fp_fgtType; // type of graduation
  42. FLOAT fp_fGraduation; // graduation parameter
  43. };
  44. #define HPF_VISIBLEFROMOUTSIDE (1UL<<0) // can be viewed from sectors that are not hazed
  45. class CHazeParameters {
  46. public:
  47. ULONG hp_ulFlags;
  48. FLOAT hp_fNear; // nearest point in LUT
  49. FLOAT hp_fFar; // farthest point in LUT
  50. INDEX hp_iSize; // LUT size in distance (must be pow2)
  51. COLOR hp_colColor; // fog color and alpha
  52. enum AttenuationType hp_atType; // type of attenuation
  53. FLOAT hp_fDensity; // attenuation parameter
  54. };
  55. #endif /* include-once check. */