Ignore:
Timestamp:
01/17/08 23:56:46 (16 years ago)
Author:
bittner
Message:

occlusion query bugfix

Location:
GTP/trunk/Lib/Vis/Preprocessing/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.cpp

    r2611 r2612  
    13501350 
    13511351        glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT, depthMapSize,  
    1352                 depthMapSize, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_BYTE, NULL); 
     1352                                 depthMapSize, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_BYTE, NULL); 
    13531353        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); 
    13541354        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); 
     
    13931393 
    13941394#endif 
    1395  
    13961395#endif 
    13971396        DoneCurrent(); 
     
    14141413 
    14151414        bool result = GlRenderer::ValidViewPoint(); 
    1416  
     1415         
    14171416        DoneCurrent(); 
    14181417         
     
    14431442          if (!ValidViewPoint()) 
    14441443                mPvsErrorBuffer[i].mError = -1.0f; 
    1445  
     1444           
    14461445          // manualy corrected view point 
    14471446          if (mFrame == 5105) 
     
    15941593        glEnable( GL_CULL_FACE ); 
    15951594 
    1596         //  int wait = 0; 
    1597         //  while (!query.ResultAvailable()) { 
    1598         //      wait++; 
    1599         //  } 
     1595        //      int wait = 0; 
     1596        //      while (!query->ResultAvailable()) { 
     1597        //        wait++; 
     1598        //      } 
    16001599 
    16011600        // reenable other state 
     
    16031602        //  cout<<"VV4 "; 
    16041603 
    1605         //cout<<"count: " << pixelCount<<endl; 
    16061604 
    16071605        if (pixelCount > 0) 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Makefile

    r2610 r2612  
    11############################################################################# 
    22# Makefile for building: preprocessor 
    3 # Generated by qmake (2.00a) (Qt 4.1.2) on: ?t 17. I 22:17:44 2008 
     3# Generated by qmake (2.00a) (Qt 4.1.2) on: ?t 17. I 23:22:18 2008 
    44# Project:  preprocessor.pro 
    55# Template: app 
     
    6363        $(MAKE) -f $(MAKEFILE).Debug uninstall 
    6464 
    65 Makefile: preprocessor.pro  C:/Qt/4.1.2/mkspecs/win32-msvc2005\qmake.conf C:/Qt/4.1.2/mkspecs/qconfig.pri \ 
     65Makefile: preprocessor.pro  C:/Qt/4.1.2/mkspecs/win32-msvc.net\qmake.conf C:/Qt/4.1.2/mkspecs/qconfig.pri \ 
    6666                C:\Qt\4.1.2\mkspecs\features\qt_config.prf \ 
    6767                C:\Qt\4.1.2\mkspecs\features\exclusive_builds.prf \ 
  • GTP/trunk/Lib/Vis/Preprocessing/src/OcclusionQuery.cpp

    r2575 r2612  
    1111#include <SDL/SDL_opengl.h> 
    1212#endif 
     13 
     14#define _ARBGL 
    1315 
    1416using namespace std; 
  • GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.cpp

    r2611 r2612  
    101101QtGlRendererBuffer::GetPixelError(int &pvsSize) 
    102102{ 
    103         float pErrorPixels = -1.0f; 
     103 
     104  float pErrorPixels = -1.0f; 
    104105 
    105106 
     
    135136        Intersectable::NewMail(); 
    136137        while (it.HasMoreEntries())  
    137         { 
     138          { 
    138139                RenderIntersectable(it.Next()); 
    139         } 
     140          } 
    140141 
    141142 
     
    147148 
    148149        OcclusionQuery *query = mOcclusionQueries[0]; 
    149  
    150  
     150         
    151151        query->BeginQuery(); 
    152152 
     
    157157        query->EndQuery(); 
    158158        glDisable(GL_STENCIL_TEST);  
     159 
    159160        // reenable other state 
    160161        //  int wait=0; 
     
    162163        //      wait++; 
    163164        //  } 
    164  
     165         
    165166 
    166167        pixelCount = query->GetQueryResult(); 
     
    170171 
    171172        if (mSnapErrorFrames && pErrorPixels >= 0.01f) { 
    172                 glReadBuffer(GL_BACK); 
    173  
    174                 char filename[256]; 
    175                 sprintf(filename, "error-frame-%04d-%0.5f.png", mFrame, pErrorPixels); 
    176                 QImage im = toImage(); 
    177                 string str = mSnapPrefix + filename; 
    178                 QString qstr(str.c_str()); 
    179  
    180                 im.save(qstr, "PNG"); 
    181                 if (1) { //0 && mFrame == 1543) { 
    182                         int x,y; 
    183                         int lastIndex = -1; 
    184                         for (y=0; y < im.height(); y++) 
    185                                 for (x=0; x < im.width(); x++) { 
    186                                         QRgb p = im.pixel(x,y); 
    187                                         int index = qRed(p) + (qGreen(p)<<8) + (qBlue(p)<<16); 
    188                                         if (qGreen(p) != 255 && index!=0) { 
    189                                                 if (index != lastIndex) { 
    190                                                         //                              Debug<<"ei="<<index<<" "; 
    191                                                         lastIndex = index; 
    192                                                 } 
    193                                         } 
    194                                 } 
    195                 } 
    196  
    197  
    198                 mUseFalseColors = false; 
    199                 glPushAttrib(GL_CURRENT_BIT); 
    200                 glColor3f(0,1,0); 
    201                 glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); 
    202                 SetupCamera(); 
    203                 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 
    204  
    205                 // Render PVS 
    206                 Intersectable::NewMail(); 
    207  
    208                 ObjectPvsIterator it = pvs.GetIterator(); 
    209                 for (; it.HasMoreEntries(); )  
    210                 { 
    211                         RenderIntersectable(it.Next()); 
    212                 } 
    213  
    214                 im = toImage(); 
    215                 sprintf(filename, "error-frame-%04d-%0.5f-pvs.png", mFrame, pErrorPixels); 
    216                 str = mSnapPrefix + filename; 
    217                 qstr = str.c_str(); 
    218                 im.save(qstr, "PNG"); 
    219                 glPopAttrib(); 
    220         } 
    221  
     173          glReadBuffer(GL_BACK); 
     174           
     175          char filename[256]; 
     176          sprintf(filename, "error-frame-%04d-%0.5f.png", mFrame, pErrorPixels); 
     177          QImage im = toImage(); 
     178          string str = mSnapPrefix + filename; 
     179          QString qstr(str.c_str()); 
     180           
     181          im.save(qstr, "PNG"); 
     182          if (1) { //0 && mFrame == 1543) { 
     183                int x,y; 
     184                int lastIndex = -1; 
     185                for (y=0; y < im.height(); y++) 
     186                  for (x=0; x < im.width(); x++) { 
     187                        QRgb p = im.pixel(x,y); 
     188                        int index = qRed(p) + (qGreen(p)<<8) + (qBlue(p)<<16); 
     189                        if (qGreen(p) != 255 && index!=0) { 
     190                          if (index != lastIndex) { 
     191                                //                              Debug<<"ei="<<index<<" "; 
     192                                lastIndex = index; 
     193                          } 
     194                        } 
     195                  } 
     196          } 
     197           
     198           
     199          mUseFalseColors = false; 
     200          glPushAttrib(GL_CURRENT_BIT); 
     201          glColor3f(0,1,0); 
     202          glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); 
     203          SetupCamera(); 
     204          glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 
     205           
     206          // Render PVS 
     207          Intersectable::NewMail(); 
     208           
     209          ObjectPvsIterator it = pvs.GetIterator(); 
     210          for (; it.HasMoreEntries(); )  
     211                { 
     212                  RenderIntersectable(it.Next()); 
     213                } 
     214           
     215          im = toImage(); 
     216          sprintf(filename, "error-frame-%04d-%0.5f-pvs.png", mFrame, pErrorPixels); 
     217          str = mSnapPrefix + filename; 
     218          qstr = str.c_str(); 
     219          im.save(qstr, "PNG"); 
     220          glPopAttrib(); 
     221        } 
     222         
    222223        glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); 
    223  
     224         
    224225        return pErrorPixels; 
    225226} 
  • GTP/trunk/Lib/Vis/Preprocessing/src/SG08/run_test_pixel

    r2611 r2612  
    44#COMMAND="./release/preprocessor.exe -preprocessor_quit_on_finish+" 
    55#COMMAND="../scripts/preprocessor.sh -preprocessor_quit_on_finish+ -preprocessor_use_gl_renderer- -preprocessor_evaluate_filter- -samples_per_pass=500000 -samples_per_evaluation=10000000 -total_samples=500000000 -preprocessor_pvs_rendererror_samples=10000 -preprocessor_evaluatePixelError+" 
    6 COMMAND="../scripts/preprocessor.sh -preprocessor_quit_on_finish+ -preprocessor_use_gl_renderer- -preprocessor_evaluate_filter- -samples_per_pass=1000000 -samples_per_evaluation=500000 -total_samples=500000000 -preprocessor_pvs_rendererror_samples=10000 -preprocessor_evaluatePixelError+" 
     6COMMAND="../scripts/preprocessor.sh -preprocessor_quit_on_finish+ -preprocessor_use_gl_renderer- -preprocessor_evaluate_filter- -samples_per_pass=1000000 -samples_per_evaluation=500000 -total_samples=500000000 -preprocessor_pvs_rendererror_samples=10000 -preprocessor_evaluatePixelError+ -preprocessor_detect_empty_viewspace+" 
    77 
    88#SCENE="../data/vienna/vienna-buildings.x3d;../data/vienna/vienna-roofs.x3d;../data/vienna/vienna-roads.x3d" 
  • GTP/trunk/Lib/Vis/Preprocessing/src/preprocessor.pro

    r2610 r2612  
    2828unix:INCLUDEPATH += ../support/src/xerces-c-src_2_7_0/include 
    2929 
    30 #XERCES = $$NONGTP/Xerces/xerces 
    31 XERCES = $$NONGTP/Xerces/xerces-c_2_8_0 
     30XERCES = $$NONGTP/Xerces/xerces 
     31#XERCES = $$NONGTP/Xerces/xerces-c_2_8_0 
    3232   
    3333INCLUDEPATH += ../src ../src/Timer ../src/QtInterface $$XERCES/include  $$NONGTP/Zlib/include $$NONGTP/Boost $$NONGTP/Devil/include 
Note: See TracChangeset for help on using the changeset viewer.