Changeset 1940 for GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface
- Timestamp:
- 01/04/07 21:39:44 (18 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/GlobalLinesRenderer.cpp
r1939 r1940 6 6 #include <Cg/cgGL.h> 7 7 8 //#include <QVBoxLayout>8 #include <QtOpenGL> 9 9 10 10 namespace GtpVisibilityPreprocessor { … … 14 14 static CGprofile sCgFragmentProfile; 15 15 16 16 17 static void handleCgError() 17 18 { 18 Debug<< "Cg error: " << cgGetErrorString(cgGetError()) << endl;19 cerr << "Cg error: " << cgGetErrorString(cgGetError()) << endl; 19 20 exit(1); 20 21 } 21 22 22 /*QtGlRendererBuffer::~QtGlRendererBuffer() 23 24 GlobalLinesRenderer::GlobalLinesRenderer(QGLPixelBuffer *buffer1, QGLPixelBuffer *buffer2): 25 mNewBuffer(buffer1), mOldBuffer(buffer2) 23 26 { 24 if (sCgFragmentProgram) 25 cgDestroyProgram(sCgFragmentProgram); 27 } 28 29 30 GlobalLinesRenderer::~GlobalLinesRenderer() 31 { 26 32 if (sCgDepthPeelingProgram) 27 33 cgDestroyProgram(sCgDepthPeelingProgram); … … 30 36 } 31 37 32 */ 38 39 void GlobalLinesRenderer::CastGlobalLines(Beam &beam, const int samples) 40 { 41 // bind pixel shader implementing the front depth buffer functionality 42 cgGLBindProgram(sCgDepthPeelingProgram); 43 cgGLEnableProfile(sCgFragmentProfile); 44 45 ApplyDepthPeeling(beam, samples); 46 } 47 48 49 void GlobalLinesRenderer::DrawGeometry() 50 { 51 } 52 53 void GlobalLinesRenderer::ApplyDepthPeeling(Beam &beam, const int samples) 54 { 55 /* if (rtNew->IsDoubleBuffered()) 56 glDrawBuffer(GL_BACK); 57 58 rtNew->BeginCapture(); 59 { 60 cgGLBindProgram(passthru); 61 glColor3f(0,0.0,0.0); 62 DrawGeometry(); //just random geomerty 63 } 64 rtNew->EndCapture(); 65 66 for(int l = 0; l < mCurrentDepth; l++) 67 { 68 // Peel another layer 69 pingpong(); // switch pointer between rendertextures 70 71 rtNew->BeginCapture(); 72 { 73 if (rtNew->IsDoubleBuffered()) 74 glDrawBuffer(GL_BACK); 75 76 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 77 78 cgGLBindProgram(fragmentProgram); 79 cgGLSetTextureParameter(input1, rtOld->GetDepthTextureID()); 80 cgGLEnableTextureParameter(input1); 81 82 glColor3f(0,0.0,0.0); 83 DrawGeometry(); 84 cgGLDisableTextureParameter(input1); 85 } 86 rtNew->EndCapture(); 87 }*/ 88 } 33 89 34 90 -
GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/GlobalLinesRenderer.h
r1939 r1940 7 7 class Beam; 8 8 class Intersectable; 9 class QGLPixelBuffer; 10 9 11 struct VssRayContainer; 10 12 … … 14 16 class __declspec(dllexport) GlobalLinesRenderer 15 17 { 16 GlobalLinesRenderer();//(QtGlPixelBuffer *buffer1, QtGlPixelBuffer *buffer2); 17 18 GlobalLinesRenderer(QGLPixelBuffer *buffer1, QGLPixelBuffer *buffer2); 18 19 ~GlobalLinesRenderer(); 19 20 20 21 void CastGlobalLines(Beam &beam, const int samples); 21 22 22 23 23 void InitGL(); … … 33 33 private: 34 34 35 /** Draws the geometry for one pass. 36 */ 37 void DrawGeometry(); 38 35 39 void ApplyDepthPeeling(Beam &beam, const int samples); 36 40 … … 38 42 const Beam &beam); 39 43 44 QGLPixelBuffer *mNewBuffer; 45 QGLPixelBuffer *mOldBuffer; 40 46 }; 41 47 -
GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.cpp
r1935 r1940 786 786 up.x, up.y, up.z); 787 787 } 788 789 790 void QtGlRendererBuffer::CastGlobalLine(Beam &beam, const int samples)791 {792 // bind pixel shader implementing the front depth buffer functionality793 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 geomerty810 }811 rtNew->EndCapture();812 813 for(int l = 0; l < mCurrentDepth; l++)814 {815 // Peel another layer816 pingpong(); // switch pointer between rendertextures817 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 788 837 789 -
GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.h
r1935 r1940 94 94 ); 95 95 96 void CastGlobalLine(Beam &beam,97 const int samples);98 99 void DepthPeeling(Beam &beam, const int samples);100 101 96 void InitGL(); 102 97
Note: See TracChangeset
for help on using the changeset viewer.