Team Fortress 2 Source Code as on 22/4/2020
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.

60 lines
1.6 KiB

  1. //===================== Copyright (c) Valve Corporation. All Rights Reserved. ======================
  2. //
  3. // Example shader that can be applied to models
  4. //
  5. //==================================================================================================
  6. #include "BaseVSShader.h"
  7. #include "convar.h"
  8. #include "example_model_dx9_helper.h"
  9. #ifdef GAME_SHADER_DLL
  10. DEFINE_FALLBACK_SHADER( Mod_Example_Model, Mod_Example_Model_DX9 )
  11. BEGIN_VS_SHADER( Mod_Example_Model_DX9, "Help for Example Model Shader" )
  12. #else
  13. DEFINE_FALLBACK_SHADER( Example_Model, Example_Model_DX9 )
  14. BEGIN_VS_SHADER( Example_Model_DX9, "Help for Example Model Shader" )
  15. #endif
  16. BEGIN_SHADER_PARAMS
  17. SHADER_PARAM( ALPHATESTREFERENCE, SHADER_PARAM_TYPE_FLOAT, "0.0", "" )
  18. END_SHADER_PARAMS
  19. void SetupVars( ExampleModel_DX9_Vars_t& info )
  20. {
  21. info.m_nBaseTexture = BASETEXTURE;
  22. info.m_nBaseTextureFrame = FRAME;
  23. info.m_nBaseTextureTransform = BASETEXTURETRANSFORM;
  24. info.m_nAlphaTestReference = ALPHATESTREFERENCE;
  25. info.m_nFlashlightTexture = FLASHLIGHTTEXTURE;
  26. info.m_nFlashlightTextureFrame = FLASHLIGHTTEXTUREFRAME;
  27. }
  28. SHADER_INIT_PARAMS()
  29. {
  30. ExampleModel_DX9_Vars_t info;
  31. SetupVars( info );
  32. InitParamsExampleModel_DX9( this, params, pMaterialName, info );
  33. }
  34. SHADER_FALLBACK
  35. {
  36. return 0;
  37. }
  38. SHADER_INIT
  39. {
  40. ExampleModel_DX9_Vars_t info;
  41. SetupVars( info );
  42. InitExampleModel_DX9( this, params, info );
  43. }
  44. SHADER_DRAW
  45. {
  46. ExampleModel_DX9_Vars_t info;
  47. SetupVars( info );
  48. DrawExampleModel_DX9( this, params, pShaderAPI, pShaderShadow, info, vertexCompression, pContextDataPtr );
  49. }
  50. END_SHADER