PageRenderTime 92ms CodeModel.GetById 22ms RepoModel.GetById 0ms app.codeStats 0ms

/indra/newview/lldrawpoolwlsky.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 84 lines | 43 code | 14 blank | 27 comment | 0 complexity | ff8686d91053306f5a9f9329ff471cfa MD5 | raw file
Possible License(s): LGPL-2.1
  1. /**
  2. * @file lldrawpoolwlsky.h
  3. * @brief LLDrawPoolWLSky class definition
  4. *
  5. * $LicenseInfo:firstyear=2007&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_DRAWPOOLWLSKY_H
  27. #define LL_DRAWPOOLWLSKY_H
  28. #include "lldrawpool.h"
  29. class LLGLSLShader;
  30. class LLDrawPoolWLSky : public LLDrawPool {
  31. public:
  32. static const U32 SKY_VERTEX_DATA_MASK = LLVertexBuffer::MAP_VERTEX |
  33. LLVertexBuffer::MAP_TEXCOORD0;
  34. static const U32 STAR_VERTEX_DATA_MASK = LLVertexBuffer::MAP_VERTEX |
  35. LLVertexBuffer::MAP_COLOR | LLVertexBuffer::MAP_TEXCOORD0;
  36. LLDrawPoolWLSky(void);
  37. /*virtual*/ ~LLDrawPoolWLSky();
  38. /*virtual*/ BOOL isDead() { return FALSE; }
  39. /*virtual*/ S32 getNumDeferredPasses() { return 1; }
  40. /*virtual*/ void beginDeferredPass(S32 pass);
  41. /*virtual*/ void endDeferredPass(S32 pass);
  42. /*virtual*/ void renderDeferred(S32 pass);
  43. /*virtual*/ LLViewerTexture *getDebugTexture();
  44. /*virtual*/ void beginRenderPass( S32 pass );
  45. /*virtual*/ void endRenderPass( S32 pass );
  46. /*virtual*/ S32 getNumPasses() { return 1; }
  47. /*virtual*/ void render(S32 pass = 0);
  48. /*virtual*/ void prerender();
  49. /*virtual*/ U32 getVertexDataMask() { return SKY_VERTEX_DATA_MASK; }
  50. /*virtual*/ BOOL verify() const { return TRUE; } // Verify that all data in the draw pool is correct!
  51. /*virtual*/ S32 getVertexShaderLevel() const { return mVertexShaderLevel; }
  52. //static LLDrawPool* createPool(const U32 type, LLViewerTexture *tex0 = NULL);
  53. // Create an empty new instance of the pool.
  54. /*virtual*/ LLDrawPoolWLSky *instancePool(); ///< covariant override
  55. /*virtual*/ LLViewerTexture* getTexture();
  56. /*virtual*/ BOOL isFacePool() { return FALSE; }
  57. /*virtual*/ void resetDrawOrders();
  58. static void cleanupGL();
  59. static void restoreGL();
  60. private:
  61. void renderDome(F32 camHeightLocal, LLGLSLShader * shader) const;
  62. void renderSkyHaze(F32 camHeightLocal) const;
  63. void renderStars(void) const;
  64. void renderSkyClouds(F32 camHeightLocal) const;
  65. void renderHeavenlyBodies();
  66. private:
  67. static LLPointer<LLViewerTexture> sCloudNoiseTexture;
  68. static LLPointer<LLImageRaw> sCloudNoiseRawImage;
  69. };
  70. #endif // LL_DRAWPOOLWLSKY_H