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.

67 lines
1.7 KiB

  1. //===================== Copyright (c) Valve Corporation. All Rights Reserved. ======================
  2. //
  3. // PS3 test shader
  4. //
  5. //==================================================================================================
  6. #include "BaseVSShader.h"
  7. #include "playstation_test_vs20.inc"
  8. #include "playstation_test_ps20.inc"
  9. #include "playstation_test_ps20b.inc"
  10. // memdbgon must be the last include file in a .cpp file!!!
  11. #include "tier0/memdbgon.h"
  12. BEGIN_VS_SHADER_FLAGS( PS3TestShader, "PS3 Test Shader", SHADER_NOT_EDITABLE )
  13. BEGIN_SHADER_PARAMS
  14. SHADER_PARAM( TEST_TEXTURE, SHADER_PARAM_TYPE_TEXTURE, "", "Test texture to sample from." )
  15. END_SHADER_PARAMS
  16. SHADER_FALLBACK
  17. {
  18. return 0;
  19. }
  20. SHADER_INIT
  21. {
  22. if( params[ TEST_TEXTURE ]->IsDefined() )
  23. {
  24. LoadTexture( TEST_TEXTURE );
  25. }
  26. }
  27. SHADER_DRAW
  28. {
  29. SHADOW_STATE
  30. {
  31. pShaderShadow->VertexShaderVertexFormat( VERTEX_POSITION, 1, 0, 0 );
  32. pShaderShadow->EnableTexture( SHADER_SAMPLER0, true );
  33. DECLARE_STATIC_VERTEX_SHADER( playstation_test_vs20 );
  34. SET_STATIC_VERTEX_SHADER( playstation_test_vs20 );
  35. DECLARE_STATIC_PIXEL_SHADER( playstation_test_ps20b );
  36. SET_STATIC_PIXEL_SHADER( playstation_test_ps20b );
  37. pShaderShadow->EnableDepthWrites( false );
  38. pShaderShadow->DepthFunc( SHADER_DEPTHFUNC_ALWAYS );
  39. pShaderShadow->EnableAlphaWrites( false );
  40. pShaderShadow->EnableCulling( false );
  41. }
  42. DYNAMIC_STATE
  43. {
  44. // Bind textures
  45. BindTexture( SHADER_SAMPLER0, TEXTURE_BINDFLAGS_NONE, TEST_TEXTURE );
  46. DECLARE_DYNAMIC_VERTEX_SHADER( playstation_test_vs20 );
  47. SET_DYNAMIC_VERTEX_SHADER( playstation_test_vs20 );
  48. DECLARE_DYNAMIC_PIXEL_SHADER( playstation_test_ps20b );
  49. SET_DYNAMIC_PIXEL_SHADER( playstation_test_ps20b );
  50. }
  51. Draw();
  52. }
  53. END_SHADER