postEffectCommon.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  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. #ifndef _POSTEFFECTCOMMON_H_
  23. #define _POSTEFFECTCOMMON_H_
  24. #ifndef _DYNAMIC_CONSOLETYPES_H_
  25. #include "console/dynamicTypes.h"
  26. #endif
  27. ///
  28. enum PFXRenderTime
  29. {
  30. /// Before a RenderInstManager bin.
  31. PFXBeforeBin,
  32. /// After a RenderInstManager bin.
  33. PFXAfterBin,
  34. /// After the diffuse rendering pass.
  35. PFXAfterDiffuse,
  36. /// When the end of the frame is reached.
  37. PFXEndOfFrame,
  38. /// This PostEffect is not processed by the manager.
  39. /// It will generate its texture when it is requested.
  40. PFXTexGenOnDemand
  41. };
  42. DefineEnumType( PFXRenderTime );
  43. /// PFXTargetClear specifies whether and how
  44. /// often a given PostEffect's target will be cleared.
  45. enum PFXTargetClear
  46. {
  47. /// Never clear the PostEffect target.
  48. PFXTargetClear_None,
  49. /// Clear once on create.
  50. PFXTargetClear_OnCreate,
  51. /// Clear before every draw.
  52. PFXTargetClear_OnDraw,
  53. };
  54. DefineEnumType( PFXTargetClear );
  55. /// PFXTargetViewport specifies how the viewport should be
  56. /// set up for a PostEffect's target.
  57. enum PFXTargetViewport
  58. {
  59. /// The default viewport set up to match the target size
  60. PFXTargetViewport_TargetSize,
  61. /// Use the current GFX viewport
  62. PFXTargetViewport_GFXViewport,
  63. /// Use the input texture 0 if it is named, otherwise
  64. /// revert to PFXTargetViewport_TargetSize if there is none
  65. PFXTargetViewport_NamedInTexture0,
  66. };
  67. DefineEnumType( PFXTargetViewport );
  68. ///
  69. struct PFXFrameState
  70. {
  71. MatrixF worldToCamera;
  72. MatrixF cameraToScreen;
  73. PFXFrameState()
  74. : worldToCamera( true ),
  75. cameraToScreen( true )
  76. {
  77. }
  78. };
  79. ///
  80. GFX_DeclareTextureProfile( PostFxTextureProfile );
  81. GFX_DeclareTextureProfile( PostFxTextureSRGBProfile );
  82. GFX_DeclareTextureProfile( VRTextureProfile );
  83. GFX_DeclareTextureProfile( VRDepthProfile );
  84. ///
  85. GFXDeclareVertexFormat( PFXVertex )
  86. {
  87. /// xyz position.
  88. Point3F point;
  89. /// The screen space texture coord.
  90. Point2F texCoord;
  91. ///
  92. Point3F wsEyeRay;
  93. };
  94. #endif // _POSTEFFECTCOMMON_H_