From 1aa0161b230f01eea3f62b8baacce8a7acc18187 Mon Sep 17 00:00:00 2001 From: Palmer Date: Mon, 5 Apr 2010 16:53:44 -0700 Subject: One last small change from svn//branches/viewer-mesh @ 114046 for render bump --- indra/newview/llvovolume.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llvovolume.cpp') diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index cb362d557c..346fc0c4e4 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -3839,7 +3839,7 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std:: } else { - if (LLPipeline::sRenderDeferred && te->getBumpmap()) + if (LLPipeline::sRenderDeferred && LLPipeline::sRenderBump && te->getBumpmap()) { registerFace(group, facep, LLRenderPass::PASS_BUMP); } -- cgit v1.2.3 From 2581f9ba0a78416575e48a09616a0d5a8d0a360c Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Mon, 1 Feb 2010 17:29:08 +0000 Subject: start to abstract-out the 'is a spotlight' question so one day we can perhaps make the UI hurt less. --- indra/newview/llvovolume.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'indra/newview/llvovolume.cpp') diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index e6de33c459..b7b024fa1d 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -2451,6 +2451,13 @@ void LLVOVolume::updateSpotLightPriority() } +bool LLVOVolume::isLightSpotlight() +{ + LLLightImageParams* params = (LLLightImageParams*) getParameterEntry(LLNetworkData::PARAMS_LIGHT_IMAGE); + return params->isLightSpotlight(); +} + + LLViewerTexture* LLVOVolume::getLightTexture() { LLUUID id = getLightTextureID(); -- cgit v1.2.3 From ec05d08ed907755cce300f95e9f4ba75a782f582 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Mon, 1 Feb 2010 17:50:55 +0000 Subject: const fix. --- indra/newview/llvovolume.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llvovolume.cpp') diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index b7b024fa1d..10160a4208 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -2451,7 +2451,7 @@ void LLVOVolume::updateSpotLightPriority() } -bool LLVOVolume::isLightSpotlight() +bool LLVOVolume::isLightSpotlight() const { LLLightImageParams* params = (LLLightImageParams*) getParameterEntry(LLNetworkData::PARAMS_LIGHT_IMAGE); return params->isLightSpotlight(); -- cgit v1.2.3 From fa95084dd3e5af99d7a0944e8e3323b91ea85ee1 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Tue, 2 Feb 2010 22:45:30 +0000 Subject: Probably the real fix for isLightSpotlight() - PARAMS_LIGHT_IMAGE isn't guaranteed, duh. --- indra/newview/llvovolume.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'indra/newview/llvovolume.cpp') diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 10160a4208..8a77461369 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -2454,7 +2454,11 @@ void LLVOVolume::updateSpotLightPriority() bool LLVOVolume::isLightSpotlight() const { LLLightImageParams* params = (LLLightImageParams*) getParameterEntry(LLNetworkData::PARAMS_LIGHT_IMAGE); - return params->isLightSpotlight(); + if (params) + { + return params->isLightSpotlight(); + } + return false; } -- cgit v1.2.3 From eb5b0f2542c16aaac2283d4050a4cc2a3c6691f8 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Thu, 4 Mar 2010 15:30:15 -0600 Subject: Optimiziation pass. Added RenderUseStreamVBO to enable/disable usage of VBO's for streaming buffers. Faster traversal of LLCullResult members. Removal of llpushcallstacks from inner loops. Sprinkling in fast timers. --- indra/newview/llvovolume.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/newview/llvovolume.cpp') diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 8a77461369..073d7c2b91 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -3304,7 +3304,6 @@ static LLFastTimer::DeclareTimer FTM_REBUILD_VBO("VBO Rebuilt"); void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) { - llpushcallstacks ; if (group->changeLOD()) { group->mLastUpdateDistance = group->mDistance; @@ -3533,9 +3532,10 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) } static LLFastTimer::DeclareTimer FTM_VOLUME_GEOM("Volume Geometry"); +static LLFastTimer::DeclareTimer FTM_VOLUME_GEOM_PARTIAL("Terse Rebuild"); + void LLVolumeGeometryManager::rebuildMesh(LLSpatialGroup* group) { - llpushcallstacks ; llassert(group); if (group && group->isState(LLSpatialGroup::MESH_DIRTY) && !group->isState(LLSpatialGroup::GEOM_DIRTY)) { @@ -3546,6 +3546,7 @@ void LLVolumeGeometryManager::rebuildMesh(LLSpatialGroup* group) for (LLSpatialGroup::element_iter drawable_iter = group->getData().begin(); drawable_iter != group->getData().end(); ++drawable_iter) { + LLFastTimer t(FTM_VOLUME_GEOM_PARTIAL); LLDrawable* drawablep = *drawable_iter; if (drawablep->isDead() || drawablep->isState(LLDrawable::FORCE_INVISIBLE) ) @@ -3627,7 +3628,6 @@ void LLVolumeGeometryManager::rebuildMesh(LLSpatialGroup* group) void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std::vector& faces, BOOL distance_sort) { - llpushcallstacks ; //calculate maximum number of vertices to store in a single buffer U32 max_vertices = (gSavedSettings.getS32("RenderMaxVBOSize")*1024)/LLVertexBuffer::calcStride(group->mSpatialPartition->mVertexDataMask); max_vertices = llmin(max_vertices, (U32) 65535); -- cgit v1.2.3 From 6286dad2e98e6737afaad405a5e9d4a009d6218b Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Mon, 8 Mar 2010 12:28:33 +0000 Subject: fixes VWR-4214 Glow effect passes through alpha textures where alpha is actually "solid" and its many many dupes. In summary this does the following: * When laying down alpha, uses the new separated color-and-alpha blend func support to suppress existing glow in proportion to the opacity of the incoming fragments * Moves glowing-alpha support from the glow pool to the alpha pool, ensures that the glow pass for a vertex buffer happens after the alpha pass for the vertex buffer so that it doesn't suppress its *own* glow. Tested with all shader modes, FBO on/off, and deferred rendering. Tested with every permutation of alpha/non-alpha/glow/non-glow/fullbright/waterglow/particle interaction I could contrive so far. :) --- indra/newview/llvovolume.cpp | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'indra/newview/llvovolume.cpp') diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 073d7c2b91..c92af140da 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -3199,11 +3199,10 @@ void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep, S32 idx = draw_vec.size()-1; - BOOL fullbright = (type == LLRenderPass::PASS_FULLBRIGHT) || - (type == LLRenderPass::PASS_INVISIBLE) || - (type == LLRenderPass::PASS_ALPHA ? facep->isState(LLFace::FULLBRIGHT) : FALSE); - + (type == LLRenderPass::PASS_INVISIBLE) || + (type == LLRenderPass::PASS_ALPHA ? facep->isState(LLFace::FULLBRIGHT) : FALSE); + if (!fullbright && type != LLRenderPass::PASS_GLOW && !facep->mVertexBuffer->hasDataType(LLVertexBuffer::TYPE_NORMAL)) { llwarns << "Non fullbright face has no normals!" << llendl; @@ -3232,12 +3231,7 @@ void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep, LLViewerTexture* tex = facep->getTexture(); - U8 glow = 0; - - if (type == LLRenderPass::PASS_GLOW) - { - glow = (U8) (facep->getTextureEntry()->getGlow() * 255); - } + U8 glow = (U8) (facep->getTextureEntry()->getGlow() * 255); if (facep->mVertexBuffer.isNull()) { @@ -3878,7 +3872,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); } -- cgit v1.2.3 From 4f4fc07eb12066dcb65a3c2274160ffa0bfd52ef Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Tue, 9 Mar 2010 13:28:23 +0000 Subject: Disable alpha-masking for glowing surfaces. It seems beyond my ability to get right. Refactor some replicated and/or strangely-expressed logic. --- indra/newview/llvovolume.cpp | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'indra/newview/llvovolume.cpp') diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index c92af140da..ea493d4798 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -3201,7 +3201,7 @@ void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep, BOOL fullbright = (type == LLRenderPass::PASS_FULLBRIGHT) || (type == LLRenderPass::PASS_INVISIBLE) || - (type == LLRenderPass::PASS_ALPHA ? facep->isState(LLFace::FULLBRIGHT) : FALSE); + (type == LLRenderPass::PASS_ALPHA && facep->isState(LLFace::FULLBRIGHT)); if (!fullbright && type != LLRenderPass::PASS_GLOW && !facep->mVertexBuffer->hasDataType(LLVertexBuffer::TYPE_NORMAL)) { @@ -3296,6 +3296,16 @@ void LLVolumeGeometryManager::getGeometry(LLSpatialGroup* group) static LLFastTimer::DeclareTimer FTM_REBUILD_VOLUME_VB("Volume"); static LLFastTimer::DeclareTimer FTM_REBUILD_VBO("VBO Rebuilt"); +bool LLVolumeGeometryManager::canRenderAsMask(LLFace* facep) +{ + const LLTextureEntry* te = facep->getTextureEntry(); + return (LLPipeline::sFastAlpha && + (te->getColor().mV[3] == 1.0f) && + (!te->getFullbright()) && // hack: alpha masking renders fullbright faces invisible, need to figure out why - for now, avoid + (te->getGlow() == 0.f) && // glowing masks are hard to implement - don't mask + facep->getTexture()->getIsAlphaMask()); +} + void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) { if (group->changeLOD()) @@ -3421,10 +3431,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) if (type == LLDrawPool::POOL_ALPHA) { - if (LLPipeline::sFastAlpha && - (te->getColor().mV[VW] == 1.0f) && - (!te->getFullbright()) && // hack: alpha masking renders fullbright faces invisible, need to figure out why - for now, avoid - facep->getTexture()->getIsAlphaMask()) + if (canRenderAsMask(facep)) { //can be treated as alpha mask simple_faces.push_back(facep); } @@ -3768,15 +3775,12 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std:: const LLTextureEntry* te = facep->getTextureEntry(); - BOOL is_alpha = facep->getPoolType() == LLDrawPool::POOL_ALPHA ? TRUE : FALSE; + BOOL is_alpha = (facep->getPoolType() == LLDrawPool::POOL_ALPHA) ? TRUE : FALSE; if (is_alpha) { // can we safely treat this as an alpha mask? - if (LLPipeline::sFastAlpha && - (te->getColor().mV[VW] == 1.0f) && - (!te->getFullbright()) && // hack: alpha masking renders fullbright faces invisible, need to figure out why - for now, avoid - facep->getTexture()->getIsAlphaMask()) + if (canRenderAsMask(facep)) { if (te->getFullbright()) { -- cgit v1.2.3 From b64b0c1b777419d210d16a378b6957de65dc3932 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Tue, 9 Mar 2010 13:45:53 +0000 Subject: We can enable alpha masking for fullbright faces as long as we're not in deferred mode. Deferred masked fullbrights are still broken (we fall back to blending instead of masking as a workaround), but they always have been. :/ --- indra/newview/llvovolume.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'indra/newview/llvovolume.cpp') diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index ea493d4798..49c0c4d4e0 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -3299,11 +3299,15 @@ static LLFastTimer::DeclareTimer FTM_REBUILD_VBO("VBO Rebuilt"); bool LLVolumeGeometryManager::canRenderAsMask(LLFace* facep) { const LLTextureEntry* te = facep->getTextureEntry(); - return (LLPipeline::sFastAlpha && - (te->getColor().mV[3] == 1.0f) && - (!te->getFullbright()) && // hack: alpha masking renders fullbright faces invisible, need to figure out why - for now, avoid + return ( + LLPipeline::sFastAlpha && // do we want masks at all? + + (te->getColor().mV[3] == 1.0f) && // can't treat as mask if we have face alpha + !(LLPipeline::sRenderDeferred && te->getFullbright()) && // hack: alpha masking renders fullbright faces invisible in deferred rendering mode, need to figure out why - for now, avoid (te->getGlow() == 0.f) && // glowing masks are hard to implement - don't mask - facep->getTexture()->getIsAlphaMask()); + + facep->getTexture()->getIsAlphaMask() // texture actually qualifies for masking (lazily calculated but expensive) + ); } void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) -- cgit v1.2.3 From 9e51aa3fd6d50181e78c42321ab90eda5761ff01 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Mon, 26 Apr 2010 14:42:06 +0100 Subject: EXT-7060 default auto alpha masking to ON for deferred rendering (only deferred rendering) (transplanted from 050ae2c9451a6b89374c5a10403f373e2475f23b) --- indra/newview/llvovolume.cpp | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) (limited to 'indra/newview/llvovolume.cpp') diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 49c0c4d4e0..aa22dc7f5d 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -2921,9 +2921,7 @@ F32 LLVOVolume::getBinRadius() { LLFace* face = mDrawable->getFace(i); if (face->getPoolType() == LLDrawPool::POOL_ALPHA && - (!LLPipeline::sFastAlpha || - face->getFaceColor().mV[3] != 1.f || - !face->getTexture()->getIsAlphaMask())) + !face->canRenderAsMask()) { alpha_wrap = TRUE; break; @@ -3296,19 +3294,6 @@ void LLVolumeGeometryManager::getGeometry(LLSpatialGroup* group) static LLFastTimer::DeclareTimer FTM_REBUILD_VOLUME_VB("Volume"); static LLFastTimer::DeclareTimer FTM_REBUILD_VBO("VBO Rebuilt"); -bool LLVolumeGeometryManager::canRenderAsMask(LLFace* facep) -{ - const LLTextureEntry* te = facep->getTextureEntry(); - return ( - LLPipeline::sFastAlpha && // do we want masks at all? - - (te->getColor().mV[3] == 1.0f) && // can't treat as mask if we have face alpha - !(LLPipeline::sRenderDeferred && te->getFullbright()) && // hack: alpha masking renders fullbright faces invisible in deferred rendering mode, need to figure out why - for now, avoid - (te->getGlow() == 0.f) && // glowing masks are hard to implement - don't mask - - facep->getTexture()->getIsAlphaMask() // texture actually qualifies for masking (lazily calculated but expensive) - ); -} void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) { @@ -3435,7 +3420,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) if (type == LLDrawPool::POOL_ALPHA) { - if (canRenderAsMask(facep)) + if (facep->canRenderAsMask()) { //can be treated as alpha mask simple_faces.push_back(facep); } @@ -3784,7 +3769,7 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std:: if (is_alpha) { // can we safely treat this as an alpha mask? - if (canRenderAsMask(facep)) + if (facep->canRenderAsMask()) { if (te->getFullbright()) { -- cgit v1.2.3 From 447bffcb532694fcc3bc3b046051f02ac4550fd3 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Tue, 4 May 2010 14:55:02 +0100 Subject: EXT-7161 Fullbright has no effect on shiny & bump mapped prim while Lighting and Shadows are enabled. --- indra/newview/llvovolume.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'indra/newview/llvovolume.cpp') diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index aa22dc7f5d..34ae915a07 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -3802,13 +3802,13 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std:: } else if (LLPipeline::sRenderDeferred) { - if (te->getBumpmap()) + if (te->getFullbright()) { - registerFace(group, facep, LLRenderPass::PASS_BUMP); + registerFace(group, facep, LLRenderPass::PASS_FULLBRIGHT_SHINY); } - else if (te->getFullbright()) + else if (te->getBumpmap()) { - registerFace(group, facep, LLRenderPass::PASS_FULLBRIGHT_SHINY); + registerFace(group, facep, LLRenderPass::PASS_BUMP); } else { -- cgit v1.2.3 From 4a3222d9c12812db70f2c9ec0050012d01155565 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Wed, 12 May 2010 03:59:01 -0500 Subject: Fix for fullbright bump not working in deferred render. Fix for shadow artifacts around split frusta. Tweak for shadow aliasing with projectors. Fix for crash on exit in mesh thread. (transplanted from 6dcf09cd3e524016c8130a0c8af3d9fc95f2d411) --- indra/newview/llvovolume.cpp | 39 +++++++++++++++++++++++++-------------- 1 file changed, 25 insertions(+), 14 deletions(-) (limited to 'indra/newview/llvovolume.cpp') diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 34ae915a07..15b04fa746 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -3225,7 +3225,8 @@ void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep, model_mat = &(drawable->getRegion()->mRenderMatrix); } - U8 bump = (type == LLRenderPass::PASS_BUMP ? facep->getTextureEntry()->getBumpmap() : 0); + + U8 bump = (type == LLRenderPass::PASS_BUMP || type == LLRenderPass::PASS_POST_BUMP) ? facep->getTextureEntry()->getBumpmap() : 0; LLViewerTexture* tex = facep->getTexture(); @@ -3794,66 +3795,76 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std:: && group->mSpatialPartition->mPartitionType != LLViewerRegion::PARTITION_HUD && LLPipeline::sRenderBump && te->getShiny()) - { + { //shiny if (tex->getPrimaryFormat() == GL_ALPHA) - { + { //invisiprim+shiny registerFace(group, facep, LLRenderPass::PASS_INVISI_SHINY); registerFace(group, facep, LLRenderPass::PASS_INVISIBLE); } else if (LLPipeline::sRenderDeferred) - { + { //deferred rendering if (te->getFullbright()) - { + { //register in post deferred fullbright shiny pass registerFace(group, facep, LLRenderPass::PASS_FULLBRIGHT_SHINY); + if (te->getBumpmap()) + { //register in post deferred bump pass + registerFace(group, facep, LLRenderPass::PASS_POST_BUMP); + } } else if (te->getBumpmap()) - { + { //register in deferred bump pass registerFace(group, facep, LLRenderPass::PASS_BUMP); } else - { + { //register in deferred simple pass (deferred simple includes shiny) llassert(mask & LLVertexBuffer::MAP_NORMAL); registerFace(group, facep, LLRenderPass::PASS_SIMPLE); } } else if (fullbright) - { + { //not deferred, register in standard fullbright shiny pass registerFace(group, facep, LLRenderPass::PASS_FULLBRIGHT_SHINY); } else - { + { //not deferred or fullbright, register in standard shiny pass registerFace(group, facep, LLRenderPass::PASS_SHINY); } } else - { + { //not alpha and not shiny if (!is_alpha && tex->getPrimaryFormat() == GL_ALPHA) - { + { //invisiprim registerFace(group, facep, LLRenderPass::PASS_INVISIBLE); } else if (fullbright) - { + { //fullbright registerFace(group, facep, LLRenderPass::PASS_FULLBRIGHT); + if (LLPipeline::sRenderDeferred && LLPipeline::sRenderBump && te->getBumpmap()) + { //if this is the deferred render and a bump map is present, register in post deferred bump + registerFace(group, facep, LLRenderPass::PASS_POST_BUMP); + } } else { if (LLPipeline::sRenderDeferred && LLPipeline::sRenderBump && te->getBumpmap()) - { + { //non-shiny or fullbright deferred bump registerFace(group, facep, LLRenderPass::PASS_BUMP); } else - { + { //all around simple llassert(mask & LLVertexBuffer::MAP_NORMAL); registerFace(group, facep, LLRenderPass::PASS_SIMPLE); } } + //not sure why this is here -- shiny HUD attachments maybe? -- davep 5/11/2010 if (!is_alpha && te->getShiny() && LLPipeline::sRenderBump) { registerFace(group, facep, LLRenderPass::PASS_SHINY); } } + //not sure why this is here, and looks like it might cause bump mapped objects to get rendered redundantly -- davep 5/11/2010 if (!is_alpha && !LLPipeline::sRenderDeferred) { llassert((mask & LLVertexBuffer::MAP_NORMAL) || fullbright); -- cgit v1.2.3 From 51f310e4aecd06be426854b9d9f15db73e5ba0a5 Mon Sep 17 00:00:00 2001 From: Monroe Linden Date: Wed, 21 Jul 2010 17:46:17 -0700 Subject: Miscellaneous cleanup in and around llmediadataclient. Added tags to some media-related logging in LLVOVolume. Made LLMediaDataClient::Responder do most of its work in tick() instead of its destructor. Added a comment to llmediadataclient.cpp that explains the idea behind the two-queue system. Made LLMediaDataClient::sortQueue() remove requests from the queue that hold references to dead items. This should make teleporting away solve many of the pathological queueing cases. Updated llmediadataclient test cases to reflect the change in behavior in sortQueue(). Removed some unnecessary const-ness in LLMediaDataClient::enqueue, which caused it to have to use const_cast. --- indra/newview/llvovolume.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/newview/llvovolume.cpp') diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 5644e02134..c838e9a28d 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -2025,12 +2025,12 @@ void LLVOVolume::mediaNavigated(LLViewerMediaImpl *impl, LLPluginClassMedia* plu } else { - llwarns << "Couldn't find media entry!" << llendl; + LL_WARNS("MediaOnAPrim") << "Couldn't find media entry!" << LL_ENDL; } if(block_navigation) { - llinfos << "blocking navigate to URI " << new_location << llendl; + LL_INFOS("MediaOnAPrim") << "blocking navigate to URI " << new_location << LL_ENDL; // "bounce back" to the current URL from the media entry mediaNavigateBounceBack(face_index); @@ -2038,7 +2038,7 @@ void LLVOVolume::mediaNavigated(LLViewerMediaImpl *impl, LLPluginClassMedia* plu else if (sObjectMediaNavigateClient) { - llinfos << "broadcasting navigate with URI " << new_location << llendl; + LL_DEBUGS("MediaOnAPrim") << "broadcasting navigate with URI " << new_location << LL_ENDL; sObjectMediaNavigateClient->navigate(new LLMediaDataClientObjectImpl(this, false), face_index, new_location); } -- cgit v1.2.3 From 94655359aaa45ef5849cb589f637331b3bcc394c Mon Sep 17 00:00:00 2001 From: Monroe Linden Date: Thu, 29 Jul 2010 15:50:20 -0700 Subject: Yet more cleanup around llmediadataclient. In LLVOVolume, added a count of LLMediaDataClientObjectImpl objects referencing each LLVOVolume object. This allows LLVOVolume::markDead() to skip the relatively expensive calls to removeFromQueue() when the LLVOVolume is known to have no active references. Refactored LLMediaDataClient and its two child classes so that only LLObjectMediaDataClient has the round-robin queue (LLObjectMediaNavigateClient doesn't need it), and cleaned up some of the virtual function hierarchy around queue processing. In LLMediaDataClient, added tracking for requests that aren't currently in a queue (i.e. requests that are in flight or waiting for retries) so they can be found when their objects are marked dead. LLMediaDataClient::Request now directly keeps track of the object ID and face associated with the request. Removed the "markedSent" concept from requests. Requests that have been sent are no longer kept in a queue. The Retry timer now references the Request object instead of the Responder. Replaced LLMediaDataClient::findOrRemove() with separate template functions for find and remove. --- indra/newview/llvovolume.cpp | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) (limited to 'indra/newview/llvovolume.cpp') diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index c838e9a28d..00d67a4ea9 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -93,8 +93,14 @@ static LLFastTimer::DeclareTimer FTM_GEN_VOLUME("Generate Volumes"); class LLMediaDataClientObjectImpl : public LLMediaDataClientObject { public: - LLMediaDataClientObjectImpl(LLVOVolume *obj, bool isNew) : mObject(obj), mNew(isNew) {} - LLMediaDataClientObjectImpl() { mObject = NULL; } + LLMediaDataClientObjectImpl(LLVOVolume *obj, bool isNew) : mObject(obj), mNew(isNew) + { + mObject->addMDCImpl(); + } + ~LLMediaDataClientObjectImpl() + { + mObject->removeMDCImpl(); + } virtual U8 getMediaDataCount() const { return mObject->getNumTEs(); } @@ -119,6 +125,18 @@ public: } return result; } + virtual bool isCurrentMediaUrl(U8 index, const std::string &url) const + { + LLTextureEntry *te = mObject->getTE(index); + if (te) + { + if (te->getMediaData()) + { + return (te->getMediaData()->getCurrentURL() == url); + } + } + return url.empty(); + } virtual LLUUID getID() const { return mObject->getID(); } @@ -193,6 +211,7 @@ LLVOVolume::LLVOVolume(const LLUUID &id, const LLPCode pcode, LLViewerRegion *re mMediaImplList.resize(getNumTEs()); mLastFetchedMediaVersion = -1; mIndexInTex = 0; + mMDCImplCount = 0; } LLVOVolume::~LLVOVolume() @@ -218,9 +237,12 @@ void LLVOVolume::markDead() { if (!mDead) { - LLMediaDataClientObject::ptr_t obj = new LLMediaDataClientObjectImpl(const_cast(this), false); - if (sObjectMediaClient) sObjectMediaClient->removeFromQueue(obj); - if (sObjectMediaNavigateClient) sObjectMediaNavigateClient->removeFromQueue(obj); + if(getMDCImplCount() > 0) + { + LLMediaDataClientObject::ptr_t obj = new LLMediaDataClientObjectImpl(const_cast(this), false); + if (sObjectMediaClient) sObjectMediaClient->removeFromQueue(obj); + if (sObjectMediaNavigateClient) sObjectMediaNavigateClient->removeFromQueue(obj); + } // Detach all media impls from this object for(U32 i = 0 ; i < mMediaImplList.size() ; i++) -- cgit v1.2.3 From 84a9e0abd86ea4546e61f9e58cd9c2d67f7def5e Mon Sep 17 00:00:00 2001 From: Monroe Linden Date: Fri, 30 Jul 2010 13:51:37 -0700 Subject: Fix for EXT-8339 Added a couple of new nav states to LLViewerMediaImpl: MEDIANAVSTATE_FIRST_LOCATION_CHANGED_SPURIOUS and MEDIANAVSTATE_COMPLETE_BEFORE_LOCATION_CHANGED_SPURIOUS. These behave just like the corresponding states without the _SPURIOUS suffix, but will be used if the new navigate doesn't change the current URL of the impl. This allows us to catch cases like the repro of this issue and discard the spurious navigate events. --- indra/newview/llvovolume.cpp | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'indra/newview/llvovolume.cpp') diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 00d67a4ea9..a75ab95622 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -2082,14 +2082,19 @@ void LLVOVolume::mediaEvent(LLViewerMediaImpl *impl, LLPluginClassMedia* plugin, } break; + case LLViewerMediaImpl::MEDIANAVSTATE_FIRST_LOCATION_CHANGED_SPURIOUS: + // This navigate didn't change the current URL. + LL_DEBUGS("MediaOnAPrim") << " NOT broadcasting navigate (spurious)" << LL_ENDL; + break; + case LLViewerMediaImpl::MEDIANAVSTATE_SERVER_FIRST_LOCATION_CHANGED: // This is the first location changed event after the start of a server-directed nav. Don't broadcast it. - llinfos << " NOT broadcasting navigate (server-directed)" << llendl; + LL_INFOS("MediaOnAPrim") << " NOT broadcasting navigate (server-directed)" << LL_ENDL; break; default: // This is a subsequent location-changed due to a redirect. Don't broadcast. - llinfos << " NOT broadcasting navigate (redirect)" << llendl; + LL_INFOS("MediaOnAPrim") << " NOT broadcasting navigate (redirect)" << LL_ENDL; break; } } @@ -2106,9 +2111,14 @@ void LLVOVolume::mediaEvent(LLViewerMediaImpl *impl, LLPluginClassMedia* plugin, } break; + case LLViewerMediaImpl::MEDIANAVSTATE_COMPLETE_BEFORE_LOCATION_CHANGED_SPURIOUS: + // This navigate didn't change the current URL. + LL_DEBUGS("MediaOnAPrim") << " NOT broadcasting navigate (spurious)" << LL_ENDL; + break; + case LLViewerMediaImpl::MEDIANAVSTATE_SERVER_COMPLETE_BEFORE_LOCATION_CHANGED: // This is the the navigate complete event from a server-directed nav. Don't broadcast it. - llinfos << " NOT broadcasting navigate (server-directed)" << llendl; + LL_INFOS("MediaOnAPrim") << " NOT broadcasting navigate (server-directed)" << LL_ENDL; break; default: -- cgit v1.2.3 From 06b0d72efa96b6a0ed665f7cd46f358c48929e7b Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Fri, 13 Aug 2010 07:24:57 -0400 Subject: Change license from GPL to LGPL (version 2.1) --- indra/newview/llvovolume.cpp | 36 +++++++++++++++--------------------- 1 file changed, 15 insertions(+), 21 deletions(-) (limited to 'indra/newview/llvovolume.cpp') diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 24e2f745d4..4e3be0f703 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -2,31 +2,25 @@ * @file llvovolume.cpp * @brief LLVOVolume class implementation * - * $LicenseInfo:firstyear=2001&license=viewergpl$ - * - * Copyright (c) 2001-2009, Linden Research, Inc. - * + * $LicenseInfo:firstyear=2001&license=viewerlgpl$ * Second Life Viewer Source Code - * The source code in this file ("Source Code") is provided by Linden Lab - * to you under the terms of the GNU General Public License, version 2.0 - * ("GPL"), unless you have obtained a separate licensing agreement - * ("Other License"), formally executed by you and Linden Lab. Terms of - * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. * - * There are special exceptions to the terms and conditions of the GPL as - * it is applied to this Source Code. View the full text of the exception - * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at - * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. * - * By copying, modifying or distributing this software, you acknowledge - * that you have read and understood your obligations described above, - * and agree to abide by those obligations. + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * - * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO - * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, - * COMPLETENESS OR PERFORMANCE. + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ -- cgit v1.2.3 From 98cc2365034a93c69704daa69efb389799cc9627 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Tue, 24 Aug 2010 18:44:39 +0100 Subject: Backed out changeset a62bf7c0af21 Backing out this merge that I pushed (prematurely) to the wrong place. --- indra/newview/llvovolume.cpp | 150 +++++++++++++++---------------------------- 1 file changed, 53 insertions(+), 97 deletions(-) (limited to 'indra/newview/llvovolume.cpp') diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 761e12020b..4e3be0f703 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -87,14 +87,8 @@ static LLFastTimer::DeclareTimer FTM_GEN_VOLUME("Generate Volumes"); class LLMediaDataClientObjectImpl : public LLMediaDataClientObject { public: - LLMediaDataClientObjectImpl(LLVOVolume *obj, bool isNew) : mObject(obj), mNew(isNew) - { - mObject->addMDCImpl(); - } - ~LLMediaDataClientObjectImpl() - { - mObject->removeMDCImpl(); - } + LLMediaDataClientObjectImpl(LLVOVolume *obj, bool isNew) : mObject(obj), mNew(isNew) {} + LLMediaDataClientObjectImpl() { mObject = NULL; } virtual U8 getMediaDataCount() const { return mObject->getNumTEs(); } @@ -119,18 +113,6 @@ public: } return result; } - virtual bool isCurrentMediaUrl(U8 index, const std::string &url) const - { - LLTextureEntry *te = mObject->getTE(index); - if (te) - { - if (te->getMediaData()) - { - return (te->getMediaData()->getCurrentURL() == url); - } - } - return url.empty(); - } virtual LLUUID getID() const { return mObject->getID(); } @@ -205,7 +187,6 @@ LLVOVolume::LLVOVolume(const LLUUID &id, const LLPCode pcode, LLViewerRegion *re mMediaImplList.resize(getNumTEs()); mLastFetchedMediaVersion = -1; mIndexInTex = 0; - mMDCImplCount = 0; } LLVOVolume::~LLVOVolume() @@ -231,12 +212,9 @@ void LLVOVolume::markDead() { if (!mDead) { - if(getMDCImplCount() > 0) - { - LLMediaDataClientObject::ptr_t obj = new LLMediaDataClientObjectImpl(const_cast(this), false); - if (sObjectMediaClient) sObjectMediaClient->removeFromQueue(obj); - if (sObjectMediaNavigateClient) sObjectMediaNavigateClient->removeFromQueue(obj); - } + LLMediaDataClientObject::ptr_t obj = new LLMediaDataClientObjectImpl(const_cast(this), false); + if (sObjectMediaClient) sObjectMediaClient->removeFromQueue(obj); + if (sObjectMediaNavigateClient) sObjectMediaNavigateClient->removeFromQueue(obj); // Detach all media impls from this object for(U32 i = 0 ; i < mMediaImplList.size() ; i++) @@ -2041,12 +2019,12 @@ void LLVOVolume::mediaNavigated(LLViewerMediaImpl *impl, LLPluginClassMedia* plu } else { - LL_WARNS("MediaOnAPrim") << "Couldn't find media entry!" << LL_ENDL; + llwarns << "Couldn't find media entry!" << llendl; } if(block_navigation) { - LL_INFOS("MediaOnAPrim") << "blocking navigate to URI " << new_location << LL_ENDL; + llinfos << "blocking navigate to URI " << new_location << llendl; // "bounce back" to the current URL from the media entry mediaNavigateBounceBack(face_index); @@ -2054,7 +2032,7 @@ void LLVOVolume::mediaNavigated(LLViewerMediaImpl *impl, LLPluginClassMedia* plu else if (sObjectMediaNavigateClient) { - LL_DEBUGS("MediaOnAPrim") << "broadcasting navigate with URI " << new_location << LL_ENDL; + llinfos << "broadcasting navigate with URI " << new_location << llendl; sObjectMediaNavigateClient->navigate(new LLMediaDataClientObjectImpl(this, false), face_index, new_location); } @@ -2076,19 +2054,14 @@ void LLVOVolume::mediaEvent(LLViewerMediaImpl *impl, LLPluginClassMedia* plugin, } break; - case LLViewerMediaImpl::MEDIANAVSTATE_FIRST_LOCATION_CHANGED_SPURIOUS: - // This navigate didn't change the current URL. - LL_DEBUGS("MediaOnAPrim") << " NOT broadcasting navigate (spurious)" << LL_ENDL; - break; - case LLViewerMediaImpl::MEDIANAVSTATE_SERVER_FIRST_LOCATION_CHANGED: // This is the first location changed event after the start of a server-directed nav. Don't broadcast it. - LL_INFOS("MediaOnAPrim") << " NOT broadcasting navigate (server-directed)" << LL_ENDL; + llinfos << " NOT broadcasting navigate (server-directed)" << llendl; break; default: // This is a subsequent location-changed due to a redirect. Don't broadcast. - LL_INFOS("MediaOnAPrim") << " NOT broadcasting navigate (redirect)" << LL_ENDL; + llinfos << " NOT broadcasting navigate (redirect)" << llendl; break; } } @@ -2105,14 +2078,9 @@ void LLVOVolume::mediaEvent(LLViewerMediaImpl *impl, LLPluginClassMedia* plugin, } break; - case LLViewerMediaImpl::MEDIANAVSTATE_COMPLETE_BEFORE_LOCATION_CHANGED_SPURIOUS: - // This navigate didn't change the current URL. - LL_DEBUGS("MediaOnAPrim") << " NOT broadcasting navigate (spurious)" << LL_ENDL; - break; - case LLViewerMediaImpl::MEDIANAVSTATE_SERVER_COMPLETE_BEFORE_LOCATION_CHANGED: // This is the the navigate complete event from a server-directed nav. Don't broadcast it. - LL_INFOS("MediaOnAPrim") << " NOT broadcasting navigate (server-directed)" << LL_ENDL; + llinfos << " NOT broadcasting navigate (server-directed)" << llendl; break; default: @@ -2486,17 +2454,6 @@ void LLVOVolume::updateSpotLightPriority() } -bool LLVOVolume::isLightSpotlight() const -{ - LLLightImageParams* params = (LLLightImageParams*) getParameterEntry(LLNetworkData::PARAMS_LIGHT_IMAGE); - if (params) - { - return params->isLightSpotlight(); - } - return false; -} - - LLViewerTexture* LLVOVolume::getLightTexture() { LLUUID id = getLightTextureID(); @@ -2956,7 +2913,9 @@ F32 LLVOVolume::getBinRadius() { LLFace* face = mDrawable->getFace(i); if (face->getPoolType() == LLDrawPool::POOL_ALPHA && - !face->canRenderAsMask()) + (!LLPipeline::sFastAlpha || + face->getFaceColor().mV[3] != 1.f || + !face->getTexture()->getIsAlphaMask())) { alpha_wrap = TRUE; break; @@ -3232,10 +3191,11 @@ void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep, S32 idx = draw_vec.size()-1; + BOOL fullbright = (type == LLRenderPass::PASS_FULLBRIGHT) || - (type == LLRenderPass::PASS_INVISIBLE) || - (type == LLRenderPass::PASS_ALPHA && facep->isState(LLFace::FULLBRIGHT)); - + (type == LLRenderPass::PASS_INVISIBLE) || + (type == LLRenderPass::PASS_ALPHA ? facep->isState(LLFace::FULLBRIGHT) : FALSE); + if (!fullbright && type != LLRenderPass::PASS_GLOW && !facep->mVertexBuffer->hasDataType(LLVertexBuffer::TYPE_NORMAL)) { llwarns << "Non fullbright face has no normals!" << llendl; @@ -3260,12 +3220,16 @@ void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep, model_mat = &(drawable->getRegion()->mRenderMatrix); } - - U8 bump = (type == LLRenderPass::PASS_BUMP || type == LLRenderPass::PASS_POST_BUMP) ? facep->getTextureEntry()->getBumpmap() : 0; + U8 bump = (type == LLRenderPass::PASS_BUMP ? facep->getTextureEntry()->getBumpmap() : 0); LLViewerTexture* tex = facep->getTexture(); - U8 glow = (U8) (facep->getTextureEntry()->getGlow() * 255); + U8 glow = 0; + + if (type == LLRenderPass::PASS_GLOW) + { + glow = (U8) (facep->getTextureEntry()->getGlow() * 255); + } if (facep->mVertexBuffer.isNull()) { @@ -3330,7 +3294,6 @@ void LLVolumeGeometryManager::getGeometry(LLSpatialGroup* group) static LLFastTimer::DeclareTimer FTM_REBUILD_VOLUME_VB("Volume"); static LLFastTimer::DeclareTimer FTM_REBUILD_VBO("VBO Rebuilt"); - void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) { if (group->changeLOD()) @@ -3456,7 +3419,10 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) if (type == LLDrawPool::POOL_ALPHA) { - if (facep->canRenderAsMask()) + if (LLPipeline::sFastAlpha && + (te->getColor().mV[VW] == 1.0f) && + (!te->getFullbright()) && // hack: alpha masking renders fullbright faces invisible, need to figure out why - for now, avoid + facep->getTexture()->getIsAlphaMask()) { //can be treated as alpha mask simple_faces.push_back(facep); } @@ -3558,8 +3524,6 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) } static LLFastTimer::DeclareTimer FTM_VOLUME_GEOM("Volume Geometry"); -static LLFastTimer::DeclareTimer FTM_VOLUME_GEOM_PARTIAL("Terse Rebuild"); - void LLVolumeGeometryManager::rebuildMesh(LLSpatialGroup* group) { llassert(group); @@ -3572,7 +3536,6 @@ void LLVolumeGeometryManager::rebuildMesh(LLSpatialGroup* group) for (LLSpatialGroup::element_iter drawable_iter = group->getData().begin(); drawable_iter != group->getData().end(); ++drawable_iter) { - LLFastTimer t(FTM_VOLUME_GEOM_PARTIAL); LLDrawable* drawablep = *drawable_iter; if (drawablep->isDead() || drawablep->isState(LLDrawable::FORCE_INVISIBLE) ) @@ -3800,12 +3763,15 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std:: const LLTextureEntry* te = facep->getTextureEntry(); - BOOL is_alpha = (facep->getPoolType() == LLDrawPool::POOL_ALPHA) ? TRUE : FALSE; + BOOL is_alpha = facep->getPoolType() == LLDrawPool::POOL_ALPHA ? TRUE : FALSE; if (is_alpha) { // can we safely treat this as an alpha mask? - if (facep->canRenderAsMask()) + if (LLPipeline::sFastAlpha && + (te->getColor().mV[VW] == 1.0f) && + (!te->getFullbright()) && // hack: alpha masking renders fullbright faces invisible, need to figure out why - for now, avoid + facep->getTexture()->getIsAlphaMask()) { if (te->getFullbright()) { @@ -3830,76 +3796,66 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std:: && group->mSpatialPartition->mPartitionType != LLViewerRegion::PARTITION_HUD && LLPipeline::sRenderBump && te->getShiny()) - { //shiny + { if (tex->getPrimaryFormat() == GL_ALPHA) - { //invisiprim+shiny + { registerFace(group, facep, LLRenderPass::PASS_INVISI_SHINY); registerFace(group, facep, LLRenderPass::PASS_INVISIBLE); } else if (LLPipeline::sRenderDeferred) - { //deferred rendering - if (te->getFullbright()) - { //register in post deferred fullbright shiny pass - registerFace(group, facep, LLRenderPass::PASS_FULLBRIGHT_SHINY); - if (te->getBumpmap()) - { //register in post deferred bump pass - registerFace(group, facep, LLRenderPass::PASS_POST_BUMP); - } - } - else if (te->getBumpmap()) - { //register in deferred bump pass + { + if (te->getBumpmap()) + { registerFace(group, facep, LLRenderPass::PASS_BUMP); } + else if (te->getFullbright()) + { + registerFace(group, facep, LLRenderPass::PASS_FULLBRIGHT_SHINY); + } else - { //register in deferred simple pass (deferred simple includes shiny) + { llassert(mask & LLVertexBuffer::MAP_NORMAL); registerFace(group, facep, LLRenderPass::PASS_SIMPLE); } } else if (fullbright) - { //not deferred, register in standard fullbright shiny pass + { registerFace(group, facep, LLRenderPass::PASS_FULLBRIGHT_SHINY); } else - { //not deferred or fullbright, register in standard shiny pass + { registerFace(group, facep, LLRenderPass::PASS_SHINY); } } else - { //not alpha and not shiny + { if (!is_alpha && tex->getPrimaryFormat() == GL_ALPHA) - { //invisiprim + { registerFace(group, facep, LLRenderPass::PASS_INVISIBLE); } else if (fullbright) - { //fullbright + { registerFace(group, facep, LLRenderPass::PASS_FULLBRIGHT); - if (LLPipeline::sRenderDeferred && LLPipeline::sRenderBump && te->getBumpmap()) - { //if this is the deferred render and a bump map is present, register in post deferred bump - registerFace(group, facep, LLRenderPass::PASS_POST_BUMP); - } } else { - if (LLPipeline::sRenderDeferred && LLPipeline::sRenderBump && te->getBumpmap()) - { //non-shiny or fullbright deferred bump + if (LLPipeline::sRenderDeferred && te->getBumpmap()) + { registerFace(group, facep, LLRenderPass::PASS_BUMP); } else - { //all around simple + { llassert(mask & LLVertexBuffer::MAP_NORMAL); registerFace(group, facep, LLRenderPass::PASS_SIMPLE); } } - //not sure why this is here -- shiny HUD attachments maybe? -- davep 5/11/2010 if (!is_alpha && te->getShiny() && LLPipeline::sRenderBump) { registerFace(group, facep, LLRenderPass::PASS_SHINY); } } - //not sure why this is here, and looks like it might cause bump mapped objects to get rendered redundantly -- davep 5/11/2010 if (!is_alpha && !LLPipeline::sRenderDeferred) { llassert((mask & LLVertexBuffer::MAP_NORMAL) || fullbright); @@ -3911,7 +3867,7 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std:: } } - if (!is_alpha && LLPipeline::sRenderGlow && te->getGlow() > 0.f) + if (LLPipeline::sRenderGlow && te->getGlow() > 0.f) { registerFace(group, facep, LLRenderPass::PASS_GLOW); } -- cgit v1.2.3 From 6db60e1a695235ac6c572ac9b57ea2d26c69d115 Mon Sep 17 00:00:00 2001 From: Palmer Date: Mon, 5 Apr 2010 16:53:44 -0700 Subject: One last small change from svn//branches/viewer-mesh @ 114046 for render bump --- indra/newview/llvovolume.cpp | 56 ++++++++++++++++++++++---------------------- 1 file changed, 28 insertions(+), 28 deletions(-) (limited to 'indra/newview/llvovolume.cpp') diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 4e3be0f703..346fc0c4e4 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -2,25 +2,31 @@ * @file llvovolume.cpp * @brief LLVOVolume class implementation * - * $LicenseInfo:firstyear=2001&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. + * $LicenseInfo:firstyear=2001&license=viewergpl$ + * + * Copyright (c) 2001-2009, Linden Research, Inc. * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. * $/LicenseInfo$ */ @@ -363,7 +369,7 @@ U32 LLVOVolume::processUpdateMessage(LLMessageSystem *mesgsys, S32 res2 = unpackTEMessage(*dp); if (TEM_INVALID == res2) { - // There's something bogus in the data that we're unpacking. + // Well, crap, there's something bogus in the data that we're unpacking. dp->dumpBufferToLog(); llwarns << "Flushing cache files" << llendl; std::string mask; @@ -1850,11 +1856,6 @@ void LLVOVolume::syncMediaData(S32 texture_index, const LLSD &media_data, bool m } LLTextureEntry *te = getTE(texture_index); - if(!te) - { - return ; - } - LL_DEBUGS("MediaOnAPrim") << "BEFORE: texture_index = " << texture_index << " hasMedia = " << te->hasMedia() << " : " << ((NULL == te->getMediaData()) ? "NULL MEDIA DATA" : ll_pretty_print_sd(te->getMediaData()->asLLSD())) << llendl; @@ -1972,13 +1973,9 @@ bool LLVOVolume::hasMediaPermission(const LLMediaEntry* media_entry, MediaPermTy } // Group permissions - else if (0 != (media_perms & LLMediaEntry::PERM_GROUP)) + else if (0 != (media_perms & LLMediaEntry::PERM_GROUP) && permGroupOwner()) { - LLPermissions* obj_perm = LLSelectMgr::getInstance()->findObjectPermissions(this); - if (obj_perm && gAgent.isInGroup(obj_perm->getGroup())) - { - return true; - } + return true; } // Owner permissions @@ -3296,6 +3293,7 @@ static LLFastTimer::DeclareTimer FTM_REBUILD_VBO("VBO Rebuilt"); void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) { + llpushcallstacks ; if (group->changeLOD()) { group->mLastUpdateDistance = group->mDistance; @@ -3526,6 +3524,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) static LLFastTimer::DeclareTimer FTM_VOLUME_GEOM("Volume Geometry"); void LLVolumeGeometryManager::rebuildMesh(LLSpatialGroup* group) { + llpushcallstacks ; llassert(group); if (group && group->isState(LLSpatialGroup::MESH_DIRTY) && !group->isState(LLSpatialGroup::GEOM_DIRTY)) { @@ -3617,6 +3616,7 @@ void LLVolumeGeometryManager::rebuildMesh(LLSpatialGroup* group) void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std::vector& faces, BOOL distance_sort) { + llpushcallstacks ; //calculate maximum number of vertices to store in a single buffer U32 max_vertices = (gSavedSettings.getS32("RenderMaxVBOSize")*1024)/LLVertexBuffer::calcStride(group->mSpatialPartition->mVertexDataMask); max_vertices = llmin(max_vertices, (U32) 65535); @@ -3839,7 +3839,7 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std:: } else { - if (LLPipeline::sRenderDeferred && te->getBumpmap()) + if (LLPipeline::sRenderDeferred && LLPipeline::sRenderBump && te->getBumpmap()) { registerFace(group, facep, LLRenderPass::PASS_BUMP); } -- cgit v1.2.3 From 956074541f429725a5ba216d6a8fa8204a676e59 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Mon, 1 Feb 2010 17:29:08 +0000 Subject: start to abstract-out the 'is a spotlight' question so one day we can perhaps make the UI hurt less. --- indra/newview/llvovolume.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'indra/newview/llvovolume.cpp') diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index e6de33c459..b7b024fa1d 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -2451,6 +2451,13 @@ void LLVOVolume::updateSpotLightPriority() } +bool LLVOVolume::isLightSpotlight() +{ + LLLightImageParams* params = (LLLightImageParams*) getParameterEntry(LLNetworkData::PARAMS_LIGHT_IMAGE); + return params->isLightSpotlight(); +} + + LLViewerTexture* LLVOVolume::getLightTexture() { LLUUID id = getLightTextureID(); -- cgit v1.2.3 From a23a7131cd1f7890e2e58c06958b13ffafbd5a38 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Mon, 1 Feb 2010 17:50:55 +0000 Subject: const fix. --- indra/newview/llvovolume.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llvovolume.cpp') diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index b7b024fa1d..10160a4208 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -2451,7 +2451,7 @@ void LLVOVolume::updateSpotLightPriority() } -bool LLVOVolume::isLightSpotlight() +bool LLVOVolume::isLightSpotlight() const { LLLightImageParams* params = (LLLightImageParams*) getParameterEntry(LLNetworkData::PARAMS_LIGHT_IMAGE); return params->isLightSpotlight(); -- cgit v1.2.3 From 84ffc72c01e53cbf4d2449d1753fd6556c5c9932 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Tue, 2 Feb 2010 22:45:30 +0000 Subject: Probably the real fix for isLightSpotlight() - PARAMS_LIGHT_IMAGE isn't guaranteed, duh. --- indra/newview/llvovolume.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'indra/newview/llvovolume.cpp') diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 10160a4208..8a77461369 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -2454,7 +2454,11 @@ void LLVOVolume::updateSpotLightPriority() bool LLVOVolume::isLightSpotlight() const { LLLightImageParams* params = (LLLightImageParams*) getParameterEntry(LLNetworkData::PARAMS_LIGHT_IMAGE); - return params->isLightSpotlight(); + if (params) + { + return params->isLightSpotlight(); + } + return false; } -- cgit v1.2.3 From 4ffac619945cafc9c7da357bf56c9bc92e318b1b Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Thu, 4 Mar 2010 15:30:15 -0600 Subject: Optimiziation pass. Added RenderUseStreamVBO to enable/disable usage of VBO's for streaming buffers. Faster traversal of LLCullResult members. Removal of llpushcallstacks from inner loops. Sprinkling in fast timers. --- indra/newview/llvovolume.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/newview/llvovolume.cpp') diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 8a77461369..073d7c2b91 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -3304,7 +3304,6 @@ static LLFastTimer::DeclareTimer FTM_REBUILD_VBO("VBO Rebuilt"); void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) { - llpushcallstacks ; if (group->changeLOD()) { group->mLastUpdateDistance = group->mDistance; @@ -3533,9 +3532,10 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) } static LLFastTimer::DeclareTimer FTM_VOLUME_GEOM("Volume Geometry"); +static LLFastTimer::DeclareTimer FTM_VOLUME_GEOM_PARTIAL("Terse Rebuild"); + void LLVolumeGeometryManager::rebuildMesh(LLSpatialGroup* group) { - llpushcallstacks ; llassert(group); if (group && group->isState(LLSpatialGroup::MESH_DIRTY) && !group->isState(LLSpatialGroup::GEOM_DIRTY)) { @@ -3546,6 +3546,7 @@ void LLVolumeGeometryManager::rebuildMesh(LLSpatialGroup* group) for (LLSpatialGroup::element_iter drawable_iter = group->getData().begin(); drawable_iter != group->getData().end(); ++drawable_iter) { + LLFastTimer t(FTM_VOLUME_GEOM_PARTIAL); LLDrawable* drawablep = *drawable_iter; if (drawablep->isDead() || drawablep->isState(LLDrawable::FORCE_INVISIBLE) ) @@ -3627,7 +3628,6 @@ void LLVolumeGeometryManager::rebuildMesh(LLSpatialGroup* group) void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std::vector& faces, BOOL distance_sort) { - llpushcallstacks ; //calculate maximum number of vertices to store in a single buffer U32 max_vertices = (gSavedSettings.getS32("RenderMaxVBOSize")*1024)/LLVertexBuffer::calcStride(group->mSpatialPartition->mVertexDataMask); max_vertices = llmin(max_vertices, (U32) 65535); -- cgit v1.2.3 From 5461959d33f2cccfcacfe7887622d68e1c94ad12 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Mon, 8 Mar 2010 12:28:33 +0000 Subject: fixes VWR-4214 Glow effect passes through alpha textures where alpha is actually "solid" and its many many dupes. In summary this does the following: * When laying down alpha, uses the new separated color-and-alpha blend func support to suppress existing glow in proportion to the opacity of the incoming fragments * Moves glowing-alpha support from the glow pool to the alpha pool, ensures that the glow pass for a vertex buffer happens after the alpha pass for the vertex buffer so that it doesn't suppress its *own* glow. Tested with all shader modes, FBO on/off, and deferred rendering. Tested with every permutation of alpha/non-alpha/glow/non-glow/fullbright/waterglow/particle interaction I could contrive so far. :) --- indra/newview/llvovolume.cpp | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'indra/newview/llvovolume.cpp') diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 073d7c2b91..c92af140da 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -3199,11 +3199,10 @@ void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep, S32 idx = draw_vec.size()-1; - BOOL fullbright = (type == LLRenderPass::PASS_FULLBRIGHT) || - (type == LLRenderPass::PASS_INVISIBLE) || - (type == LLRenderPass::PASS_ALPHA ? facep->isState(LLFace::FULLBRIGHT) : FALSE); - + (type == LLRenderPass::PASS_INVISIBLE) || + (type == LLRenderPass::PASS_ALPHA ? facep->isState(LLFace::FULLBRIGHT) : FALSE); + if (!fullbright && type != LLRenderPass::PASS_GLOW && !facep->mVertexBuffer->hasDataType(LLVertexBuffer::TYPE_NORMAL)) { llwarns << "Non fullbright face has no normals!" << llendl; @@ -3232,12 +3231,7 @@ void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep, LLViewerTexture* tex = facep->getTexture(); - U8 glow = 0; - - if (type == LLRenderPass::PASS_GLOW) - { - glow = (U8) (facep->getTextureEntry()->getGlow() * 255); - } + U8 glow = (U8) (facep->getTextureEntry()->getGlow() * 255); if (facep->mVertexBuffer.isNull()) { @@ -3878,7 +3872,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); } -- cgit v1.2.3 From 43c425db2467fa91d2df40b5dd708a738003131e Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Tue, 9 Mar 2010 13:28:23 +0000 Subject: Disable alpha-masking for glowing surfaces. It seems beyond my ability to get right. Refactor some replicated and/or strangely-expressed logic. --- indra/newview/llvovolume.cpp | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'indra/newview/llvovolume.cpp') diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index c92af140da..ea493d4798 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -3201,7 +3201,7 @@ void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep, BOOL fullbright = (type == LLRenderPass::PASS_FULLBRIGHT) || (type == LLRenderPass::PASS_INVISIBLE) || - (type == LLRenderPass::PASS_ALPHA ? facep->isState(LLFace::FULLBRIGHT) : FALSE); + (type == LLRenderPass::PASS_ALPHA && facep->isState(LLFace::FULLBRIGHT)); if (!fullbright && type != LLRenderPass::PASS_GLOW && !facep->mVertexBuffer->hasDataType(LLVertexBuffer::TYPE_NORMAL)) { @@ -3296,6 +3296,16 @@ void LLVolumeGeometryManager::getGeometry(LLSpatialGroup* group) static LLFastTimer::DeclareTimer FTM_REBUILD_VOLUME_VB("Volume"); static LLFastTimer::DeclareTimer FTM_REBUILD_VBO("VBO Rebuilt"); +bool LLVolumeGeometryManager::canRenderAsMask(LLFace* facep) +{ + const LLTextureEntry* te = facep->getTextureEntry(); + return (LLPipeline::sFastAlpha && + (te->getColor().mV[3] == 1.0f) && + (!te->getFullbright()) && // hack: alpha masking renders fullbright faces invisible, need to figure out why - for now, avoid + (te->getGlow() == 0.f) && // glowing masks are hard to implement - don't mask + facep->getTexture()->getIsAlphaMask()); +} + void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) { if (group->changeLOD()) @@ -3421,10 +3431,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) if (type == LLDrawPool::POOL_ALPHA) { - if (LLPipeline::sFastAlpha && - (te->getColor().mV[VW] == 1.0f) && - (!te->getFullbright()) && // hack: alpha masking renders fullbright faces invisible, need to figure out why - for now, avoid - facep->getTexture()->getIsAlphaMask()) + if (canRenderAsMask(facep)) { //can be treated as alpha mask simple_faces.push_back(facep); } @@ -3768,15 +3775,12 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std:: const LLTextureEntry* te = facep->getTextureEntry(); - BOOL is_alpha = facep->getPoolType() == LLDrawPool::POOL_ALPHA ? TRUE : FALSE; + BOOL is_alpha = (facep->getPoolType() == LLDrawPool::POOL_ALPHA) ? TRUE : FALSE; if (is_alpha) { // can we safely treat this as an alpha mask? - if (LLPipeline::sFastAlpha && - (te->getColor().mV[VW] == 1.0f) && - (!te->getFullbright()) && // hack: alpha masking renders fullbright faces invisible, need to figure out why - for now, avoid - facep->getTexture()->getIsAlphaMask()) + if (canRenderAsMask(facep)) { if (te->getFullbright()) { -- cgit v1.2.3 From 6b08cc3a2da882982f80be477c159c2d2e4d89d0 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Tue, 9 Mar 2010 13:45:53 +0000 Subject: We can enable alpha masking for fullbright faces as long as we're not in deferred mode. Deferred masked fullbrights are still broken (we fall back to blending instead of masking as a workaround), but they always have been. :/ --- indra/newview/llvovolume.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'indra/newview/llvovolume.cpp') diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index ea493d4798..49c0c4d4e0 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -3299,11 +3299,15 @@ static LLFastTimer::DeclareTimer FTM_REBUILD_VBO("VBO Rebuilt"); bool LLVolumeGeometryManager::canRenderAsMask(LLFace* facep) { const LLTextureEntry* te = facep->getTextureEntry(); - return (LLPipeline::sFastAlpha && - (te->getColor().mV[3] == 1.0f) && - (!te->getFullbright()) && // hack: alpha masking renders fullbright faces invisible, need to figure out why - for now, avoid + return ( + LLPipeline::sFastAlpha && // do we want masks at all? + + (te->getColor().mV[3] == 1.0f) && // can't treat as mask if we have face alpha + !(LLPipeline::sRenderDeferred && te->getFullbright()) && // hack: alpha masking renders fullbright faces invisible in deferred rendering mode, need to figure out why - for now, avoid (te->getGlow() == 0.f) && // glowing masks are hard to implement - don't mask - facep->getTexture()->getIsAlphaMask()); + + facep->getTexture()->getIsAlphaMask() // texture actually qualifies for masking (lazily calculated but expensive) + ); } void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) -- cgit v1.2.3 From 0655104fa2339fd0b8e5a0385e5a1d8141834a88 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Mon, 26 Apr 2010 14:42:06 +0100 Subject: EXT-7060 default auto alpha masking to ON for deferred rendering (only deferred rendering) (transplanted from 050ae2c9451a6b89374c5a10403f373e2475f23b) --- indra/newview/llvovolume.cpp | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) (limited to 'indra/newview/llvovolume.cpp') diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 49c0c4d4e0..aa22dc7f5d 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -2921,9 +2921,7 @@ F32 LLVOVolume::getBinRadius() { LLFace* face = mDrawable->getFace(i); if (face->getPoolType() == LLDrawPool::POOL_ALPHA && - (!LLPipeline::sFastAlpha || - face->getFaceColor().mV[3] != 1.f || - !face->getTexture()->getIsAlphaMask())) + !face->canRenderAsMask()) { alpha_wrap = TRUE; break; @@ -3296,19 +3294,6 @@ void LLVolumeGeometryManager::getGeometry(LLSpatialGroup* group) static LLFastTimer::DeclareTimer FTM_REBUILD_VOLUME_VB("Volume"); static LLFastTimer::DeclareTimer FTM_REBUILD_VBO("VBO Rebuilt"); -bool LLVolumeGeometryManager::canRenderAsMask(LLFace* facep) -{ - const LLTextureEntry* te = facep->getTextureEntry(); - return ( - LLPipeline::sFastAlpha && // do we want masks at all? - - (te->getColor().mV[3] == 1.0f) && // can't treat as mask if we have face alpha - !(LLPipeline::sRenderDeferred && te->getFullbright()) && // hack: alpha masking renders fullbright faces invisible in deferred rendering mode, need to figure out why - for now, avoid - (te->getGlow() == 0.f) && // glowing masks are hard to implement - don't mask - - facep->getTexture()->getIsAlphaMask() // texture actually qualifies for masking (lazily calculated but expensive) - ); -} void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) { @@ -3435,7 +3420,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) if (type == LLDrawPool::POOL_ALPHA) { - if (canRenderAsMask(facep)) + if (facep->canRenderAsMask()) { //can be treated as alpha mask simple_faces.push_back(facep); } @@ -3784,7 +3769,7 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std:: if (is_alpha) { // can we safely treat this as an alpha mask? - if (canRenderAsMask(facep)) + if (facep->canRenderAsMask()) { if (te->getFullbright()) { -- cgit v1.2.3 From f07b8c194447be4753512716402993888b2ed98c Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Tue, 4 May 2010 14:55:02 +0100 Subject: EXT-7161 Fullbright has no effect on shiny & bump mapped prim while Lighting and Shadows are enabled. --- indra/newview/llvovolume.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'indra/newview/llvovolume.cpp') diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index aa22dc7f5d..34ae915a07 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -3802,13 +3802,13 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std:: } else if (LLPipeline::sRenderDeferred) { - if (te->getBumpmap()) + if (te->getFullbright()) { - registerFace(group, facep, LLRenderPass::PASS_BUMP); + registerFace(group, facep, LLRenderPass::PASS_FULLBRIGHT_SHINY); } - else if (te->getFullbright()) + else if (te->getBumpmap()) { - registerFace(group, facep, LLRenderPass::PASS_FULLBRIGHT_SHINY); + registerFace(group, facep, LLRenderPass::PASS_BUMP); } else { -- cgit v1.2.3 From 6c086be01659a0d23a91bf6e3ea07bafd86c4dd7 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Wed, 12 May 2010 03:59:01 -0500 Subject: Fix for fullbright bump not working in deferred render. Fix for shadow artifacts around split frusta. Tweak for shadow aliasing with projectors. Fix for crash on exit in mesh thread. (transplanted from 6dcf09cd3e524016c8130a0c8af3d9fc95f2d411) --- indra/newview/llvovolume.cpp | 39 +++++++++++++++++++++++++-------------- 1 file changed, 25 insertions(+), 14 deletions(-) (limited to 'indra/newview/llvovolume.cpp') diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 34ae915a07..15b04fa746 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -3225,7 +3225,8 @@ void LLVolumeGeometryManager::registerFace(LLSpatialGroup* group, LLFace* facep, model_mat = &(drawable->getRegion()->mRenderMatrix); } - U8 bump = (type == LLRenderPass::PASS_BUMP ? facep->getTextureEntry()->getBumpmap() : 0); + + U8 bump = (type == LLRenderPass::PASS_BUMP || type == LLRenderPass::PASS_POST_BUMP) ? facep->getTextureEntry()->getBumpmap() : 0; LLViewerTexture* tex = facep->getTexture(); @@ -3794,66 +3795,76 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std:: && group->mSpatialPartition->mPartitionType != LLViewerRegion::PARTITION_HUD && LLPipeline::sRenderBump && te->getShiny()) - { + { //shiny if (tex->getPrimaryFormat() == GL_ALPHA) - { + { //invisiprim+shiny registerFace(group, facep, LLRenderPass::PASS_INVISI_SHINY); registerFace(group, facep, LLRenderPass::PASS_INVISIBLE); } else if (LLPipeline::sRenderDeferred) - { + { //deferred rendering if (te->getFullbright()) - { + { //register in post deferred fullbright shiny pass registerFace(group, facep, LLRenderPass::PASS_FULLBRIGHT_SHINY); + if (te->getBumpmap()) + { //register in post deferred bump pass + registerFace(group, facep, LLRenderPass::PASS_POST_BUMP); + } } else if (te->getBumpmap()) - { + { //register in deferred bump pass registerFace(group, facep, LLRenderPass::PASS_BUMP); } else - { + { //register in deferred simple pass (deferred simple includes shiny) llassert(mask & LLVertexBuffer::MAP_NORMAL); registerFace(group, facep, LLRenderPass::PASS_SIMPLE); } } else if (fullbright) - { + { //not deferred, register in standard fullbright shiny pass registerFace(group, facep, LLRenderPass::PASS_FULLBRIGHT_SHINY); } else - { + { //not deferred or fullbright, register in standard shiny pass registerFace(group, facep, LLRenderPass::PASS_SHINY); } } else - { + { //not alpha and not shiny if (!is_alpha && tex->getPrimaryFormat() == GL_ALPHA) - { + { //invisiprim registerFace(group, facep, LLRenderPass::PASS_INVISIBLE); } else if (fullbright) - { + { //fullbright registerFace(group, facep, LLRenderPass::PASS_FULLBRIGHT); + if (LLPipeline::sRenderDeferred && LLPipeline::sRenderBump && te->getBumpmap()) + { //if this is the deferred render and a bump map is present, register in post deferred bump + registerFace(group, facep, LLRenderPass::PASS_POST_BUMP); + } } else { if (LLPipeline::sRenderDeferred && LLPipeline::sRenderBump && te->getBumpmap()) - { + { //non-shiny or fullbright deferred bump registerFace(group, facep, LLRenderPass::PASS_BUMP); } else - { + { //all around simple llassert(mask & LLVertexBuffer::MAP_NORMAL); registerFace(group, facep, LLRenderPass::PASS_SIMPLE); } } + //not sure why this is here -- shiny HUD attachments maybe? -- davep 5/11/2010 if (!is_alpha && te->getShiny() && LLPipeline::sRenderBump) { registerFace(group, facep, LLRenderPass::PASS_SHINY); } } + //not sure why this is here, and looks like it might cause bump mapped objects to get rendered redundantly -- davep 5/11/2010 if (!is_alpha && !LLPipeline::sRenderDeferred) { llassert((mask & LLVertexBuffer::MAP_NORMAL) || fullbright); -- cgit v1.2.3