- Timestamp:
- 01/25/06 01:44:46 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/VUT/GtpVisibilityPreprocessor/src/RenderSimulator.cpp
r564 r574 24 24 << avgRtWithoutOverhead << "\n"; 25 25 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 26 35 app << "===== END OF Render Simulation statistics ==========\n"; 27 36 } … … 31 40 mObjRenderCost(0.0f), 32 41 mVcOverhead(0.0f), 33 mMoveSpeed(0.0f), 34 mOnlyValid(false) 42 mMoveSpeed(0.0f) 35 43 {} 36 44 … … 43 51 mObjRenderCost(objRenderCost), 44 52 mVcOverhead(vcOverhead), 45 mMoveSpeed(moveSpeed), 46 mOnlyValid(false) 53 mMoveSpeed(moveSpeed) 47 54 { 48 55 } … … 55 62 56 63 57 void RenderSimulator::SetRenderOnlyValid(const bool renderOnlyValid)58 {59 mOnlyValid = renderOnlyValid;60 }61 62 63 64 void RenderSimulator::SetVcOverhead(const float vcOverhead) 64 65 { … … 66 67 } 67 68 69 68 70 void RenderSimulator::SetMoveSpeed(const float moveSpeed) 69 71 { 70 72 mMoveSpeed = moveSpeed; 71 73 } 74 72 75 73 76 bool RenderSimulator::RenderScene() … … 77 80 78 81 Real renderTime = 0; 79 82 Real validRenderTime = 0; 83 80 84 // overhead for loading the PVS of the view cells 81 85 float loadPvsOverhead = 0; 82 86 float validLoadPvsOverhead = 0; 87 83 88 ViewCellContainer::const_iterator it, 84 89 it_end = mViewCellsManager->GetViewCells().end(); … … 89 94 ViewCell *vc = *it; 90 95 91 if (mOnlyValid && !vc->GetValid())92 continue;96 const bool valid = !vc->GetValid(); 97 93 98 94 99 // probability of view cell … … 103 108 // speed and the probability that a view cell border is crossed 104 109 loadPvsOverhead += GetCrossVcProbability() * mVcOverhead; 105 106 //Debug << "vccost: " << vcCost << " p in vc " << pInVc 107 //<< " cross vc " << GetCrossVcProbability() << endl; 110 renderTime += vcCost; 108 111 109 112 //-- update statistics 110 renderTime += vcCost; 111 113 112 114 if (vcCost > mSimulationStatistics.maxCost) 113 115 mSimulationStatistics.maxCost = vcCost; 114 116 else if (vcCost < mSimulationStatistics.minCost) 115 117 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 } 116 130 } 117 131 118 132 mSimulationStatistics.avgRtWithoutOverhead = renderTime; 119 133 mSimulationStatistics.avgRenderTime = renderTime + loadPvsOverhead; 134 135 mSimulationStatistics.validAvgRtWithoutOverhead = renderTime; 136 mSimulationStatistics.validAvgRenderTime = renderTime + loadPvsOverhead; 120 137 121 138 mSimulationStatistics.Stop();
Note: See TracChangeset
for help on using the changeset viewer.