Changeset 2002 for GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface
- Timestamp:
- 01/21/07 00:14:50 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlRenderer.cpp
r1997 r2002 83 83 84 84 85 85 // reimplemented here so that we can snap the error windows 86 86 float 87 87 QtGlRendererBuffer::GetPixelError(int &pvsSize) … … 96 96 unsigned int pixelCount; 97 97 98 //static int query = -1;99 //if (query == -1)100 // glGenOcclusionQueriesNV(1, (unsigned int *)&query);101 102 OcclusionQuery query;103 98 104 99 ViewCell *viewcell = mViewCellsManager->GetViewCell(mViewPoint); 105 100 if (viewcell == NULL) 106 101 return 0.0f; 107 108 if (mDetectEmptyViewSpace) { 109 // now check whether any backfacing polygon would pass the depth test 110 SetupCamera(); 111 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 112 glEnable( GL_CULL_FACE ); 113 glCullFace(GL_BACK); 114 115 cout<<"RS "; 116 RenderScene(); 117 118 glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE); 119 glDepthMask(GL_FALSE); 120 glDisable( GL_CULL_FACE ); 121 122 query.BeginQuery(); 123 124 cout<<"RS "; 125 RenderScene(); 126 cout<<"RS3 "; 127 128 query.EndQuery(); 129 130 // at this point, if possible, go and do some other computation 131 glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); 132 glDepthMask(GL_TRUE); 133 glEnable( GL_CULL_FACE ); 134 135 // reenable other state 136 pixelCount = query.GetQueryResult(); 137 cout<<"RS4 "; 138 139 if (pixelCount > 0) 140 return -1.0f; // backfacing polygon found -> not a valid viewspace sample 141 142 } else 143 glDisable( GL_CULL_FACE ); 144 145 102 146 103 // ViewCell *viewcell = NULL; 147 104 … … 182 139 183 140 mUseFalseColors = true; 184 185 query.BeginQuery(); 141 142 OcclusionQuery *query = mOcclusionQueries[0]; 143 144 query->BeginQuery(); 186 145 187 146 SetupCamera(); … … 189 148 RenderScene(); 190 149 191 query.EndQuery(); 192 150 query->EndQuery(); 193 151 194 152 // reenable other state 195 pixelCount = query.GetQueryResult(); 196 153 // int wait=0; 154 // while (!query.ResultAvailable()) { 155 // wait++; 156 // } 157 158 pixelCount = query->GetQueryResult(); 197 159 198 160 pErrorPixels = ((float)pixelCount)/(GetWidth()*GetHeight()); 199 200 201 if (mSnapErrorFrames && pErrorPixels > 0.0 01f) {161 162 163 if (mSnapErrorFrames && pErrorPixels > 0.01f) { 202 164 203 165 char filename[256];
Note: See TracChangeset
for help on using the changeset viewer.