00001 00032 #include "llviewerprecompiledheaders.h" 00033 00034 #include "lldrawpoolclouds.h" 00035 00036 #include "llface.h" 00037 #include "llsky.h" 00038 #include "llviewercamera.h" 00039 #include "llvoclouds.h" 00040 #include "pipeline.h" 00041 00042 LLDrawPoolClouds::LLDrawPoolClouds() : 00043 LLDrawPool(POOL_CLOUDS) 00044 { 00045 } 00046 00047 LLDrawPool *LLDrawPoolClouds::instancePool() 00048 { 00049 return new LLDrawPoolClouds(); 00050 } 00051 00052 BOOL LLDrawPoolClouds::addFace(LLFace* face) 00053 { 00054 llerrs << "WTF?" << llendl; 00055 return FALSE; 00056 } 00057 00058 void LLDrawPoolClouds::enqueue(LLFace *facep) 00059 { 00060 mDrawFace.push_back(facep); 00061 facep->mDistance = (facep->mCenterAgent - gCamera->getOrigin()) * gCamera->getAtAxis(); 00062 } 00063 00064 void LLDrawPoolClouds::beginRenderPass(S32 pass) 00065 { 00066 glEnableClientState(GL_VERTEX_ARRAY); 00067 glEnableClientState(GL_TEXTURE_COORD_ARRAY); 00068 glEnableClientState(GL_NORMAL_ARRAY); 00069 } 00070 00071 void LLDrawPoolClouds::prerender() 00072 { 00073 mVertexShaderLevel = gPipeline.getVertexShaderLevel(LLPipeline::SHADER_ENVIRONMENT); 00074 } 00075 00076 void LLDrawPoolClouds::render(S32 pass) 00077 { 00078 LLFastTimer ftm(LLFastTimer::FTM_RENDER_CLOUDS); 00079 if (!(gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_CLOUDS))) 00080 { 00081 return; 00082 } 00083 00084 if (mDrawFace.empty()) 00085 { 00086 return; 00087 } 00088 00089 LLGLSPipelineAlpha gls_pipeline_alpha; 00090 LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE); 00091 glAlphaFunc(GL_GREATER,0.01f); 00092 00093 gPipeline.enableLightsFullbright(LLColor4(1.f,1.f,1.f)); 00094 00095 mDrawFace[0]->bindTexture(); 00096 00097 std::sort(mDrawFace.begin(), mDrawFace.end(), LLFace::CompareDistanceGreater()); 00098 00099 drawLoop(); 00100 } 00101 00102 00103 void LLDrawPoolClouds::renderForSelect() 00104 { 00105 }