Changeset 2057 for GTP/trunk/App/Demos/Illum/Ogre/src/ReflectionTest
- Timestamp:
- 01/24/07 21:46:05 (18 years ago)
- Location:
- GTP/trunk/App/Demos/Illum/Ogre/src/ReflectionTest
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Illum/Ogre/src/ReflectionTest/include/ReflectionTest.h
r1879 r2057 30 30 #include "FrameCapture.h" 31 31 32 int scene = 1; 32 float refIndex = 0.77; 33 int scene = 3; 33 34 FrameCapture* capture; 34 35 35 36 bool multiplebounce = true; 37 38 int currentMaterial = 6; 39 int currentObject = 0; 40 String objectNames[] = {String("sphere.mesh"), 41 String("teapot.mesh")}; 42 43 String materialNames[] = {String("GTP/MultiBounce/Reflector"), 44 String("GTP/MultiBounce/Refractor"), 45 String("GTP/MultiBounce/CausticRefractor"), 46 String("GTP/MultiBounce/Reflector_MinMax"), 47 String("GTP/MultiBounce/Refractor_MinMax"), 48 String("GTP/MultiBounce/CausticRefractor_MinMax"), 49 String("GTP/MultiBounce/Refractor2L")}; 50 51 String resourceGroupName[] = { String("GTP_MultipleReflection"), 52 String("GTP_MultipleRefraction"), 53 String("GTP_MultipleRefraction"), 54 String("GTP_MultipleReflection_MinMax"), 55 String("GTP_MultipleRefraction_MinMax"), 56 String("GTP_MultipleRefraction_MinMax"), 57 String("GTP_MultipleRefraction2L")}; 36 58 37 59 // Listener class for frame updates … … 52 74 this->mMoveSpeed = 1.0; 53 75 if(scene == 3) 54 this->mMoveSpeed = 5.0;76 this->mMoveSpeed = 10.0; 55 77 mStatsOn = false; 56 78 showDebugOverlay(mStatsOn); … … 79 101 float elapsed = thisTime - lastTime; 80 102 float move = elapsed * 0.25; 103 if(scene == 3) 104 move *= 10; 81 105 float rotate = 80.0 * move; 106 107 if (mInputDevice->isKeyDown(KC_J)) 108 { 109 MaterialPtr mat1 = MaterialManager::getSingleton().getByName("GTP/MultiBounce/Refractor2L"); 110 GpuProgramParameters* Fparams1 = mat1->getTechnique(0)->getPass(0)->getFragmentProgramParameters().getPointer(); 111 MaterialPtr mat2 = MaterialManager::getSingleton().getByName("GTP/MultiBounce/PhotonMap2L"); 112 GpuProgramParameters* Fparams2 = mat2->getTechnique(0)->getPass(0)->getFragmentProgramParameters().getPointer(); 113 114 refIndex -= 0.001; 115 116 Fparams1->setNamedConstant("refIndex", refIndex); 117 Fparams2->setNamedConstant("refIndex", refIndex); 118 } 119 if (mInputDevice->isKeyDown(KC_K)) 120 { 121 MaterialPtr mat1 = MaterialManager::getSingleton().getByName("GTP/MultiBounce/Refractor2L"); 122 GpuProgramParameters* Fparams1 = mat1->getTechnique(0)->getPass(0)->getFragmentProgramParameters().getPointer(); 123 MaterialPtr mat2 = MaterialManager::getSingleton().getByName("GTP/MultiBounce/PhotonMap2L"); 124 GpuProgramParameters* Fparams2 = mat2->getTechnique(0)->getPass(0)->getFragmentProgramParameters().getPointer(); 125 126 refIndex += 0.001; 127 Fparams1->setNamedConstant("refIndex", refIndex); 128 Fparams2->setNamedConstant("refIndex", refIndex); 129 } 82 130 83 131 if (mInputDevice->isKeyDown(KC_UP)) … … 277 325 278 326 } 327 328 void loadResources(void) 329 { 330 // Initialise, parse scripts etc 331 ResourceGroupManager::getSingleton().initialiseResourceGroup("Bootstrap"); 332 ResourceGroupManager::getSingleton().initialiseResourceGroup("General"); 333 ResourceGroupManager::getSingleton().initialiseResourceGroup("PostProc"); 334 ResourceGroupManager::getSingleton().initialiseResourceGroup("GTP_Basic"); 335 ResourceGroupManager::getSingleton().initialiseResourceGroup("GTP_EnvMap"); 336 ResourceGroupManager::getSingleton().initialiseResourceGroup("GTP_Caustic"); 337 ResourceGroupManager::getSingleton().initialiseResourceGroup("GTP_MultiBounce_Shared"); 338 ResourceGroupManager::getSingleton().initialiseResourceGroup(resourceGroupName[currentMaterial]); 339 if(currentMaterial == 2) 340 ResourceGroupManager::getSingleton().initialiseResourceGroup("GTP_MultiBounce_PhotonMap"); 341 if(currentMaterial == 5) 342 ResourceGroupManager::getSingleton().initialiseResourceGroup("GTP_MultiBounce_PhotonMap_MinMax"); 343 } 279 344 280 345 void createScene(void) … … 314 379 //mCamera->lookAt(Vector3(0,1.2,0.0)); 315 380 316 bool teapot = true;317 381 Entity* object; 318 if(teapot) 319 object = mSceneMgr->createEntity("object", "teapot.mesh"); 320 else 321 object = mSceneMgr->createEntity("object", "sphere.mesh"); 322 323 object->setMaterialName("MetalTeapotMultipleBounce"); 382 object = mSceneMgr->createEntity("object", objectNames[currentObject]); 383 384 object->setMaterialName(materialNames[currentMaterial]); 324 385 objectNode = rootNode->createChildSceneNode("objectNode"); 325 386 objectNode->attachObject(object); 326 if(teapot) 327 objectNode->scale(0.5,0.5,0.5); 328 else 329 objectNode->scale(0.005,0.005,0.005); 387 388 if(currentObject == 1) 389 objectNode->scale(0.5,0.5,0.5); 390 if(currentObject == 0) 391 objectNode->scale(0.005,0.005,0.005); 330 392 //objectNode->scale(0.005,0.005,0.005); 393 331 394 objectNode->setPosition(0,1.2,0); 332 395 objectNode->_updateBounds(); … … 381 444 382 445 mCamera->setPosition(2.3,7.0,2.3); 383 mCamera->lookAt(Vector3(0,5.75,0.0));446 //mCamera->lookAt(Vector3(0,5.75,0.0)); 384 447 385 448 Entity* object = mSceneMgr->createEntity("object", "teapot.mesh"); … … 410 473 411 474 void createScene3(void) 412 { 475 { 413 476 SceneNode* rootNode = mSceneMgr->getRootSceneNode(); 414 477 415 bool teapot = true;416 478 //mCamera->getParentSceneNode()->translate(Vector3(6.564,4.328,0.059)); 417 479 //mCamera->setPosition(4.0,4.2,-3.5); 418 mCamera->setPosition(7.0,2.6,-0.5); 419 mCamera->lookAt(Vector3(1.0, 0.0,0.6)); 480 mCamera->getParentSceneNode()->translate(7.0,2.6,-0.5); 481 //mCamera->setPosition(7.0,2.6,-0.5); 482 //mCamera->lookAt(Vector3(1.0, 0.0,0.6)); 420 483 Entity* object; 421 422 if(teapot) 423 object = mSceneMgr->createEntity("object", "teapot.mesh"); 424 else 425 object = mSceneMgr->createEntity("object", "sphere.mesh"); 426 object->setMaterialName("MetalTeapotMultipleBounce"); 484 485 object = mSceneMgr->createEntity("object", objectNames[currentObject]); 486 487 object->setMaterialName(materialNames[currentMaterial]); 427 488 objectNode = rootNode->createChildSceneNode(); 428 489 objectNode->attachObject(object); 429 490 430 if( teapot)491 if(currentObject == 1) 431 492 { 432 493 objectNode->scale(2.7,2.7,2.7); 433 494 objectNode->setPosition(0,0.7,0.0); 434 495 } 435 else496 if(currentObject == 0) 436 497 { 437 498 objectNode->scale(0.027,0.027,0.027); … … 445 506 SceneNode* roomNode = rootNode->createChildSceneNode(); 446 507 roomNode->attachObject(room); 447 roomNode->_updateBounds(); 508 roomNode->setScale(2,2,2); 509 roomNode->_updateBounds(); 510 511 mSceneMgr->setShadowTechnique(SHADOWTYPE_NONE); 512 Light* Light1 = mSceneMgr->createLight("Light1"); 513 Light1->setType(Light::LT_SPOTLIGHT); 514 Light1->setCastShadows(true); 515 Light1->setDiffuseColour(ColourValue(1,1, 1)); 516 Light1->setPowerScale(1.0); 517 SceneNode* LightNode1 = rootNode->createChildSceneNode(); 518 LightNode1->setPosition(3,3,3); 519 Light1->setDirection(-1,-1,-1); 520 Light1->setSpotlightRange(Degree(0),Degree(120)); 521 LightNode1->attachObject(Light1); 522 523 BillboardSet* bbs = mSceneMgr->createBillboardSet("bb", 1); 524 bbs->setDefaultDimensions(0.2, 0.2); 525 bbs->createBillboard(Vector3::ZERO, ColourValue::White); 526 bbs->setMaterialName("Flare"); 527 LightNode1->attachObject(bbs); 448 528 } 449 529 -
GTP/trunk/App/Demos/Illum/Ogre/src/ReflectionTest/scripts/ReflectionTest.7.10.vcproj
r2025 r2057 2 2 <VisualStudioProject 3 3 ProjectType="Visual C++" 4 Version="7 ,00"4 Version="7.10" 5 5 Name="ReflectionTest" 6 6 ProjectGUID="{945CF851-1CE7-469B-AB24-82A7C12C7170}" 7 7 RootNamespace="GameToolsRaytraceDemo" 8 Keyword="Win32Proj" 9 > 8 Keyword="Win32Proj"> 10 9 <Platforms> 11 10 <Platform 12 Name="Win32" 13 /> 11 Name="Win32"/> 14 12 </Platforms> 15 <ToolFiles>16 </ToolFiles>17 13 <Configurations> 18 14 <Configuration … … 21 17 IntermediateDirectory="..\obj\$(ConfigurationName)" 22 18 ConfigurationType="1" 23 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" 24 CharacterSet="2" 25 > 26 <Tool 27 Name="VCPreBuildEventTool" 28 /> 29 <Tool 30 Name="VCCustomBuildTool" 31 /> 32 <Tool 33 Name="VCXMLDataGeneratorTool" 34 /> 35 <Tool 36 Name="VCWebServiceProxyGeneratorTool" 37 /> 38 <Tool 39 Name="VCMIDLTool" 40 /> 19 CharacterSet="2"> 41 20 <Tool 42 21 Name="VCCLCompilerTool" … … 44 23 AdditionalIncludeDirectories="..\include;"$(OGRE_PATH)\Samples\Common\include";"$(OGRE_PATH)\OgreMain\include";..\..\..\..\..\..\..\Lib\Illum\IllumModule\OgreIllumModule\include;..\..\..\..\..\..\..\Lib\Illum\IllumModule\OgreIllumModule\include\RenderTechniques;..\..\..\..\..\..\..\Lib\Illum\IllumModule\OgreIllumModule\include\RenderingRuns;..\..\..\..\..\..\..\Lib\Illum\IllumModule\IllumModule\include\RenderTechniques;..\..\..\..\..\..\..\Lib\Illum\IllumModule\IllumModule\include;..\..\..\..\..\..\..\Lib\Illum\IllumModule\IllumModule\include\RenderingRuns;..\..\Common\include" 45 24 PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;GAMETOOLS_ILLUMINATION_MODULE" 46 MinimalRebuild=" true"25 MinimalRebuild="TRUE" 47 26 BasicRuntimeChecks="3" 48 27 RuntimeLibrary="3" 49 EnableFunctionLevelLinking=" true"28 EnableFunctionLevelLinking="TRUE" 50 29 UsePrecompiledHeader="0" 51 30 WarningLevel="3" 52 Detect64BitPortabilityProblems="true" 53 DebugInformationFormat="4" 54 /> 31 Detect64BitPortabilityProblems="TRUE" 32 DebugInformationFormat="4"/> 55 33 <Tool 56 Name="VCManagedResourceCompilerTool" 57 /> 58 <Tool 59 Name="VCResourceCompilerTool" 60 /> 61 <Tool 62 Name="VCPreLinkEventTool" 63 /> 34 Name="VCCustomBuildTool"/> 64 35 <Tool 65 36 Name="VCLinkerTool" … … 69 40 AdditionalLibraryDirectories="..\..\..\..\..\..\..\Lib\Illum\IllumModule\OgreIllumModule\bin\Debug;"$(OGRE_PATH)\OgreMain\lib\$(ConfigurationName)";..\..\..\..\..\..\..\Lib\Illum\IllumModule\IllumModule\bin\Debug" 70 41 IgnoreDefaultLibraryNames="" 71 GenerateDebugInformation=" true"42 GenerateDebugInformation="TRUE" 72 43 ProgramDatabaseFile="$(OutDir)/proba.pdb" 73 44 SubSystem="2" 74 45 OptimizeForWindows98="1" 75 TargetMachine="1" 76 /> 46 TargetMachine="1"/> 77 47 <Tool 78 Name="VCALinkTool" 79 /> 80 <Tool 81 Name="VCManifestTool" 82 /> 83 <Tool 84 Name="VCXDCMakeTool" 85 /> 86 <Tool 87 Name="VCBscMakeTool" 88 /> 89 <Tool 90 Name="VCFxCopTool" 91 /> 92 <Tool 93 Name="VCAppVerifierTool" 94 /> 95 <Tool 96 Name="VCWebDeploymentTool" 97 /> 48 Name="VCMIDLTool"/> 98 49 <Tool 99 50 Name="VCPostBuildEventTool" 100 CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\..\bin\$(ConfigurationName)" 101 /> 51 CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\..\bin\$(ConfigurationName)"/> 52 <Tool 53 Name="VCPreBuildEventTool"/> 54 <Tool 55 Name="VCPreLinkEventTool"/> 56 <Tool 57 Name="VCResourceCompilerTool"/> 58 <Tool 59 Name="VCWebServiceProxyGeneratorTool"/> 60 <Tool 61 Name="VCXMLDataGeneratorTool"/> 62 <Tool 63 Name="VCWebDeploymentTool"/> 64 <Tool 65 Name="VCManagedWrapperGeneratorTool"/> 66 <Tool 67 Name="VCAuxiliaryManagedWrapperGeneratorTool"/> 102 68 </Configuration> 103 69 <Configuration … … 106 72 IntermediateDirectory="..\obj\$(ConfigurationName)" 107 73 ConfigurationType="1" 108 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"109 74 CharacterSet="2" 110 WholeProgramOptimization="1" 111 > 112 <Tool 113 Name="VCPreBuildEventTool" 114 /> 115 <Tool 116 Name="VCCustomBuildTool" 117 /> 118 <Tool 119 Name="VCXMLDataGeneratorTool" 120 /> 121 <Tool 122 Name="VCWebServiceProxyGeneratorTool" 123 /> 124 <Tool 125 Name="VCMIDLTool" 126 /> 75 WholeProgramOptimization="TRUE"> 127 76 <Tool 128 77 Name="VCCLCompilerTool" 129 78 Optimization="2" 130 79 InlineFunctionExpansion="1" 131 EnableIntrinsicFunctions=" true"80 EnableIntrinsicFunctions="TRUE" 132 81 FavorSizeOrSpeed="1" 133 OmitFramePointers=" true"134 EnableFiberSafeOptimizations=" false"82 OmitFramePointers="TRUE" 83 EnableFiberSafeOptimizations="FALSE" 135 84 AdditionalIncludeDirectories="..\include;"$(OGRE_PATH)\Samples\Common\include";"$(OGRE_PATH)\OgreMain\include";..\..\..\..\..\..\..\Lib\Illum\IllumModule\OgreIllumModule\include;..\..\..\..\..\..\..\Lib\Illum\IllumModule\OgreIllumModule\include\RenderTechniques;..\..\..\..\..\..\..\Lib\Illum\IllumModule\OgreIllumModule\include\RenderingRuns;..\..\..\..\..\..\..\Lib\Illum\IllumModule\IllumModule\include\RenderTechniques;..\..\..\..\..\..\..\Lib\Illum\IllumModule\IllumModule\include;..\..\..\..\..\..\..\Lib\Illum\IllumModule\IllumModule\include\RenderingRuns;..\..\Common\include" 136 85 PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;GAMETOOLS_ILLUMINATION_MODULE" 137 StringPooling=" true"138 MinimalRebuild=" true"86 StringPooling="TRUE" 87 MinimalRebuild="TRUE" 139 88 RuntimeLibrary="2" 140 BufferSecurityCheck=" false"141 EnableFunctionLevelLinking=" true"89 BufferSecurityCheck="FALSE" 90 EnableFunctionLevelLinking="TRUE" 142 91 UsePrecompiledHeader="0" 143 92 WarningLevel="3" 144 Detect64BitPortabilityProblems="true" 145 DebugInformationFormat="3" 146 /> 93 Detect64BitPortabilityProblems="TRUE" 94 DebugInformationFormat="3"/> 147 95 <Tool 148 Name="VCManagedResourceCompilerTool" 149 /> 150 <Tool 151 Name="VCResourceCompilerTool" 152 /> 153 <Tool 154 Name="VCPreLinkEventTool" 155 /> 96 Name="VCCustomBuildTool"/> 156 97 <Tool 157 98 Name="VCLinkerTool" … … 160 101 LinkIncremental="1" 161 102 AdditionalLibraryDirectories="..\..\..\..\..\..\..\Lib\Illum\IllumModule\OgreIllumModule\bin\Release;"$(OGRE_PATH)\OgreMain\lib\$(ConfigurationName)";..\..\..\..\..\..\..\Lib\Illum\IllumModule\IllumModule\bin\Release" 162 GenerateDebugInformation=" false"103 GenerateDebugInformation="FALSE" 163 104 SubSystem="2" 164 105 OptimizeReferences="2" 165 106 EnableCOMDATFolding="2" 166 107 OptimizeForWindows98="1" 167 TargetMachine="1" 168 /> 108 TargetMachine="1"/> 169 109 <Tool 170 Name="VCALinkTool" 171 /> 172 <Tool 173 Name="VCManifestTool" 174 /> 175 <Tool 176 Name="VCXDCMakeTool" 177 /> 178 <Tool 179 Name="VCBscMakeTool" 180 /> 181 <Tool 182 Name="VCFxCopTool" 183 /> 184 <Tool 185 Name="VCAppVerifierTool" 186 /> 187 <Tool 188 Name="VCWebDeploymentTool" 189 /> 110 Name="VCMIDLTool"/> 190 111 <Tool 191 112 Name="VCPostBuildEventTool" 192 CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\..\bin\$(ConfigurationName)" 193 /> 113 CommandLine="copy $(OutDir)\$(TargetFileName) ..\..\..\bin\$(ConfigurationName)"/> 114 <Tool 115 Name="VCPreBuildEventTool"/> 116 <Tool 117 Name="VCPreLinkEventTool"/> 118 <Tool 119 Name="VCResourceCompilerTool"/> 120 <Tool 121 Name="VCWebServiceProxyGeneratorTool"/> 122 <Tool 123 Name="VCXMLDataGeneratorTool"/> 124 <Tool 125 Name="VCWebDeploymentTool"/> 126 <Tool 127 Name="VCManagedWrapperGeneratorTool"/> 128 <Tool 129 Name="VCAuxiliaryManagedWrapperGeneratorTool"/> 194 130 </Configuration> 195 131 </Configurations> … … 199 135 <Filter 200 136 Name="Source Files" 201 Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm" 202 > 137 Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"> 203 138 <File 204 RelativePath="..\src\ReflectionTest.cpp" 205 > 139 RelativePath="..\src\ReflectionTest.cpp"> 206 140 </File> 207 141 </Filter> 208 142 <Filter 209 143 Name="Header Files" 210 Filter="h;hpp;hxx;hm;inl;inc" 211 > 144 Filter="h;hpp;hxx;hm;inl;inc"> 212 145 <File 213 RelativePath="..\..\Common\src\FrameCapture.cpp" 214 > 146 RelativePath="..\..\Common\src\FrameCapture.cpp"> 215 147 </File> 216 148 <File 217 RelativePath="..\..\Common\include\FrameCapture.h" 218 > 149 RelativePath="..\..\Common\include\FrameCapture.h"> 219 150 </File> 220 151 <File 221 RelativePath="..\include\ReflectionTest.h" 222 > 152 RelativePath="..\include\ReflectionTest.h"> 223 153 </File> 224 154 </Filter> 225 155 <Filter 226 156 Name="Resource Files" 227 Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" 228 > 157 Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"> 229 158 <File 230 RelativePath="..\..\..\Media\materials\programs\MetalTeapot.hlsl" 231 > 159 RelativePath="..\..\..\Media\materials\programs\MetalTeapot.hlsl"> 232 160 </File> 233 161 <File 234 RelativePath="..\..\..\Media\materials\scripts\MetalTeapot.material" 235 > 162 RelativePath="..\..\..\Media\materials\scripts\MetalTeapot.material"> 236 163 </File> 237 164 <File 238 RelativePath="..\..\..\Media\materials\programs\MetalTeapotNew.hlsl" 239 > 165 RelativePath="..\..\..\Media\materials\programs\MetalTeapotNew.hlsl"> 240 166 </File> 241 167 </Filter>
Note: See TracChangeset
for help on using the changeset viewer.