Changeset 1883 for GTP/trunk/Lib/Vis/Preprocessing/src/RssTree.cpp
- Timestamp:
- 12/12/06 17:25:53 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/RssTree.cpp
r1877 r1883 28 28 #include "Preprocessor.h" 29 29 #include "SceneGraph.h" 30 #include "SamplingStrategy.h" 30 31 31 32 … … 1949 1950 Vector3 direction = VssRay::GetDirection(dirVector.x, dirVector.y); 1950 1951 //cout<<"dir vector.x="<<dirVector.x<<"direction'.x="<<atan2(direction.x, direction.y)<<endl; 1951 rays.push_back(SimpleRay(origin, direction)); 1952 rays.push_back(SimpleRay(origin, 1953 direction, 1954 SamplingStrategy::RSS_BASED_DISTRIBUTION, 1955 1.0f 1956 )); 1952 1957 } 1953 1958 } else { … … 2308 2313 2309 2314 //Debug<<"dir vector.x="<<dirVector.x<<"direction'.x="<<atan2(direction.x, direction.y)<<endl; 2310 rays.push_back(SimpleRay(origin, direction)); 2315 rays.push_back(SimpleRay(origin, 2316 direction, 2317 SamplingStrategy::RSS_BASED_DISTRIBUTION, 2318 1.0f 2319 )); 2311 2320 } 2312 2321 … … 2472 2481 if (!intersects) { 2473 2482 //cout<<"dir vector.x="<<dirVector.x<<"direction'.x="<<atan2(direction.x, direction.y)<<endl; 2474 rays.push_back(SimpleRay(origin, direction)); 2483 rays.push_back(SimpleRay(origin, 2484 direction, 2485 SamplingStrategy::RSS_BASED_DISTRIBUTION, 2486 1.0f 2487 )); 2475 2488 generated++; 2476 2489 } … … 2588 2601 if (node->IsLeaf()) { 2589 2602 RssTreeLeaf *leaf = (RssTreeLeaf *)node; 2590 prunned += PruneRaysRandom(leaf, ratio);2591 //prunned += PruneRaysContribution(leaf, ratio);2603 //prunned += PruneRaysRandom(leaf, ratio); 2604 prunned += PruneRaysContribution(leaf, ratio); 2592 2605 } else { 2593 2606 RssTreeInterior *in = (RssTreeInterior *)node; … … 2722 2735 // if small very high importance of the last sample 2723 2736 // if 1.0f then weighs = 1 1/2 1/3 1/4 2724 //float passSampleWeightDecay = 1.0f;2725 float passSampleWeightDecay = 1000.0f;2737 float passSampleWeightDecay = 1.0f; 2738 //float passSampleWeightDecay = 1000.0f; 2726 2739 2727 2740 float … … 2730 2743 int passDiff = mCurrentPass - pass; 2731 2744 float weight; 2732 if ( 1)2745 if (0) 2733 2746 weight = 1.0f/(passDiff + passSampleWeightDecay); 2734 2747 else … … 2777 2790 RssTree::ComputeImportance(RssTreeLeaf *leaf) 2778 2791 { 2792 #if 1 2779 2793 if (leaf->mTotalRays) 2780 2794 leaf->mImportance = leaf->mTotalContribution / leaf->mTotalRays; 2781 2795 else 2782 leaf->mImportance = 0.0f;2796 leaf->mImportance = Limits::Small; 2783 2797 return; 2798 #endif 2784 2799 2785 2800 if (0)
Note: See TracChangeset
for help on using the changeset viewer.