diff options
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/lldrawpoolsky.cpp | 68 |
1 files changed, 66 insertions, 2 deletions
diff --git a/linden/indra/newview/lldrawpoolsky.cpp b/linden/indra/newview/lldrawpoolsky.cpp index f0ed380..7f21adc 100644 --- a/linden/indra/newview/lldrawpoolsky.cpp +++ b/linden/indra/newview/lldrawpoolsky.cpp | |||
@@ -61,8 +61,8 @@ LLDrawPool *LLDrawPoolSky::instancePool() | |||
61 | 61 | ||
62 | void LLDrawPoolSky::prerender() | 62 | void LLDrawPoolSky::prerender() |
63 | { | 63 | { |
64 | mVertexShaderLevel = LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_ENVIRONMENT); | 64 | mVertexShaderLevel = LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_ENVIRONMENT); |
65 | gSky.mVOSkyp->updateGeometry(gSky.mVOSkyp->mDrawable); | 65 | // gSky.mVOSkyp->updateGeometry(gSky.mVOSkyp->mDrawable); |
66 | } | 66 | } |
67 | 67 | ||
68 | void LLDrawPoolSky::render(S32 pass) | 68 | void LLDrawPoolSky::render(S32 pass) |
@@ -97,6 +97,7 @@ void LLDrawPoolSky::render(S32 pass) | |||
97 | } | 97 | } |
98 | 98 | ||
99 | 99 | ||
100 | LLVOSky *voskyp = gSky.mVOSkyp; | ||
100 | LLGLSPipelineSkyBox gls_skybox; | 101 | LLGLSPipelineSkyBox gls_skybox; |
101 | 102 | ||
102 | LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE); | 103 | LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE); |
@@ -119,9 +120,43 @@ void LLDrawPoolSky::render(S32 pass) | |||
119 | { | 120 | { |
120 | renderSkyCubeFace(i); | 121 | renderSkyCubeFace(i); |
121 | } | 122 | } |
123 | |||
124 | LLFace *hbfaces[3]; | ||
125 | hbfaces[0] = NULL; | ||
126 | hbfaces[1] = NULL; | ||
127 | hbfaces[2] = NULL; | ||
128 | for (S32 curr_face = 0; curr_face < face_count; curr_face++) | ||
129 | { | ||
130 | LLFace* facep = mDrawFace[curr_face]; | ||
131 | if (voskyp->isSameFace(LLVOSky::FACE_SUN, facep)) | ||
132 | { | ||
133 | hbfaces[0] = facep; | ||
134 | } | ||
135 | if (voskyp->isSameFace(LLVOSky::FACE_MOON, facep)) | ||
136 | { | ||
137 | hbfaces[1] = facep; | ||
138 | } | ||
139 | if (voskyp->isSameFace(LLVOSky::FACE_BLOOM, facep)) | ||
140 | { | ||
141 | hbfaces[2] = facep; | ||
142 | } | ||
143 | } | ||
122 | 144 | ||
123 | LLGLEnable blend(GL_BLEND); | 145 | LLGLEnable blend(GL_BLEND); |
124 | 146 | ||
147 | if (hbfaces[2]) | ||
148 | { | ||
149 | // renderSunHalo(hbfaces[2]); | ||
150 | } | ||
151 | if (hbfaces[0]) | ||
152 | { | ||
153 | // renderHeavenlyBody(0, hbfaces[0]); | ||
154 | } | ||
155 | if (hbfaces[1]) | ||
156 | { | ||
157 | // renderHeavenlyBody(1, hbfaces[1]); | ||
158 | } | ||
159 | |||
125 | glPopMatrix(); | 160 | glPopMatrix(); |
126 | } | 161 | } |
127 | 162 | ||
@@ -146,6 +181,35 @@ void LLDrawPoolSky::renderSkyCubeFace(U8 side) | |||
146 | } | 181 | } |
147 | } | 182 | } |
148 | 183 | ||
184 | void LLDrawPoolSky::renderHeavenlyBody(U8 hb, LLFace* face) | ||
185 | { | ||
186 | if ( !mHB[hb]->getDraw() ) return; | ||
187 | if (! face->getGeomCount()) return; | ||
188 | |||
189 | LLImageGL* tex = face->getTexture(); | ||
190 | gGL.getTexUnit(0)->bind(tex); | ||
191 | LLColor4 color(mHB[hb]->getInterpColor()); | ||
192 | LLOverrideFaceColor override(this, color); | ||
193 | face->renderIndexed(); | ||
194 | } | ||
195 | |||
196 | |||
197 | |||
198 | void LLDrawPoolSky::renderSunHalo(LLFace* face) | ||
199 | { | ||
200 | if (! mHB[0]->getDraw()) return; | ||
201 | if (! face->getGeomCount()) return; | ||
202 | |||
203 | LLImageGL* tex = face->getTexture(); | ||
204 | gGL.getTexUnit(0)->bind(tex); | ||
205 | LLColor4 color(mHB[0]->getInterpColor()); | ||
206 | color.mV[3] = llclamp(mHB[0]->getHaloBrighness(), 0.f, 1.f); | ||
207 | |||
208 | LLOverrideFaceColor override(this, color); | ||
209 | face->renderIndexed(); | ||
210 | } | ||
211 | |||
212 | |||
149 | void LLDrawPoolSky::renderForSelect() | 213 | void LLDrawPoolSky::renderForSelect() |
150 | { | 214 | { |
151 | } | 215 | } |