Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

76 lines
2.2 KiB

  1. //===== Copyright � 1996-2007, Valve Corporation, All rights reserved. ======//
  2. //
  3. // Purpose:
  4. //
  5. // $Revision: $
  6. // $NoKeywords: $
  7. //
  8. // Fast path model rendering
  9. //
  10. //===========================================================================//
  11. #ifndef MODELRENDERSYSTEM_H
  12. #define MODELRENDERSYSTEM_H
  13. #ifdef _WIN32
  14. #pragma once
  15. #endif
  16. #include "clientleafsystem.h"
  17. //-----------------------------------------------------------------------------
  18. // Forward declarations
  19. //-----------------------------------------------------------------------------
  20. struct ModelRenderSystemData_t
  21. {
  22. IClientRenderable *m_pRenderable;
  23. IClientModelRenderable *m_pModelRenderable;
  24. RenderableInstance_t m_InstanceData;
  25. };
  26. struct TranslucentInstanceRenderData_t
  27. {
  28. StudioModelArrayInfo_t *m_pModelInfo;
  29. StudioArrayInstanceData_t *m_pInstanceData;
  30. };
  31. struct TranslucentTempData_t
  32. {
  33. int m_nColorMeshHandleCount;
  34. DataCacheHandle_t *m_pColorMeshHandles;
  35. bool m_bReleaseRenderData;
  36. };
  37. enum ModelRenderMode_t
  38. {
  39. MODEL_RENDER_MODE_NORMAL,
  40. MODEL_RENDER_MODE_SHADOW_DEPTH,
  41. MODEL_RENDER_MODE_RTT_SHADOWS,
  42. MODEL_RENDER_MODE_SSAO
  43. };
  44. //-----------------------------------------------------------------------------
  45. // The client leaf system
  46. //-----------------------------------------------------------------------------
  47. abstract_class IModelRenderSystem
  48. {
  49. public:
  50. virtual void DrawModels( ModelRenderSystemData_t *pModels, int nCount, ModelRenderMode_t renderMode, bool bShadowDepthIncludeTranslucentMaterials = false ) = 0;
  51. virtual void DrawBrushModels( ModelRenderSystemData_t *pModels, int nCount, ModelRenderMode_t renderMode ) = 0;
  52. virtual void ComputeTranslucentRenderData( ModelRenderSystemData_t *pModels, int nCount, TranslucentInstanceRenderData_t *pRenderData, TranslucentTempData_t *pTempData ) = 0;
  53. virtual void CleanupTranslucentTempData( TranslucentTempData_t *pTempData ) = 0;
  54. virtual IMaterial *GetFastPathColorMaterial() = 0;
  55. };
  56. //-----------------------------------------------------------------------------
  57. // Singleton accessor
  58. //-----------------------------------------------------------------------------
  59. extern IModelRenderSystem *g_pModelRenderSystem;
  60. #endif // MODELRENDERSYSTEM_H