PageRenderTime 11ms CodeModel.GetById 1ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/indra/newview/lldrawpoolterrain.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 88 lines | 50 code | 13 blank | 25 comment | 0 complexity | 16168e26c757c33b1605a1226c3bf620 MD5 | raw file
 1/** 
 2 * @file lldrawpoolterrain.h
 3 * @brief LLDrawPoolTerrain 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
27#ifndef LL_LLDRAWPOOLTERRAIN_H
28#define LL_LLDRAWPOOLTERRAIN_H
29
30#include "lldrawpool.h"
31
32class LLDrawPoolTerrain : public LLFacePool
33{
34	LLPointer<LLViewerTexture> mTexturep;
35public:
36	enum
37	{
38		VERTEX_DATA_MASK =	LLVertexBuffer::MAP_VERTEX |
39							LLVertexBuffer::MAP_NORMAL |
40							LLVertexBuffer::MAP_TEXCOORD0 |
41							LLVertexBuffer::MAP_TEXCOORD1 |
42							LLVertexBuffer::MAP_TEXCOORD2 |
43							LLVertexBuffer::MAP_TEXCOORD3
44	};
45
46	virtual U32 getVertexDataMask();
47	static S32 getDetailMode();
48
49	LLDrawPoolTerrain(LLViewerTexture *texturep);
50	virtual ~LLDrawPoolTerrain();
51
52	/*virtual*/ LLDrawPool *instancePool();
53
54	/*virtual*/ S32 getNumDeferredPasses() { return 1; }
55	/*virtual*/ void beginDeferredPass(S32 pass);
56	/*virtual*/ void endDeferredPass(S32 pass);
57	/*virtual*/ void renderDeferred(S32 pass);
58
59	/*virtual*/ S32 getNumShadowPasses() { return 1; }
60	/*virtual*/ void beginShadowPass(S32 pass);
61	/*virtual*/ void endShadowPass(S32 pass);
62	/*virtual*/ void renderShadow(S32 pass);
63
64	/*virtual*/ void render(S32 pass = 0);
65	/*virtual*/ void prerender();
66	/*virtual*/ void beginRenderPass( S32 pass );
67	/*virtual*/ void endRenderPass( S32 pass );
68	/*virtual*/ void dirtyTextures(const std::set<LLViewerFetchedTexture*>& textures);
69	/*virtual*/ LLViewerTexture *getTexture();
70	/*virtual*/ LLViewerTexture *getDebugTexture();
71	/*virtual*/ LLColor3 getDebugColor() const; // For AGP debug display
72
73	LLPointer<LLViewerTexture> mAlphaRampImagep;
74	LLPointer<LLViewerTexture> m2DAlphaRampImagep;
75	LLPointer<LLViewerTexture> mAlphaNoiseImagep;
76
77	static S32 sDetailMode;
78	static F32 sDetailScale; // meters per texture
79protected:
80	void renderSimple();
81	void renderOwnership();
82
83	void renderFull2TU();
84	void renderFull4TU();
85	void renderFullShader();
86};
87
88#endif // LL_LLDRAWPOOLSIMPLE_H