Changeset 1935 for GTP/trunk/Lib/Vis/Preprocessing/src/QtGlRenderer
- Timestamp:
- 01/04/07 00:23:09 (18 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing/src/QtGlRenderer
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
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);
Note: See TracChangeset
for help on using the changeset viewer.