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.

65 lines
1.5 KiB

  1. //========= Copyright � 1996-2006, Valve Corporation, All rights reserved. ============//
  2. #include "BaseVSShader.h"
  3. #include "proto_ice_helper.h"
  4. // memdbgon must be the last include file in a .cpp file!!!
  5. #include "tier0/memdbgon.h"
  6. DEFINE_FALLBACK_SHADER( ProtoIce, ProtoIce_dx9 )
  7. BEGIN_VS_SHADER( ProtoIce_dx9, "ProtoIce" )
  8. BEGIN_SHADER_PARAMS
  9. SHADER_PARAM( BUMPMAP, SHADER_PARAM_TYPE_TEXTURE, "", "Normal map" )
  10. SHADER_PARAM( BUMPFRAME, SHADER_PARAM_TYPE_INTEGER, "0", "Frame number for $bumpmap" )
  11. SHADER_PARAM( SSBUMP, SHADER_PARAM_TYPE_INTEGER, "0", "whether or not to use alternate bumpmap format with height" )
  12. END_SHADER_PARAMS
  13. void SetupVarsProtoIce( ProtoIceVars_t &info )
  14. {
  15. info.m_nBaseTexture = BASETEXTURE;
  16. info.m_nBaseTextureFrame = FRAME;
  17. info.m_nBumpmap = BUMPMAP;
  18. info.m_nBumpFrame = BUMPFRAME;
  19. info.m_nSsBump = SSBUMP;
  20. }
  21. SHADER_INIT_PARAMS()
  22. {
  23. ProtoIceVars_t info;
  24. SetupVarsProtoIce( info );
  25. InitParamsProtoIce( this, params, pMaterialName, info );
  26. }
  27. SHADER_FALLBACK
  28. {
  29. if ( ( g_pHardwareConfig->GetDXSupportLevel() < 90 ) || ( !g_pHardwareConfig->SupportsPixelShaders_2_b() ) )
  30. {
  31. return "Wireframe";
  32. }
  33. if ( g_pConfig && g_pConfig->bEditMode )
  34. {
  35. return "VertexLitGeneric";
  36. }
  37. return 0;
  38. }
  39. SHADER_INIT
  40. {
  41. ProtoIceVars_t info;
  42. SetupVarsProtoIce( info );
  43. InitProtoIce( this, params, info );
  44. }
  45. SHADER_DRAW
  46. {
  47. ProtoIceVars_t info;
  48. SetupVarsProtoIce( info );
  49. DrawProtoIce( this, params, pShaderAPI, pShaderShadow, info, vertexCompression );
  50. }
  51. END_SHADER