lldrawpoolavatar.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. /**
  2. * @file lldrawpoolavatar.h
  3. * @brief LLDrawPoolAvatar class definition
  4. *
  5. * $LicenseInfo:firstyear=2002&license=viewergpl$
  6. *
  7. * Copyright (c) 2002-2009, Linden Research, Inc.
  8. *
  9. * Second Life Viewer Source Code
  10. * The source code in this file ("Source Code") is provided by Linden Lab
  11. * to you under the terms of the GNU General Public License, version 2.0
  12. * ("GPL"), unless you have obtained a separate licensing agreement
  13. * ("Other License"), formally executed by you and Linden Lab. Terms of
  14. * the GPL can be found in doc/GPL-license.txt in this distribution, or
  15. * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
  16. *
  17. * There are special exceptions to the terms and conditions of the GPL as
  18. * it is applied to this Source Code. View the full text of the exception
  19. * in the file doc/FLOSS-exception.txt in this software distribution, or
  20. * online at
  21. * http://secondlifegrid.net/programs/open_source/licensing/flossexception
  22. *
  23. * By copying, modifying or distributing this software, you acknowledge
  24. * that you have read and understood your obligations described above,
  25. * and agree to abide by those obligations.
  26. *
  27. * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
  28. * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
  29. * COMPLETENESS OR PERFORMANCE.
  30. * $/LicenseInfo$
  31. */
  32. #ifndef LL_LLDRAWPOOLAVATAR_H
  33. #define LL_LLDRAWPOOLAVATAR_H
  34. #include "lldrawpool.h"
  35. class LLGLSLShader;
  36. class LLFace;
  37. class LLVolume;
  38. class LLVolumeFace;
  39. class LLVOVolume;
  40. class LLDrawPoolAvatar final : public LLFacePool
  41. {
  42. public:
  43. LLDrawPoolAvatar(U32 type);
  44. ~LLDrawPoolAvatar() override;
  45. enum
  46. {
  47. SHADER_LEVEL_BUMP = 2,
  48. SHADER_LEVEL_CLOTH = 3
  49. };
  50. enum
  51. {
  52. VERTEX_DATA_MASK = LLVertexBuffer::MAP_VERTEX |
  53. LLVertexBuffer::MAP_NORMAL |
  54. LLVertexBuffer::MAP_TEXCOORD0 |
  55. LLVertexBuffer::MAP_WEIGHT |
  56. LLVertexBuffer::MAP_CLOTHWEIGHT
  57. };
  58. typedef enum
  59. {
  60. SHADOW_PASS_AVATAR_OPAQUE,
  61. SHADOW_PASS_AVATAR_ALPHA_BLEND,
  62. SHADOW_PASS_AVATAR_ALPHA_MASK,
  63. NUM_SHADOW_PASSES
  64. } eShadowPass;
  65. U32 getVertexDataMask() override { return VERTEX_DATA_MASK; }
  66. static LLMatrix4& getModelView();
  67. LL_INLINE S32 getNumPasses() override { return 3; }
  68. void beginRenderPass(S32 pass) override;
  69. void endRenderPass(S32 pass) override;
  70. void prerender() override;
  71. void render(S32 pass = 0) override;
  72. LL_INLINE S32 getNumDeferredPasses() override { return 3; }
  73. void beginDeferredPass(S32 pass) override;
  74. void endDeferredPass(S32 pass) override;
  75. LL_INLINE void renderDeferred(S32 pass) override { render(pass); }
  76. LL_INLINE S32 getNumPostDeferredPasses() override { return 1; }
  77. void beginPostDeferredPass(S32 pass) override;
  78. void endPostDeferredPass(S32 pass) override;
  79. void renderPostDeferred(S32 pass) override;
  80. LL_INLINE S32 getNumShadowPasses() override { return NUM_SHADOW_PASSES; }
  81. void beginShadowPass(S32 pass) override;
  82. void endShadowPass(S32 pass) override;
  83. void renderShadow(S32 pass) override;
  84. static void beginRigid();
  85. static void beginImpostor();
  86. static void beginSkinned();
  87. static void endRigid();
  88. static void endImpostor();
  89. static void endSkinned();
  90. static void beginDeferredImpostor();
  91. static void beginDeferredRigid();
  92. static void beginDeferredSkinned();
  93. static void endDeferredImpostor();
  94. static void endDeferredRigid();
  95. static void endDeferredSkinned();
  96. // Renders only one avatar if single_avatar is not null.
  97. void renderAvatars(LLVOAvatar* single_avatar, S32 pass = -1);
  98. public:
  99. static F32 sMinimumAlpha;
  100. static S32 sDiffuseChannel;
  101. static S32 sShadowPass;
  102. static bool sSkipOpaque;
  103. static bool sSkipTransparent;
  104. static LLGLSLShader* sVertexProgram;
  105. };
  106. #endif // LL_LLDRAWPOOLAVATAR_H