shd8bumpdiff.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. /*
  2. ** Command & Conquer Generals Zero Hour(tm)
  3. ** Copyright 2025 Electronic Arts Inc.
  4. **
  5. ** This program is free software: you can redistribute it and/or modify
  6. ** it under the terms of the GNU General Public License as published by
  7. ** the Free Software Foundation, either version 3 of the License, or
  8. ** (at your option) any later version.
  9. **
  10. ** This program is distributed in the hope that it will be useful,
  11. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ** GNU General Public License for more details.
  14. **
  15. ** You should have received a copy of the GNU General Public License
  16. ** along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. /***********************************************************************************************
  19. *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
  20. ***********************************************************************************************
  21. * *
  22. * Project Name : WWSHADE *
  23. * *
  24. * $Archive:: /Commando/Code/ww3d2/shd8bumpdiff.h $*
  25. * *
  26. * $Author:: Kenny_m
  27. *
  28. * $Modtime:: 07/08/02 3:39p $*
  29. * *
  30. * $Revision:: 1 $*
  31. * *
  32. *---------------------------------------------------------------------------------------------*
  33. * Functions: *
  34. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  35. #ifndef SHD8BUMPDIFF_H
  36. #define SHD8BUMPDIFF_H
  37. #ifndef SHDINTERFACE_H
  38. #include "shdinterface.h"
  39. #endif
  40. #ifndef SHDHWSHADER_H
  41. #include "shdhwshader.h"
  42. #endif
  43. class Shd8BumpDiffClass : public ShdInterfaceClass
  44. {
  45. public:
  46. Shd8BumpDiffClass(const ShdDefClass* def);
  47. virtual ~Shd8BumpDiffClass();
  48. static void Init();
  49. static void Shutdown();
  50. virtual int Get_Pass_Count() { return 2; }
  51. virtual bool Pass_Selection(ShdMeshClass*, RenderInfoClass*,int);
  52. virtual int Get_Texture_Count() const { return 2; }
  53. virtual TextureClass* Peek_Texture(int idx) const { return idx==0 ? Texture : NormalMap; }
  54. virtual void Apply_Shared(int cur_pass, RenderInfoClass& rinfo);
  55. virtual void Apply_Instance(int cur_pass, RenderInfoClass& rinfo);
  56. virtual unsigned Get_Vertex_Stream_Count() const;
  57. virtual unsigned Get_Vertex_Size(unsigned stream) const;
  58. virtual bool Use_HW_Vertex_Processing() const { return Vertex_Shader.Is_Using_Hardware(); }
  59. virtual void Copy_Vertex_Stream
  60. (
  61. unsigned stream,
  62. void* dest_buffer,
  63. const VertexStreamStruct& vss,
  64. unsigned vertex_count
  65. );
  66. protected:
  67. void Setup_Self_Shadow_Info(ShdMeshClass& mesh, RenderInfoClass& rinfo);
  68. static ShdHWVertexShader Vertex_Shader;
  69. static ShdHWPixelShader Pixel_Shader;
  70. static Matrix4x4 View_Projection_Matrix;
  71. TextureClass* Texture;
  72. TextureClass* NormalMap;
  73. Vector4 Ambient;
  74. Vector4 Diffuse;
  75. Vector4 Bumpiness;
  76. // self shadowing
  77. static ShdHWPixelShader Self_Shadow_Pixel_Shader;
  78. static ShdHWVertexShader Self_Shadow_Vertex_Shader;
  79. Matrix4x4 Self_Shadow_Transform;
  80. };
  81. #endif // SHD8BUMPDIFF_H