Ignore:
Timestamp:
01/25/06 01:44:46 (18 years ago)
Author:
mattausch
Message:

finished function for view cell construction
removed bsp rays from vspbspmanager

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/VUT/GtpVisibilityPreprocessor/src/RenderSimulator.cpp

    r564 r574  
    2424                << avgRtWithoutOverhead << "\n"; 
    2525         
     26        app << "#VALID_MAX_COST ( maximal cost of a valid view cell )\n" << validMaxCost << "\n"; 
     27 
     28        app << "#VALID_MIN_COST ( minimal cost of a valid view cell )\n" << validMinCost << "\n"; 
     29 
     30        app << "#VALID_AVG_RENDER_TIME ( average render time )\n" << validAvgRenderTime << "\n"; 
     31 
     32        app << "#VALID_AVG_RENDER_TIME_NO_OVERHEAD ( valid average render time without overhead )\n"  
     33                << validAvgRtWithoutOverhead << "\n"; 
     34         
    2635        app << "===== END OF Render Simulation statistics ==========\n"; 
    2736} 
     
    3140mObjRenderCost(0.0f),  
    3241mVcOverhead(0.0f),  
    33 mMoveSpeed(0.0f), 
    34 mOnlyValid(false) 
     42mMoveSpeed(0.0f) 
    3543{} 
    3644 
     
    4351mObjRenderCost(objRenderCost),  
    4452mVcOverhead(vcOverhead),  
    45 mMoveSpeed(moveSpeed), 
    46 mOnlyValid(false) 
     53mMoveSpeed(moveSpeed) 
    4754{ 
    4855} 
     
    5562 
    5663 
    57 void RenderSimulator::SetRenderOnlyValid(const bool renderOnlyValid) 
    58 { 
    59         mOnlyValid = renderOnlyValid; 
    60 } 
    61  
    62  
    6364void RenderSimulator::SetVcOverhead(const float vcOverhead) 
    6465{ 
     
    6667} 
    6768 
     69 
    6870void RenderSimulator::SetMoveSpeed(const float moveSpeed) 
    6971{ 
    7072        mMoveSpeed = moveSpeed; 
    7173} 
     74 
    7275 
    7376bool RenderSimulator::RenderScene() 
     
    7780 
    7881        Real renderTime = 0; 
    79          
     82        Real validRenderTime = 0; 
     83 
    8084        // overhead for loading the PVS of the view cells 
    8185        float loadPvsOverhead = 0; 
    82          
     86        float validLoadPvsOverhead = 0; 
     87 
    8388        ViewCellContainer::const_iterator it,  
    8489                it_end = mViewCellsManager->GetViewCells().end(); 
     
    8994                ViewCell *vc = *it; 
    9095 
    91                 if (mOnlyValid && !vc->GetValid()) 
    92                         continue; 
     96                const bool valid = !vc->GetValid(); 
     97         
    9398 
    9499                // probability of view cell 
     
    103108                // speed and the probability that a view cell border is crossed 
    104109                loadPvsOverhead += GetCrossVcProbability() * mVcOverhead; 
    105  
    106                 //Debug << "vccost: " << vcCost << " p in vc " << pInVc 
    107                 //<< " cross vc " << GetCrossVcProbability() << endl; 
     110                renderTime += vcCost; 
    108111 
    109112                //-- update statistics 
    110                 renderTime += vcCost; 
    111          
     113 
    112114                if (vcCost > mSimulationStatistics.maxCost) 
    113115                        mSimulationStatistics.maxCost = vcCost; 
    114116                else if (vcCost < mSimulationStatistics.minCost) 
    115117                        mSimulationStatistics.minCost = vcCost; 
     118 
     119                //-- different statistics for only valid view cells 
     120                if (valid) 
     121                { 
     122                        validLoadPvsOverhead += GetCrossVcProbability() * mVcOverhead; 
     123                        validRenderTime += vcCost; 
     124                 
     125                        if (vcCost > mSimulationStatistics.validMaxCost) 
     126                                mSimulationStatistics.validMaxCost = vcCost; 
     127                        else if (vcCost < mSimulationStatistics.validMinCost) 
     128                                mSimulationStatistics.validMinCost = vcCost; 
     129                } 
    116130        } 
    117131         
    118132        mSimulationStatistics.avgRtWithoutOverhead = renderTime; 
    119133        mSimulationStatistics.avgRenderTime = renderTime + loadPvsOverhead; 
     134 
     135        mSimulationStatistics.validAvgRtWithoutOverhead = renderTime; 
     136        mSimulationStatistics.validAvgRenderTime = renderTime + loadPvsOverhead; 
    120137         
    121138        mSimulationStatistics.Stop(); 
Note: See TracChangeset for help on using the changeset viewer.