Ignore:
Timestamp:
01/18/08 09:28:09 (16 years ago)
Author:
bittner
Message:

evaluation of pvs error still does not work

File:
1 edited

Legend:

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

    r2612 r2613  
    102102{ 
    103103 
     104  MakeCurrent(); 
     105 
    104106  float pErrorPixels = -1.0f; 
    105107 
     
    113115                return 0.0f; 
    114116 
    115  
    116117        ObjectPvs pvs; 
    117  
     118         
    118119        if (1)  
    119120                pvs = viewcell->GetPvs(); 
     
    121122                mViewCellsManager->ApplyFilter2(viewcell, false, 1.0f, pvs); 
    122123 
     124        mUseForcedColors = true; 
     125 
    123126        SetupCamera(); 
    124127        glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); 
    125128        glColorMask(GL_FALSE, GL_TRUE, GL_FALSE, GL_FALSE); 
     129        glColor3f(0,1,0); 
    126130 
    127131 
     
    133137 
    134138        pvsSize = pvs.GetSize(); 
     139        cout<<pvsSize<<endl; 
    135140 
    136141        Intersectable::NewMail(); 
     
    140145          } 
    141146 
    142  
    143147        //glColorMask(GL_TRUE, GL_FALSE, GL_FALSE, GL_FALSE); 
    144148        glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); 
    145149        glEnable(GL_STENCIL_TEST);  
    146  
    147         mUseFalseColors = true; 
    148  
     150        glColor3f(1,0,0); 
     151 
     152         
    149153        OcclusionQuery *query = mOcclusionQueries[0]; 
    150          
     154 
     155        //      SetupCamera(); 
     156 
     157        Intersectable::NewMail(); 
     158 
    151159        query->BeginQuery(); 
    152160 
    153         SetupCamera(); 
    154  
    155161        RenderScene(); 
    156  
     162         
    157163        query->EndQuery(); 
    158164        glDisable(GL_STENCIL_TEST);  
     
    166172 
    167173        pixelCount = query->GetQueryResult(); 
    168  
     174        //      cout<<"pc="<<pixelCount<<endl; 
     175         
    169176        pErrorPixels = ((float)pixelCount)/(GetWidth()*GetHeight()); 
    170177 
    171178 
    172         if (mSnapErrorFrames && pErrorPixels >= 0.01f) { 
     179        if (mSnapErrorFrames && (0 && pErrorPixels >= 0.01f)) { 
    173180          glReadBuffer(GL_BACK); 
     181          //glReadBuffer(GL_FRONT); 
    174182           
    175183          char filename[256]; 
     
    180188           
    181189          im.save(qstr, "PNG"); 
    182           if (1) { //0 && mFrame == 1543) { 
     190          if (0) { //0 && mFrame == 1543) { 
    183191                int x,y; 
    184192                int lastIndex = -1; 
     
    196204          } 
    197205           
    198            
    199206          mUseFalseColors = false; 
    200207          glPushAttrib(GL_CURRENT_BIT); 
    201208          glColor3f(0,1,0); 
    202209          glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); 
    203           SetupCamera(); 
    204210          glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 
    205211           
     
    207213          Intersectable::NewMail(); 
    208214           
     215           
    209216          ObjectPvsIterator it = pvs.GetIterator(); 
    210217          for (; it.HasMoreEntries(); )  
     
    212219                  RenderIntersectable(it.Next()); 
    213220                } 
     221 
     222          mUseForcedColors = false; 
    214223           
    215224          im = toImage(); 
     
    222231         
    223232        glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); 
    224          
     233 
     234        DoneCurrent(); 
     235 
    225236        return pErrorPixels; 
    226237} 
Note: See TracChangeset for help on using the changeset viewer.