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.

118 lines
3.2 KiB

  1. //===== Copyright � 1996-2005, Valve Corporation, All rights reserved. ======//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //
  7. //===========================================================================//
  8. #ifndef SHADERSHADOWDX10_H
  9. #define SHADERSHADOWDX10_H
  10. #ifdef _WIN32
  11. #pragma once
  12. #endif
  13. #include "shaderapi/ishaderapi.h"
  14. #include "shaderapi/ishadershadow.h"
  15. //-----------------------------------------------------------------------------
  16. // The empty shader shadow
  17. //-----------------------------------------------------------------------------
  18. class CShaderShadowDx10 : public IShaderShadow
  19. {
  20. public:
  21. CShaderShadowDx10();
  22. virtual ~CShaderShadowDx10();
  23. // Sets the default *shadow* state
  24. void SetDefaultState();
  25. // Methods related to depth buffering
  26. void DepthFunc( ShaderDepthFunc_t depthFunc );
  27. void EnableDepthWrites( bool bEnable );
  28. void EnableDepthTest( bool bEnable );
  29. void EnablePolyOffset( PolygonOffsetMode_t nOffsetMode );
  30. // Suppresses/activates color writing
  31. void EnableColorWrites( bool bEnable );
  32. void EnableAlphaWrites( bool bEnable );
  33. // Methods related to alpha blending
  34. void EnableBlending( bool bEnable );
  35. void EnableBlendingForceOpaque( bool bEnable );
  36. void BlendFunc( ShaderBlendFactor_t srcFactor, ShaderBlendFactor_t dstFactor );
  37. // Alpha testing
  38. void EnableAlphaTest( bool bEnable );
  39. void AlphaFunc( ShaderAlphaFunc_t alphaFunc, float alphaRef /* [0-1] */ );
  40. // Wireframe/filled polygons
  41. void PolyMode( ShaderPolyModeFace_t face, ShaderPolyMode_t polyMode );
  42. // Back face culling
  43. void EnableCulling( bool bEnable );
  44. // Indicates the vertex format for use with a vertex shader
  45. // The flags to pass in here come from the VertexFormatFlags_t enum
  46. // If pTexCoordDimensions is *not* specified, we assume all coordinates
  47. // are 2-dimensional
  48. void VertexShaderVertexFormat( unsigned int flags,
  49. int numTexCoords, int* pTexCoordDimensions,
  50. int userDataSize );
  51. // Per texture unit stuff
  52. void EnableTexture( Sampler_t stage, bool bEnable );
  53. void EnableVertexTexture( VertexTextureSampler_t stage, bool bEnable );
  54. // Separate alpha blending
  55. void EnableBlendingSeparateAlpha( bool bEnable );
  56. void BlendFuncSeparateAlpha( ShaderBlendFactor_t srcFactor, ShaderBlendFactor_t dstFactor );
  57. // Sets the vertex and pixel shaders
  58. void SetVertexShader( const char *pFileName, int vshIndex );
  59. void SetPixelShader( const char *pFileName, int pshIndex );
  60. // Convert from linear to gamma color space on writes to frame buffer.
  61. void EnableSRGBWrite( bool bEnable )
  62. {
  63. }
  64. void EnableSRGBRead( Sampler_t stage, bool bEnable )
  65. {
  66. }
  67. virtual void DisableFogGammaCorrection( bool bDisable )
  68. {
  69. //FIXME: empty for now.
  70. }
  71. virtual void FogMode( ShaderFogMode_t fogMode, bool bVertexFog )
  72. {
  73. //FIXME: empty for now.
  74. }
  75. // Alpha to coverage
  76. void EnableAlphaToCoverage( bool bEnable );
  77. void SetShadowDepthFiltering( Sampler_t stage );
  78. // More alpha blending state
  79. void BlendOp( ShaderBlendOp_t blendOp );
  80. void BlendOpSeparateAlpha( ShaderBlendOp_t blendOp );
  81. virtual float GetLightMapScaleFactor( void ) const
  82. {
  83. Assert( 0 );
  84. return 1.0;
  85. }
  86. bool m_IsTranslucent;
  87. bool m_IsAlphaTested;
  88. bool m_bIsDepthWriteEnabled;
  89. bool m_bUsesVertexAndPixelShaders;
  90. };
  91. extern CShaderShadowDx10* g_pShaderShadowDx10;
  92. #endif // SHADERSHADOWDX10_H