Changeset 1949 for GTP/trunk/Lib/Vis/Preprocessing/src
- Timestamp:
- 01/07/07 03:53:52 (18 years ago)
- Location:
- GTP/trunk/Lib/Vis/Preprocessing/src
- Files:
-
- 2 deleted
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.h
r1944 r1949 25 25 class TransformedMeshInstance; 26 26 class TriangleIntersectable; 27 27 class BvhNode; 28 28 29 29 struct VssRayContainer; -
GTP/trunk/Lib/Vis/Preprocessing/src/GlobalLinesRenderer.cpp
r1945 r1949 60 60 glLoadIdentity(); 61 61 62 gluPerspective(60.0, (GLfloat)w/(GLfloat)h, 3, 5000.0);62 //gluPerspective(60.0, (GLfloat)w/(GLfloat)h, 3, 5000.0); 63 63 //gluPerspective(60.0, (GLfloat)w/(GLfloat)h, 0.5, 10.0); 64 glOrtho(-1000, 1000, -1000, 1000, 1, 1000); 64 65 } 65 66 … … 92 93 switch(key) 93 94 { 94 case ' ': 95 case '2': 96 ++ globalLinesRenderer->mMaxDepth; 97 cout << "max depth: " << globalLinesRenderer->mMaxDepth << endl; 98 return; 99 case '1': 100 -- globalLinesRenderer->mMaxDepth; 101 cout << "max depth: " << globalLinesRenderer->mMaxDepth << endl; 95 102 return; 96 103 default: … … 108 115 } 109 116 */ 110 GlobalLinesRenderer::GlobalLinesRenderer(Preprocessor *preprocessor, GlRenderer *renderer): 117 GlobalLinesRenderer::GlobalLinesRenderer(Preprocessor *preprocessor, 118 GlRenderer *renderer): 111 119 mNewBuffer(NULL), 112 120 mOldBuffer(NULL), 113 mMaxDepth( 100),121 mMaxDepth(0), 114 122 mRenderer(renderer), 115 123 mPreprocessor(preprocessor) … … 188 196 AxisAlignedBox3 bbox = globalLinesRenderer->mPreprocessor->mKdTree->GetBox(); 189 197 const Vector3 midPoint = bbox.Center(); 190 const Vector3 viewPoint = midPoint + Vector3(-800, 0, 0); 198 //const Vector3 viewPoint = midPoint + Vector3(-800, 0, 0); 199 const Vector3 viewPoint = midPoint + Vector3(2, 0, 0); 191 200 192 201 cout << "midPoint: " << midPoint << endl; … … 200 209 gluLookAt(0, 0, 3, 0, 0, 0, 0, 1, 0); 201 210 202 glDisable(GL_CULL_FACE); 211 //glDisable(GL_CULL_FACE); 212 glEnable(GL_CULL_FACE); 203 213 glDisable(GL_LIGHTING); 204 214 //glEnable(GL_COLOR_MATERIAL); … … 214 224 215 225 mNewBuffer = new RenderTexture(texWidth, texHeight, true, true); 216 mNewBuffer->Initialize(true, true, false, true, true, 8, 8, 8, 8);//, RenderTexture::RT_COPY_TO_TEXTURE); 217 226 //mNewBuffer->Initialize(true, true, false, true, true, 8, 8, 8, 8);//, RenderTexture::RT_COPY_TO_TEXTURE); 227 mNewBuffer->Initialize(true, true, false, true, true, 8, 8, 8, 8, RenderTexture::RT_COPY_TO_TEXTURE); 228 218 229 mOldBuffer = new RenderTexture(texWidth, texHeight, true, true); 219 mOldBuffer ->Initialize(true, true, false, true, true, 8, 8, 8, 8);//, RenderTexture::RT_COPY_TO_TEXTURE); 230 //mOldBuffer ->Initialize(true, true, false, true, true, 8, 8, 8, 8);//, RenderTexture::RT_COPY_TO_TEXTURE); 231 mOldBuffer ->Initialize(true, true, false, true, true, 8, 8, 8, 8, RenderTexture::RT_COPY_TO_TEXTURE); 220 232 221 233 // Setup Cg … … 265 277 glClearColor(0.1, 0.7, 0.2, 1); 266 278 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 267 279 280 glFrontFace(GL_CCW); 281 glCullFace(GL_BACK); 282 glEnable(GL_CULL_FACE); 283 glShadeModel(GL_FLAT); 284 glEnable(GL_DEPTH_TEST); 285 268 286 glMatrixMode(GL_MODELVIEW); 269 287 glLoadIdentity(); … … 272 290 0, 1, 0); 273 291 274 glEnable(GL_DEPTH_TEST);275 292 } 276 293 mNewBuffer->EndCapture(); … … 282 299 glMatrixMode(GL_MODELVIEW); 283 300 glLoadIdentity(); 301 302 glFrontFace(GL_CCW); 303 glCullFace(GL_BACK); 304 glEnable(GL_CULL_FACE); 305 glShadeModel(GL_FLAT); 306 glEnable(GL_DEPTH_TEST); 307 284 308 gluLookAt(viewPoint.x, viewPoint.y, viewPoint.z, 285 309 midPoint.x, midPoint.y, midPoint.z, 286 310 0, 1, 0); 287 311 288 glEnable(GL_DEPTH_TEST);289 312 glClearColor(0.6, 0.2, 0.2, 1); 290 313 } … … 326 349 mNewBuffer->EndCapture(); 327 350 328 //mNewBuffer->Bind(); 329 mNewBuffer->BindDepth(); 330 mNewBuffer->EnableTextureTarget(); 331 332 333 //glBindTexture(texture_target,texID); 334 //const int texID = mNewBuffer->GetTextureTarget(); 335 //glGetTexImage(texture_target,0,texture_format,GL_FLOAT,data); 336 /* 337 for(int l = 0; l < mMaxDepth; ++ l) 351 //mNewBuffer->BindDepth(); 352 //float data[262144]; 353 //glGetTexImage(mNewBuffer->GetTextureTarget(), 0, mNewBuffer->texture_format, GL_FLOAT, data); 354 if (mNewBuffer->IsRectangleTexture()) cout << "rect" << endl; 355 //else cout << "haga"<<endl; 356 357 for(int i = 0; i < mMaxDepth; ++ i) 338 358 { 339 359 // Peel another layer … … 348 368 349 369 cgGLBindProgram(sCgDepthPeelingProgram); 370 // cgGLBindProgram(sCgPassThroughProgram); 350 371 cgGLEnableProfile(sCgFragmentProfile); 351 372 cgGLSetTextureParameter(sTextureParam, mOldBuffer->GetDepthTextureID()); 352 373 cgGLEnableTextureParameter(sTextureParam); 353 374 354 //glColor3f(0,0.0,0.0); 355 DrawGeometry(); 375 glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); 376 glMatrixMode(GL_MODELVIEW); 377 glPushMatrix(); 378 { 379 //glutSolidTorus(0.25, 1, 32, 64); 380 DrawGeometry(); 381 } 382 glPopMatrix(); 383 356 384 cgGLDisableTextureParameter(sTextureParam); 385 cgGLDisableProfile(sCgFragmentProfile); 357 386 } 358 387 mNewBuffer->EndCapture(); 359 388 } 360 */ 389 390 PrintGLerror("display 1"); 391 392 //mNewBuffer->Bind(); 393 mNewBuffer->BindDepth(); 394 mNewBuffer->EnableTextureTarget(); 395 361 396 362 397 PrintGLerror("display 2"); 363 398 glColor3f(1,1,1); 364 399 glBegin(GL_QUADS); 365 glTexCoord2f(0, 0); glVertex3f(-1 , -1, -0.5f);366 glTexCoord2f(1, 0); glVertex3f( 1 , -1, -0.5f);367 glTexCoord2f(1, 1); glVertex3f( 1 , 1, -0.5f);368 glTexCoord2f(0, 1); glVertex3f(-1 , 1, -0.5f);400 glTexCoord2f(0, 0); glVertex3f(-1000, -1000, -0.5f); 401 glTexCoord2f(1, 0); glVertex3f( 1000, -1000, -0.5f); 402 glTexCoord2f(1, 1); glVertex3f( 1000, 1000, -0.5f); 403 glTexCoord2f(0, 1); glVertex3f(-1000, 1000, -0.5f); 369 404 glEnd(); 370 PrintGLerror("display 1");371 405 372 406 if (mNewBuffer->IsFloatTexture()) -
GTP/trunk/Lib/Vis/Preprocessing/src/GlobalLinesRenderer.h
r1941 r1949 43 43 void DrawGeometry(); 44 44 void Run(); 45 int mMaxDepth; 45 46 protected: 46 47 … … 62 63 63 64 Preprocessor *mPreprocessor; 64 int mMaxDepth;65 65 66 66 GlRenderer *mRenderer; -
GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.vcproj
r1940 r1949 302 302 Name="VCAuxiliaryManagedWrapperGeneratorTool"/> 303 303 </Configuration> 304 <Configuration 305 Name="Release_Qt|Win32" 306 OutputDirectory="$(ConfigurationName)" 307 IntermediateDirectory="$(ConfigurationName)" 308 ConfigurationType="4" 309 CharacterSet="2"> 310 <Tool 311 Name="VCCLCompilerTool" 312 Optimization="3" 313 InlineFunctionExpansion="0" 314 FavorSizeOrSpeed="0" 315 OptimizeForProcessor="3" 316 OptimizeForWindowsApplication="TRUE" 317 AdditionalIncludeDirectories="..\src;..\..\..\..\..\..\NonGTP\Devil\include;..\..\..\..\..\..\NonGTP\Zlib\include;..\..\..\..\..\..\NonGTP\Xerces;..\..\..\..\..\..\NonGTP\Boost;..\MultiLevelRayTracing;"$(QTDIR)\include\QtCore";"$(QTDIR)\include\QtGui";"$(QTDIR)\include";"$(QTDIR)\include\QtOpenGl";"$(CG_INC_PATH)"" 318 PreprocessorDefinitions="WIN32;NDEBUG;_LIB;USE_QT" 319 ExceptionHandling="TRUE" 320 RuntimeLibrary="2" 321 DisableLanguageExtensions="FALSE" 322 ForceConformanceInForLoopScope="FALSE" 323 RuntimeTypeInfo="TRUE" 324 UsePrecompiledHeader="0" 325 BrowseInformation="1" 326 WarningLevel="2" 327 Detect64BitPortabilityProblems="TRUE" 328 DebugInformationFormat="3"/> 329 <Tool 330 Name="VCCustomBuildTool"/> 331 <Tool 332 Name="VCLibrarianTool" 333 OutputFile="../lib/Release/$(ProjectName).lib"/> 334 <Tool 335 Name="VCMIDLTool"/> 336 <Tool 337 Name="VCPostBuildEventTool"/> 338 <Tool 339 Name="VCPreBuildEventTool"/> 340 <Tool 341 Name="VCPreLinkEventTool"/> 342 <Tool 343 Name="VCResourceCompilerTool"/> 344 <Tool 345 Name="VCWebServiceProxyGeneratorTool"/> 346 <Tool 347 Name="VCXMLDataGeneratorTool"/> 348 <Tool 349 Name="VCManagedWrapperGeneratorTool"/> 350 <Tool 351 Name="VCAuxiliaryManagedWrapperGeneratorTool"/> 352 </Configuration> 304 353 </Configurations> 305 354 <References> … … 592 641 Outputs=""/> 593 642 </FileConfiguration> 643 <FileConfiguration 644 Name="Release_Qt|Win32"> 645 <Tool 646 Name="VCCustomBuildTool" 647 Description="" 648 CommandLine="" 649 Outputs=""/> 650 </FileConfiguration> 594 651 </File> 595 652 <File … … 644 701 Outputs=""/> 645 702 </FileConfiguration> 703 <FileConfiguration 704 Name="Release_Qt|Win32"> 705 <Tool 706 Name="VCCustomBuildTool" 707 Description="" 708 CommandLine="" 709 Outputs=""/> 710 </FileConfiguration> 646 711 </File> 647 712 <File … … 650 715 <File 651 716 RelativePath="..\src\Pvs.h"> 652 </File>653 <File654 RelativePath=".\QtGlViewer.cpp">655 </File>656 <File657 RelativePath=".\QtGlViewer.h">658 717 </File> 659 718 <File -
GTP/trunk/Lib/Vis/Preprocessing/src/SamplingStrategy.h
r1942 r1949 282 282 283 283 virtual bool RequiresRays() { 284 for (int i=0; i < mDistributions.size(); i++)284 for (int i=0; i < (int)mDistributions.size(); i++) 285 285 if (mDistributions[i]->RequiresRays()) 286 286 return true; -
GTP/trunk/Lib/Vis/Preprocessing/src/TestPreprocessor.vcproj
r1940 r1949 267 267 LinkIncremental="1" 268 268 AdditionalLibraryDirectories="..\src\GL;..\lib\release;..\..\Preprocessing\lib\release;..\..\..\..\..\..\NonGTP\Boost\lib;..\..\..\..\..\..\NonGTP\Xerces\xercesc\lib;..\..\..\..\..\..\NonGTP\Zlib\lib;..\..\..\..\..\..\NonGTP\Devil\lib;..\MultiLevelRayTracing\RTScene\Release;..\MultiLevelRayTracing\RTWorld\Release;"$(QTDIR)\lib";.\QtGlRenderer\Release" 269 GenerateDebugInformation="FALSE" 270 SubSystem="1" 271 OptimizeReferences="2" 272 EnableCOMDATFolding="2" 273 TargetMachine="1" 274 FixedBaseAddress="1"/> 275 <Tool 276 Name="VCMIDLTool"/> 277 <Tool 278 Name="VCPostBuildEventTool"/> 279 <Tool 280 Name="VCPreBuildEventTool"/> 281 <Tool 282 Name="VCPreLinkEventTool"/> 283 <Tool 284 Name="VCResourceCompilerTool"/> 285 <Tool 286 Name="VCWebServiceProxyGeneratorTool"/> 287 <Tool 288 Name="VCXMLDataGeneratorTool"/> 289 <Tool 290 Name="VCWebDeploymentTool"/> 291 <Tool 292 Name="VCManagedWrapperGeneratorTool"/> 293 <Tool 294 Name="VCAuxiliaryManagedWrapperGeneratorTool"/> 295 </Configuration> 296 <Configuration 297 Name="Release_Qt|Win32" 298 OutputDirectory="$(ConfigurationName)" 299 IntermediateDirectory="$(ConfigurationName)" 300 ConfigurationType="1" 301 CharacterSet="2"> 302 <Tool 303 Name="VCCLCompilerTool" 304 Optimization="3" 305 GlobalOptimizations="TRUE" 306 InlineFunctionExpansion="2" 307 FavorSizeOrSpeed="1" 308 EnableFiberSafeOptimizations="TRUE" 309 OptimizeForProcessor="3" 310 OptimizeForWindowsApplication="TRUE" 311 AdditionalIncludeDirectories="..\include;..\..\..\..\..\..\NonGTP\Boost;..\src;..\..\..\..\..\..\NonGTP\Devil\include;..\..\..\..\..\..\NonGTP\Zlib\include;..\..\..\..\..\..\NonGTP\Xerces;"$(QTDIR)\include\QtOpenGl";"$(QTDIR)\include\Qt";"$(QTDIR)\include\QtCore";"$(QTDIR)\include";QtInterface" 312 PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;USE_QT;TRY_GLOBAL_LINES" 313 RuntimeLibrary="2" 314 RuntimeTypeInfo="TRUE" 315 UsePrecompiledHeader="0" 316 WarningLevel="3" 317 Detect64BitPortabilityProblems="TRUE" 318 DebugInformationFormat="3"/> 319 <Tool 320 Name="VCCustomBuildTool"/> 321 <Tool 322 Name="VCLinkerTool" 323 AdditionalDependencies="xerces-c_2.lib glew32.lib zdll.lib zziplib.lib devil.lib glut32.lib OpenGL32.Lib glu32.lib Preprocessor.lib QtCore4.lib qtmain.lib cg.lib cgGL.lib QtOpenGL4.lib Qt3Support4.lib QtTest4.lib QtGui4.lib QtInterface.lib" 324 OutputFile="../bin/release/Preprocessor.exe" 325 LinkIncremental="1" 326 AdditionalLibraryDirectories="..\src\GL;..\lib\release;..\..\Preprocessing\lib\release;..\..\..\..\..\..\NonGTP\Boost\lib;..\..\..\..\..\..\NonGTP\Xerces\xercesc\lib;..\..\..\..\..\..\NonGTP\Zlib\lib;..\..\..\..\..\..\NonGTP\Devil\lib;..\MultiLevelRayTracing\RTScene\Release;..\MultiLevelRayTracing\RTWorld\Release;"$(QTDIR)\lib";.\QtInterface\Release;"$(CG_LIB_PATH)"" 269 327 GenerateDebugInformation="FALSE" 270 328 SubSystem="1" -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
r1946 r1949 98 98 mMixtureDistribution->GenerateSamples(mSamplesPerPass, simpleRays); 99 99 100 cout << "generated " << simpleRays.size() << " samples in "100 cout << "generated " << (int)simpleRays.size() << " samples in " 101 101 << TimeDiff(startTime, GetTime()) * 1e-3 << " secs" << endl; 102 102 -
GTP/trunk/Lib/Vis/Preprocessing/src/depth_peeling.cg
r1940 r1949 1 1 2 2 float3 main(in float4 col : COL0, 3 4 uniform samplerRECTdepthTex) : COLOR3 in float3 pos : WPOS, 4 uniform sampler2D depthTex) : COLOR 5 5 { 6 float zold = texRECT(depthTex, pos.xy); 7 if(pos.z < (zold + .000001)) 6 float zold = tex2D(depthTex, pos.xy / 256.0); 7 8 if(pos.z < (zold + 0.1)) 8 9 discard; 9 10 else; -
GTP/trunk/Lib/Vis/Preprocessing/src/main.cpp
r1942 r1949 28 28 #include "ObjExporter.h" 29 29 #include "SceneGraph.h" 30 //#include "GlobalLinesRenderer.h"30 #include "GlobalLinesRenderer.h" 31 31 32 32 #include "ViewCellsManager.h"
Note: See TracChangeset
for help on using the changeset viewer.