PageRenderTime 125ms CodeModel.GetById 0ms RepoModel.GetById 0ms app.codeStats 0ms

/indra/newview/lldrawpoolalpha.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 97 lines | 56 code | 15 blank | 26 comment | 0 complexity | 5521a8892d177b17e06056e6ac797ac1 MD5 | raw file
Possible License(s): LGPL-2.1
  1. /**
  2. * @file lldrawpoolalpha.h
  3. * @brief LLDrawPoolAlpha class definition
  4. *
  5. * $LicenseInfo:firstyear=2002&license=viewerlgpl$
  6. * Second Life Viewer Source Code
  7. * Copyright (C) 2010, Linden Research, Inc.
  8. *
  9. * This library is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU Lesser General Public
  11. * License as published by the Free Software Foundation;
  12. * version 2.1 of the License only.
  13. *
  14. * This library is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  17. * Lesser General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU Lesser General Public
  20. * License along with this library; if not, write to the Free Software
  21. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  22. *
  23. * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
  24. * $/LicenseInfo$
  25. */
  26. #ifndef LL_LLDRAWPOOLALPHA_H
  27. #define LL_LLDRAWPOOLALPHA_H
  28. #include "lldrawpool.h"
  29. #include "llrender.h"
  30. #include "llframetimer.h"
  31. class LLFace;
  32. class LLColor4;
  33. class LLGLSLShader;
  34. class LLDrawPoolAlpha: public LLRenderPass
  35. {
  36. public:
  37. enum
  38. {
  39. VERTEX_DATA_MASK = LLVertexBuffer::MAP_VERTEX |
  40. LLVertexBuffer::MAP_NORMAL |
  41. LLVertexBuffer::MAP_COLOR |
  42. LLVertexBuffer::MAP_TEXCOORD0
  43. };
  44. virtual U32 getVertexDataMask() { return VERTEX_DATA_MASK; }
  45. LLDrawPoolAlpha(U32 type = LLDrawPool::POOL_ALPHA);
  46. /*virtual*/ ~LLDrawPoolAlpha();
  47. /*virtual*/ S32 getNumDeferredPasses();
  48. /*virtual*/ void beginDeferredPass(S32 pass);
  49. /*virtual*/ void endDeferredPass(S32 pass);
  50. /*virtual*/ void renderDeferred(S32 pass);
  51. /*virtual*/ S32 getNumPostDeferredPasses();
  52. /*virtual*/ void beginPostDeferredPass(S32 pass);
  53. /*virtual*/ void endPostDeferredPass(S32 pass);
  54. /*virtual*/ void renderPostDeferred(S32 pass);
  55. /*virtual*/ void beginRenderPass(S32 pass = 0);
  56. /*virtual*/ void endRenderPass( S32 pass );
  57. /*virtual*/ S32 getNumPasses() { return 1; }
  58. virtual void render(S32 pass = 0);
  59. /*virtual*/ void prerender();
  60. void renderGroupAlpha(LLSpatialGroup* group, U32 type, U32 mask, BOOL texture = TRUE);
  61. void renderAlpha(U32 mask);
  62. void renderAlphaHighlight(U32 mask);
  63. static BOOL sShowDebugAlpha;
  64. private:
  65. LLGLSLShader* current_shader;
  66. LLGLSLShader* target_shader;
  67. LLGLSLShader* simple_shader;
  68. LLGLSLShader* fullbright_shader;
  69. LLGLSLShader* emissive_shader;
  70. // our 'normal' alpha blend function for this pass
  71. LLRender::eBlendFactor mColorSFactor;
  72. LLRender::eBlendFactor mColorDFactor;
  73. LLRender::eBlendFactor mAlphaSFactor;
  74. LLRender::eBlendFactor mAlphaDFactor;
  75. };
  76. class LLDrawPoolAlphaPostWater : public LLDrawPoolAlpha
  77. {
  78. public:
  79. LLDrawPoolAlphaPostWater();
  80. virtual void render(S32 pass = 0);
  81. };
  82. #endif // LL_LLDRAWPOOLALPHA_H