lldrawpoolground.cpp

Go to the documentation of this file.
00001 
00032 #include "llviewerprecompiledheaders.h"
00033 
00034 #include "lldrawpoolground.h"
00035 
00036 #include "llviewercontrol.h"
00037 
00038 #include "lldrawable.h"
00039 #include "llface.h"
00040 #include "llsky.h"
00041 #include "llviewercamera.h"
00042 #include "llviewerwindow.h"
00043 #include "llworld.h"
00044 #include "pipeline.h"
00045 #include "llagent.h"
00046 #include "llviewerregion.h"
00047 #include "llglslshader.h"
00048 
00049 LLDrawPoolGround::LLDrawPoolGround() :
00050         LLFacePool(POOL_GROUND)
00051 {
00052 }
00053 
00054 LLDrawPool *LLDrawPoolGround::instancePool()
00055 {
00056         return new LLDrawPoolGround();
00057 }
00058 
00059 void LLDrawPoolGround::prerender()
00060 {
00061         mVertexShaderLevel = LLShaderMgr::getVertexShaderLevel(LLShaderMgr::SHADER_ENVIRONMENT);
00062 }
00063 
00064 void LLDrawPoolGround::render(S32 pass)
00065 {
00066         if (mDrawFace.empty())
00067         {
00068                 return;
00069         }       
00070         
00071         glEnableClientState(GL_TEXTURE_COORD_ARRAY);
00072         glEnableClientState(GL_VERTEX_ARRAY);
00073 
00074         LLGLSPipelineSkyBox gls_skybox;
00075         LLGLDisable tex(GL_TEXTURE_2D);
00076         LLGLDepthTest gls_depth(GL_FALSE, GL_FALSE);
00077 
00078         glMatrixMode( GL_PROJECTION );
00079                 
00080         glPushMatrix();
00081         //gViewerWindow->setup3DRender();
00082 
00083         glMatrixMode(GL_MODELVIEW);
00084 
00085         F32 water_height = gAgent.getRegion()->getWaterHeight();
00086         glPushMatrix();
00087         LLVector3 origin = gCamera->getOrigin();
00088         glTranslatef(origin.mV[0], origin.mV[1], llmax(origin.mV[2], water_height));
00089 
00090         LLFace *facep = mDrawFace[0];
00091 
00092         gPipeline.disableLights();
00093 
00094         LLOverrideFaceColor col(this, gSky.mVOSkyp->getGLFogColor());
00095         facep->renderIndexed();
00096         
00097         glMatrixMode( GL_PROJECTION );
00098         glPopMatrix();
00099         glMatrixMode( GL_MODELVIEW );
00100         glPopMatrix();
00101 }
00102 
00103 void LLDrawPoolGround::renderForSelect()
00104 {
00105 }
00106 

Generated on Thu Jul 1 06:08:26 2010 for Second Life Viewer by  doxygen 1.4.7