diff options
Diffstat (limited to 'linden/indra/newview/lldrawpoolsky.cpp')
-rw-r--r-- | linden/indra/newview/lldrawpoolsky.cpp | 58 |
1 files changed, 40 insertions, 18 deletions
diff --git a/linden/indra/newview/lldrawpoolsky.cpp b/linden/indra/newview/lldrawpoolsky.cpp index 127c5c5..ef91b58 100644 --- a/linden/indra/newview/lldrawpoolsky.cpp +++ b/linden/indra/newview/lldrawpoolsky.cpp | |||
@@ -49,7 +49,7 @@ | |||
49 | #include "llglslshader.h" | 49 | #include "llglslshader.h" |
50 | 50 | ||
51 | LLDrawPoolSky::LLDrawPoolSky() : | 51 | LLDrawPoolSky::LLDrawPoolSky() : |
52 | LLFacePool(POOL_SKY) | 52 | LLFacePool(POOL_SKY), mShader(NULL) |
53 | { | 53 | { |
54 | } | 54 | } |
55 | 55 | ||
@@ -61,6 +61,7 @@ LLDrawPool *LLDrawPoolSky::instancePool() | |||
61 | void LLDrawPoolSky::prerender() | 61 | void LLDrawPoolSky::prerender() |
62 | { | 62 | { |
63 | mVertexShaderLevel = LLShaderMgr::getVertexShaderLevel(LLShaderMgr::SHADER_ENVIRONMENT); | 63 | mVertexShaderLevel = LLShaderMgr::getVertexShaderLevel(LLShaderMgr::SHADER_ENVIRONMENT); |
64 | gSky.mVOSkyp->updateGeometry(gSky.mVOSkyp->mDrawable); | ||
64 | } | 65 | } |
65 | 66 | ||
66 | void LLDrawPoolSky::render(S32 pass) | 67 | void LLDrawPoolSky::render(S32 pass) |
@@ -70,25 +71,45 @@ void LLDrawPoolSky::render(S32 pass) | |||
70 | return; | 71 | return; |
71 | } | 72 | } |
72 | 73 | ||
74 | // Don't draw the sky box if we can and are rendering the WL sky dome. | ||
75 | if (gPipeline.canUseWindLightShaders()) | ||
76 | { | ||
77 | return; | ||
78 | } | ||
79 | |||
80 | // use a shader only underwater | ||
81 | if(mVertexShaderLevel > 0 && LLPipeline::sUnderWaterRender) | ||
82 | { | ||
83 | mShader = &gObjectFullbrightWaterProgram; | ||
84 | mShader->bind(); | ||
85 | } | ||
86 | else | ||
87 | { | ||
88 | // don't use shaders! | ||
89 | if (gGLManager.mHasShaderObjects) | ||
90 | { | ||
91 | // Ironically, we must support shader objects to be | ||
92 | // able to use this call. | ||
93 | glUseProgramObjectARB(0); | ||
94 | } | ||
95 | mShader = NULL; | ||
96 | } | ||
97 | |||
98 | |||
73 | LLVOSky *voskyp = gSky.mVOSkyp; | 99 | LLVOSky *voskyp = gSky.mVOSkyp; |
74 | LLGLSPipelineSkyBox gls_skybox; | 100 | LLGLSPipelineSkyBox gls_skybox; |
75 | LLGLDepthTest gls_depth(GL_FALSE, GL_FALSE); | ||
76 | 101 | ||
77 | if (gCamera->getOrigin().mV[VZ] < gAgent.getRegion()->getWaterHeight()) | 102 | LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE); |
78 | //gWorldPointer->getWaterHeight()) | 103 | |
79 | { | 104 | LLGLClampToFarClip far_clip(glh_get_current_projection()); |
80 | //gGLSFog.set(); | 105 | |
81 | } | 106 | LLGLEnable fog_enable( (mVertexShaderLevel < 1 && gCamera->cameraUnderWater()) ? GL_FOG : 0); |
82 | 107 | ||
83 | gPipeline.disableLights(); | 108 | gPipeline.disableLights(); |
84 | 109 | ||
85 | glMatrixMode( GL_PROJECTION ); | 110 | LLGLDisable clip(GL_CLIP_PLANE0); |
86 | 111 | ||
87 | glPushMatrix(); | 112 | glPushMatrix(); |
88 | //gViewerWindow->setup3DRender(); | ||
89 | |||
90 | glMatrixMode(GL_MODELVIEW); | ||
91 | glPushMatrix(); | ||
92 | LLVector3 origin = gCamera->getOrigin(); | 113 | LLVector3 origin = gCamera->getOrigin(); |
93 | glTranslatef(origin.mV[0], origin.mV[1], origin.mV[2]); | 114 | glTranslatef(origin.mV[0], origin.mV[1], origin.mV[2]); |
94 | 115 | ||
@@ -128,21 +149,19 @@ void LLDrawPoolSky::render(S32 pass) | |||
128 | 149 | ||
129 | if (hbfaces[2]) | 150 | if (hbfaces[2]) |
130 | { | 151 | { |
131 | renderSunHalo(hbfaces[2]); | 152 | // renderSunHalo(hbfaces[2]); |
132 | } | 153 | } |
133 | if (hbfaces[0]) | 154 | if (hbfaces[0]) |
134 | { | 155 | { |
135 | renderHeavenlyBody(0, hbfaces[0]); | 156 | // renderHeavenlyBody(0, hbfaces[0]); |
136 | } | 157 | } |
137 | if (hbfaces[1]) | 158 | if (hbfaces[1]) |
138 | { | 159 | { |
139 | renderHeavenlyBody(1, hbfaces[1]); | 160 | // renderHeavenlyBody(1, hbfaces[1]); |
140 | } | 161 | } |
141 | 162 | ||
163 | glDisableClientState(GL_TEXTURE_COORD_ARRAY); | ||
142 | 164 | ||
143 | glMatrixMode( GL_PROJECTION ); | ||
144 | glPopMatrix(); | ||
145 | glMatrixMode( GL_MODELVIEW ); | ||
146 | glPopMatrix(); | 165 | glPopMatrix(); |
147 | } | 166 | } |
148 | 167 | ||
@@ -204,3 +223,6 @@ void LLDrawPoolSky::renderForSelect() | |||
204 | { | 223 | { |
205 | } | 224 | } |
206 | 225 | ||
226 | void LLDrawPoolSky::endRenderPass( S32 pass ) | ||
227 | { | ||
228 | } | ||