2
0

terrRender.h 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. //-----------------------------------------------------------------------------
  2. // Copyright (c) 2012 GarageGames, LLC
  3. //
  4. // Permission is hereby granted, free of charge, to any person obtaining a copy
  5. // of this software and associated documentation files (the "Software"), to
  6. // deal in the Software without restriction, including without limitation the
  7. // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  8. // sell copies of the Software, and to permit persons to whom the Software is
  9. // furnished to do so, subject to the following conditions:
  10. //
  11. // The above copyright notice and this permission notice shall be included in
  12. // all copies or substantial portions of the Software.
  13. //
  14. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  19. // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  20. // IN THE SOFTWARE.
  21. //-----------------------------------------------------------------------------
  22. //~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
  23. // Arcane-FX for MIT Licensed Open Source version of Torque 3D from GarageGames
  24. // Copyright (C) 2015 Faust Logic, Inc.
  25. //
  26. // The terrain implementation of zodiacs is largely contained in
  27. // afxZodiac.[h,cpp], however, some changes are required to the terrain
  28. // code. Structures EmitChunk and SquareStackNode now contain an
  29. // afxZodiacBitmask for keeping track of zodiac intersections.
  30. //~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
  31. #ifndef _TERRRENDER_H_
  32. #define _TERRRENDER_H_
  33. #ifndef _TERRDATA_H_
  34. #include "terrain/terrData.h"
  35. #endif
  36. #include "afx/ce/afxZodiacDefs.h"
  37. enum TerrConstants : U32
  38. {
  39. MaxClipPlanes = 8, ///< left, right, top, bottom - don't need far tho...
  40. //MaxTerrainMaterials = 256,
  41. MaxTerrainLights = 64,
  42. MaxVisibleLights = 31,
  43. ClipPlaneMask = (1 << MaxClipPlanes) - 1,
  44. FarSphereMask = 0x80000000,
  45. FogPlaneBoxMask = 0x40000000,
  46. };
  47. class SceneRenderState;
  48. // Allows a lighting system to plug into terrain rendering
  49. class TerrainLightingPlugin
  50. {
  51. public:
  52. virtual ~TerrainLightingPlugin() {}
  53. virtual void setupLightStage(LightManager * lm, LightInfo* light, SceneData& sgData, BaseMatInstance* basemat, BaseMatInstance** dmat) = 0;
  54. virtual void cleanupLights(LightManager * lm) {}
  55. };
  56. /// A special texture profile used for the terrain layer id map.
  57. GFX_DeclareTextureProfile( TerrainLayerTexProfile );
  58. #endif // _TERRRENDER_H_