- Timestamp:
- 01/04/07 00:23:09 (18 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing/src
- Files:
-
- 1 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.cpp
r1931 r1935 882 882 883 883 884 885 886 887 888 889 884 void GlRendererBuffer::SampleBeamContributions(Intersectable *sourceObject, 890 885 Beam &beam, … … 1015 1010 glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 0, 0, depthMapSize, depthMapSize); 1016 1011 1017 1018 1012 // reset clear function 1019 1013 glClearDepth(clearDepth); 1020 1021 1014 1022 1015 … … 1099 1092 #endif 1100 1093 1101 1102 1103 // 6. Use occlusion queries for all viewcell meshes associated with the beam -> 1094 // 6. Use occlusion queries for all viewcell meshes associated with the beam -> 1104 1095 // a fragment passes if the corresponding stencil fragment is set and its depth is 1105 1096 // between origin and termination buffer … … 1132 1123 } 1133 1124 1134 1135 1136 1125 // at this point, if possible, go and do some other computation 1137 1126 1138 1139 1140 1127 // 7. The number of visible pixels is the number of sample rays which see the source 1141 1128 // object from the corresponding viewcell -> remember these values for later update … … 1179 1166 #endif 1180 1167 1181 1182 1183 1168 //-- cleanup 1184 1185 1169 1186 1170 // reset gl state … … 1189 1173 glEnable(GL_CULL_FACE); 1190 1174 glDisable(GL_STENCIL_TEST); 1175 1191 1176 #if USE_CG 1192 1177 cgGLDisableProfile(sCgFragmentProfile); -
GTP/trunk/Lib/Vis/Preprocessing/src/GvsPreprocessor.cpp
r1934 r1935 15 15 { 16 16 17 #define GVS_DEBUG 017 #define GVS_DEBUG 1 18 18 19 19 struct VizStruct … … 435 435 // take xnew, p = intersect(viewcell, line(pnew, predicted(x)) as origin ? 436 436 // difficult to say!! 437 const Vector3 newOrigin = newPoint + newDir * -5000.0f; 437 const float offset = 0.5f; 438 const Vector3 newOrigin = newPoint - newDir * offset; 438 439 439 440 const SimpleRay simpleRay(newOrigin, newDir, SamplingStrategy::GVS, 1.0f); -
GTP/trunk/Lib/Vis/Preprocessing/src/QtGlRenderer/QtGlRenderer.cpp
r1926 r1935 21 21 static CGcontext sCgContext = NULL; 22 22 static CGprogram sCgFragmentProgram = NULL; 23 static CGprogram sCgDepthPeelingProgram = NULL; 23 24 static CGprofile sCgFragmentProfile; 24 25 … … 140 141 if (sCgFragmentProgram) 141 142 cgDestroyProgram(sCgFragmentProgram); 143 if (sCgDepthPeelingProgram) 144 cgDestroyProgram(sCgDepthPeelingProgram); 142 145 if (sCgContext) 143 146 cgDestroyContext(sCgContext); … … 692 695 } 693 696 694 695 696 697 // at this point, if possible, go and do some other computation 697 698 699 698 700 699 // 7. The number of visible pixels is the number of sample rays which see the source … … 739 738 #endif 740 739 741 742 740 //////// 743 741 //-- cleanup 744 745 742 746 743 // reset gl state … … 791 788 792 789 790 void QtGlRendererBuffer::CastGlobalLine(Beam &beam, const int samples) 791 { 792 // bind pixel shader implementing the front depth buffer functionality 793 cgGLBindProgram(sCgFragmentProgram); 794 cgGLEnableProfile(sCgFragmentProfile); 795 796 DepthPeeling(beam, samples); 797 } 798 799 800 void QtGlRendererBuffer::DepthPeeling(Beam &beam, const int samples) 801 { 802 /* if (rtNew->IsDoubleBuffered()) 803 glDrawBuffer(GL_BACK); 804 805 rtNew->BeginCapture(); 806 { 807 cgGLBindProgram(passthru); 808 glColor3f(0,0.0,0.0); 809 DrawGeometry(); //just random geomerty 810 } 811 rtNew->EndCapture(); 812 813 for(int l = 0; l < mCurrentDepth; l++) 814 { 815 // Peel another layer 816 pingpong(); // switch pointer between rendertextures 817 818 rtNew->BeginCapture(); 819 { 820 if (rtNew->IsDoubleBuffered()) 821 glDrawBuffer(GL_BACK); 822 823 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 824 825 cgGLBindProgram(fragmentProgram); 826 cgGLSetTextureParameter(input1, rtOld->GetDepthTextureID()); 827 cgGLEnableTextureParameter(input1); 828 829 glColor3f(0,0.0,0.0); 830 DrawGeometry(); 831 cgGLDisableTextureParameter(input1); 832 } 833 rtNew->EndCapture(); 834 }*/ 835 } 836 837 793 838 void QtGlRendererBuffer::InitGL() 794 839 { 795 796 840 makeCurrent(); 841 GlRenderer::InitGL(); 797 842 798 843 #if 1 … … 851 896 Debug << "---- PROGRAM BEGIN ----\n" << 852 897 cgGetProgramString(sCgFragmentProgram, CG_COMPILED_PROGRAM) << "---- PROGRAM END ----\n"; 898 899 900 sCgDepthPeelingProgram = 901 cgCreateProgramFromFile(sCgContext, 902 CG_SOURCE, 903 "../src/depth_peeling.cg", 904 sCgFragmentProfile, 905 NULL, 906 NULL); 907 908 if (!cgIsProgramCompiled(sCgDepthPeelingProgram)) 909 cgCompileProgram(sCgDepthPeelingProgram); 910 911 cgGLLoadProgram(sCgDepthPeelingProgram); 912 cgGLBindProgram(sCgDepthPeelingProgram); 913 914 Debug << "---- PROGRAM BEGIN ----\n" 915 << cgGetProgramString(sCgDepthPeelingProgram, CG_COMPILED_PROGRAM) 916 << "---- PROGRAM END ----\n"; 853 917 854 918 #endif … … 1742 1806 1743 1807 1744 1745 1808 void 1746 1809 QtRendererControlWidget::FocusNextPvsErrorFrame(void) … … 1752 1815 void 1753 1816 QtRendererControlWidget::UpdatePvsErrorItem(int row, 1754 1817 GlRendererBuffer::PvsErrorEntry &pvsErrorEntry) 1755 1818 { 1756 1819 -
GTP/trunk/Lib/Vis/Preprocessing/src/QtGlRenderer/QtGlRenderer.h
r1932 r1935 79 79 80 80 void SampleBeamContributions( 81 Intersectable *sourceObject,82 Beam &beam,83 const int samples,84 BeamSampleStatistics &stat81 Intersectable *sourceObject, 82 Beam &beam, 83 const int samples, 84 BeamSampleStatistics &stat 85 85 ); 86 86 87 87 void 88 88 SampleViewpointContributions( 89 Intersectable *sourceObject,90 const Vector3 viewPoint,91 Beam &beam,92 const int desiredSamples,93 BeamSampleStatistics &stat89 Intersectable *sourceObject, 90 const Vector3 viewPoint, 91 Beam &beam, 92 const int desiredSamples, 93 BeamSampleStatistics &stat 94 94 ); 95 95 96 void CastGlobalLine(Beam &beam, 97 const int samples); 98 99 void DepthPeeling(Beam &beam, const int samples); 100 96 101 void InitGL(); 97 102 98 /** Computes rays from information gained with hw sampling -103 /** Computes rays from information gained with hw sampling 99 104 */ 100 105 void ComputeRays(Intersectable *sourceObj, VssRayContainer &rays); -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
r1932 r1935 3561 3561 if (p < raysOut) 3562 3562 { 3563 if ( 0 &&(*rit)->mFlags & VssRay::BorderSample)3563 if ((*rit)->mFlags & VssRay::BorderSample) 3564 3564 { 3565 3565 vcRays.push_back(*rit); … … 3567 3567 else if ((*rit)->mFlags & VssRay::ReverseSample) 3568 3568 { 3569 cout << "l";3570 3569 vcRays2.push_back(*rit); 3571 3570 } 3572 else if(0)3571 else 3573 3572 { 3574 3573 vcRays3.push_back(*rit);
Note: See TracChangeset
for help on using the changeset viewer.