Changeset 2615 for GTP/trunk/Lib/Vis/Preprocessing/src/GvsPreprocessor.cpp
- Timestamp:
- 01/19/08 05:28:24 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/GvsPreprocessor.cpp
r2601 r2615 48 48 Environment::GetSingleton()->GetBoolValue("Preprocessor.evaluatePixelError", mEvaluatePixelError); 49 49 50 Environment::GetSingleton()->GetBoolValue("ViewCells.useKdPvs", mUseKdPvs); 51 52 50 53 char gvsStatsLog[100]; 51 54 Environment::GetSingleton()->GetStringValue("GvsPreprocessor.stats", gvsStatsLog); … … 183 186 obj->mCounter = 1; 184 187 mTrianglePvs.push_back(obj); 185 186 /*mViewCellsManager->ComputeSampleContribution(ray, 187 true, 188 mCurrentViewCell, 189 true);*/ 188 189 if (mUseKdPvs) 190 { 191 KdNode *node = mKdTree->GetPvsNode(ray.mTermination); 192 193 if (!node->Mailed()) 194 { 195 node->Mail(); 196 mKdPvs.push_back(mKdTree->GetOrCreateKdIntersectable(node)); 197 } 198 } 190 199 191 200 result = true; … … 863 872 for (lit = leaves.begin(); lit != leaves.end(); ++ lit) 864 873 { 865 KdLeaf *leaf = *lit; 874 KdLeaf *leaf = *lit; 875 876 if (mUseKdPvs) 877 mKdPvs.push_back(mKdTree->GetOrCreateKdIntersectable(leaf)); 878 866 879 ObjectContainer::const_iterator oit, oit_end = leaf->mObjects.end(); 867 880 … … 892 905 (*oit)->mCounter = 0; 893 906 } 894 int dummy = 0; 907 908 895 909 while (NextViewCell())// && (dummy < 3)) 896 910 { … … 898 912 //if (mProcessedViewCells < 53) continue; 899 913 914 if (mUseKdPvs) 915 { 916 KdNode::NewMail(); 917 mKdPvs.clear(); 918 } 919 900 920 long startTime = GetTime(); 901 921 cout << "\n***********************\n" … … 910 930 mGvsStats.mTotalTrianglePvs += mGvsStats.mTrianglePvs; 911 931 912 ObjectContainer objectPvs; 913 914 // exchange triangle pvs with objects 915 //UpdatePvs(mCurrentViewCell); 916 GetObjectPvs(objectPvs); 917 918 // add pvs 919 ObjectContainer::const_iterator it, it_end = objectPvs.end(); 920 921 for (it = objectPvs.begin(); it != it_end; ++ it) 922 { 923 mCurrentViewCell->GetPvs().AddSampleDirty(*it, 1.0f); 924 } 925 926 cout << "triangle pvs of " << (int)mTrianglePvs.size() 927 << " was converted to object pvs of " << (int)objectPvs.size() << endl; 928 932 if (!mUseKdPvs) 933 { 934 ObjectContainer objectPvs; 935 936 // optain object pvs 937 GetObjectPvs(objectPvs); 938 939 // add pvs 940 ObjectContainer::const_iterator it, it_end = objectPvs.end(); 941 942 for (it = objectPvs.begin(); it != it_end; ++ it) 943 { 944 mCurrentViewCell->GetPvs().AddSampleDirty(*it, 1.0f); 945 } 946 947 cout << "triangle pvs of " << (int)mTrianglePvs.size() 948 << " was converted to object pvs of " << (int)objectPvs.size() << endl; 949 950 mGvsStats.mPerViewCellPvs = (int)objectPvs.size(); 951 } 952 else 953 { 954 // add pvs 955 ObjectContainer::const_iterator it, it_end = mKdPvs.end(); 956 957 for (it = mKdPvs.begin(); it != it_end; ++ it) 958 { 959 mCurrentViewCell->GetPvs().AddSampleDirty(*it, 1.0f); 960 } 961 962 mGvsStats.mPerViewCellPvs = mKdPvs.size(); 963 } 929 964 930 965 //////// … … 932 967 933 968 mGvsStats.mViewCells = mProcessedViewCells;//mPass; 934 //mGvsStats.mPerViewCellPvs = mCurrentViewCell->GetPvs().GetSize(); 935 mGvsStats.mPerViewCellPvs = (int)objectPvs.size(); 969 936 970 937 971 mGvsStats.mTotalPvs += mGvsStats.mPerViewCellPvs; … … 950 984 951 985 mTrianglePvs.clear(); 952 986 #if 0 953 987 if (GVS_DEBUG) 954 988 { … … 957 991 CLEAR_CONTAINER(mVssRays); 958 992 } 959 960 // is this really necessary?961 //ClearRayQueue();962 993 cout << "finished" << endl; 994 963 995 if (mEvaluatePixelError || mExportVisibility) 964 996 { 965 997 StorePvs(objectPvs); 966 998 } 999 #endif 967 1000 } 968 1001 } … … 1039 1072 1040 1073 BvhLeaf::NewMail(); 1074 //KdNode::NewMail(); 1041 1075 1042 1076 ObjectContainer::const_iterator oit, oit_end = mTrianglePvs.end(); … … 1053 1087 if (!bv || bv->Mailed()) 1054 1088 continue; 1055 1089 1056 1090 bv->Mail(); 1057 1058 1091 objectPvs.push_back(bv); 1059 1092 }
Note: See TracChangeset
for help on using the changeset viewer.