PageRenderTime 42ms CodeModel.GetById 20ms app.highlight 6ms RepoModel.GetById 14ms 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
 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
27#ifndef LL_LLDRAWPOOLALPHA_H
28#define LL_LLDRAWPOOLALPHA_H
29
30#include "lldrawpool.h"
31#include "llrender.h"
32#include "llframetimer.h"
33
34class LLFace;
35class LLColor4;
36class LLGLSLShader;
37
38class LLDrawPoolAlpha: public LLRenderPass
39{
40public:
41	enum
42	{
43		VERTEX_DATA_MASK =	LLVertexBuffer::MAP_VERTEX |
44							LLVertexBuffer::MAP_NORMAL |
45							LLVertexBuffer::MAP_COLOR |
46							LLVertexBuffer::MAP_TEXCOORD0
47	};
48	virtual U32 getVertexDataMask() { return VERTEX_DATA_MASK; }
49
50	LLDrawPoolAlpha(U32 type = LLDrawPool::POOL_ALPHA);
51	/*virtual*/ ~LLDrawPoolAlpha();
52
53	/*virtual*/ S32 getNumDeferredPasses();
54	/*virtual*/ void beginDeferredPass(S32 pass);
55	/*virtual*/ void endDeferredPass(S32 pass);
56	/*virtual*/ void renderDeferred(S32 pass);
57
58	/*virtual*/ S32 getNumPostDeferredPasses();
59	/*virtual*/ void beginPostDeferredPass(S32 pass);
60	/*virtual*/ void endPostDeferredPass(S32 pass);
61	/*virtual*/ void renderPostDeferred(S32 pass);
62
63	/*virtual*/ void beginRenderPass(S32 pass = 0);
64	/*virtual*/ void endRenderPass( S32 pass );
65	/*virtual*/ S32	 getNumPasses() { return 1; }
66
67	virtual void render(S32 pass = 0);
68	/*virtual*/ void prerender();
69
70	void renderGroupAlpha(LLSpatialGroup* group, U32 type, U32 mask, BOOL texture = TRUE);
71	void renderAlpha(U32 mask);
72	void renderAlphaHighlight(U32 mask);
73	
74	static BOOL sShowDebugAlpha;
75
76private:
77	LLGLSLShader* current_shader;
78	LLGLSLShader* target_shader;
79	LLGLSLShader* simple_shader;
80	LLGLSLShader* fullbright_shader;	
81	LLGLSLShader* emissive_shader;
82
83	// our 'normal' alpha blend function for this pass
84	LLRender::eBlendFactor mColorSFactor;
85	LLRender::eBlendFactor mColorDFactor;	
86	LLRender::eBlendFactor mAlphaSFactor;
87	LLRender::eBlendFactor mAlphaDFactor;
88};
89
90class LLDrawPoolAlphaPostWater : public LLDrawPoolAlpha
91{
92public:
93	LLDrawPoolAlphaPostWater();
94	virtual void render(S32 pass = 0);
95};
96
97#endif // LL_LLDRAWPOOLALPHA_H