PageRenderTime 15ms CodeModel.GetById 1ms app.highlight 11ms RepoModel.GetById 1ms 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
 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
27#ifndef LL_DRAWPOOLWLSKY_H
28#define LL_DRAWPOOLWLSKY_H
29
30#include "lldrawpool.h"
31
32class LLGLSLShader;
33
34class LLDrawPoolWLSky : public LLDrawPool {
35public:
36
37	static const U32 SKY_VERTEX_DATA_MASK =	LLVertexBuffer::MAP_VERTEX |
38							LLVertexBuffer::MAP_TEXCOORD0;
39	static const U32 STAR_VERTEX_DATA_MASK =	LLVertexBuffer::MAP_VERTEX |
40		LLVertexBuffer::MAP_COLOR | LLVertexBuffer::MAP_TEXCOORD0;
41
42	LLDrawPoolWLSky(void);
43	/*virtual*/ ~LLDrawPoolWLSky();
44
45	/*virtual*/ BOOL isDead() { return FALSE; }
46
47	/*virtual*/ S32 getNumDeferredPasses() { return 1; }
48	/*virtual*/ void beginDeferredPass(S32 pass);
49	/*virtual*/ void endDeferredPass(S32 pass);
50	/*virtual*/ void renderDeferred(S32 pass);
51
52	/*virtual*/ LLViewerTexture *getDebugTexture();
53	/*virtual*/ void beginRenderPass( S32 pass );
54	/*virtual*/ void endRenderPass( S32 pass );
55	/*virtual*/ S32	 getNumPasses() { return 1; }
56	/*virtual*/ void render(S32 pass = 0);
57	/*virtual*/ void prerender();
58	/*virtual*/ U32 getVertexDataMask() { return SKY_VERTEX_DATA_MASK; }
59	/*virtual*/ BOOL verify() const { return TRUE; }		// Verify that all data in the draw pool is correct!
60	/*virtual*/ S32 getVertexShaderLevel() const { return mVertexShaderLevel; }
61	
62	//static LLDrawPool* createPool(const U32 type, LLViewerTexture *tex0 = NULL);
63
64	// Create an empty new instance of the pool.
65	/*virtual*/ LLDrawPoolWLSky *instancePool();  ///< covariant override
66	/*virtual*/ LLViewerTexture* getTexture();
67	/*virtual*/ BOOL isFacePool() { return FALSE; }
68	/*virtual*/ void resetDrawOrders();
69
70	static void cleanupGL();
71	static void restoreGL();
72private:
73	void renderDome(F32 camHeightLocal, LLGLSLShader * shader) const;
74	void renderSkyHaze(F32 camHeightLocal) const;
75	void renderStars(void) const;
76	void renderSkyClouds(F32 camHeightLocal) const;
77	void renderHeavenlyBodies();
78
79private:
80	static LLPointer<LLViewerTexture> sCloudNoiseTexture;
81	static LLPointer<LLImageRaw> sCloudNoiseRawImage;
82};
83
84#endif // LL_DRAWPOOLWLSKY_H