Ignore:
Timestamp:
01/04/07 21:39:44 (17 years ago)
Author:
mattausch
Message:
 
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  
    66#include <Cg/cgGL.h> 
    77 
    8 //#include <QVBoxLayout> 
     8#include <QtOpenGL> 
    99 
    1010namespace GtpVisibilityPreprocessor { 
     
    1414static CGprofile sCgFragmentProfile; 
    1515 
     16 
    1617static void handleCgError()  
    1718{ 
    18     Debug << "Cg error: " << cgGetErrorString(cgGetError()) << endl; 
     19    cerr << "Cg error: " << cgGetErrorString(cgGetError()) << endl; 
    1920    exit(1); 
    2021} 
    2122 
    22 /*QtGlRendererBuffer::~QtGlRendererBuffer() 
     23 
     24GlobalLinesRenderer::GlobalLinesRenderer(QGLPixelBuffer *buffer1, QGLPixelBuffer *buffer2): 
     25mNewBuffer(buffer1), mOldBuffer(buffer2) 
    2326{ 
    24         if (sCgFragmentProgram) 
    25                 cgDestroyProgram(sCgFragmentProgram); 
     27} 
     28 
     29 
     30GlobalLinesRenderer::~GlobalLinesRenderer() 
     31{ 
    2632        if (sCgDepthPeelingProgram) 
    2733                cgDestroyProgram(sCgDepthPeelingProgram); 
     
    3036} 
    3137 
    32 */ 
     38  
     39void 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 
     49void GlobalLinesRenderer::DrawGeometry() 
     50{ 
     51} 
     52 
     53void 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} 
    3389 
    3490 
  • GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/GlobalLinesRenderer.h

    r1939 r1940  
    77class Beam; 
    88class Intersectable; 
     9class QGLPixelBuffer; 
     10 
    911struct VssRayContainer; 
    1012 
     
    1416class __declspec(dllexport) GlobalLinesRenderer 
    1517{ 
    16         GlobalLinesRenderer();//(QtGlPixelBuffer *buffer1, QtGlPixelBuffer *buffer2); 
    17  
     18        GlobalLinesRenderer(QGLPixelBuffer *buffer1, QGLPixelBuffer *buffer2); 
    1819        ~GlobalLinesRenderer(); 
    1920 
    2021        void CastGlobalLines(Beam &beam, const int samples); 
    21  
    2222 
    2323        void InitGL(); 
     
    3333private: 
    3434 
     35        /** Draws the geometry for one pass. 
     36        */ 
     37        void DrawGeometry(); 
     38 
    3539        void ApplyDepthPeeling(Beam &beam, const int samples); 
    3640 
     
    3842                                                 const Beam &beam); 
    3943 
     44        QGLPixelBuffer *mNewBuffer; 
     45        QGLPixelBuffer *mOldBuffer; 
    4046}; 
    4147 
  • GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.cpp

    r1935 r1940  
    786786                          up.x, up.y, up.z); 
    787787}                
    788  
    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 } 
    836788 
    837789 
  • GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.h

    r1935 r1940  
    9494                ); 
    9595 
    96         void CastGlobalLine(Beam &beam, 
    97                                                 const int samples); 
    98  
    99         void DepthPeeling(Beam &beam, const int samples); 
    100  
    10196        void InitGL(); 
    10297 
Note: See TracChangeset for help on using the changeset viewer.