diff options
author | Jacek Antonelli | 2008-08-15 23:44:54 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:44:54 -0500 |
commit | b2afb8800bb033a04bb3ecdf0363068d56648ef1 (patch) | |
tree | 3568129b5bbddb47cd39d622b4137a8fbff4abaf /linden/indra/newview/lldrawpoolsimple.cpp | |
parent | Second Life viewer sources 1.14.0.1 (diff) | |
download | meta-impy-b2afb8800bb033a04bb3ecdf0363068d56648ef1.zip meta-impy-b2afb8800bb033a04bb3ecdf0363068d56648ef1.tar.gz meta-impy-b2afb8800bb033a04bb3ecdf0363068d56648ef1.tar.bz2 meta-impy-b2afb8800bb033a04bb3ecdf0363068d56648ef1.tar.xz |
Second Life viewer sources 1.15.0.2
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/lldrawpoolsimple.cpp | 100 |
1 files changed, 72 insertions, 28 deletions
diff --git a/linden/indra/newview/lldrawpoolsimple.cpp b/linden/indra/newview/lldrawpoolsimple.cpp index ec8929e..3af8bc2 100644 --- a/linden/indra/newview/lldrawpoolsimple.cpp +++ b/linden/indra/newview/lldrawpoolsimple.cpp | |||
@@ -4,6 +4,7 @@ | |||
4 | * | 4 | * |
5 | * Copyright (c) 2002-2007, Linden Research, Inc. | 5 | * Copyright (c) 2002-2007, Linden Research, Inc. |
6 | * | 6 | * |
7 | * Second Life Viewer Source Code | ||
7 | * The source code in this file ("Source Code") is provided by Linden Lab | 8 | * The source code in this file ("Source Code") is provided by Linden Lab |
8 | * to you under the terms of the GNU General Public License, version 2.0 | 9 | * to you under the terms of the GNU General Public License, version 2.0 |
9 | * ("GPL"), unless you have obtained a separate licensing agreement | 10 | * ("GPL"), unless you have obtained a separate licensing agreement |
@@ -28,43 +29,92 @@ | |||
28 | #include "llviewerprecompiledheaders.h" | 29 | #include "llviewerprecompiledheaders.h" |
29 | 30 | ||
30 | #include "lldrawpoolsimple.h" | 31 | #include "lldrawpoolsimple.h" |
32 | #include "lldrawpoolbump.h" | ||
31 | 33 | ||
34 | #include "llviewercamera.h" | ||
32 | #include "llagent.h" | 35 | #include "llagent.h" |
33 | #include "lldrawable.h" | 36 | #include "lldrawable.h" |
34 | #include "llface.h" | 37 | #include "llface.h" |
35 | #include "llsky.h" | 38 | #include "llsky.h" |
36 | #include "pipeline.h" | 39 | #include "pipeline.h" |
40 | #include "llglslshader.h" | ||
37 | 41 | ||
38 | class LLRenderPassGlow : public LLRenderPass | 42 | class LLRenderShinyGlow : public LLDrawPoolBump |
39 | { | 43 | { |
40 | public: | 44 | public: |
41 | LLRenderPassGlow(): LLRenderPass(LLRenderPass::PASS_GLOW) { } | 45 | LLRenderShinyGlow() { } |
42 | 46 | ||
43 | enum | 47 | void render(S32 pass = 0) |
44 | { | 48 | { |
45 | VERTEX_DATA_MASK = LLVertexBuffer::MAP_VERTEX | | 49 | LLCubeMap* cube_map = gSky.mVOSkyp->getCubeMap(); |
46 | LLVertexBuffer::MAP_TEXCOORD | 50 | if( cube_map ) |
47 | }; | 51 | { |
48 | 52 | cube_map->enable(0); | |
49 | virtual U32 getVertexDataMask() { return VERTEX_DATA_MASK; } | 53 | cube_map->setMatrix(0); |
54 | cube_map->bind(); | ||
55 | glEnableClientState(GL_NORMAL_ARRAY); | ||
56 | |||
57 | glColor4f(1,1,1,1); | ||
58 | |||
59 | U32 mask = LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_NORMAL; | ||
60 | renderStatic(LLRenderPass::PASS_SHINY, mask); | ||
61 | renderActive(LLRenderPass::PASS_SHINY, mask); | ||
62 | |||
63 | glDisableClientState(GL_NORMAL_ARRAY); | ||
64 | cube_map->disable(); | ||
65 | cube_map->restoreMatrix(); | ||
66 | } | ||
67 | } | ||
68 | }; | ||
50 | 69 | ||
51 | virtual void prerender() { } | 70 | void LLDrawPoolGlow::render(S32 pass) |
71 | { | ||
72 | LLGLEnable blend(GL_BLEND); | ||
73 | glBlendFunc(GL_SRC_ALPHA, GL_ONE); | ||
74 | gPipeline.enableLightsFullbright(LLColor4(1,1,1,1)); | ||
75 | glEnableClientState(GL_TEXTURE_COORD_ARRAY); | ||
76 | glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); | ||
77 | renderTexture(LLRenderPass::PASS_GLOW, getVertexDataMask()); | ||
78 | renderActive(LLRenderPass::PASS_GLOW, getVertexDataMask()); | ||
52 | 79 | ||
53 | void render(S32 pass = 0) | 80 | if (gSky.mVOSkyp) |
54 | { | 81 | { |
55 | LLGLEnable blend(GL_BLEND); | 82 | glPushMatrix(); |
56 | glBlendFunc(GL_SRC_ALPHA, GL_ONE); | 83 | LLVector3 origin = gCamera->getOrigin(); |
57 | renderTexture(LLRenderPass::PASS_GLOW, getVertexDataMask()); | 84 | glTranslatef(origin.mV[0], origin.mV[1], origin.mV[2]); |
58 | renderActive(LLRenderPass::PASS_GLOW, getVertexDataMask()); | 85 | |
59 | glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); | 86 | LLFace* facep = gSky.mVOSkyp->mFace[LLVOSky::FACE_BLOOM]; |
87 | |||
88 | if (facep) | ||
89 | { | ||
90 | LLGLDisable cull(GL_CULL_FACE); | ||
91 | facep->getTexture()->bind(); | ||
92 | glColor4f(1,1,1,1); | ||
93 | facep->renderIndexed(getVertexDataMask()); | ||
94 | } | ||
95 | |||
96 | glPopMatrix(); | ||
60 | } | 97 | } |
61 | 98 | ||
62 | void pushBatch(LLDrawInfo& params, U32 mask, BOOL texture = TRUE) | 99 | glDisableClientState(GL_TEXTURE_COORD_ARRAY); |
100 | |||
101 | if (LLPipeline::sDynamicReflections) | ||
63 | { | 102 | { |
64 | glColor4ubv(params.mGlowColor.mV); | 103 | LLRenderShinyGlow glow; |
65 | LLRenderPass::pushBatch(params, mask, texture); | 104 | glow.render(); |
66 | } | 105 | } |
67 | }; | 106 | |
107 | glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_FALSE); | ||
108 | glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); | ||
109 | |||
110 | } | ||
111 | |||
112 | void LLDrawPoolGlow::pushBatch(LLDrawInfo& params, U32 mask, BOOL texture) | ||
113 | { | ||
114 | glColor4ubv(params.mGlowColor.mV); | ||
115 | LLRenderPass::pushBatch(params, mask, texture); | ||
116 | } | ||
117 | |||
68 | 118 | ||
69 | LLDrawPoolSimple::LLDrawPoolSimple() : | 119 | LLDrawPoolSimple::LLDrawPoolSimple() : |
70 | LLRenderPass(POOL_SIMPLE) | 120 | LLRenderPass(POOL_SIMPLE) |
@@ -73,7 +123,7 @@ LLDrawPoolSimple::LLDrawPoolSimple() : | |||
73 | 123 | ||
74 | void LLDrawPoolSimple::prerender() | 124 | void LLDrawPoolSimple::prerender() |
75 | { | 125 | { |
76 | mVertexShaderLevel = gPipeline.getVertexShaderLevel(LLPipeline::SHADER_OBJECT); | 126 | mVertexShaderLevel = LLShaderMgr::getVertexShaderLevel(LLShaderMgr::SHADER_OBJECT); |
77 | } | 127 | } |
78 | 128 | ||
79 | void LLDrawPoolSimple::beginRenderPass(S32 pass) | 129 | void LLDrawPoolSimple::beginRenderPass(S32 pass) |
@@ -117,20 +167,14 @@ void LLDrawPoolSimple::render(S32 pass) | |||
117 | } | 167 | } |
118 | 168 | ||
119 | { | 169 | { |
120 | LLFastTimer t(LLFastTimer::FTM_RENDER_GLOW); | ||
121 | glDisableClientState(GL_COLOR_ARRAY); | ||
122 | LLRenderPassGlow glow; | ||
123 | glow.render(); | ||
124 | } | ||
125 | |||
126 | { | ||
127 | LLFastTimer t(LLFastTimer::FTM_RENDER_INVISIBLE); | 170 | LLFastTimer t(LLFastTimer::FTM_RENDER_INVISIBLE); |
128 | U32 invisi_mask = LLVertexBuffer::MAP_VERTEX; | 171 | U32 invisi_mask = LLVertexBuffer::MAP_VERTEX; |
172 | glDisableClientState(GL_COLOR_ARRAY); | ||
129 | glDisableClientState(GL_TEXTURE_COORD_ARRAY); | 173 | glDisableClientState(GL_TEXTURE_COORD_ARRAY); |
130 | glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE); | 174 | glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE); |
131 | renderInvisible(invisi_mask); | 175 | renderInvisible(invisi_mask); |
132 | renderActive(LLRenderPass::PASS_INVISIBLE, invisi_mask); | 176 | renderActive(LLRenderPass::PASS_INVISIBLE, invisi_mask); |
133 | glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); | 177 | glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_FALSE); |
134 | } | 178 | } |
135 | } | 179 | } |
136 | 180 | ||