From db5ba95f5849779edbda70ba13666ae63fce3859 Mon Sep 17 00:00:00 2001 From: Shyotl Date: Sat, 9 Apr 2011 19:44:27 -0500 Subject: [PATCH 01/22] Fixed fast-alpha'd textures on hud attachments not rendering as fullbright --- indra/newview/llvovolume.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index ade4a343b..abbc5e9b6 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -2766,7 +2766,9 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std:: // can we safely treat this as an alpha mask? if (facep->canRenderAsMask()) { - if (te->getFullbright()) + const LLDrawable* drawablep = facep->getDrawable(); + const LLVOVolume* vobj = drawablep ? drawablep->getVOVolume() : NULL; + if (te->getFullbright() || (vobj && vobj->isHUDAttachment())) { registerFace(group, facep, LLRenderPass::PASS_FULLBRIGHT_ALPHA_MASK); } From e9147cb7fb0cf93fdd26cdf6acbf5f6dd5b6bb79 Mon Sep 17 00:00:00 2001 From: Shyotl Date: Mon, 11 Apr 2011 22:19:49 -0500 Subject: [PATCH 02/22] Cleaned up overlapping elements in group properties panel --- .../default/xui/en-us/panel_group_general.xml | 45 ++++++++++--------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/indra/newview/skins/default/xui/en-us/panel_group_general.xml b/indra/newview/skins/default/xui/en-us/panel_group_general.xml index 4580ed72e..20f75ecbb 100644 --- a/indra/newview/skins/default/xui/en-us/panel_group_general.xml +++ b/indra/newview/skins/default/xui/en-us/panel_group_general.xml @@ -80,23 +80,23 @@ Hover your mouse over the options for more help. - + Group Preferences - - - - + Content Rating + + @@ -124,29 +127,27 @@ Hover your mouse over the options for more help. - - - My Active Title - - - - - - + + + My Active Title + + + Retrieving member data From 125a90e46b6dbf3718431d801909749a2680fed4 Mon Sep 17 00:00:00 2001 From: Shyotl Date: Tue, 12 Apr 2011 15:24:31 -0500 Subject: [PATCH 03/22] Cleanup --- indra/newview/llhudeffect.cpp | 1 - indra/newview/llhudeffect.h | 3 --- indra/newview/llhudeffectbeam.cpp | 1 - indra/newview/llhudeffecttrail.cpp | 1 - indra/newview/llspatialpartition.h | 2 +- 5 files changed, 1 insertion(+), 7 deletions(-) diff --git a/indra/newview/llhudeffect.cpp b/indra/newview/llhudeffect.cpp index c1d46f98d..bfd62805a 100644 --- a/indra/newview/llhudeffect.cpp +++ b/indra/newview/llhudeffect.cpp @@ -38,7 +38,6 @@ #include "llgl.h" #include "llagent.h" #include "llrendersphere.h" -#include "llimagegl.h" #include "llviewerobjectlist.h" #include "lldrawable.h" diff --git a/indra/newview/llhudeffect.h b/indra/newview/llhudeffect.h index 954cda7c8..781e57fa6 100644 --- a/indra/newview/llhudeffect.h +++ b/indra/newview/llhudeffect.h @@ -37,9 +37,6 @@ #include "lluuid.h" #include "v4coloru.h" -#include "llinterp.h" -#include "llframetimer.h" -#include "llmemory.h" const F32 LL_HUD_DUR_SHORT = 1.f; diff --git a/indra/newview/llhudeffectbeam.cpp b/indra/newview/llhudeffectbeam.cpp index a7c121434..fc8fc3cd0 100644 --- a/indra/newview/llhudeffectbeam.cpp +++ b/indra/newview/llhudeffectbeam.cpp @@ -43,7 +43,6 @@ #include "llgl.h" #include "llglheaders.h" #include "llhudrender.h" -#include "llimagegl.h" #include "llrendersphere.h" #include "llviewercamera.h" #include "llvoavatar.h" diff --git a/indra/newview/llhudeffecttrail.cpp b/indra/newview/llhudeffecttrail.cpp index c01222ebc..fa69a27e0 100644 --- a/indra/newview/llhudeffecttrail.cpp +++ b/indra/newview/llhudeffecttrail.cpp @@ -35,7 +35,6 @@ #include "llhudeffecttrail.h" #include "llviewercontrol.h" -#include "llimagegl.h" #include "message.h" #include "llagent.h" diff --git a/indra/newview/llspatialpartition.h b/indra/newview/llspatialpartition.h index ebab60e49..5b7ce8863 100644 --- a/indra/newview/llspatialpartition.h +++ b/indra/newview/llspatialpartition.h @@ -408,7 +408,7 @@ public: BOOL mOcclusionEnabled; // if TRUE, occlusion culling is performed BOOL mInfiniteFarClip; // if TRUE, frustum culling ignores far clip plane U32 mBufferUsage; - BOOL mRenderByGroup; + const BOOL mRenderByGroup; U32 mLODSeed; U32 mLODPeriod; //number of frames between LOD updates for a given spatial group (staggered by mLODSeed) U32 mVertexDataMask; From 15a8a86b1513d6994f23e3e8de55c974a872d84a Mon Sep 17 00:00:00 2001 From: Shyotl Date: Tue, 12 Apr 2011 15:26:03 -0500 Subject: [PATCH 04/22] Alphas can now glow as expected --- indra/newview/llvovolume.cpp | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index abbc5e9b6..0eb19b92d 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -337,11 +337,6 @@ void LLVOVolume::animateTextures() te->getScale(&scale_s, &scale_t); } - LLVector3 scale(scale_s, scale_t, 1.f); - LLVector3 trans(off_s+0.5f, off_t+0.5f, 0.f); - LLQuaternion quat; - quat.setQuat(rot, 0, 0, -1.f); - if (!facep->mTextureMatrix) { facep->mTextureMatrix = new LLMatrix4(); @@ -349,7 +344,16 @@ void LLVOVolume::animateTextures() LLMatrix4& tex_mat = *facep->mTextureMatrix; tex_mat.setIdentity(); - tex_mat.translate(LLVector3(-0.5f, -0.5f, 0.f)); + LLVector3 trans ; + { + trans.set(LLVector3(off_s+0.5f, off_t+0.5f, 0.f)); + tex_mat.translate(LLVector3(-0.5f, -0.5f, 0.f)); + } + + LLVector3 scale(scale_s, scale_t, 1.f); + LLQuaternion quat; + quat.setQuat(rot, 0, 0, -1.f); + tex_mat.rotate(quat); LLMatrix4 mat; @@ -892,9 +896,7 @@ BOOL LLVOVolume::calcLOD() if (distance < rampDist) { // Boost LOD when you're REALLY close - distance *= 1.0f/rampDist; - distance *= distance; - distance *= rampDist; + distance *= distance/rampDist; } // DON'T Compensate for field of view changing on FOV zoom. @@ -2228,7 +2230,7 @@ void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep, U8 glow = 0; - if (type == LLRenderPass::PASS_GLOW) + if (type == LLRenderPass::PASS_GLOW || type==LLRenderPass::PASS_ALPHA) //Alpha pass now handles glow internally { glow = (U8) (facep->getTextureEntry()->getGlow() * 255); } @@ -2864,7 +2866,7 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std:: } } - if (LLPipeline::sRenderGlow && te->getGlow() > 0.f) + if (!is_alpha && LLPipeline::sRenderGlow && te->getGlow() > 0.f) { registerFace(group, facep, LLRenderPass::PASS_GLOW); } From c6fa0be39bf1b890ea32a67480cdbf97a228058d Mon Sep 17 00:00:00 2001 From: Shyotl Date: Tue, 12 Apr 2011 16:40:23 -0500 Subject: [PATCH 05/22] Cleanup and render-to-texture tweaks. Added two new debug render modes Fixed bizarre issue with line-widths being sporadically inconsistent in ui. (needs glFlush for some reason) --- indra/newview/llspatialpartition.cpp | 18 +- indra/newview/llviewerdisplay.cpp | 5 +- indra/newview/llviewermenu.cpp | 8 +- indra/newview/pipeline.cpp | 253 ++++++++++++++++++--------- indra/newview/pipeline.h | 7 +- 5 files changed, 203 insertions(+), 88 deletions(-) diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index 63784107b..3bb62ea03 100644 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -2883,6 +2883,16 @@ public: renderBoundingBox(drawable); } + if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_BUILD_QUEUE)) + { + if (drawable->isState(LLDrawable::IN_REBUILD_Q2)) + { + gGL.color4f(0.6f, 0.6f, 0.1f, 1.f); + const LLVector3* ext = drawable->getSpatialExtents(); + drawBoxOutline((ext[0]+ext[1])*0.5f, (ext[1]-ext[0])*0.5f); + } + } + if (drawable->getVOVolume() && gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_TEXTURE_PRIORITY)) { renderTexturePriority(drawable); @@ -2902,6 +2912,10 @@ public: { renderRaycast(drawable); } + if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_UPDATE_TYPE)) + { + renderUpdateType(drawable); + } LLVOAvatar* avatar = dynamic_cast(drawable->getVObj().get()); @@ -3060,13 +3074,15 @@ void LLSpatialPartition::renderDebug() LLPipeline::RENDER_DEBUG_OCCLUSION | LLPipeline::RENDER_DEBUG_LIGHTS | LLPipeline::RENDER_DEBUG_BATCH_SIZE | + LLPipeline::RENDER_DEBUG_UPDATE_TYPE | LLPipeline::RENDER_DEBUG_BBOXES | LLPipeline::RENDER_DEBUG_POINTS | LLPipeline::RENDER_DEBUG_TEXTURE_PRIORITY | LLPipeline::RENDER_DEBUG_TEXTURE_ANIM | LLPipeline::RENDER_DEBUG_RAYCAST | LLPipeline::RENDER_DEBUG_AVATAR_VOLUME | - LLPipeline::RENDER_DEBUG_AGENT_TARGET)) + LLPipeline::RENDER_DEBUG_AGENT_TARGET | + LLPipeline::RENDER_DEBUG_BUILD_QUEUE)) { return; } diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp index 765329cdc..98ab73cb8 100644 --- a/indra/newview/llviewerdisplay.cpp +++ b/indra/newview/llviewerdisplay.cpp @@ -119,7 +119,6 @@ void render_hud_attachments(); void render_ui_3d(); void render_ui_2d(); void render_disconnected_background(); -void render_hud_elements(); void display_startup() { @@ -681,9 +680,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) LLGLState::checkTextureChannels(); LLGLState::checkClientArrays(); - BOOL to_texture = !for_snapshot && - gPipeline.canUseVertexShaders() && - LLPipeline::sRenderGlow; + BOOL to_texture = gPipeline.canUseVertexShaders() && (LLPipeline::sRenderDeferred || LLPipeline::sRenderGlow); LLAppViewer::instance()->pingMainloopTimeout("Display:Swap"); diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 6fb3fa9be..34ca31e78 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -1478,7 +1478,13 @@ void init_debug_rendering_menu(LLMenuGL* menu) sub_menu->append(new LLMenuItemCheckGL("Sculpt", &LLPipeline::toggleRenderDebug, NULL, &LLPipeline::toggleRenderDebugControl, (void*)LLPipeline::RENDER_DEBUG_SCULPTED)); - + sub_menu->append(new LLMenuItemCheckGL("Build Queue", &LLPipeline::toggleRenderDebug, NULL, + &LLPipeline::toggleRenderDebugControl, + (void*)LLPipeline::RENDER_DEBUG_BUILD_QUEUE)); + sub_menu->append(new LLMenuItemCheckGL("Update Types", &LLPipeline::toggleRenderDebug, NULL, + &LLPipeline::toggleRenderDebugControl, + (void*)LLPipeline::RENDER_DEBUG_UPDATE_TYPE)); + sub_menu->append(new LLMenuItemCallGL("Vectorize Perf Test", &run_vectorize_perf_test)); sub_menu = new LLMenuGL("Render Tests"); diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 15a05e13c..c1299f3ac 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -146,6 +146,7 @@ const LLMatrix4* gGLLastMatrix = NULL; std::string gPoolNames[] = { // Correspond to LLDrawpool enum render type + "NONE", "POOL_SIMPLE", "POOL_TERRAIN", "POOL_BUMP", @@ -380,6 +381,7 @@ void LLPipeline::init() LLViewerShaderMgr::instance()->setShaders(); stop_glerror(); + setLightingDetail(-1); } LLPipeline::~LLPipeline() @@ -452,8 +454,6 @@ void LLPipeline::cleanup() releaseGLBuffers(); - mBloomImagep = NULL; - mBloomImage2p = NULL; mFaceSelectImagep = NULL; mMovedBridge.clear(); @@ -558,13 +558,12 @@ void LLPipeline::allocateScreenBuffer(U32 resX, U32 resY) //static void LLPipeline::updateRenderDeferred() { - BOOL deferred = (gSavedSettings.getBOOL("RenderDeferred") && + sRenderDeferred = (gSavedSettings.getBOOL("RenderDeferred") && LLRenderTarget::sUseFBO && gSavedSettings.getBOOL("VertexShaderEnable") && gSavedSettings.getBOOL("RenderAvatarVP") && - gSavedSettings.getBOOL("WindLightUseAtmosShaders")) ? TRUE : FALSE; - - sRenderDeferred = deferred; + gSavedSettings.getBOOL("WindLightUseAtmosShaders") && + !gUseWireframe); } void LLPipeline::releaseGLBuffers() @@ -1398,6 +1397,7 @@ void LLPipeline::updateCull(LLCamera& camera, LLCullResult& result, S32 water_cl gGLLastMatrix = NULL; glLoadMatrixd(gGLLastModelView); + LLVertexBuffer::unbind(); LLGLDisable blend(GL_BLEND); LLGLDisable test(GL_ALPHA_TEST); @@ -1475,10 +1475,10 @@ void LLPipeline::updateCull(LLCamera& camera, LLCullResult& result, S32 water_cl { mScreen.flush(); } - /*else if (LLPipeline::sUseOcclusion > 1) + else if (LLPipeline::sUseOcclusion > 1) { glFlush(); - }*/ + } } void LLPipeline::markNotCulled(LLSpatialGroup* group, LLCamera& camera) @@ -2372,6 +2372,7 @@ void LLPipeline::postSort(LLCamera& camera) assertInitialized(); + llpushcallstacks ; //rebuild drawable geometry for (LLCullResult::sg_list_t::iterator i = sCull->beginDrawableGroups(); i != sCull->endDrawableGroups(); ++i) { @@ -2382,7 +2383,7 @@ void LLPipeline::postSort(LLCamera& camera) group->rebuildGeom(); } } - + llpushcallstacks ; //rebuild groups sCull->assertDrawMapsEmpty(); @@ -2400,10 +2401,10 @@ void LLPipeline::postSort(LLCamera& camera) } LLSpatialGroup::sNoDelete = TRUE;*/ + rebuildPriorityGroups(); - - - + llpushcallstacks ; + const S32 bin_count = 1024*8; static LLCullResult::drawinfo_list_t alpha_bins[bin_count]; @@ -2504,7 +2505,7 @@ void LLPipeline::postSort(LLCamera& camera) std::sort(sCull->beginAlphaGroups(), sCull->endAlphaGroups(), LLSpatialGroup::CompareDepthGreater()); } - + llpushcallstacks ; // only render if the flag is set. The flag is only set if we are in edit mode or the toggle is set in the menus static const LLCachedControl beacon_always_on("BeaconAlwaysOn",false); if (beacon_always_on && !sShadowRender) @@ -2553,7 +2554,7 @@ void LLPipeline::postSort(LLCamera& camera) forAllVisibleDrawables(renderSoundHighlights); } } - + llpushcallstacks ; // If managing your telehub, draw beacons at telehub and currently selected spawnpoint. if (LLFloaterTelehub::renderBeacons()) { @@ -2583,6 +2584,7 @@ void LLPipeline::postSort(LLCamera& camera) } //LLSpatialGroup::sNoDelete = FALSE; + llpushcallstacks ; } @@ -2615,7 +2617,12 @@ void render_hud_elements() // Render debugging beacons. //gObjectList.renderObjectBeacons(); - //LLHUDObject::renderAll(); + + //TO-DO: + //V2 moved this line from LLPipeline::renderGeom + //Uncomment once multisample z-buffer issues are figured out on ati cards. + // LLHUDObject::renderAll(); + //gObjectList.resetObjectBeacons(); } else if (gForceRenderLandFence) @@ -2938,6 +2945,9 @@ void LLPipeline::renderGeom(LLCamera& camera, BOOL forceVBOUpdate) { // Render debugging beacons. gObjectList.renderObjectBeacons(); + //TO-DO: + //V2 moved this line to LLPipeline::render_hud_elements + //Migrate once multisample z-buffer issues are figured out on ati cards. LLHUDObject::renderAll(); gObjectList.resetObjectBeacons(); } @@ -3167,26 +3177,32 @@ void LLPipeline::renderGeomPostDeferred(LLCamera& camera) gGLLastMatrix = NULL; glLoadMatrixd(gGLModelView); - renderHighlights(); - mHighlightFaces.clear(); - - renderDebug(); - - LLVertexBuffer::unbind(); - - if (gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI)) + //TO-DO: + //V2 moved block to LLPipeline::renderDeferredLighting + //Migrate once multisample z-buffer issues are figured out on ati cards. { - // Render debugging beacons. - gObjectList.renderObjectBeacons(); - LLHUDObject::renderAll(); - gObjectList.resetObjectBeacons(); - } - else - { - // Make sure particle effects disappear - LLHUDObject::renderAllForTimer(); - } + renderHighlights(); + mHighlightFaces.clear(); + renderDebug(); + + LLVertexBuffer::unbind(); + + if (gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI)) + { + // Render debugging beacons. + gObjectList.renderObjectBeacons(); + LLHUDObject::renderAll(); + gObjectList.resetObjectBeacons(); + } + else + { + // Make sure particle effects disappear + LLHUDObject::renderAllForTimer(); + } + } + //END + if (occlude) { occlude = FALSE; @@ -3282,6 +3298,9 @@ void LLPipeline::renderDebug() { LLMemType mt(LLMemType::MTYPE_PIPELINE); + if(!mRenderDebugMask) + return; + assertInitialized(); gGL.color4f(1,1,1,1); @@ -3446,6 +3465,55 @@ void LLPipeline::renderDebug() } } + if (mRenderDebugMask & LLPipeline::RENDER_DEBUG_BUILD_QUEUE) + { + U32 count = 0; + U32 size = mBuildQ2.size(); + LLColor4 col; + + LLGLEnable blend(GL_BLEND); + LLGLDepthTest depth(GL_TRUE, GL_FALSE); + gGL.getTexUnit(0)->bind(LLViewerImage::sWhiteImagep.get()); + + for (LLSpatialGroup::sg_vector_t::iterator iter = mGroupQ2.begin(); iter != mGroupQ2.end(); ++iter) + { + LLSpatialGroup* group = *iter; + if (group->isDead()) + { + continue; + } + + LLSpatialBridge* bridge = group->mSpatialPartition->asBridge(); + + if (bridge && (!bridge->mDrawable || bridge->mDrawable->isDead())) + { + continue; + } + + if (bridge) + { + gGL.pushMatrix(); + glMultMatrixf((F32*)bridge->mDrawable->getRenderMatrix().mMatrix); + } + + F32 alpha = (F32) (size-count)/size; + + + LLVector2 c(1.f-alpha, alpha); + c.normVec(); + + + ++count; + col.set(c.mV[0], c.mV[1], 0, alpha*0.5f+0.1f); + group->drawObjectBox(col); + + if (bridge) + { + gGL.popMatrix(); + } + } + } + gGL.flush(); } @@ -4257,32 +4325,28 @@ void LLPipeline::setupHWLights(LLDrawPool* pool) LLVector4 light_pos_gl(light_pos, 1.0f); F32 light_radius = llmax(light->getLightRadius(), 0.001f); - F32 atten, quad; -#if 0 //1.9.1 - if (pool->getVertexShaderLevel() > 0) - { - atten = light_radius; - quad = llmax(light->getLightFalloff(), 0.0001f); - } - else -#endif - { - F32 x = (3.f * (1.f + light->getLightFalloff())); - atten = x / (light_radius); // % of brightness at radius - quad = 0.0f; - } + F32 x = (3.f * (1.f + light->getLightFalloff())); // why this magic? probably trying to match a historic behavior. + float linatten = x / (light_radius); // % of brightness at radius + mHWLightColors[cur_light] = light_color; S32 gllight = GL_LIGHT0+cur_light; glLightfv(gllight, GL_POSITION, light_pos_gl.mV); glLightfv(gllight, GL_DIFFUSE, light_color.mV); glLightfv(gllight, GL_AMBIENT, LLColor4::black.mV); - glLightfv(gllight, GL_SPECULAR, LLColor4::black.mV); glLightf (gllight, GL_CONSTANT_ATTENUATION, 0.0f); - glLightf (gllight, GL_LINEAR_ATTENUATION, atten); - glLightf (gllight, GL_QUADRATIC_ATTENUATION, quad); - glLightf (gllight, GL_SPOT_EXPONENT, 0.0f); - glLightf (gllight, GL_SPOT_CUTOFF, 180.0f); + glLightf (gllight, GL_LINEAR_ATTENUATION, linatten); + glLightf (gllight, GL_QUADRATIC_ATTENUATION, 0.0f); + //Point lights + { + glLightf (gllight, GL_SPOT_EXPONENT, 0.0f); + glLightf (gllight, GL_SPOT_CUTOFF, 180.0f); + + // we use specular.w = 1.0 as a cheap hack for the shaders to know that this is omnidirectional rather than a spotlight + const float specular[] = {0.f, 0.f, 0.f, 1.f}; + glLightfv(gllight, GL_SPECULAR, specular); + //llinfos << "boring light" << llendl; + } cur_light++; if (cur_light >= 8) { @@ -4299,7 +4363,7 @@ void LLPipeline::setupHWLights(LLDrawPool* pool) glLightfv(gllight, GL_SPECULAR, LLColor4::black.mV); } - if (gAgent.getAvatarObject() && + if (isAgentAvatarValid() && gAgent.getAvatarObject()->mSpecialRenderMode == 3) { LLColor4 light_color = LLColor4::white; @@ -4309,13 +4373,10 @@ void LLPipeline::setupHWLights(LLDrawPool* pool) LLVector4 light_pos_gl(light_pos, 1.0f); F32 light_radius = 16.f; - F32 atten, quad; - { F32 x = 3.f; - atten = x / (light_radius); // % of brightness at radius - quad = 0.0f; - } + float linatten = x / (light_radius); // % of brightness at radius + mHWLightColors[2] = light_color; S32 gllight = GL_LIGHT2; glLightfv(gllight, GL_POSITION, light_pos_gl.mV); @@ -4323,8 +4384,8 @@ void LLPipeline::setupHWLights(LLDrawPool* pool) glLightfv(gllight, GL_AMBIENT, LLColor4::black.mV); glLightfv(gllight, GL_SPECULAR, LLColor4::black.mV); glLightf (gllight, GL_CONSTANT_ATTENUATION, 0.0f); - glLightf (gllight, GL_LINEAR_ATTENUATION, atten); - glLightf (gllight, GL_QUADRATIC_ATTENUATION, quad); + glLightf (gllight, GL_LINEAR_ATTENUATION, linatten); + glLightf (gllight, GL_QUADRATIC_ATTENUATION, 0.0f); glLightf (gllight, GL_SPOT_EXPONENT, 0.0f); glLightf (gllight, GL_SPOT_CUTOFF, 180.0f); } @@ -4341,6 +4402,7 @@ void LLPipeline::setupHWLights(LLDrawPool* pool) void LLPipeline::enableLights(U32 mask) { assertInitialized(); + if (mLightingDetail == 0) { mask &= 0xf003; // sun and backlight only (and fullbright bit) @@ -5528,6 +5590,14 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield) gGL.getTexUnit(0)->activate(); gGL.getTexUnit(0)->setTextureBlendType(LLTexUnit::TB_MULT); + //TO-DO: + //V2 requires this for hover text and such since they have been pulled out of geom render. + //Do this when multisample z-buffer issues are figured out + /*if (LLRenderTarget::sUseFBO) + { //copy depth buffer from mScreen to framebuffer + LLRenderTarget::copyContentsToFramebuffer(mScreen, 0, 0, mScreen.getWidth(), mScreen.getHeight(), + 0, 0, mScreen.getWidth(), mScreen.getHeight(), GL_DEPTH_BUFFER_BIT, GL_NEAREST); + }*/ } @@ -5836,6 +5906,9 @@ void LLPipeline::renderDeferredLighting() { LLGLDisable blend(GL_BLEND); + //TO-DO: + //V2 changed to LLGLDepthTest depth(GL_TRUE, GL_FALSE, GL_ALWAYS); + //Do this when multisample z-buffer issues are figured out LLGLDepthTest depth(GL_FALSE); stop_glerror(); glDrawArrays(GL_TRIANGLE_STRIP, 0, 3); @@ -5852,6 +5925,9 @@ void LLPipeline::renderDeferredLighting() { LLGLDisable blend(GL_BLEND); + //TO-DO: + //V2 changed to LLGLDepthTest depth(GL_TRUE, GL_FALSE, GL_ALWAYS); + //Do this when multisample z-buffer issues are figured out LLGLDepthTest depth(GL_FALSE); stop_glerror(); glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); @@ -6088,6 +6164,26 @@ void LLPipeline::renderDeferredLighting() popRenderTypeMask(); } + //TO-DO: + //V2 moved block from LLPipeline::renderGeomPostDeferred + //Migrate once multisample z-buffer issues are figured out on ati cards. + /*{ + //render highlights, etc. + renderHighlights(); + mHighlightFaces.clear(); + + renderDebug(); + + LLVertexBuffer::unbind(); + + if (gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI)) + { + // Render debugging beacons. + gObjectList.renderObjectBeacons(); + gObjectList.resetObjectBeacons(); + } + }*/ + mScreen.flush(); } @@ -6251,48 +6347,47 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) gPipeline.popRenderTypeMask(); } - gPipeline.pushRenderTypeMask(); - - clearRenderTypeMask(LLPipeline::RENDER_TYPE_WATER, - LLPipeline::RENDER_TYPE_VOIDWATER, - LLPipeline::RENDER_TYPE_GROUND, - LLPipeline::RENDER_TYPE_SKY, - LLPipeline::RENDER_TYPE_CLASSIC_CLOUDS, - LLPipeline::RENDER_TYPE_WL_CLOUDS, - LLPipeline::END_RENDER_TYPES); if (gSavedSettings.getBOOL("RenderWaterReflections")) { //mask out selected geometry based on reflection detail S32 detail = gSavedSettings.getS32("RenderReflectionDetail"); - if (detail > 0) + //if (detail > 0) { //mask out selected geometry based on reflection detail { - if (detail < 4) - { - clearRenderTypeMask(LLPipeline::RENDER_TYPE_PARTICLES, END_RENDER_TYPES); + gPipeline.pushRenderTypeMask(); if (detail < 3) { - clearRenderTypeMask(LLPipeline::RENDER_TYPE_AVATAR, END_RENDER_TYPES); + clearRenderTypeMask(LLPipeline::RENDER_TYPE_PARTICLES, END_RENDER_TYPES); if (detail < 2) { + clearRenderTypeMask(LLPipeline::RENDER_TYPE_AVATAR, END_RENDER_TYPES); + if (detail < 1) + { clearRenderTypeMask(LLPipeline::RENDER_TYPE_VOLUME, END_RENDER_TYPES); } } } + + clearRenderTypeMask(LLPipeline::RENDER_TYPE_WATER, + LLPipeline::RENDER_TYPE_VOIDWATER, + LLPipeline::RENDER_TYPE_GROUND, + LLPipeline::RENDER_TYPE_SKY, + LLPipeline::RENDER_TYPE_CLASSIC_CLOUDS, + LLPipeline::RENDER_TYPE_WL_CLOUDS, + LLPipeline::END_RENDER_TYPES); static LLCachedControl skip_distortion_updates("SkipReflectOcclusionUpdates",false); LLPipeline::sSkipUpdate = skip_distortion_updates; LLGLUserClipPlane clip_plane(plane, mat, projection); LLGLDisable cull(GL_CULL_FACE); updateCull(camera, ref_result, 1); stateSort(camera, ref_result); + gPipeline.grabReferences(ref_result); + renderGeom(camera); + LLPipeline::sSkipUpdate = FALSE; + gPipeline.popRenderTypeMask(); } - gPipeline.grabReferences(ref_result); - LLGLUserClipPlane clip_plane(plane, mat, projection); - renderGeom(camera); - LLPipeline::sSkipUpdate = FALSE; } } - gPipeline.popRenderTypeMask(); } glCullFace(GL_BACK); glPopMatrix(); diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index 36f4c33ec..a7b318c60 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -397,7 +397,9 @@ public: RENDER_DEBUG_SHADOW_FRUSTA = 0x0040000, RENDER_DEBUG_SCULPTED = 0x0080000, RENDER_DEBUG_AVATAR_VOLUME = 0x0100000, - RENDER_DEBUG_AGENT_TARGET = 0x0200000, + RENDER_DEBUG_BUILD_QUEUE = 0x0200000, + RENDER_DEBUG_AGENT_TARGET = 0x0400000, + RENDER_DEBUG_UPDATE_TYPE = 0x0800000, }; public: @@ -602,8 +604,6 @@ protected: std::vector mSelectedFaces; LLPointer mFaceSelectImagep; - LLPointer mBloomImagep; - LLPointer mBloomImage2p; U32 mLightMask; U32 mLightMovingMask; @@ -620,6 +620,7 @@ public: }; void render_bbox(const LLVector3 &min, const LLVector3 &max); +void render_hud_elements(); extern LLPipeline gPipeline; extern BOOL gRenderForSelect; From aa1167e4d592b3d3e08e5f2d8bddef23a1dc7c01 Mon Sep 17 00:00:00 2001 From: Shyotl Date: Tue, 12 Apr 2011 17:47:45 -0500 Subject: [PATCH 06/22] Un-borked Non-Deferred + Snapshot + RenderUseFBO + RenderGlow combination. --- indra/newview/llviewerdisplay.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp index 98ab73cb8..4998a7f9e 100644 --- a/indra/newview/llviewerdisplay.cpp +++ b/indra/newview/llviewerdisplay.cpp @@ -680,7 +680,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) LLGLState::checkTextureChannels(); LLGLState::checkClientArrays(); - BOOL to_texture = gPipeline.canUseVertexShaders() && (LLPipeline::sRenderDeferred || LLPipeline::sRenderGlow); + BOOL to_texture = gPipeline.canUseVertexShaders() && (LLPipeline::sRenderDeferred || (LLPipeline::sRenderGlow && !gSnapshot)); LLAppViewer::instance()->pingMainloopTimeout("Display:Swap"); From 6cbbe493ddae08279597c58712c5133745f25b07 Mon Sep 17 00:00:00 2001 From: Shyotl Date: Wed, 13 Apr 2011 02:47:49 -0500 Subject: [PATCH 07/22] Removed warning regarding 'RenderCubeMap' feature upon startup --- indra/newview/llappviewer.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 5a582678e..dff8e1b30 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -450,8 +450,6 @@ static void settings_to_globals() gShowObjectUpdates = gSavedSettings.getBOOL("ShowObjectUpdates"); LLWorldMapView::sMapScale = gSavedSettings.getF32("MapScale"); LLHoverView::sShowHoverTips = gSavedSettings.getBOOL("ShowHoverTips"); - - LLCubeMap::sUseCubeMaps = LLFeatureManager::getInstance()->isFeatureAvailable("RenderCubeMap"); } static void settings_modify() @@ -738,6 +736,9 @@ bool LLAppViewer::init() gGLActive = TRUE; initWindow(); + // initWindow also initializes the Feature List, so now we can initialize this global. + LLCubeMap::sUseCubeMaps = LLFeatureManager::getInstance()->isFeatureAvailable("RenderCubeMap"); + // call all self-registered classes LLInitClassList::instance().fireCallbacks(); From 2abece181940452204d8042787cb546940d75785 Mon Sep 17 00:00:00 2001 From: "tmac@latestevidence.com" Date: Sat, 16 Apr 2011 15:56:15 -0400 Subject: [PATCH 08/22] Fixed searching for Visual Studio Express versions --- indra/develop.py | 51 ++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 41 insertions(+), 10 deletions(-) diff --git a/indra/develop.py b/indra/develop.py index 35b8aa753..03d1b19bd 100755 --- a/indra/develop.py +++ b/indra/develop.py @@ -518,9 +518,16 @@ class WindowsSetup(PlatformSetup): self.using_express = True print 'Building with ', self.gens[version]['gen'] , "Express edition" break - else: - print >> sys.stderr, 'Cannot find any Visual Studio installation' - sys.exit(1) + else: + for version in 'vc80 vc90 vc100 vc71'.split(): + if self.find_visual_studio_express_single(version): + self._generator = version + self.using_express = True + print 'Building with ', self.gens[version]['gen'] , "Express edition" + break + else: + print >> sys.stderr, 'Cannot find any Visual Studio installation' + sys.exit(1) return self._generator def _set_generator(self, gen): @@ -605,6 +612,28 @@ class WindowsSetup(PlatformSetup): except WindowsError, err: print >> sys.stderr, "Didn't find ", self.gens[gen]['gen'] return '' + + def find_visual_studio_express_single(self, gen=None): + if gen is None: + gen = self._generator + gen = gen.lower() + try: + import _winreg + key_str = (r'SOFTWARE\Microsoft\VCEXpress\%s_Config\Setup\VC' % + self.gens[gen]['ver']) + value_str = (r'ProductDir') + print ('Reading VS environment from HKEY_CURRENT_USER\%s\%s' % + (key_str, value_str)) + print key_str + + reg = _winreg.ConnectRegistry(None, _winreg.HKEY_CURRENT_USER) + key = _winreg.OpenKey(reg, key_str) + value = _winreg.QueryValueEx(key, value_str)[0]+"IDE" + print 'Found: %s' % value + return value + except WindowsError, err: + print >> sys.stderr, "Didn't find ", self.gens[gen]['gen'] + return '' def get_build_cmd(self): if self.incredibuild: @@ -617,13 +646,15 @@ class WindowsSetup(PlatformSetup): if environment == '': environment = self.find_visual_studio_express() if environment == '': - print >> sys.stderr, "Something went very wrong during build stage, could not find a Visual Studio?" - else: - build_dirs=self.build_dirs() - print >> sys.stderr, "\nSolution generation complete, it can can now be found in:", build_dirs[0] - print >> sys.stderr, "\nAs you are using an Express Visual Studio, the build step cannot be automated" - print >> sys.stderr, "\nPlease see https://wiki.secondlife.com/wiki/Microsoft_Visual_Studio#Extra_steps_for_Visual_Studio_Express_editions for Visual Studio Express specific information" - exit(0) + environment = self.find_visual_studio_express_single() + if environment == '': + print >> sys.stderr, "Something went very wrong during build stage, could not find a Visual Studio?" + else: + build_dirs=self.build_dirs() + print >> sys.stderr, "\nSolution generation complete, it can can now be found in:", build_dirs[0] + print >> sys.stderr, "\nAs you are using an Express Visual Studio, the build step cannot be automated" + print >> sys.stderr, "\nPlease see https://wiki.secondlife.com/wiki/Microsoft_Visual_Studio#Extra_steps_for_Visual_Studio_Express_editions for Visual Studio Express specific information" + exit(0) # devenv.com is CLI friendly, devenv.exe... not so much. return ('"%sdevenv.com" %s.sln /build %s' % From 8204ec5565bb7412153de0d7b0d9699ee7b90b4a Mon Sep 17 00:00:00 2001 From: Shyotl Date: Fri, 15 Apr 2011 01:21:33 -0500 Subject: [PATCH 09/22] New gpu_table entries --- indra/newview/gpu_table.txt | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/indra/newview/gpu_table.txt b/indra/newview/gpu_table.txt index 8da785d37..b489034db 100644 --- a/indra/newview/gpu_table.txt +++ b/indra/newview/gpu_table.txt @@ -302,6 +302,8 @@ NVIDIA GeForce 6700 .*NVIDIA.*GeForce 67.* 2 1 NVIDIA GeForce 6800 .*NVIDIA.*GeForce 68.* 2 1 NVIDIA GeForce 7000M .*NVIDIA.*GeForce 7000M.* 0 1 NVIDIA GeForce 7100M .*NVIDIA.*GeForce 7100M.* 0 1 +NVIDIA GeForce 7000 .*NVIDIA.*GeForce 70.* 0 1 +NVIDIA GeForce 7100 .*NVIDIA.*GeForce 71.* 0 1 NVIDIA GeForce 7200 .*NVIDIA.*GeForce 72.* 1 1 NVIDIA GeForce 7300 .*NVIDIA.*GeForce 73.* 1 1 NVIDIA GeForce 7500 .*NVIDIA.*GeForce 75.* 1 1 @@ -389,8 +391,39 @@ NVIDIA MCP78 .*NVIDIA.*MCP78.* 1 1 NVIDIA Quadro2 .*Quadro2.* 0 1 NVIDIA Quadro4 .*Quadro4.* 0 1 NVIDIA Quadro DCC .*Quadro DCC.* 0 1 -NVIDIA Quadro FX 4500 .*Quadro.*FX.*4500.* 3 1 +NVIDIA Quadro FX 1400 .*Quadro.*FX.*1400.* 1 1 +NVIDIA Quadro FX 1500 .*Quadro.*FX.*1500.* 1 1 +NVIDIA Quadro FX 1700 .*Quadro.*FX.*1700.* 2 1 +NVIDIA Quadro FX 1800 .*Quadro.*FX.*1800.* 2 1 +NVIDIA Quadro FX 3400 .*Quadro.*FX.*3400.* 1 1 +NVIDIA Quadro FX 3450 .*Quadro.*FX.*3450.* 1 1 +NVIDIA Quadro FX 3500 .*Quadro.*FX.*3500.* 1 1 +NVIDIA Quadro FX 3700 .*Quadro.*FX.*3700.* 2 1 +NVIDIA Quadro FX 3800 .*Quadro.*FX.*3800.* 2 1 +NVIDIA Quadro FX 370 .*Quadro.*FX.*370.* 2 1 +NVIDIA Quadro FX 380 .*Quadro.*FX.*380.* 2 1 +NVIDIA Quadro FX 4000 .*Quadro.*FX.*4000.* 1 1 +NVIDIA Quadro FX 4500 .*Quadro.*FX.*4500.* 1 1 +NVIDIA Quadro FX 4600 .*Quadro.*FX.*4600.* 2 1 +NVIDIA Quadro FX 4700 .*Quadro.*FX.*4700.* 2 1 +NVIDIA Quadro FX 4800 .*Quadro.*FX.*4800.* 2 1 +NVIDIA Quadro FX 470 .*Quadro.*FX.*470.* 2 1 +NVIDIA Quadro FX 5500 .*Quadro.*FX.*5500.* 1 1 +NVIDIA Quadro FX 5600 .*Quadro.*FX.*5600.* 2 1 +NVIDIA Quadro FX 5700 .*Quadro.*FX.*5700.* 2 1 +NVIDIA Quadro FX 5800 .*Quadro.*FX.*5800.* 2 1 +NVIDIA Quadro FX 540 .*Quadro.*FX.*540.* 1 1 +NVIDIA Quadro FX 550 .*Quadro.*FX.*550.* 1 1 +NVIDIA Quadro FX 560 .*Quadro.*FX.*560.* 1 1 +NVIDIA Quadro FX 570 .*Quadro.*FX.*570.* 2 1 +NVIDIA Quadro FX 580 .*Quadro.*FX.*580.* 2 1 NVIDIA Quadro FX .*Quadro FX.* 1 1 +NVIDIA Quadro VX 200 .*Quadro VX.*200.* 2 1 +NVIDIA Quadro 2000 .*Quadro.*2000.* 2 1 +NVIDIA Quadro 4000 .*Quadro.*4000.* 2 1 +NVIDIA Quadro 5000 .*Quadro.*5000.* 2 1 +NVIDIA Quadro 6000 .*Quadro.*6000.* 2 1 +NVIDIA Quadro 600 .*Quadro.*600.* 2 1 NVIDIA Quadro NVS .*Quadro NVS.* 0 1 NVIDIA RIVA TNT .*RIVA TNT.* 0 0 NVIDIA PCI .*NVIDIA.*/PCI/SSE2 0 0 From d2d53fec7fa73e1d276b0939fc241a164fd31f71 Mon Sep 17 00:00:00 2001 From: Shyotl Date: Fri, 15 Apr 2011 02:42:30 -0500 Subject: [PATCH 10/22] Minor tweaks of little consequence. Nullcheck, overrun paranoia. --- indra/llprimitive/llprimitive.cpp | 5 ++--- indra/llrender/llglstates.h | 11 +++++++--- indra/llrender/llrender.cpp | 36 ++++++++++++++++++++----------- indra/newview/llface.cpp | 29 ++++++++++++++----------- 4 files changed, 49 insertions(+), 32 deletions(-) diff --git a/indra/llprimitive/llprimitive.cpp b/indra/llprimitive/llprimitive.cpp index 9b6f383e1..9bbb07583 100644 --- a/indra/llprimitive/llprimitive.cpp +++ b/indra/llprimitive/llprimitive.cpp @@ -1085,8 +1085,7 @@ BOOL LLPrimitive::packTEMessage(LLMessageSystem *mesgsys, int shield, std::strin U8 packed_buffer[MAX_TE_BUFFER]; U8 *cur_ptr = packed_buffer; - - S32 last_face_index = getNumTEs() - 1; + S32 last_face_index = llmin((U32) getNumTEs(), MAX_TES) - 1; if (client_str == "c228d1cf-4b5d-4ba8-84f4-899a0796aa97") shield = 0; @@ -1380,7 +1379,7 @@ S32 LLPrimitive::unpackTEMessage(LLDataPacker &dp) return retval; } - face_count = getNumTEs(); + face_count = llmin((U32) getNumTEs(), MAX_TES); U32 i; cur_ptr += unpackTEField(cur_ptr, packed_buffer+size, (U8 *)image_data, 16, face_count, MVT_LLUUID); diff --git a/indra/llrender/llglstates.h b/indra/llrender/llglstates.h index d5a29dcd0..9ade49e4e 100644 --- a/indra/llrender/llglstates.h +++ b/indra/llrender/llglstates.h @@ -238,9 +238,11 @@ public: class LLGLSSpecular { public: + F32 mShininess; LLGLSSpecular(const LLColor4& color, F32 shininess) { - if (shininess > 0.0f) + mShininess = shininess; + if (mShininess > 0.0f) { glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, color.mV); S32 shiny = (S32)(shininess*128.f); @@ -250,8 +252,11 @@ public: } ~LLGLSSpecular() { - glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, LLColor4(0.f,0.f,0.f,0.f).mV); - glMateriali(GL_FRONT_AND_BACK, GL_SHININESS, 0); + if (mShininess > 0.f) + { + glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, LLColor4(0.f,0.f,0.f,0.f).mV); + glMateriali(GL_FRONT_AND_BACK, GL_SHININESS, 0); + } } }; diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp index 8a62e557f..1d5078a76 100644 --- a/indra/llrender/llrender.cpp +++ b/indra/llrender/llrender.cpp @@ -795,15 +795,21 @@ void LLRender::setColorMask(bool writeColorR, bool writeColorG, bool writeColorB { flush(); - mCurrColorMask[0] = writeColorR; - mCurrColorMask[1] = writeColorG; - mCurrColorMask[2] = writeColorB; + if (mCurrColorMask[0] != writeColorR || + mCurrColorMask[1] != writeColorG || + mCurrColorMask[2] != writeColorB || + mCurrColorMask[3] != writeAlpha) + { + mCurrColorMask[0] = writeColorR; + mCurrColorMask[1] = writeColorG; + mCurrColorMask[2] = writeColorB; mCurrColorMask[3] = writeAlpha; glColorMask(writeColorR ? GL_TRUE : GL_FALSE, writeColorG ? GL_TRUE : GL_FALSE, - writeColorB ? GL_TRUE : GL_FALSE, - writeAlpha ? GL_TRUE : GL_FALSE); + writeColorB ? GL_TRUE : GL_FALSE, + writeAlpha ? GL_TRUE : GL_FALSE); + } } void LLRender::setSceneBlendType(eBlendType type) @@ -841,15 +847,19 @@ void LLRender::setAlphaRejectSettings(eCompareFunc func, F32 value) { flush(); - mCurrAlphaFunc = func; - mCurrAlphaFuncVal = value; - if (func == CF_DEFAULT) + if (mCurrAlphaFunc != func || + mCurrAlphaFuncVal != value) { - glAlphaFunc(GL_GREATER, 0.01f); - } - else - { - glAlphaFunc(sGLCompareFunc[func], value); + mCurrAlphaFunc = func; + mCurrAlphaFuncVal = value; + if (func == CF_DEFAULT) + { + glAlphaFunc(GL_GREATER, 0.01f); + } + else + { + glAlphaFunc(sGLCompareFunc[func], value); + } } } diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index f929f2fe6..18a9ed8e7 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -596,23 +596,26 @@ void LLFace::printDebugInfo() const llinfos << "II: " << mIndicesIndex << " Count:" << mIndicesCount << llendl; llinfos << llendl; - poolp->printDebugInfo(); - - S32 pool_references = 0; - for (std::vector::iterator iter = poolp->mReferences.begin(); - iter != poolp->mReferences.end(); iter++) + if (poolp) { - LLFace *facep = *iter; - if (facep == this) + poolp->printDebugInfo(); + + S32 pool_references = 0; + for (std::vector::iterator iter = poolp->mReferences.begin(); + iter != poolp->mReferences.end(); iter++) { - llinfos << "Pool reference: " << pool_references << llendl; - pool_references++; + LLFace *facep = *iter; + if (facep == this) + { + llinfos << "Pool reference: " << pool_references << llendl; + pool_references++; + } } - } - if (pool_references != 1) - { - llinfos << "Incorrect number of pool references!" << llendl; + if (pool_references != 1) + { + llinfos << "Incorrect number of pool references!" << llendl; + } } #if 0 From 3901893a3a9fcf067e8bfc42ce0cbbdf9ca391a6 Mon Sep 17 00:00:00 2001 From: Shyotl Date: Sat, 16 Apr 2011 18:18:24 -0500 Subject: [PATCH 11/22] Resolved some unitialized variables. --- indra/llrender/llglslshader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp index 74d48fa0e..057b025d9 100644 --- a/indra/llrender/llglslshader.cpp +++ b/indra/llrender/llglslshader.cpp @@ -70,7 +70,7 @@ hasGamma(false), hasLighting(false), calculatesAtmospherics(false) // LLGLSL Shader implementation //=============================== LLGLSLShader::LLGLSLShader(S32 shader_class) -: mProgramObject(0), mShaderClass(shader_class), mShaderLevel(0), mShaderGroup(SG_DEFAULT) +: mProgramObject(0), mShaderClass(shader_class), mActiveTextureChannels(0), mShaderLevel(0), mShaderGroup(SG_DEFAULT), mUniformsDirty(FALSE) { LLShaderMgr::getGlobalShaderList().push_back(this); } From 2afa251b64d786a9d65f8a1f576825bd1b97f9c3 Mon Sep 17 00:00:00 2001 From: Shyotl Date: Sat, 16 Apr 2011 21:11:14 -0500 Subject: [PATCH 12/22] Added walking sound to collision list in sound explorer floater. Undid some minor regression. --- indra/newview/llfloaterexploresounds.cpp | 3 +- indra/newview/llspatialpartition.cpp | 145 ++++++++++++----------- 2 files changed, 75 insertions(+), 73 deletions(-) diff --git a/indra/newview/llfloaterexploresounds.cpp b/indra/newview/llfloaterexploresounds.cpp index 6aedb1007..6ecd796c8 100644 --- a/indra/newview/llfloaterexploresounds.cpp +++ b/indra/newview/llfloaterexploresounds.cpp @@ -42,7 +42,8 @@ const LLUUID collision_sounds[num_collision_sounds] = LLUUID("be582e5d-b123-41a2-a150-454c39e961c8"), LLUUID("c70141d4-ba06-41ea-bcbc-35ea81cb8335"), LLUUID("7d1826f4-24c4-4aac-8c2e-eff45df37783"), - LLUUID("063c97d3-033a-4e9b-98d8-05c8074922cb") + LLUUID("063c97d3-033a-4e9b-98d8-05c8074922cb"), + LLUUID("e8af4a28-aa83-4310-a7c4-c047e15ea0df") //Step sound }; LLFloaterExploreSounds* LLFloaterExploreSounds::sInstance; diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index b56385962..5f3e91545 100644 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -116,78 +116,6 @@ void validate_drawable(LLDrawable* drawablep) #define validate_drawable(x) #endif -class LLOctreeStateCheck : public LLOctreeTraveler -{ -public: - U32 mInheritedMask[LLViewerCamera::NUM_CAMERAS]; - - LLOctreeStateCheck() - { - for (U32 i = 0; i < LLViewerCamera::NUM_CAMERAS; i++) - { - mInheritedMask[i] = 0; - } - } - - virtual void traverse(const LLSpatialGroup::OctreeNode* node) - { - LLSpatialGroup* group = (LLSpatialGroup*) node->getListener(0); - - node->accept(this); - - - U32 temp[LLViewerCamera::NUM_CAMERAS]; - - for (U32 i = 0; i < LLViewerCamera::NUM_CAMERAS; i++) - { - temp[i] = mInheritedMask[i]; - mInheritedMask[i] |= group->mOcclusionState[i] & LLSpatialGroup::OCCLUDED; - } - - for (U32 i = 0; i < node->getChildCount(); i++) - { - traverse(node->getChild(i)); - } - - for (U32 i = 0; i < LLViewerCamera::NUM_CAMERAS; i++) - { - mInheritedMask[i] = temp[i]; - } - } - - - virtual void visit(const LLOctreeNode* state) - { - LLSpatialGroup* group = (LLSpatialGroup*) state->getListener(0); - - for (U32 i = 0; i < LLViewerCamera::NUM_CAMERAS; i++) - { - if (mInheritedMask[i] && !(group->mOcclusionState[i] & mInheritedMask[i])) - { - llerrs << "Spatial group failed inherited mask test." << llendl; - } - } - - if (group->isState(LLSpatialGroup::DIRTY)) - { - assert_parent_state(group, LLSpatialGroup::DIRTY); - } - } - - void assert_parent_state(LLSpatialGroup* group, LLSpatialGroup::eSpatialState state) - { - LLSpatialGroup* parent = group->getParent(); - while (parent) - { - if (!parent->isState(state)) - { - llerrs << "Spatial group failed parent state check." << llendl; - } - parent = parent->getParent(); - } - } -}; - S32 AABBSphereIntersect(const LLVector3& min, const LLVector3& max, const LLVector3 &origin, const F32 &rad) { @@ -3069,6 +2997,79 @@ void LLSpatialPartition::renderIntersectingBBoxes(LLCamera* camera) pusher.traverse(mOctree); } +class LLOctreeStateCheck : public LLOctreeTraveler +{ +public: + U32 mInheritedMask[LLViewerCamera::NUM_CAMERAS]; + + LLOctreeStateCheck() + { + for (U32 i = 0; i < LLViewerCamera::NUM_CAMERAS; i++) + { + mInheritedMask[i] = 0; + } + } + + virtual void traverse(const LLSpatialGroup::OctreeNode* node) + { + LLSpatialGroup* group = (LLSpatialGroup*) node->getListener(0); + + node->accept(this); + + + U32 temp[LLViewerCamera::NUM_CAMERAS]; + + for (U32 i = 0; i < LLViewerCamera::NUM_CAMERAS; i++) + { + temp[i] = mInheritedMask[i]; + mInheritedMask[i] |= group->mOcclusionState[i] & LLSpatialGroup::OCCLUDED; + } + + for (U32 i = 0; i < node->getChildCount(); i++) + { + traverse(node->getChild(i)); + } + + for (U32 i = 0; i < LLViewerCamera::NUM_CAMERAS; i++) + { + mInheritedMask[i] = temp[i]; + } + } + + + virtual void visit(const LLOctreeNode* state) + { + LLSpatialGroup* group = (LLSpatialGroup*) state->getListener(0); + + for (U32 i = 0; i < LLViewerCamera::NUM_CAMERAS; i++) + { + if (mInheritedMask[i] && !(group->mOcclusionState[i] & mInheritedMask[i])) + { + llerrs << "Spatial group failed inherited mask test." << llendl; + } + } + + if (group->isState(LLSpatialGroup::DIRTY)) + { + assert_parent_state(group, LLSpatialGroup::DIRTY); + } + } + + void assert_parent_state(LLSpatialGroup* group, LLSpatialGroup::eSpatialState state) + { + LLSpatialGroup* parent = group->getParent(); + while (parent) + { + if (!parent->isState(state)) + { + llerrs << "Spatial group failed parent state check." << llendl; + } + parent = parent->getParent(); + } + } +}; + + void LLSpatialPartition::renderDebug() { if (!gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_OCTREE | From cacf87e962855aa11ba6c95592a81cd62dc27bb3 Mon Sep 17 00:00:00 2001 From: Shyotl Date: Sat, 16 Apr 2011 23:42:14 -0500 Subject: [PATCH 13/22] The collisions list is a vanilla C array of explicit size? Ugggh. --- indra/newview/llfloaterexploresounds.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llfloaterexploresounds.cpp b/indra/newview/llfloaterexploresounds.cpp index 6ecd796c8..56c57b4bd 100644 --- a/indra/newview/llfloaterexploresounds.cpp +++ b/indra/newview/llfloaterexploresounds.cpp @@ -12,7 +12,7 @@ #include "llfloaterchat.h" #include "llfloaterblacklist.h" -static const size_t num_collision_sounds = 28; +static const size_t num_collision_sounds = 29; const LLUUID collision_sounds[num_collision_sounds] = { LLUUID("dce5fdd4-afe4-4ea1-822f-dd52cac46b08"), From e81f2ea3bee2a6e3bbc30b33d9a58df9e666a050 Mon Sep 17 00:00:00 2001 From: "tmac@latestevidence.com" Date: Sun, 17 Apr 2011 14:35:31 -0400 Subject: [PATCH 14/22] Made Debug textures floater smaller and better organized. --- .../xui/en-us/floater_avatar_textures.xml | 88 ++++++++----------- 1 file changed, 35 insertions(+), 53 deletions(-) diff --git a/indra/newview/skins/default/xui/en-us/floater_avatar_textures.xml b/indra/newview/skins/default/xui/en-us/floater_avatar_textures.xml index 5236be1de..e83fb1904 100644 --- a/indra/newview/skins/default/xui/en-us/floater_avatar_textures.xml +++ b/indra/newview/skins/default/xui/en-us/floater_avatar_textures.xml @@ -1,63 +1,45 @@ - - - Baked Textures - - - Composite Textures - - +