Changeset 2741 for GTP/trunk/Lib
- Timestamp:
- 06/06/08 09:58:57 (17 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/scripts/run_gvs_vps.sh
r2740 r2741 14 14 SCENE=../data/Arena/arena_trees.obj 15 15 #VIEWCELLS=../data/Arena/arena-high-lods-5000-viewcells.xml.gz 16 #SCENE=../data/vienna/ 2vienna_cropped.obj16 #SCENE=../data/vienna/vienna_cropped.obj 17 17 #SCENE=../data/roofs_new.obj 18 18 SCENE=../data/vienna/city_full_hp.obj 19 #SCENE=../data/vienna/vienna_rep.obj 19 SCENE=../data/vienna/vienna_rep.obj 20 #SCENE=../data/vienna/vienna_cropped.obj 20 21 21 SCENE=../data/vienna/vienna_cropped.obj22 22 VIEWCELLS=../data/vienna/vienna_cropped-gradient-viewcells.xml.gz 23 23 VIEWPOINTS=../data/vienna/testwalk.vp … … 25 25 26 26 #LOG_PREFIX=../src/SG08/rebut-arena-pixel2 27 LOG_PREFIX=../src/SG08/test _jitter_0.127 LOG_PREFIX=../src/SG08/test 28 28 29 29 ENVIRONMENT=gvs.env … … 43 43 -gvs_initial_samples=16 \ 44 44 -gvs_max_viewcells=1 \ 45 -gvs_min_contribution= 200 \45 -gvs_min_contribution=50 \ 46 46 -gvs_per_viewcell=true \ 47 47 -gvs_radius_of_influence=5.0 \ -
GTP/trunk/Lib/Vis/Preprocessing/src/GvsPreprocessor.cpp
r2740 r2741 234 234 simpleRays.clear(); 235 235 236 CreateRandomizedReverseRays(currentRay .mOrigin, predictedHit, hitTriangle, simpleRays, 16);236 CreateRandomizedReverseRays(currentRay, predictedHit, simpleRays, 16); 237 237 238 238 static VssRayContainer reverseRays; … … 679 679 680 680 681 #if 0681 #if 1 682 682 for (size_t i = 0; i < vssRays.size(); ++ i) 683 683 { … … 1577 1577 1578 1578 // compute the pixel error of this visibility solution 1579 if ( 0&& mEvaluatePixelError)1579 if (1 && mEvaluatePixelError) 1580 1580 ComputeRenderError(); 1581 1581 } … … 2040 2040 2041 2041 2042 void GvsPreprocessor::CreateRandomizedReverseRays(const Vector3 &origin, 2043 const Vector3 &termination, 2044 const Triangle3 &triangle, 2042 void GvsPreprocessor::CreateRandomizedReverseRays(const VssRay &ray, 2043 const Vector3 &predictedPoint, 2045 2044 SimpleRayContainer &rays, 2046 2045 int number) … … 2052 2051 while (((rays.size() - currentNumber) < number) && (tries ++ < 20)) 2053 2052 { 2054 SimpleRay ray;2055 if (CreateRandomizedReverseRay( origin, termination, triangle, ray))2056 rays.push_back( ray);2053 SimpleRay simpleRay; 2054 if (CreateRandomizedReverseRay(ray, predictedPoint, simpleRay)) 2055 rays.push_back(simpleRay); 2057 2056 } 2058 2057 … … 2061 2060 2062 2061 2063 bool GvsPreprocessor::CreateRandomizedReverseRay(const Vector3 &origin, 2064 const Vector3 &termination, 2065 const Triangle3 &triangle, 2066 SimpleRay &ray) 2067 { 2068 //Vector3 nd = triangle.GetNormal(); 2062 bool GvsPreprocessor::CreateRandomizedReverseRay(const VssRay &ray, 2063 const Vector3 &predictedPoint, 2064 SimpleRay &simpleRay) 2065 { 2066 //Vector3 nd = ray.GetNormalizedDir(); 2069 2067 const AxisAlignedBox3 box = mCurrentViewCell->GetBox(); 2070 Vector3 nd = box.GetNearestFace(origin).GetNormal();2068 //Vector3 nd = box.GetNearestFace(origin).GetNormal(); 2071 2069 //cout << "pt: " << origin << " face: " << box.GetNearestFace(origin) << endl; 2072 nd.Normalize();2073 2070 2074 2071 // Compute right handed coordinate system from direction 2075 Vector3 U, V;2072 /*Vector3 U, V; 2076 2073 nd.RightHandedBase(U, V); 2077 2074 … … 2082 2079 2083 2080 Vector2 vr2(rr[0], rr[1]); 2084 const float sigma = triangle.GetBoundingBox().Radius() * mRadiusOfInfluence;2081 const float sigma = 1.0f;//triangle.GetBoundingBox().Radius() * mRadiusOfInfluence; 2085 2082 Vector2 gaussvec2; 2086 2083 … … 2090 2087 const Vector3 shift = gaussvec2.xx * U + gaussvec2.yy * V; 2091 2088 2092 Vector3 newOrigin = origin + shift; 2089 Vector3 newOrigin = ray.mOrigin + shift; 2090 */ 2093 2091 //cout << "o: " << origin << " new o: " << newOrigin << endl; 2094 2095 Vector3 direction = termination- newOrigin;2092 Vector3 newOrigin = box.GetRandomPoint(); 2093 Vector3 direction = predictedPoint - newOrigin; 2096 2094 2097 2095 const float len = Magnitude(direction); … … 2102 2100 direction /= len; 2103 2101 2104 if ( !IntersectsViewCell(newOrigin, -direction))2102 if (0 && !IntersectsViewCell(newOrigin, -direction)) 2105 2103 { 2106 2104 //cout << "x"; … … 2111 2109 // $$ jb the pdf is yet not correct for all sampling methods! 2112 2110 const float pdf = 1.0f; 2113 ray = SimpleRay(newOrigin, direction, SamplingStrategy::GVS, pdf);2111 simpleRay = SimpleRay(newOrigin, direction, SamplingStrategy::GVS, pdf); 2114 2112 2115 2113 return true; -
GTP/trunk/Lib/Vis/Preprocessing/src/GvsPreprocessor.h
r2740 r2741 297 297 void PrepareProbablyVisibleSampling(); 298 298 299 void CreateRandomizedReverseRays(const Vector3 &origin, 300 const Vector3 &termination, 301 const Triangle3 &triangle, 299 void CreateRandomizedReverseRays(const VssRay &ray, 300 const Vector3 &predictedPoint, 302 301 SimpleRayContainer &rays, 303 302 int number); 304 303 305 bool CreateRandomizedReverseRay(const Vector3 &origin, 306 const Vector3 &termination, 307 const Triangle3 &triangle, 308 SimpleRay &ray); 304 bool CreateRandomizedReverseRay(const VssRay &ray, 305 const Vector3 &predictedPoint, 306 SimpleRay &simpleray); 309 307 310 308 inline bool IntersectsViewCell(Vector3 &origin, const Vector3 &dir) const; -
GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.cpp
r2738 r2741 257 257 GLfloat mat_ambient[] = {0.5f, 0.5f, 0.5f, 1.0f}; 258 258 GLfloat mat_diffuse[] = {1.0f, 1.0f, 1.0f, 1.0f}; 259 GLfloat mat_specular[] = {0. 3f, 0.3f, 0.3f, 1.0f};259 GLfloat mat_specular[] = {0.5f, 0.5f, 0.5f, 1.0f}; 260 260 GLfloat mat_shininess[] = {1.0f}; 261 261 … … 285 285 glEnable(GL_COLOR_MATERIAL); 286 286 287 GLfloat lmodel_ambient[] = {0. 3f, 0.3f, 0.3f, 1.0f};288 glLightModelfv(GL_LIGHT_MODEL_AMBIENT, lmodel_ambient);287 GLfloat lmodel_ambient[] = {0.5f, 0.5f, 0.5, 1.0f}; 288 //glLightModelfv(GL_LIGHT_MODEL_AMBIENT, lmodel_ambient); 289 289 290 290 glShadeModel(GL_SMOOTH); -
GTP/trunk/Lib/Vis/Preprocessing/src/SamplingStrategy.cpp
r2735 r2741 829 829 { 830 830 //mViewCell->GetRandomEdgePoint(origin, normal); 831 origin = mViewCell->GetBox().GetRandomSurfacePoint(); 831 //origin = mViewCell->GetBox().GetRandomSurfacePoint(); 832 origin = mViewCell->GetBox().GetRandomPoint(); 832 833 833 834 // move a little bit back to avoid piercing through walls
Note: See TracChangeset
for help on using the changeset viewer.