Changeset 967

Show
Ignore:
Timestamp:
08/04/08 12:30:41 (4 months ago)
Author:
soft.linden
Message:

Snapshot of internal branch shadow-draft-2
Last Changed Rev: 93542
Last Changed Date: 2008-08-01 16:13:51 -0700 (Fri, 01 Aug 2008)

Supplementary files:
http://secondlife.com/developers/opensource/downloads/2008/08/md5sums-shadow-draft-2-r93542.txt
http://secondlife.com/developers/opensource/downloads/2008/08/slviewer-artwork-shadow-draft-2-r93542.zip
http://secondlife.com/developers/opensource/downloads/2008/08/slviewer-darwin-libs-shadow-draft-2-r93542.tar.gz
http://secondlife.com/developers/opensource/downloads/2008/08/slviewer-win32-libs-shadow-draft-2-r93542.zip
http://secondlife.com/developers/opensource/downloads/2008/08/slviewer-linux-libs-shadow-draft-2-r93542.tar.gz

Source tarballs - redundant to this svn:
http://secondlife.com/developers/opensource/downloads/2008/08/slviewer-src-shadow-draft-2-r93542.tar.gz
http://secondlife.com/developers/opensource/downloads/2008/08/slviewer-src-shadow-draft-2-r93542.zip

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/shadow-draft-2/doc/asset_urls.txt

    r940 r967  
    22# https://wiki.secondlife.com/wiki/Get_source_and_compile 
    33 
    4 SLASSET_MD5=http://secondlife.com/developers/opensource/downloads/2008/07/md5sums-shadow-draft-2-r93306.txt 
    5 SLASSET_ART=http://secondlife.com/developers/opensource/downloads/2008/07/slviewer-artwork-shadow-draft-2-r93306.zip 
    6 SLASSET_LIBS_DARWIN=http://secondlife.com/developers/opensource/downloads/2008/07/slviewer-darwin-libs-shadow-draft-2-r93306.tar.gz 
    7 SLASSET_LIBS_WIN32=http://secondlife.com/developers/opensource/downloads/2008/07/slviewer-win32-libs-shadow-draft-2-r93306.zip 
    8 SLASSET_LIBS_LINUXI386=http://secondlife.com/developers/opensource/downloads/2008/07/slviewer-linux-libs-shadow-draft-2-r93306.tar.gz 
     4SLASSET_MD5=http://secondlife.com/developers/opensource/downloads/2008/08/md5sums-shadow-draft-2-r93542.txt 
     5SLASSET_ART=http://secondlife.com/developers/opensource/downloads/2008/08/slviewer-artwork-shadow-draft-2-r93542.zip 
     6SLASSET_LIBS_DARWIN=http://secondlife.com/developers/opensource/downloads/2008/08/slviewer-darwin-libs-shadow-draft-2-r93542.tar.gz 
     7SLASSET_LIBS_WIN32=http://secondlife.com/developers/opensource/downloads/2008/08/slviewer-win32-libs-shadow-draft-2-r93542.zip 
     8SLASSET_LIBS_LINUXI386=http://secondlife.com/developers/opensource/downloads/2008/08/slviewer-linux-libs-shadow-draft-2-r93542.tar.gz 
  • branches/shadow-draft-2/indra/llcommon/llfasttimer.h

    r743 r967  
    7171                 
    7272                // common render components 
     73                FTM_SHADOW_GEOMETRY, 
     74                FTM_SHADOW_RENDER, 
     75                FTM_SHADOW_TERRAIN, 
     76                FTM_SHADOW_AVATAR, 
     77                FTM_SHADOW_SIMPLE, 
     78                FTM_SHADOW_ALPHA, 
     79                FTM_SHADOW_TREE, 
     80                 
    7381                FTM_RENDER_GEOMETRY, 
    7482                 FTM_RENDER_TERRAIN, 
  • branches/shadow-draft-2/indra/llcommon/lluuid.cpp

    r714 r967  
    185185        memcpy(bytes, mData, UUID_BYTES);               /* Flawfinder: ignore */ 
    186186        bytes[UUID_BYTES] = '\0'; 
    187         out = bytes
     187        out.assign(bytes, UUID_BYTES)
    188188} 
    189189 
  • branches/shadow-draft-2/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl

    r940 r967  
    3030        vec2 tc = gl_FragCoord.xy - dlt*kern_scale; 
    3131         
     32        const int c_kern_length = 8; 
     33         
    3234        for (int i = 0; i < kern_length; i++) 
    3335        { 
  • branches/shadow-draft-2/indra/newview/lldrawpoolavatar.cpp

    r743 r967  
    254254void LLDrawPoolAvatar::beginShadowPass(S32 pass) 
    255255{ 
    256         LLFastTimer t(LLFastTimer::FTM_RENDER_CHARACTERS); 
     256        LLFastTimer t(LLFastTimer::FTM_SHADOW_AVATAR); 
    257257         
    258258        sVertexProgram = &gDeferredAvatarShadowProgram; 
     
    276276void LLDrawPoolAvatar::endShadowPass(S32 pass) 
    277277{ 
    278         LLFastTimer t(LLFastTimer::FTM_RENDER_CHARACTERS); 
     278        LLFastTimer t(LLFastTimer::FTM_SHADOW_AVATAR); 
    279279 
    280280        if (sShaderLevel > 0) 
     
    290290void LLDrawPoolAvatar::renderShadow(S32 pass) 
    291291{ 
     292        LLFastTimer t(LLFastTimer::FTM_SHADOW_AVATAR); 
    292293        if (!gRenderAvatar) 
    293294        { 
  • branches/shadow-draft-2/indra/newview/lldrawpoolterrain.cpp

    r893 r967  
    258258void LLDrawPoolTerrain::beginShadowPass(S32 pass) 
    259259{ 
    260         LLFastTimer t(LLFastTimer::FTM_RENDER_TERRAIN); 
     260        LLFastTimer t(LLFastTimer::FTM_SHADOW_TERRAIN); 
    261261        LLFacePool::beginRenderPass(pass); 
    262262        LLViewerImage::unbindTexture(0); 
     
    266266void LLDrawPoolTerrain::endShadowPass(S32 pass) 
    267267{ 
    268         LLFastTimer t(LLFastTimer::FTM_RENDER_TERRAIN); 
     268        LLFastTimer t(LLFastTimer::FTM_SHADOW_TERRAIN); 
    269269        LLFacePool::endRenderPass(pass); 
    270270        gDeferredShadowProgram.unbind(); 
     
    273273void LLDrawPoolTerrain::renderShadow(S32 pass) 
    274274{ 
    275         LLFastTimer t(LLFastTimer::FTM_RENDER_TERRAIN); 
     275        LLFastTimer t(LLFastTimer::FTM_SHADOW_TERRAIN); 
    276276        if (mDrawFace.empty()) 
    277277        { 
  • branches/shadow-draft-2/indra/newview/lldrawpooltree.cpp

    r761 r967  
    9292void LLDrawPoolTree::render(S32 pass) 
    9393{ 
    94         LLFastTimer t(LLFastTimer::FTM_RENDER_TREES); 
     94        LLFastTimer t(LLPipeline::sShadowRender ? LLFastTimer::FTM_SHADOW_TREE : LLFastTimer::FTM_RENDER_TREES); 
    9595 
    9696        if (mDrawFace.empty()) 
     
    162162void LLDrawPoolTree::beginShadowPass(S32 pass) 
    163163{ 
    164         LLFastTimer t(LLFastTimer::FTM_RENDER_TREES); 
     164        LLFastTimer t(LLFastTimer::FTM_SHADOW_TREE); 
    165165        gGL.setAlphaRejectSettings(LLRender::CF_GREATER, 0.5f); 
    166166        gDeferredShadowProgram.bind(); 
     
    174174void LLDrawPoolTree::endShadowPass(S32 pass) 
    175175{ 
    176         LLFastTimer t(LLFastTimer::FTM_RENDER_TREES); 
     176        LLFastTimer t(LLFastTimer::FTM_SHADOW_TREE); 
    177177        gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT); 
    178178        gDeferredShadowProgram.unbind(); 
  • branches/shadow-draft-2/indra/newview/llfasttimerview.cpp

    r893 r967  
    162162//      { LLFastTimer::FTM_REBUILD_CLOUD_VB,    "     Cloud",           &LLColor4::cyan3, 0 }, 
    163163        { LLFastTimer::FTM_REBUILD_GRASS_VB,    "     Grass",           &LLColor4::cyan4, 0 }, 
    164         { LLFastTimer::FTM_RENDER_GEOMETRY,             "  Geometry",           &LLColor4::green2, 1 }, 
     164        { LLFastTimer::FTM_SHADOW_RENDER,               "  Shadow",                     &LLColor4::green5, 1 }, 
     165        { LLFastTimer::FTM_SHADOW_SIMPLE,               "   Simple",            &LLColor4::yellow2, 1 }, 
     166        { LLFastTimer::FTM_SHADOW_ALPHA,                "   Alpha",                     &LLColor4::yellow6, 1 }, 
     167        { LLFastTimer::FTM_SHADOW_TERRAIN,              "   Terrain",           &LLColor4::green6, 1 }, 
     168        { LLFastTimer::FTM_SHADOW_AVATAR,               "   Avatar",            &LLColor4::yellow1, 1 }, 
     169        { LLFastTimer::FTM_SHADOW_TREE,                 "   Tree",                      &LLColor4::yellow8, 1 }, 
     170        { LLFastTimer::FTM_RENDER_GEOMETRY,             "  Geometry",           &LLColor4::green2, 1 }, 
    165171        { LLFastTimer::FTM_POOLS,                               "   Pools",                     &LLColor4::green3, 1 }, 
    166172        { LLFastTimer::FTM_POOLRENDER,                  "    RenderPool",       &LLColor4::green4, 1 }, 
  • branches/shadow-draft-2/indra/newview/llspatialpartition.cpp

    r940 r967  
    12921292                        clearState(QUERY_PENDING | DISCARD_QUERY); 
    12931293                } 
    1294                 else if (mSpatialPartition->isOcclusionEnabled()
    1295                 { 
     1294                else if (mSpatialPartition->isOcclusionEnabled() && isState(LLSpatialGroup::OCCLUDED)
     1295                {      //check occlusion has been issued for occluded node that has not had a query issued 
    12961296                        assert_states_valid(this); 
    12971297                        clearState(LLSpatialGroup::OCCLUDED, LLSpatialGroup::STATE_MODE_DIFF); 
     
    14911491 
    14921492                if (group->mOctreeNode->getParent() &&  //never occlusion cull the root node 
    1493                       LLPipeline::sUseOcclusion &&                    //ignore occlusion if disabled 
     1493                      LLPipeline::sUseOcclusion &&                    //ignore occlusion if disabled 
    14941494                        group->isState(LLSpatialGroup::OCCLUDED)) 
    14951495                { 
     
    16631663        LLVector3& mMin; 
    16641664        LLVector3& mMax; 
     1665}; 
     1666 
     1667class LLOctreeCullDetectVisible: public LLOctreeCullShadow 
     1668{ 
     1669public: 
     1670        LLOctreeCullDetectVisible(LLCamera* camera) 
     1671                : LLOctreeCullShadow(camera), mResult(FALSE) { } 
     1672 
     1673        virtual bool earlyFail(LLSpatialGroup* group) 
     1674        { 
     1675                if (mResult || //already found a node, don't check any more 
     1676                        group->mOctreeNode->getParent() &&      //never occlusion cull the root node 
     1677                        LLPipeline::sUseOcclusion &&                    //ignore occlusion if disabled 
     1678                        group->isState(LLSpatialGroup::OCCLUDED)) 
     1679                { 
     1680                        return true; 
     1681                } 
     1682                 
     1683                return false; 
     1684        } 
     1685 
     1686        virtual void processGroup(LLSpatialGroup* group) 
     1687        { 
     1688                if (group->isVisible()) 
     1689                { 
     1690                        mResult = TRUE; 
     1691                } 
     1692        } 
     1693 
     1694        BOOL mResult; 
    16651695}; 
    16661696 
     
    18301860} 
    18311861 
     1862BOOL LLSpatialPartition::visibleObjectsInFrustum(LLCamera& camera) 
     1863{ 
     1864        LLOctreeCullDetectVisible vis(&camera); 
     1865        vis.traverse(mOctree); 
     1866        return vis.mResult; 
     1867} 
    18321868 
    18331869S32 LLSpatialPartition::cull(LLCamera &camera, std::vector<LLDrawable *>* results, BOOL for_select) 
     
    21262162                                                 
    21272163                drawBoxOutline(group->mBounds[0],group->mBounds[1]); 
     2164 
     2165 
     2166                //draw bounding box for draw info 
     2167                if (group->mSpatialPartition->mRenderByGroup) 
     2168                { 
     2169                        gGL.color4f(1.0f, 0.75f, 0.25f, 0.6f); 
     2170                        for (LLSpatialGroup::draw_map_t::iterator i = group->mDrawMap.begin(); i != group->mDrawMap.end(); ++i) 
     2171                        { 
     2172                                for (LLSpatialGroup::drawmap_elem_t::iterator j = i->second.begin(); j != i->second.end(); ++j) 
     2173                                { 
     2174                                        LLDrawInfo* draw_info = *j; 
     2175                                        LLVector3 center = (draw_info->mExtents[1] + draw_info->mExtents[0])*0.5f; 
     2176                                        LLVector3 size = (draw_info->mExtents[1] - draw_info->mExtents[0])*0.5f; 
     2177                                        drawBoxOutline(center, size); 
     2178                                } 
     2179                        } 
     2180                } 
    21282181        } 
    21292182         
     
    21842237} 
    21852238 
    2186 void renderBoundingBox(LLDrawable* drawable) 
    2187 
    2188         if (drawable->isSpatialBridge()) 
    2189         { 
    2190                 gGL.color4f(1,0.5f,0,1); 
    2191         } 
    2192         else if (drawable->getVOVolume()) 
    2193         { 
    2194                 if (drawable->isRoot()) 
    2195                 { 
    2196                         gGL.color4f(1,1,0,1); 
    2197                 } 
    2198                 else 
    2199                 { 
    2200                         gGL.color4f(0,1,0,1); 
    2201                 } 
    2202         } 
    2203         else if (drawable->getVObj()) 
    2204         { 
    2205                 switch (drawable->getVObj()->getPCode()) 
    2206                 { 
    2207                         case LLViewerObject::LL_VO_SURFACE_PATCH: 
    2208                                         gGL.color4f(0,1,1,1); 
    2209                                         break; 
    2210                         case LLViewerObject::LL_VO_CLOUDS: 
    2211                                         gGL.color4f(0.5f,0.5f,0.5f,1.0f); 
    2212                                         break; 
    2213                         case LLViewerObject::LL_VO_PART_GROUP: 
    2214                                         gGL.color4f(0,0,1,1); 
    2215                                         break; 
    2216                         case LLViewerObject::LL_VO_WATER: 
    2217                                         gGL.color4f(0,0.5f,1,1); 
    2218                                         break; 
    2219                         case LL_PCODE_LEGACY_TREE: 
    2220                                         gGL.color4f(0,0.5f,0,1); 
    2221                         default: 
    2222                                         gGL.color4f(1,0,1,1); 
    2223                                         break; 
    2224                 } 
    2225         } 
    2226         else  
    2227         { 
    2228                 gGL.color4f(1,0,0,1); 
     2239void renderBoundingBox(LLDrawable* drawable, BOOL set_color = TRUE) 
     2240
     2241        if (set_color) 
     2242        { 
     2243                if (drawable->isSpatialBridge()) 
     2244                { 
     2245                        gGL.color4f(1,0.5f,0,1); 
     2246                } 
     2247                else if (drawable->getVOVolume()) 
     2248                { 
     2249                        if (drawable->isRoot()) 
     2250                        { 
     2251                                gGL.color4f(1,1,0,1); 
     2252                        } 
     2253                        else 
     2254                        { 
     2255                                gGL.color4f(0,1,0,1); 
     2256                        } 
     2257                } 
     2258                else if (drawable->getVObj()) 
     2259                { 
     2260                        switch (drawable->getVObj()->getPCode()) 
     2261                        { 
     2262                                case LLViewerObject::LL_VO_SURFACE_PATCH: 
     2263                                                gGL.color4f(0,1,1,1); 
     2264                                                break; 
     2265                                case LLViewerObject::LL_VO_CLOUDS: 
     2266                                                gGL.color4f(0.5f,0.5f,0.5f,1.0f); 
     2267                                                break; 
     2268                                case LLViewerObject::LL_VO_PART_GROUP: 
     2269                                                gGL.color4f(0,0,1,1); 
     2270                                                break; 
     2271                                case LLViewerObject::LL_VO_WATER: 
     2272                                                gGL.color4f(0,0.5f,1,1); 
     2273                                                break; 
     2274                                case LL_PCODE_LEGACY_TREE: 
     2275                                                gGL.color4f(0,0.5f,0,1); 
     2276                                default: 
     2277                                                gGL.color4f(1,0,1,1); 
     2278                                                break; 
     2279                        } 
     2280                } 
     2281                else  
     2282                { 
     2283                        gGL.color4f(1,0,0,1); 
     2284                } 
    22292285        } 
    22302286 
     
    24882544        } 
    24892545}; 
     2546 
     2547class LLOctreePushBBoxVerts : public LLOctreeTraveler<LLDrawable> 
     2548{ 
     2549public: 
     2550        LLCamera* mCamera; 
     2551        LLOctreePushBBoxVerts(LLCamera* camera): mCamera(camera) {} 
     2552         
     2553        virtual void traverse(const LLSpatialGroup::OctreeNode* node) 
     2554        { 
     2555                LLSpatialGroup* group = (LLSpatialGroup*) node->getListener(0); 
     2556                 
     2557                if (!mCamera || mCamera->AABBInFrustum(group->mBounds[0], group->mBounds[1])) 
     2558                { 
     2559                        node->accept(this); 
     2560 
     2561                        for (U32 i = 0; i < node->getChildCount(); i++) 
     2562                        { 
     2563                                traverse(node->getChild(i)); 
     2564                        } 
     2565                } 
     2566        } 
     2567 
     2568        virtual void visit(const LLSpatialGroup::OctreeNode* branch) 
     2569        { 
     2570                LLSpatialGroup* group = (LLSpatialGroup*) branch->getListener(0); 
     2571 
     2572                if (group->isState(LLSpatialGroup::GEOM_DIRTY) || (mCamera && !mCamera->AABBInFrustumNoFarClip(group->mBounds[0], group->mBounds[1]))) 
     2573                { 
     2574                        return; 
     2575                } 
     2576 
     2577                for (LLSpatialGroup::OctreeNode::const_element_iter i = branch->getData().begin(); i != branch->getData().end(); ++i) 
     2578                { 
     2579                        LLDrawable* drawable = *i; 
     2580                                                 
     2581                        renderBoundingBox(drawable, FALSE);                      
     2582                } 
     2583        } 
     2584}; 
     2585 
     2586void LLSpatialPartition::renderIntersectingBBoxes(LLCamera* camera) 
     2587{ 
     2588        LLOctreePushBBoxVerts pusher(camera); 
     2589        pusher.traverse(mOctree); 
     2590} 
    24902591 
    24912592void LLSpatialPartition::renderDebug() 
  • branches/shadow-draft-2/indra/newview/llspatialpartition.h

    r940 r967  
    8787        LLFace* mFace; //associated face 
    8888        F32 mDistance; 
     89        LLVector3 mExtents[2]; 
    8990 
    9091        struct CompareTexture 
     
    339340        virtual void rebuildGeom(LLSpatialGroup* group); 
    340341 
     342        BOOL visibleObjectsInFrustum(LLCamera& camera); 
    341343        S32 cull(LLCamera &camera, std::vector<LLDrawable *>* results = NULL, BOOL for_select = FALSE); // Cull on arbitrary frustum 
    342344         
     
    347349 
    348350        void renderDebug(); 
     351        void renderIntersectingBBoxes(LLCamera* camera); 
    349352        void restoreGL(); 
    350353        void resetVertexBuffers(); 
  • branches/shadow-draft-2/indra/newview/llviewerdisplay.cpp

    r940 r967  
    740740                                gPipeline.mDeferredScreen.bindTarget(); 
    741741                                gPipeline.mDeferredScreen.clear(); 
    742                                 glClear(GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); 
    743742                        } 
    744743                        else 
    745744                        { 
    746745                                gPipeline.mScreen.bindTarget(); 
    747                                 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); 
     746                                gPipeline.mScreen.clear(); 
    748747                        } 
    749748                         
  • branches/shadow-draft-2/indra/newview/llviewermenu.cpp

    r743 r967  
    13281328                                                                                                        &LLPipeline::toggleRenderDebugControl, 
    13291329                                                                                                        (void*)LLPipeline::RENDER_DEBUG_OCTREE)); 
     1330        sub_menu->append(new LLMenuItemCheckGL("Shadow Frusta", &LLPipeline::toggleRenderDebug, NULL, 
     1331                                                                                                        &LLPipeline::toggleRenderDebugControl, 
     1332                                                                                                        (void*)LLPipeline::RENDER_DEBUG_SHADOW_FRUSTA)); 
    13301333        sub_menu->append(new LLMenuItemCheckGL("Occlusion",     &LLPipeline::toggleRenderDebug, NULL, 
    13311334                                                                                                        &LLPipeline::toggleRenderDebugControl, 
  • branches/shadow-draft-2/indra/newview/llviewerobject.cpp

    r737 r967  
    36663666        { 
    36673667                retval = LLPrimitive::setTEColor(te, color); 
    3668                 setChanged(TEXTURE); 
     3668                //setChanged(TEXTURE); 
    36693669                if (mDrawable.notNull() && retval) 
    36703670                { 
    36713671                        // These should only happen on updates which are not the initial update. 
    3672                         gPipeline.markTextured(mDrawable); 
     3672                        dirtyMesh(); 
    36733673                } 
    36743674        } 
  • branches/shadow-draft-2/indra/newview/llvoiceclient.cpp

    r714 r967  
    34273427{ 
    34283428        std::string result; 
    3429         std::string rawuuid; 
    3430         uuid.toCompressedString(rawuuid); 
    3431          
    34323429        // Prepending this apparently prevents conflicts with reserved names inside the vivox and diamondware code. 
    34333430        result = "x"; 
     
    34363433        // with e-mail local-parts. 
    34373434        // See RFC-4648 "Base 64 Encoding with URL and Filename Safe Alphabet" 
    3438         result += LLBase64::encode((const U8*)rawuuid.c_str(), UUID_BYTES); 
     3435        result += LLBase64::encode(uuid.mData, UUID_BYTES); 
    34393436        LLStringUtil::replaceChar(result, '+', '-'); 
    34403437        LLStringUtil::replaceChar(result, '/', '_'); 
     
    34683465                { 
    34693466                        // The decode succeeded.  Stuff the bits into the result's UUID 
    3470                         // MBW -- XXX -- there's no analogue of LLUUID::toCompressedString that allows you to set a UUID from binary data. 
    3471                         // The data field is public, so we cheat thusly: 
    34723467                        memcpy(uuid.mData, rawuuid, UUID_BYTES); 
    34733468                        result = true; 
  • branches/shadow-draft-2/indra/newview/llvopartgroup.cpp

    r940 r967  
    469469                        U32 count = facep->getIndicesCount(); 
    470470                        LLDrawInfo* info = new LLDrawInfo(start,end,count,offset,facep->getTexture(), buffer, fullbright);  
     471                        info->mExtents[0] = group->mObjectExtents[0]; 
     472                        info->mExtents[1] = group->mObjectExtents[1]; 
    471473                        info->mVSize = vsize; 
    472474                        draw_vec.push_back(info); 
  • branches/shadow-draft-2/indra/newview/llvovolume.cpp

    r940 r967  
    12701270{ 
    12711271        S32 res = LLViewerObject::setTEColor(te, color); 
     1272        if (res && mDrawable.notNull()) 
     1273        { 
     1274                //gPipeline.markTextured(mDrawable); 
     1275                mDrawable->setState(LLDrawable::REBUILD_COLOR); 
     1276                dirtyMesh(); 
     1277                //mFaceMappingChanged = TRUE; 
     1278        } 
     1279        return  res; 
     1280} 
     1281 
     1282S32 LLVOVolume::setTEBumpmap(const U8 te, const U8 bumpmap) 
     1283{ 
     1284        S32 res = LLViewerObject::setTEBumpmap(te, bumpmap); 
    12721285        if (res) 
    12731286        { 
     
    12781291} 
    12791292 
    1280 S32 LLVOVolume::setTEBumpmap(const U8 te, const U8 bumpmap
    1281 { 
    1282         S32 res = LLViewerObject::setTEBumpmap(te, bumpmap); 
     1293S32 LLVOVolume::setTETexGen(const U8 te, const U8 texgen
     1294{ 
     1295        S32 res = LLViewerObject::setTETexGen(te, texgen); 
    12831296        if (res) 
    12841297        { 
     
    12891302} 
    12901303 
    1291 S32 LLVOVolume::setTETexGen(const U8 te, const U8 texgen
    1292 { 
    1293         S32 res = LLViewerObject::setTETexGen(te, texgen); 
     1304S32 LLVOVolume::setTEShiny(const U8 te, const U8 shiny
     1305{ 
     1306        S32 res = LLViewerObject::setTEShiny(te, shiny); 
    12941307        if (res) 
    12951308        { 
     
    13001313} 
    13011314 
    1302 S32 LLVOVolume::setTEShiny(const U8 te, const U8 shiny
    1303 { 
    1304         S32 res = LLViewerObject::setTEShiny(te, shiny); 
     1315S32 LLVOVolume::setTEFullbright(const U8 te, const U8 fullbright
     1316{ 
     1317        S32 res = LLViewerObject::setTEFullbright(te, fullbright); 
    13051318        if (res) 
    13061319        { 
     
    13111324} 
    13121325 
    1313 S32 LLVOVolume::setTEFullbright(const U8 te, const U8 fullbright
    1314 { 
    1315         S32 res = LLViewerObject::setTEFullbright(te, fullbright); 
     1326S32 LLVOVolume::setTEMediaFlags(const U8 te, const U8 media_flags
     1327{ 
     1328        S32 res = LLViewerObject::setTEMediaFlags(te, media_flags); 
    13161329        if (res) 
    13171330        { 
     
    13221335} 
    13231336 
    1324 S32 LLVOVolume::setTEMediaFlags(const U8 te, const U8 media_flags
    1325 { 
    1326         S32 res = LLViewerObject::setTEMediaFlags(te, media_flags); 
     1337S32 LLVOVolume::setTEGlow(const U8 te, const F32 glow
     1338{ 
     1339        S32 res = LLViewerObject::setTEGlow(te, glow); 
    13271340        if (res) 
    13281341        { 
     
    13331346} 
    13341347 
    1335 S32 LLVOVolume::setTEGlow(const U8 te, const F32 glow
    1336 { 
    1337         S32 res = LLViewerObject::setTEGlow(te, glow); 
     1348S32 LLVOVolume::setTEScale(const U8 te, const F32 s, const F32 t
     1349{ 
     1350        S32 res = LLViewerObject::setTEScale(te, s, t); 
    13381351        if (res) 
    13391352        { 
     
    13411354                mFaceMappingChanged = TRUE; 
    13421355        } 
    1343         return res; 
    1344 } 
    1345  
    1346 S32 LLVOVolume::setTEScale(const U8 te, const F32 s, const F32 t
    1347 { 
    1348         S32 res = LLViewerObject::setTEScale(te, s, t); 
     1356        return res; 
     1357} 
     1358 
     1359S32 LLVOVolume::setTEScaleS(const U8 te, const F32 s
     1360{ 
     1361        S32 res = LLViewerObject::setTEScaleS(te, s); 
    13491362        if (res) 
    13501363        { 
     
    13551368} 
    13561369 
    1357 S32 LLVOVolume::setTEScaleS(const U8 te, const F32 s
    1358 { 
    1359         S32 res = LLViewerObject::setTEScaleS(te, s); 
     1370S32 LLVOVolume::setTEScaleT(const U8 te, const F32 t
     1371{ 
     1372        S32 res = LLViewerObject::setTEScaleT(te, t); 
    13601373        if (res) 
    13611374        { 
     
    13661379} 
    13671380 
    1368 S32 LLVOVolume::setTEScaleT(const U8 te, const F32 t) 
    1369 { 
    1370         S32 res = LLViewerObject::setTEScaleT(te, t); 
    1371         if (res) 
    1372         { 
    1373                 gPipeline.markTextured(mDrawable); 
    1374                 mFaceMappingChanged = TRUE; 
    1375         } 
    1376         return res; 
    1377 } 
    1378  
    13791381void LLVOVolume::updateTEData() 
    13801382{ 
    1381         if (mDrawable.notNull()) 
     1383        /*if (mDrawable.notNull()) 
    13821384        { 
    13831385                mFaceMappingChanged = TRUE; 
    13841386                gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_MATERIAL, TRUE); 
    1385         } 
     1387        }*/ 
    13861388} 
    13871389 
     
    20402042                draw_vec[idx]->mVSize = llmax(draw_vec[idx]->mVSize, facep->getVirtualSize()); 
    20412043                validate_draw_info(*draw_vec[idx]); 
     2044                update_min_max(draw_vec[idx]->mExtents[0], draw_vec[idx]->mExtents[1], facep->mExtents[0]); 
     2045                update_min_max(draw_vec[idx]->mExtents[0], draw_vec[idx]->mExtents[1], facep->mExtents[1]); 
    20422046        } 
    20432047        else 
     
    20592063                        facep->setDrawInfo(draw_info); 
    20602064                } 
     2065                draw_info->mExtents[0] = facep->mExtents[0]; 
     2066                draw_info->mExtents[1] = facep->mExtents[1]; 
    20612067                validate_draw_info(*draw_info); 
    20622068        } 
  • branches/shadow-draft-2/indra/newview/pipeline.cpp

    r940 r967  
    12771277} 
    12781278 
     1279BOOL LLPipeline::visibleObjectsInFrustum(LLCamera& camera) 
     1280{ 
     1281        for (LLWorld::region_list_t::iterator iter = LLWorld::getInstance()->getRegionList().begin();  
     1282                        iter != LLWorld::getInstance()->getRegionList().end(); ++iter) 
     1283        { 
     1284                LLViewerRegion* region = *iter; 
     1285 
     1286                for (U32 i = 0; i < LLViewerRegion::NUM_PARTITIONS; i++) 
     1287                { 
     1288                        LLSpatialPartition* part = region->getSpatialPartition(i); 
     1289                        if (part) 
     1290                        { 
     1291                                if (hasRenderType(part->mDrawableType)) 
     1292                                { 
     1293                                        if (part->visibleObjectsInFrustum(camera)) 
     1294                                        { 
     1295                                                return TRUE; 
     1296                                        } 
     1297                                } 
     1298                        } 
     1299                } 
     1300        } 
     1301 
     1302        return FALSE; 
     1303} 
     1304 
     1305BOOL LLPipeline::getVisibleExtents(LLCamera& camera, LLVector3& min, LLVector3& max) 
     1306{ 
     1307        min = LLVector3(F32_MAX, F32_MAX, F32_MAX); 
     1308        max = LLVector3(-F32_MAX, -F32_MAX, -F32_MAX); 
     1309 
     1310 
     1311        BOOL res = TRUE; 
     1312 
     1313        for (LLWorld::region_list_t::iterator iter = LLWorld::getInstance()->getRegionList().begin();  
     1314                        iter != LLWorld::getInstance()->getRegionList().end(); ++iter) 
     1315        { 
     1316                LLViewerRegion* region = *iter; 
     1317 
     1318                for (U32 i = 0; i < LLViewerRegion::NUM_PARTITIONS; i++) 
     1319                { 
     1320                        LLSpatialPartition* part = region->getSpatialPartition(i); 
     1321                        if (part) 
     1322                        { 
     1323                                if (hasRenderType(part->mDrawableType)) 
     1324                                { 
     1325                                        if (!part->getVisibleExtents(camera, min, max)) 
     1326                                        { 
     1327                                                res = FALSE; 
     1328                                        } 
     1329                                } 
     1330                        } 
     1331                } 
     1332        } 
     1333 
     1334        return res; 
     1335} 
     1336 
     1337 
    12791338void LLPipeline::updateCull(LLCamera& camera, LLCullResult& result, S32 water_clip) 
    12801339{ 
     
    12941353        if (to_texture) 
    12951354        { 
    1296                 if (LLPipeline::sRenderDeferred) 
    1297                 { 
    1298                         mDeferredScreen.bindTarget(); 
    1299                         mDeferredScreen.clear(); 
    1300                 } 
    1301                 else 
     1355                //if (LLPipeline::sRenderDeferred) 
     1356                //{ 
     1357                //      mDeferredScreen.bindTarget(); 
     1358                //} 
     1359                //else 
    13021360                { 
    13031361                        mScreen.bindTarget(); 
     
    13861444        if (to_texture) 
    13871445        { 
    1388                 mScreen.flush(); 
    1389  
    1390                 if (LLPipeline::sRenderDeferred) 
    1391                 { 
    1392                         mDeferredScreen.flush(); 
    1393                 } 
    1394                 else 
     1446                //if (LLPipeline::sRenderDeferred) 
     1447                //{ 
     1448                //      mDeferredScreen.flush(); 
     1449                //} 
     1450                //else 
    13951451                { 
    13961452                        mScreen.flush(); 
    13971453                } 
    1398                 LLRenderTarget::unbindTarget(); 
    13991454        } 
    14001455        else if (LLPipeline::sUseOcclusion > 1) 
     
    21922247                                                if (params->mFace) 
    21932248                                                { 
    2194                                                         LLVector3 box = (params->mFace->mExtents[1] - params->mFace->mExtents[0]) * 0.25f; 
    2195                                                         LLVector3 v = (params->mFace->getPositionAgent()-camera.getOrigin()); 
    2196                                                          
    2197                                                         for (U32 j = 0; j < 3; j++) 
     2249                                                        BOOL culled = !group->mSpatialPartition->isBridge(); 
     2250                                                        if (culled) 
    21982251                                                        { 
    2199                                                                 v.mV[j] -= box.mV[j] * at.mV[j]; 
     2252</