From 7f2e96f0a316d92446ac2388b60c4156b245fb2a Mon Sep 17 00:00:00 2001 From: Shyotl Date: Fri, 19 Aug 2011 01:34:38 -0500 Subject: [PATCH] Misc small updates to renderer. --- indra/newview/lldrawpool.cpp | 5 ----- indra/newview/lldrawpool.h | 2 -- indra/newview/llhudrender.cpp | 20 ++++++++++++++------ indra/newview/llvovolume.cpp | 12 +----------- indra/newview/pipeline.cpp | 7 +++++-- 5 files changed, 20 insertions(+), 26 deletions(-) diff --git a/indra/newview/lldrawpool.cpp b/indra/newview/lldrawpool.cpp index 589b97822..e32d1b70d 100644 --- a/indra/newview/lldrawpool.cpp +++ b/indra/newview/lldrawpool.cpp @@ -258,11 +258,6 @@ void LLFacePool::dirtyTextures(const std::set& textures { } -BOOL LLFacePool::moveFace(LLFace *face, LLDrawPool *poolp, BOOL copy_data) -{ - return TRUE; -} - // static S32 LLFacePool::drawLoop(face_array_t& face_list) { diff --git a/indra/newview/lldrawpool.h b/indra/newview/lldrawpool.h index a0c947150..481614592 100644 --- a/indra/newview/lldrawpool.h +++ b/indra/newview/lldrawpool.h @@ -183,8 +183,6 @@ public: virtual void resetDrawOrders(); void resetAll(); - BOOL moveFace(LLFace *face, LLDrawPool *poolp, BOOL copy_data = FALSE); - void destroy(); void buildEdges(); diff --git a/indra/newview/llhudrender.cpp b/indra/newview/llhudrender.cpp index e4f5a9735..9b5633872 100644 --- a/indra/newview/llhudrender.cpp +++ b/indra/newview/llhudrender.cpp @@ -104,23 +104,31 @@ void hud_render_text(const LLWString &wstr, const LLVector3 &pos_agent, //get the render_pos in screen space F64 winX, winY, winZ; + LLRect world_view_rect = gViewerWindow->getWorldViewRectRaw(); + S32 viewport[4]; + viewport[0] = world_view_rect.mLeft; + viewport[1] = world_view_rect.mBottom; + viewport[2] = world_view_rect.getWidth(); + viewport[3] = world_view_rect.getHeight(); gluProject(render_pos.mV[0], render_pos.mV[1], render_pos.mV[2], - gGLModelView, gGLProjection, (GLint*) gGLViewport, + gGLModelView, gGLProjection, (GLint*) viewport, &winX, &winY, &winZ); - //fonts all render orthographically, set up projection + //fonts all render orthographically, set up projection`` glMatrixMode(GL_PROJECTION); glPushMatrix(); glMatrixMode(GL_MODELVIEW); gGL.pushMatrix(); LLUI::pushMatrix(); - gViewerWindow->setup2DRender(); - + gl_state_for_2d(world_view_rect.getWidth(), world_view_rect.getHeight()); + gViewerWindow->setup3DViewport(); + + winX -= world_view_rect.mLeft; + winY -= world_view_rect.mBottom; LLUI::loadIdentity(); + glLoadIdentity(); LLUI::translate((F32) winX*1.0f/LLFontGL::sScaleX, (F32) winY*1.0f/(LLFontGL::sScaleY), -(((F32) winZ*2.f)-1.f)); - //glRotatef(angle * RAD_TO_DEG, axis.mV[VX], axis.mV[VY], axis.mV[VZ]); - //glScalef(right_scale, up_scale, 1.f); F32 right_x; font.render(wstr, 0, 0, 0, color, LLFontGL::LEFT, LLFontGL::BASELINE, style, wstr.length(), 1000, &right_x); diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 7df4fc0f8..090376f4b 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -2967,17 +2967,7 @@ void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep, } } - U8 glow = 0; - - if (type == LLRenderPass::PASS_GLOW || type==LLRenderPass::PASS_ALPHA) //Alpha pass now handles glow internally - { - glow = (U8) (facep->getTextureEntry()->getGlow() * 255); - } - - if (!facep->getVertexBuffer()) - { - llerrs << "WTF?" << llendl; - } + U8 glow = (U8) (facep->getTextureEntry()->getGlow() * 255); if (idx >= 0 && draw_vec[idx]->mVertexBuffer == facep->getVertexBuffer() && diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index b30e89b38..bfad5f435 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -7875,8 +7875,11 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) LLGLDisable cull(GL_CULL_FACE); updateCull(camera, ref_result, -water_clip, &plane); stateSort(camera, ref_result); - gPipeline.grabReferences(ref_result); - renderGeom(camera); + if (LLDrawPoolWater::sNeedsDistortionUpdate) + { + gPipeline.grabReferences(ref_result); + renderGeom(camera); + } LLPipeline::sSkipUpdate = FALSE; gPipeline.popRenderTypeMask(); }