- Timestamp:
- 01/08/07 02:18:50 (18 years ago)
- Location:
- GTP/trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Vis/HillyTerrain/OGRE/TestCullingTerrain.vcproj
r1619 r1953 248 248 AdditionalLibraryDirectories=""$(OGRE_PATH)\Dependencies\Lib\$(ConfigurationName)";"$(OGRE_PATH)\OgreMain\Lib\$(ConfigurationName)";"$(OGRE_PATH)\PlugIns\OctreeSceneManager\bin\$(ConfigurationName)";"$(OGRE_PATH)\Samples\Common\CEGUIRenderer\lib";"..\..\Ogre\lib\$(ConfigurationName)";..\..\..\..\..\Lib\Vis\OnlineCullingCHC\lib;"..\..\..\..\..\Lib\Vis\OnlineCullingCHC\OGRE\lib\$(ConfigurationName)";"..\..\..\..\..\Lib\Vis\OnlineCullingCHC\IVReader\lib\$(ConfigurationName)";..\..\..\..\..\..\..\NonGTP\Xerces\xercesc\lib" 249 249 GenerateDebugInformation="TRUE" 250 SubSystem="2" 251 OptimizeReferences="2" 252 EnableCOMDATFolding="2" 253 TargetMachine="1"/> 254 <Tool 255 Name="VCMIDLTool"/> 256 <Tool 257 Name="VCPostBuildEventTool"/> 258 <Tool 259 Name="VCPreBuildEventTool"/> 260 <Tool 261 Name="VCPreLinkEventTool"/> 262 <Tool 263 Name="VCResourceCompilerTool"/> 264 <Tool 265 Name="VCWebServiceProxyGeneratorTool"/> 266 <Tool 267 Name="VCXMLDataGeneratorTool"/> 268 <Tool 269 Name="VCWebDeploymentTool"/> 270 <Tool 271 Name="VCManagedWrapperGeneratorTool"/> 272 <Tool 273 Name="VCAuxiliaryManagedWrapperGeneratorTool"/> 274 </Configuration> 275 <Configuration 276 Name="Release_qt|Win32" 277 OutputDirectory="$(ConfigurationName)" 278 IntermediateDirectory="$(ConfigurationName)" 279 ConfigurationType="1" 280 CharacterSet="2"> 281 <Tool 282 Name="VCCLCompilerTool" 283 Optimization="3" 284 GlobalOptimizations="TRUE" 285 InlineFunctionExpansion="2" 286 EnableIntrinsicFunctions="TRUE" 287 FavorSizeOrSpeed="1" 288 EnableFiberSafeOptimizations="TRUE" 289 OptimizeForProcessor="0" 290 OptimizeForWindowsApplication="TRUE" 291 AdditionalIncludeDirectories=""$(OGRE_PATH)\Dependencies\include";"$(OGRE_PATH)\OgreMain\include";"$(OGRE_PATH)\Samples\Common\include";"$(OGRE_PATH)\Dependencies\include\CEGUI";"$(OGRE_PATH)\PlugIns\OctreeSceneManager\include";"$(OGRE_PATH)\Samples\Common\CEGUIRenderer\include";..\..\Ogre\include;..\..\..\..\..\Lib\Vis\OnlineCullingCHC\include;..\include;..\..\..\..\..\Lib\Vis\OnlineCullingCHC\OGRE\include;..\..\..\..\..\Lib\Vis\OnlineCullingCHC\IVReader\include" 292 PreprocessorDefinitions="_WINDOWS;_STLP_USE_DYNAMIC_LIB;OGRE_LIBRARY_IMPORTS;_RELEASE;WIN32;_STLP_RELEASE;GTP_VISIBILITY_MODIFIED_OGRE" 293 RuntimeLibrary="2" 294 RuntimeTypeInfo="TRUE" 295 UsePrecompiledHeader="0" 296 WarningLevel="3" 297 Detect64BitPortabilityProblems="TRUE" 298 DebugInformationFormat="3"/> 299 <Tool 300 Name="VCCustomBuildTool"/> 301 <Tool 302 Name="VCLinkerTool" 303 AdditionalDependencies="OGREMain.LIB CEGUIBase.lib OgreGUIRenderer.lib IVReader.lib zdll.lib zziplib.lib xerces-c_2.lib Plugin_OctreeSceneManager.lib Plugin_VisibilitySceneManager.lib GtpVisibility.lib Preprocessor.lib" 304 OutputFile="$(OGRE_PATH)/Samples/Common/bin/Release/TestCullingTerrain.exe" 305 LinkIncremental="1" 306 AdditionalLibraryDirectories=""$(OGRE_PATH)\Dependencies\Lib\$(ConfigurationName)";"$(OGRE_PATH)\OgreMain\Lib\$(ConfigurationName)";"$(OGRE_PATH)\PlugIns\OctreeSceneManager\bin\$(ConfigurationName)";"$(OGRE_PATH)\Samples\Common\CEGUIRenderer\lib";"..\..\..\..\..\Lib\Vis\OnlineCullingCHC\lib\$(ConfigurationName)";"..\..\..\..\..\Lib\Vis\OnlineCullingCHC\OGRE\lib\$(ConfigurationName)";"..\..\..\..\..\Lib\Vis\OnlineCullingCHC\IVReader\lib\$(ConfigurationName)";..\..\..\..\..\..\..\NonGTP\Xerces\xercesc\lib;"..\..\..\..\..\Lib\Vis\Preprocessing\lib\$(ConfigurationName)"" 307 GenerateDebugInformation="FALSE" 250 308 SubSystem="2" 251 309 OptimizeReferences="2" -
GTP/trunk/App/Demos/Vis/KdTreeDemo/OGRE/scripts/TestKdTree.vcproj
r1238 r1953 263 263 <Configuration 264 264 Name="Release Internal|Win32" 265 OutputDirectory="$(ConfigurationName)" 266 IntermediateDirectory="$(ConfigurationName)" 267 ConfigurationType="1" 268 CharacterSet="2" 269 WholeProgramOptimization="TRUE"> 270 <Tool 271 Name="VCCLCompilerTool" 272 Optimization="2" 273 GlobalOptimizations="TRUE" 274 InlineFunctionExpansion="1" 275 EnableIntrinsicFunctions="TRUE" 276 ImproveFloatingPointConsistency="TRUE" 277 FavorSizeOrSpeed="1" 278 OmitFramePointers="TRUE" 279 OptimizeForProcessor="2" 280 OptimizeForWindowsApplication="TRUE" 281 AdditionalIncludeDirectories="..\include;"$(OGRE_PATH)\Samples\Common\include";"$(OGRE_PATH)\OgreMain\include";..\..\..\..\..\..\Lib\Vis\OnlineCullingCHC\IVReader\include;..\..\..\..\..\..\Lib\Vis\OnlineCullingCHC\OGRE\include;..\..\..\..\..\..\Lib\Vis\OnlineCullingCHC\include" 282 PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;GTP_VISIBILITY_MODIFIED_OGRE" 283 StringPooling="TRUE" 284 MinimalRebuild="TRUE" 285 RuntimeLibrary="2" 286 BufferSecurityCheck="FALSE" 287 EnableFunctionLevelLinking="TRUE" 288 UsePrecompiledHeader="0" 289 WarningLevel="3" 290 Detect64BitPortabilityProblems="TRUE" 291 DebugInformationFormat="3"/> 292 <Tool 293 Name="VCCustomBuildTool"/> 294 <Tool 295 Name="VCLinkerTool" 296 AdditionalDependencies="OgreMain.lib IVReader.lib" 297 OutputFile="$(OutDir)/$(ProjectName).exe" 298 LinkIncremental="1" 299 AdditionalLibraryDirectories=""$(OGRE_PATH)\OgreMain\lib\$(ConfigurationName)";"..\..\..\..\..\..\Lib\Vis\OnlineCullingCHC\IVReader\lib\$(ConfigurationName)"" 300 GenerateDebugInformation="TRUE" 301 SubSystem="2" 302 OptimizeReferences="2" 303 EnableCOMDATFolding="2" 304 OptimizeForWindows98="1" 305 TargetMachine="1"/> 306 <Tool 307 Name="VCMIDLTool"/> 308 <Tool 309 Name="VCPostBuildEventTool" 310 CommandLine="copy $(OutDir)\$(TargetFileName) "$(OGRE_PATH)\Samples\Common\bin\$(ConfigurationName)""/> 311 <Tool 312 Name="VCPreBuildEventTool"/> 313 <Tool 314 Name="VCPreLinkEventTool"/> 315 <Tool 316 Name="VCResourceCompilerTool"/> 317 <Tool 318 Name="VCWebServiceProxyGeneratorTool"/> 319 <Tool 320 Name="VCXMLDataGeneratorTool"/> 321 <Tool 322 Name="VCWebDeploymentTool"/> 323 <Tool 324 Name="VCManagedWrapperGeneratorTool"/> 325 <Tool 326 Name="VCAuxiliaryManagedWrapperGeneratorTool"/> 327 </Configuration> 328 <Configuration 329 Name="Release_qt|Win32" 265 330 OutputDirectory="$(ConfigurationName)" 266 331 IntermediateDirectory="$(ConfigurationName)" -
GTP/trunk/Lib/Vis/Preprocessing/src/GlobalLinesRenderer.cpp
r1951 r1953 5 5 #include "Preprocessor.h" 6 6 #include "GlRenderer.h" 7 // the devil library 8 #include <IL/il.h> 9 #include <IL/ilu.h> 10 #include <IL/ilut.h> 7 11 8 12 #include <Cg/cg.h> … … 25 29 static int texWidth = 256; 26 30 static int texHeight = 256; 27 static Vector3 scaleFactor = Vector3(2000.0f, 2000.0f, 2000.0f); 28 static Vector3 translFactor = Vector3(1000.0f, 1000.0f, 1000.0f); 31 32 33 static void InitDevIl() 34 { 35 ilInit(); 36 ILuint ImageName; 37 ilGenImages(1, &ImageName); 38 ilBindImage(ImageName); 39 ilEnable(IL_FILE_OVERWRITE); 40 41 // ilRegisterFormat(IL_RGBA); 42 // ilRegisterType(IL_FLOAT); 43 44 // ilEnable(IL_ORIGIN_SET); 45 // ilOriginFunc(IL_ORIGIN_UPPER_LEFT); 46 } 47 29 48 30 49 static void cgErrorCallback() … … 69 88 } 70 89 90 91 void SetFrustum(int sizeX, int sizeY, float nearPlane, float farPlane) 92 { 93 glMatrixMode(GL_PROJECTION); 94 glLoadIdentity(); 95 96 glOrtho(-sizeX / 2, sizeX / 2, 97 -sizeY / 2, sizeY / 2, 98 nearPlane, farPlane); 99 100 /*glOrtho(0, sizeX, 101 0, sizeY , 102 nearPlane, farPlane);*/ 103 } 71 104 72 105 void Display() … … 98 131 cout << "max depth: " << globalLinesRenderer->mMaxDepth << endl; 99 132 return; 133 case '3': 134 //globalLinesRenderer->ApplyDepthPeeling(Beam(), 0); 135 globalLinesRenderer->GrabDepthBuffer(globalLinesRenderer->mNewDepthBuffer, globalLinesRenderer->mNewTexture); 100 136 default: 101 137 return; 102 138 } 103 139 } 140 104 141 105 142 /*GlobalLinesRenderer::GlobalLinesRenderer(RenderTexture *buffer1, … … 107 144 Preprocessor *preprocessor, 108 145 GlRenderer *renderer) 109 : mNew Buffer(buffer1), mOldBuffer(buffer2), mPreprocessor(preprocessor), mMaxDepth(100),146 : mNewTexture(buffer1), mOldTexture(buffer2), mPreprocessor(preprocessor), mMaxDepth(100), 110 147 mRenderer(renderer) 111 148 { 112 149 } 113 150 */ 151 152 114 153 GlobalLinesRenderer::GlobalLinesRenderer(Preprocessor *preprocessor, 115 154 GlRenderer *renderer): 116 mNew Buffer(NULL),117 mOld Buffer(NULL),155 mNewTexture(NULL), 156 mOldTexture(NULL), 118 157 mMaxDepth(0), 119 158 mRenderer(renderer), … … 152 191 glPushMatrix(); 153 192 { 154 glLoadIdentity(); 155 //translFactor = Vector3(-1, -1, -1); 156 157 glScalef(scaleFactor.x, scaleFactor.y, scaleFactor.z); 158 glTranslatef(translFactor.x, translFactor.y, translFactor.z); 159 160 //cout << "scale: " << scaleFactor << endl; 161 //cout << "transl: " << translFactor << endl; 162 193 //glLoadIdentity(); 194 163 195 //mRenderer->mUseFalseColors = true; 164 196 ObjectContainer::const_iterator oit, oit_end = mPreprocessor->mObjects.end(); … … 177 209 void GlobalLinesRenderer::SwitchRenderTextures() 178 210 { 179 RenderTexture *buffer = mOld Buffer;180 mOld Buffer = mNewBuffer;181 mNew Buffer= buffer;211 RenderTexture *buffer = mOldTexture; 212 mOldTexture = mNewTexture; 213 mNewTexture = buffer; 182 214 } 183 215 … … 185 217 void GlobalLinesRenderer::InitGl() 186 218 { 219 InitDevIl(); 220 187 221 glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE); 188 222 glutInitWindowPosition(50, 50); … … 209 243 AxisAlignedBox3 bbox = globalLinesRenderer->mPreprocessor->mKdTree->GetBox(); 210 244 211 Vector3 center = bbox.Center(); 212 translFactor = -center; 213 //translFactor.z = 0; 214 //translFactor = Vector3(-1500, -1500, -1500); 215 float diag = 2.0f / Magnitude(bbox.Diagonal()); 216 scaleFactor = Vector3(diag, diag, diag); 217 218 Vector3 midPoint = Vector3(0, 0, 0); 219 Vector3 viewPoint = Vector3(0, 0, 500); 220 245 Vector3 midPoint = bbox.Center(); 246 247 const float sceneSize = Magnitude(bbox.Diagonal()); 248 Vector3 viewPoint = midPoint + Vector3(0.5 * sceneSize, 0, 0); 249 221 250 cout << "mid point: " << midPoint << endl; 222 251 cout << "view point: " << viewPoint << endl; … … 232 261 glEnable(GL_CULL_FACE); 233 262 glDisable(GL_LIGHTING); 234 //glEnable(GL_COLOR_MATERIAL);235 263 glDisable(GL_COLOR_MATERIAL); 236 264 glEnable(GL_DEPTH_TEST); … … 241 269 // Note that RT_COPY_TO_TEXTURE is required for depth textures on ATI hardware 242 270 243 mNew Buffer= new RenderTexture(texWidth, texHeight, true, true);244 //mNew Buffer->Initialize(true, true, false, true, true, 8, 8, 8, 8);//, RenderTexture::RT_COPY_TO_TEXTURE);245 mNew Buffer->Initialize(true, true, false, true, true, 8, 8, 8, 8, RenderTexture::RT_COPY_TO_TEXTURE);246 247 mOld Buffer= new RenderTexture(texWidth, texHeight, true, true);248 //mOld Buffer->Initialize(true, true, false, true, true, 8, 8, 8, 8);//, RenderTexture::RT_COPY_TO_TEXTURE);249 mOld Buffer->Initialize(true, true, false, true, true, 8, 8, 8, 8, RenderTexture::RT_COPY_TO_TEXTURE);271 mNewTexture = new RenderTexture(texWidth, texHeight, true, true); 272 //mNewTexture->Initialize(true, true, false, true, true, 8, 8, 8, 8);//, RenderTexture::RT_COPY_TO_TEXTURE); 273 mNewTexture->Initialize(true, true, false, true, true, 8, 8, 8, 8, RenderTexture::RT_COPY_TO_TEXTURE); 274 275 mOldTexture = new RenderTexture(texWidth, texHeight, true, true); 276 //mOldTexture ->Initialize(true, true, false, true, true, 8, 8, 8, 8);//, RenderTexture::RT_COPY_TO_TEXTURE); 277 mOldTexture ->Initialize(true, true, false, true, true, 8, 8, 8, 8, RenderTexture::RT_COPY_TO_TEXTURE); 250 278 251 279 // Setup Cg … … 264 292 cgCreateProgramFromFile(sCgContext, 265 293 CG_SOURCE, 266 mNew Buffer->IsRectangleTexture() ?294 mNewTexture->IsRectangleTexture() ? 267 295 "../src/depth_peelingRect.cg" : "../src/depth_peeling2d.cg", 268 296 GLEW_ARB_fragment_program ? CG_PROFILE_ARBFP1 : CG_PROFILE_FP30, … … 290 318 291 319 // setup the rendering context for the RenderTexture 292 mNewBuffer->BeginCapture(); 293 { 294 Reshape(texWidth, texHeight); 320 mNewTexture->BeginCapture(); 321 { 322 //Reshape(texWidth, texHeight); 323 glViewport(0, 0, texWidth, texHeight); 324 SetFrustum(sceneSize, sceneSize, 1, sceneSize); 325 295 326 glClearColor(0.1, 0.7, 0.2, 1); 296 327 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); … … 307 338 midPoint.x, midPoint.y, midPoint.z, 308 339 0, 1, 0); 309 } 310 mNewBuffer->EndCapture(); 340 341 //SetFrustum(sceneSize, sceneSize, 1, sceneSize); 342 } 343 mNewTexture->EndCapture(); 311 344 312 345 // setup the rendering context for the RenderTexture 313 mOldBuffer->BeginCapture(); 314 { 315 Reshape(texWidth, texHeight); 346 mOldTexture->BeginCapture(); 347 { 348 glClearColor(0.1, 0.7, 0.2, 1); 349 350 //Reshape(texWidth, texHeight); 351 glViewport(0, 0, texWidth, texHeight); 352 SetFrustum(sceneSize, sceneSize, 1, sceneSize); 353 316 354 glMatrixMode(GL_MODELVIEW); 317 355 glLoadIdentity(); … … 327 365 0, 1, 0); 328 366 329 glClearColor(0.6, 0.2, 0.2, 1);330 } 331 mOld Buffer->EndCapture();367 //SetFrustum(sceneSize, sceneSize, 1, sceneSize); 368 } 369 mOldTexture->EndCapture(); 332 370 333 371 PrintGLerror("init"); … … 335 373 336 374 337 void GlobalLinesRenderer::ProcessDepthBuffer() 338 { 375 Intersectable *GetObject(const int index) 376 { 377 return NULL; 378 } 379 380 381 void GlobalLinesRenderer::ProcessDepthBuffer(VssRayContainer &vssRays) 382 { 383 GrabDepthBuffer(mNewDepthBuffer, mNewTexture); 384 GrabDepthBuffer(mOldDepthBuffer, mOldTexture); 385 386 GrabItemBuffer(mNewItemBuffer, mNewTexture); 387 GrabItemBuffer(mOldItemBuffer, mOldTexture); 388 389 for (int y = 0; y < texHeight; ++ y) 390 { 391 for (int x = 0; x < texWidth; ++ x) 392 { 393 const int index = x + texWidth * y; 394 const float newDepth = mNewDepthBuffer[index]; 395 const float oldDepth = mOldDepthBuffer[index]; 396 397 float newDummy1 = mNear + (mFar - mNear) * newDepth; 398 float oldDummy1 = mNear + (mFar - mNear) * oldDepth; 399 400 float newDummy2 = x - texWidth / 2; 401 float newDummy3 = y - texHeight / 2; 402 403 float oldDummy2 = newDummy2; 404 float oldDummy3 = newDummy3; 405 406 const Vector3 newPt = newDepth * mEyeVec + newDummy1 * mLeftVec + newDummy2 * mUpVec; 407 const Vector3 oldPt = oldDepth * mEyeVec + oldDummy1 * mLeftVec + oldDummy2 * mUpVec; 408 409 Intersectable *termObj1 = GetObject(mNewItemBuffer[index]); 410 Intersectable *termObj2 = GetObject(mOldItemBuffer[index]); 411 412 // create rays in both directions 413 vssRays.push_back(new VssRay(oldPt, newPt, NULL, termObj1)); 414 vssRays.push_back(new VssRay(newPt, oldPt, NULL, termObj2)); 415 } 416 } 339 417 } 340 418 … … 346 424 347 425 426 void GlobalLinesRenderer::GrabDepthBuffer(float *data, RenderTexture *rt) 427 { 428 rt->BindDepth(); 429 rt->EnableTextureTarget(); 430 cout << "depth: " << mNewTexture->GetDepthBits() << endl; 431 432 const int texFormat = GL_DEPTH_COMPONENT; 433 glGetTexImage(mNewTexture->GetTextureTarget(), 0, texFormat, GL_FLOAT, data); 434 435 mNewTexture->DisableTextureTarget(); 436 } 437 438 439 void GlobalLinesRenderer::GrabItemBuffer(float *data, RenderTexture *rt) 440 { 441 rt->BindDepth(); 442 rt->EnableTextureTarget(); 443 cout << "depth: " << mNewTexture->GetDepthBits() << endl; 444 445 const int texFormat = GL_DEPTH_COMPONENT; 446 glGetTexImage(mNewTexture->GetTextureTarget(), 0, texFormat, GL_FLOAT, data); 447 448 mNewTexture->DisableTextureTarget(); 449 } 450 451 void GlobalLinesRenderer::ExportDepthBuffer() 452 { 453 mNewTexture->BindDepth(); 454 mNewTexture->EnableTextureTarget(); 455 cout << "depth: " << mNewTexture->GetDepthBits() << endl; 456 457 const bool components = 1;//mNewTexture->GetDepthBits() / 8; 458 459 float *data = new float[texWidth * texHeight * components]; 460 //const int texFormat = WGL_TEXTURE_DEPTH_COMPONENT_NV; 461 const int texFormat = GL_DEPTH_COMPONENT; 462 //const int texFormat = GL_RGBA; 463 glGetTexImage(mNewTexture->GetTextureTarget(), 0, texFormat, GL_FLOAT, data); 464 465 /*for (int i = texWidth * 123; i < texWidth * 124; ++ i) 466 { 467 cout << data[i] << " "; 468 } 469 cout << "Saving image " << texWidth << " " << texHeight << endl; 470 */ 471 string filename("depth.tga"); 472 ilRegisterType(IL_FLOAT); 473 474 const int depth = 1; 475 const int bpp = components; 476 477 ilTexImage(texWidth, texHeight, depth, bpp, IL_LUMINANCE, IL_FLOAT, data); 478 ilSaveImage((char *const)filename.c_str()); 479 480 cout << "finished" << endl; 481 delete data; 482 cout << "data deleted" << endl; 483 mNewTexture->DisableTextureTarget(); 484 PrintGLerror("grab texture"); 485 } 486 487 348 488 void GlobalLinesRenderer::ApplyDepthPeeling(Beam &beam, const int samples) 349 489 { 350 mNew Buffer->BeginCapture();490 mNewTexture->BeginCapture(); 351 491 { 352 492 //cgGLBindProgram(sCgPassThroughProgram); … … 354 494 DrawGeometry(); 355 495 } 356 mNewBuffer->EndCapture(); 357 358 //mNewBuffer->BindDepth(); 359 /*float *data = new float[texWidth * texHeight]; 360 //const int texFormat = WGL_TEXTURE_DEPTH_COMPONENT_NV; 361 const int texFormat = GL_LUMINANCE; 362 glGetTexImage(mNewBuffer->GetTextureTarget(), 0, texFormat, GL_FLOAT, data); 363 364 delete [] data; 365 */ 496 mNewTexture->EndCapture(); 497 366 498 PrintGLerror("firstpass"); 367 499 368 if (mNew Buffer->IsRectangleTexture()) cout << "rect" << endl;500 if (mNewTexture->IsRectangleTexture()) cout << "rect" << endl; 369 501 370 502 for(int i = 0; i < mMaxDepth; ++ i) … … 373 505 SwitchRenderTextures(); // switch pointer between rendertextures 374 506 375 mNew Buffer->BeginCapture();507 mNewTexture->BeginCapture(); 376 508 { 377 //if (mNew Buffer->IsDoubleBuffered())509 //if (mNewTexture->IsDoubleBuffered()) 378 510 // glDrawBuffer(GL_BACK); 379 511 … … 383 515 // cgGLBindProgram(sCgPassThroughProgram); 384 516 cgGLEnableProfile(sCgFragmentProfile); 385 cgGLSetTextureParameter(sTextureParam, mOld Buffer->GetDepthTextureID());517 cgGLSetTextureParameter(sTextureParam, mOldTexture->GetDepthTextureID()); 386 518 cgGLEnableTextureParameter(sTextureParam); 387 519 … … 394 526 cgGLDisableProfile(sCgFragmentProfile); 395 527 } 396 mNew Buffer->EndCapture();528 mNewTexture->EndCapture(); 397 529 } 398 530 399 531 PrintGLerror("endpeeling"); 400 532 401 //mNew Buffer->Bind();402 mNew Buffer->BindDepth();403 mNew Buffer->EnableTextureTarget();533 //mNewTexture->Bind(); 534 mNewTexture->BindDepth(); 535 mNewTexture->EnableTextureTarget(); 404 536 405 537 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 406 538 407 if (mNew Buffer->IsRectangleTexture())539 if (mNewTexture->IsRectangleTexture()) 408 540 { 409 541 glBegin(GL_QUADS); 410 542 glTexCoord2f(0, 0); glVertex3f(-1, -1, -0.5f); 411 glTexCoord2f(mNew Buffer->GetWidth(), 0); glVertex3f( 1, -1, -0.5f);412 glTexCoord2f(mNew Buffer->GetWidth(), mNewBuffer->GetHeight()); glVertex3f( 1, 1, -0.5f);413 glTexCoord2f(0, mNew Buffer->GetHeight()); glVertex3f(-1, 1, -0.5f);543 glTexCoord2f(mNewTexture->GetWidth(), 0); glVertex3f( 1, -1, -0.5f); 544 glTexCoord2f(mNewTexture->GetWidth(), mNewTexture->GetHeight()); glVertex3f( 1, 1, -0.5f); 545 glTexCoord2f(0, mNewTexture->GetHeight()); glVertex3f(-1, 1, -0.5f); 414 546 glEnd(); 415 547 } … … 424 556 } 425 557 426 mNew Buffer->DisableTextureTarget();558 mNewTexture->DisableTextureTarget(); 427 559 PrintGLerror("displaytexture"); 428 560 } -
GTP/trunk/Lib/Vis/Preprocessing/src/GlobalLinesRenderer.h
r1949 r1953 4 4 #include "common.h" 5 5 #include "Containers.h" 6 #include "Vector3.h" 7 6 8 7 9 class RenderTexture; … … 41 43 42 44 void RenderObject(Intersectable *obj); 43 void DrawGeometry(); 45 46 47 /** Draws the geometry for one pass. 48 */ 49 void DrawGeometry(); 44 50 void Run(); 45 int mMaxDepth; 51 void GrabDepthBuffer(float *data, RenderTexture *rt); 52 void GrabItemBuffer(float *data, RenderTexture *rt); 53 void ApplyDepthPeeling(Beam &beam, const int samples); 54 void ExportDepthBuffer(); 55 void ProcessDepthBuffer(VssRayContainer &vssRays); 56 57 int mMaxDepth; 58 Vector3 mEyeVec; 59 Vector3 mLeftVec; 60 Vector3 mUpVec; 61 float mFar; 62 float mNear; 63 64 float *mNewDepthBuffer; 65 float *mOldDepthBuffer; 66 float *mNewItemBuffer; 67 float *mOldItemBuffer; 68 RenderTexture *mNewTexture; 69 RenderTexture *mOldTexture; 46 70 protected: 47 71 48 72 void ProcessDepthBuffer(); 49 50 /** Draws the geometry for one pass.51 */52 53 54 void ApplyDepthPeeling(Beam &beam, const int samples);55 73 56 74 void SwitchRenderTextures(); … … 59 77 const Beam &beam); 60 78 61 RenderTexture *mNewBuffer; 62 RenderTexture *mOldBuffer; 79 63 80 64 81 Preprocessor *mPreprocessor;
Note: See TracChangeset
for help on using the changeset viewer.