lldrawpoolsimple.h 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. /**
  2. * @file lldrawpoolsimple.h
  3. * @brief LLDrawPoolSimple 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_LLDRAWPOOLSIMPLE_H
  33. #define LL_LLDRAWPOOLSIMPLE_H
  34. #include "lldrawpool.h"
  35. class LLGLSLShader;
  36. class LLDrawPoolSimple final : public LLRenderPass
  37. {
  38. public:
  39. enum
  40. {
  41. VERTEX_DATA_MASK = LLVertexBuffer::MAP_VERTEX |
  42. LLVertexBuffer::MAP_NORMAL |
  43. LLVertexBuffer::MAP_TEXCOORD0 |
  44. LLVertexBuffer::MAP_COLOR
  45. };
  46. LL_INLINE U32 getVertexDataMask() override { return VERTEX_DATA_MASK; }
  47. LLDrawPoolSimple();
  48. LL_INLINE S32 getNumDeferredPasses() override { return 1; }
  49. void renderDeferred(S32 pass) override;
  50. // Only for use with the EE renderer
  51. void prerender() override;
  52. void render(S32 pass = 0) override;
  53. };
  54. class LLDrawPoolGrass final : public LLRenderPass
  55. {
  56. public:
  57. enum
  58. {
  59. VERTEX_DATA_MASK = LLVertexBuffer::MAP_VERTEX |
  60. LLVertexBuffer::MAP_NORMAL |
  61. LLVertexBuffer::MAP_TEXCOORD0 |
  62. LLVertexBuffer::MAP_COLOR
  63. };
  64. LL_INLINE U32 getVertexDataMask() override { return VERTEX_DATA_MASK; }
  65. LLDrawPoolGrass();
  66. LL_INLINE S32 getNumDeferredPasses() override { return 1; }
  67. void renderDeferred(S32 pass) override;
  68. // Only for use with the EE renderer
  69. void beginRenderPass(S32 pass) override;
  70. void endRenderPass(S32 pass) override;
  71. void prerender() override;
  72. void render(S32 pass = 0) override;
  73. };
  74. class LLDrawPoolAlphaMask final : public LLRenderPass
  75. {
  76. public:
  77. enum
  78. {
  79. VERTEX_DATA_MASK = LLVertexBuffer::MAP_VERTEX |
  80. LLVertexBuffer::MAP_NORMAL |
  81. LLVertexBuffer::MAP_TEXCOORD0 |
  82. LLVertexBuffer::MAP_COLOR
  83. };
  84. LL_INLINE U32 getVertexDataMask() override { return VERTEX_DATA_MASK; }
  85. LLDrawPoolAlphaMask();
  86. LL_INLINE S32 getNumDeferredPasses() override { return 1; }
  87. void renderDeferred(S32 pass) override;
  88. // Only for use with the EE renderer
  89. void prerender() override;
  90. void render(S32 pass = 0) override;
  91. };
  92. class LLDrawPoolFullbrightAlphaMask final : public LLRenderPass
  93. {
  94. public:
  95. enum
  96. {
  97. VERTEX_DATA_MASK = LLVertexBuffer::MAP_VERTEX |
  98. LLVertexBuffer::MAP_TEXCOORD0 |
  99. LLVertexBuffer::MAP_COLOR
  100. };
  101. LL_INLINE U32 getVertexDataMask() override { return VERTEX_DATA_MASK; }
  102. LLDrawPoolFullbrightAlphaMask();
  103. LL_INLINE S32 getNumPostDeferredPasses() override { return 1; }
  104. void renderPostDeferred(S32 pass) override;
  105. // Only for use with the EE renderer
  106. void prerender() override;
  107. void render(S32 pass = 0) override;
  108. };
  109. class LLDrawPoolFullbright final : public LLRenderPass
  110. {
  111. public:
  112. enum
  113. {
  114. VERTEX_DATA_MASK = LLVertexBuffer::MAP_VERTEX |
  115. LLVertexBuffer::MAP_TEXCOORD0 |
  116. LLVertexBuffer::MAP_COLOR
  117. };
  118. LL_INLINE U32 getVertexDataMask() override { return VERTEX_DATA_MASK; }
  119. LLDrawPoolFullbright();
  120. LL_INLINE S32 getNumPostDeferredPasses() override { return 1; }
  121. void renderPostDeferred(S32 pass) override;
  122. // Only for use with the EE renderer
  123. void prerender() override;
  124. void render(S32 pass = 0) override;
  125. };
  126. class LLDrawPoolGlow final : public LLRenderPass
  127. {
  128. public:
  129. LLDrawPoolGlow()
  130. : LLRenderPass(LLDrawPool::POOL_GLOW)
  131. {
  132. }
  133. enum
  134. {
  135. VERTEX_DATA_MASK = LLVertexBuffer::MAP_VERTEX |
  136. LLVertexBuffer::MAP_TEXCOORD0 |
  137. LLVertexBuffer::MAP_EMISSIVE
  138. };
  139. LL_INLINE U32 getVertexDataMask() override { return VERTEX_DATA_MASK; }
  140. LL_INLINE S32 getNumPostDeferredPasses() override { return 1; }
  141. void renderPostDeferred(S32 pass) override;
  142. // Only for use with the EE renderer
  143. void render(S32 pass = 0) override;
  144. private:
  145. void render(LLGLSLShader* shaderp);
  146. };
  147. #endif // LL_LLDRAWPOOLSIMPLE_H