Changeset 861 for GTP/trunk/Lib
- Timestamp:
- 04/28/06 19:49:56 (19 years ago)
- Location:
- GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE
- Files:
-
- 269 added
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/Readme.txt
r701 r861 2 2 ------------------------------ 3 3 4 OGRE_PATH: points to directory where ogre.sln is located (i.e., the directory OGRE/trunk/ogrenew) 5 Set preprocessor flag /D "TIXML_USE_STL" should be used in order to use the correct tinyXML STL version 4 Run-time hardware Requeriments: 5 =============================== 6 7 Recommended configuration: 8 -Pentium 4 or equivalent AMD at 2GHz or more. 9 -Graphic card Vertex Shader 3.0/Pixel Shader 3.0 Compatible 10 -RAM 1GB 11 -DirectX 9c / OpenGL 12 13 Required configuration: 14 -Pentium 4 or equivalent AMD at 1GHz or more. 15 -Graphic card Vertex Shader 2.0/Pixel Shader 2.0 Compatible 16 -RAM 512MB 17 -DirectX 9c / OpenGL 18 19 - The IBR Billboard Cloud Tree Generator has been tested succesfully with this configurations: 20 21 OpenGL - GLSL ---- ATI 9700 Mobility 22 OpenGL - Cg ---- ATI 9700 Mobility 23 Direct3D - Cg ---- ATI 9700 Mobility 24 Direct3D - HLSL ---- ATI 9700 Mobility 25 26 OpenGL - GLSL ---- NVIDIA Quadro FX 4500 / NVIDIA 7800 GT 27 OpenGL - Cg ---- NVIDIA Quadro FX 4500 / NVIDIA 7800 GT 28 Direct3D - Cg ---- NVIDIA Quadro FX 4500 / NVIDIA 7800 GT 29 Direct3D - HLSL ---- NVIDIA Quadro FX 4500 / NVIDIA 7800 GT 30 31 Required dependencies: 32 ====================== 33 34 The IBR Billboard Cloud Tree Generator core depends on several other 35 libraries that you will need install, if they're not already present 36 on your system. The most typical libraries you may need to install 37 are: 38 39 * Ogre3D 40 * Boost 41 42 Optionally: 43 44 * OpenEXR 45 * ImageDebugger 46 47 48 Folders Structure: 49 ================== 50 51 Runtime folders: 52 53 /bin/Release 54 /bin/Debug 55 56 - These folders contain the release / debug IBRBillboardCloudTreeGenerator. 57 You should use the realease version. Only if you find out a bug use the debug 58 version to report it. 59 60 Documentation folders: 61 62 /doc/userManual 63 /doc/devManual 64 65 - The user manual cover all the features available in the IBR Billboard Cloud Tree Generator. 66 - The developer manual it is basically a doxygen documentationn of the IBR Billboard Cloud 67 Tree Generator Core, this documentation will useful if you want to extend the application 68 in some specific ways. 69 70 Media folders: 71 72 /media 73 /media/general 74 /media/chestnut/leaves 75 76 - The media folder is the default folder where you will find the media used by the 77 IBR Billboard Cloud Tree Generator. This include the shaders, textures, Ogre3D materials, ... 78 - The default shaders used are placed in media/general. 79 - There is a sample tree placed in media/chestnut. The more important file from this sample 80 tree is the configuration file (sampleChestnutLeaves.cfg) placed in /media/chestnut/leaves. This 81 configuration file must be used when you run the IBR Billboard Cloud Tree Generator, for this sample. 82 83 Source code folders: 84 85 /include 86 /src 87 /scripts 88 89 Temporary folders: 90 91 /misc 92 /obj 93 94 95 Compilation instructions: 96 ========================= 97 98 Note: There is a preprocessor flag /D "TIXML_USE_STL" used in order to use the correct tinyXML STL version -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/include/IBRBillboardCloudTreeFrameListener.h
r721 r861 11 11 12 12 public: 13 IBRBillboardCloudTreeFrameListener(Ogre::RenderWindow *win, bool useBufferedInputKeys = false, bool useBufferedInputMouse = false) 14 : OgreFrameListener(win, useBufferedInputKeys, useBufferedInputMouse) 15 { 16 } 13 IBRBillboardCloudTreeFrameListener(Ogre::RenderWindow *win, bool useBufferedInputKeys = false, bool useBufferedInputMouse = false); 17 14 18 ~IBRBillboardCloudTreeFrameListener() 19 { 20 } 15 ~IBRBillboardCloudTreeFrameListener(); 21 16 22 bool frameStarted(const Ogre::FrameEvent& evt) 23 { 24 // Call default 25 return OgreFrameListener::frameStarted(evt); 26 } 17 bool frameStarted(const Ogre::FrameEvent& evt); 18 19 bool processUnbufferedKeyInput(const Ogre::FrameEvent& evt); 27 20 28 21 }; -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/include/LBBC/LBBCBillboardViewMode.h
r821 r861 16 16 epsilonX = 0.0; 17 17 epsilonY = 0.0; 18 factor = 1.0 / 255.0;18 factor = 0.125; 19 19 } 20 20 … … 35 35 virtual bool processUnbufferedKeyInput(const Ogre::FrameEvent& evt) 36 36 { 37 if (mInputDevice->isKeyDown(Ogre::KC_ 1))38 { 39 epsilonX = epsilonX + factor;40 } 41 42 if (mInputDevice->isKeyDown(Ogre::KC_ 2))43 { 44 epsilonX = epsilonX - factor;45 } 46 47 if (mInputDevice->isKeyDown(Ogre::KC_ 3))48 { 49 epsilonY = epsilonY + factor;37 if (mInputDevice->isKeyDown(Ogre::KC_RIGHT)) 38 { 39 epsilonX = epsilonX + (factor * evt.timeSinceLastFrame); 40 } 41 42 if (mInputDevice->isKeyDown(Ogre::KC_LEFT)) 43 { 44 epsilonX = epsilonX - (factor * evt.timeSinceLastFrame); 45 } 46 47 if (mInputDevice->isKeyDown(Ogre::KC_UP)) 48 { 49 epsilonY = epsilonY + (factor * evt.timeSinceLastFrame); 50 50 } 51 51 52 if (mInputDevice->isKeyDown(Ogre::KC_ 4))53 { 54 epsilonY = epsilonY - factor;52 if (mInputDevice->isKeyDown(Ogre::KC_DOWN)) 53 { 54 epsilonY = epsilonY - (factor * evt.timeSinceLastFrame); 55 55 } 56 56 57 57 mFragParams = mBillboardCloudEntity->getSubEntity(0)->getMaterial()->getBestTechnique()->getPass(0)->getFragmentProgramParameters(); 58 58 59 mFragParams->setNamedConstant("epsilonX", epsilonX); 59 60 mFragParams->setNamedConstant("epsilonY", epsilonY); … … 71 72 } 72 73 74 ///* Move camera forward by keypress. */ 75 //if (mInputDevice->isKeyDown(Ogre::KC_UP) || mInputDevice->isKeyDown(Ogre::KC_W) ) 76 //{ 77 // mTranslateVector.z = -mMoveScale; 78 //} 79 80 ///* Move camera backward by keypress. */ 81 //if (mInputDevice->isKeyDown(Ogre::KC_DOWN) || mInputDevice->isKeyDown(Ogre::KC_S) ) 82 //{ 83 // mTranslateVector.z = mMoveScale; 84 //} 85 73 86 /* Move camera forward by keypress. */ 74 if (mInputDevice->isKeyDown(Ogre::KC_ UP) || mInputDevice->isKeyDown(Ogre::KC_W) )87 if (mInputDevice->isKeyDown(Ogre::KC_W) ) 75 88 { 76 89 mTranslateVector.z = -mMoveScale; … … 78 91 79 92 /* Move camera backward by keypress. */ 80 if (mInputDevice->isKeyDown(Ogre::KC_ DOWN) || mInputDevice->isKeyDown(Ogre::KC_S) )93 if (mInputDevice->isKeyDown(Ogre::KC_S) ) 81 94 { 82 95 mTranslateVector.z = mMoveScale; … … 95 108 } 96 109 97 if (mInputDevice->isKeyDown(Ogre::KC_RIGHT))98 {99 mCamera->yaw(-mRotScale);100 }101 102 if (mInputDevice->isKeyDown(Ogre::KC_LEFT))103 {104 mCamera->yaw(mRotScale);105 }110 //if (mInputDevice->isKeyDown(Ogre::KC_RIGHT)) 111 //{ 112 // mCamera->yaw(-mRotScale); 113 //} 114 // 115 //if (mInputDevice->isKeyDown(Ogre::KC_LEFT)) 116 //{ 117 // mCamera->yaw(mRotScale); 118 //} 106 119 107 120 // see if switching is on, and you want to toggle … … 186 199 mWindow->setDebugText("P: " + Ogre::StringConverter::toString(mCamera->getDerivedPosition()) + " " + 187 200 "O: " + Ogre::StringConverter::toString(mCamera->getDerivedOrientation())); 188 } 201 } 189 202 190 203 // Return true to continue rendering … … 201 214 202 215 Ogre::SceneNode* sNode = mSceneMgr->getRootSceneNode()->createChildSceneNode(); 203 //mBillboardCloudEntity = mSceneMgr->createEntity(mBillboardCloudMeshName, mBillboardCloudMeshName);204 mBillboardCloudEntity = mSceneMgr->createEntity("chestnutLeavesBillboardCloudGrouped.mesh", "chestnutLeavesBillboardCloudGrouped.mesh");216 mBillboardCloudEntity = mSceneMgr->createEntity(mBillboardCloudMeshName, mBillboardCloudMeshName); 217 //mBillboardCloudEntity = mSceneMgr->createEntity("chestnutLeavesBillboardCloudGrouped.mesh", "chestnutLeavesBillboardCloudGrouped.mesh"); 205 218 //mBillboardCloudEntity = mSceneMgr->createEntity("mapleLeavesBillboardCloudGrouped.mesh", "mapleLeavesBillboardCloudGrouped.mesh"); 206 219 //mBillboardCloudEntity = mSceneMgr->createEntity("prunusLeavesBillboardCloudGrouped.mesh", "prunusLeavesBillboardCloudGrouped.mesh"); 207 220 sNode->attachObject(mBillboardCloudEntity); 208 sNode->rotate(Ogre::Vector3::UNIT_X, Ogre::Radian(Ogre::Degree(-90.0)));221 //sNode->rotate(Ogre::Vector3::UNIT_X, Ogre::Radian(Ogre::Degree(-90.0))); 209 222 } 210 223 -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/include/LBBC/LBBCClusterViewMode.h
r821 r861 38 38 39 39 Ogre::SceneNode* sNode = mSceneMgr->getRootSceneNode()->createChildSceneNode(); 40 //Ogre::Entity* eLeafClustersGrouped = mSceneMgr->createEntity(mEntityClustersMeshName, mEntityClustersMeshName);41 Ogre::Entity* eLeafClustersGrouped = mSceneMgr->createEntity("chestnutLeafClustersGrouped.mesh", "chestnutLeafClustersGrouped.mesh");40 Ogre::Entity* eLeafClustersGrouped = mSceneMgr->createEntity(mEntityClustersMeshName, mEntityClustersMeshName); 41 //Ogre::Entity* eLeafClustersGrouped = mSceneMgr->createEntity("chestnutLeafClustersGrouped.mesh", "chestnutLeafClustersGrouped.mesh"); 42 42 //Ogre::Entity* eLeafClustersGrouped = mSceneMgr->createEntity("mapleLeafClustersGrouped.mesh", "mapleLeafClustersGrouped.mesh"); 43 43 //Ogre::Entity* eLeafClustersGrouped = mSceneMgr->createEntity("prunusLeafClustersGrouped.mesh", "prunusLeafClustersGrouped.mesh"); 44 44 sNode->attachObject(eLeafClustersGrouped); 45 sNode->rotate(Ogre::Vector3::UNIT_X, Ogre::Radian(Ogre::Degree(-90.0)));45 //sNode->rotate(Ogre::Vector3::UNIT_X, Ogre::Radian(Ogre::Degree(-90.0))); 46 46 } 47 47 protected: -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/media/general/indirectTexturingDefault_FP20.cg
r821 r861 6 6 uniform float epsilonY, 7 7 uniform float sourceTextureSize, 8 uniform float numSamples, 9 uniform float sqrtNumSamples, 8 10 out float4 ocolor: COLOR) 9 11 { 10 12 ocolor = float4(0.0, 0.0, 0.0, 0.0); 11 13 float2 epsilon = float2(epsilonX, epsilonY); 14 float4 value = tex2D(indirectTexture, subTexCoord).xyzw; 15 float2 coords = float2(0.0, 1.0) - abs(texCoord - ( value.xy - epsilon ) ); 12 16 13 float2 coords = float2(0.0, 1.0) - abs(texCoord - ( tex2D(indirectTexture, subTexCoord).xy - epsilon ) ); 14 15 if (tex2D(indirectTexture, subTexCoord).z != 0.0) 16 { 17 ocolor = float4(tex2D(sourceTexture, coords * sourceTextureSize).xyzw); 17 if (value.z != 0.0) 18 { 19 float2 newcoord = value.zw + ((coords * sourceTextureSize) / sqrtNumSamples); 20 ocolor = float4(tex2D(sourceTexture, newcoord).xyzw); 18 21 } 19 22 } 20 -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/media/general/indirectTexturingDefault_glsl_FP20.shd
r821 r861 4 4 uniform float epsilonY; 5 5 uniform float sourceTextureSize; 6 uniform float numSamples; 7 uniform float sqrtNumSamples; 6 8 7 9 void main(void) … … 11 13 vec2 texCoord = gl_TexCoord[0].xy; 12 14 vec2 subTexCoord = gl_TexCoord[1].xy; 13 vec2 coords = vec2(0.0, 1.0) - abs(texCoord - ( texture2D(indirectTexture, subTexCoord ).xy - epsilon ) ); 15 vec4 value = texture2D(indirectTexture, subTexCoord).xyzw; 16 vec2 coords = vec2(0.0, 1.0) - abs(texCoord - ( value.xy - epsilon ) ); 14 17 15 if ( texture2D(indirectTexture, subTexCoord).z != 0.0)18 if (value.z != 0.0) 16 19 { 17 ocolor = texture2D(sourceTexture, coords * sourceTextureSize).xyzw; 20 vec2 newcoord = value.zw + ((coords * sourceTextureSize) / sqrtNumSamples); 21 ocolor = vec4(texture2D(sourceTexture, newcoord).xyzw); 18 22 } 19 20 23 gl_FragColor = ocolor; 21 24 } -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/media/general/indirectTexturingDefault_hlsl_FP20.shd
r821 r861 5 5 uniform float epsilonY; 6 6 uniform float sourceTextureSize; 7 uniform float numSamples; 8 uniform float sqrtNumSamples; 7 9 8 10 float4 main_fp(float2 texCoord: TEXCOORD0, … … 11 13 float4 ocolor = float4(0.0, 0.0, 0.0, 0.0); 12 14 float2 epsilon = float2(epsilonX, epsilonY); 15 float4 value = tex2D(indirectTexture, subTexCoord).xyzw; 16 float2 coords = float2(0.0, 1.0) - abs(texCoord - ( value.xy - epsilon ) ); 13 17 14 float2 coords = float2(0.0, 1.0) - abs(texCoord - ( tex2D(indirectTexture, subTexCoord).xy - epsilon ) ); 15 16 if (tex2D(indirectTexture, subTexCoord).z != 0.0) 17 { 18 ocolor = float4(tex2D(sourceTexture, coords * sourceTextureSize).xyzw); 18 if (value.w != 0.0) 19 { 20 float2 newcoord = value.zw + ((coords * sourceTextureSize) / sqrtNumSamples); 21 ocolor = float4(tex2D(sourceTexture, newcoord).xyzw); 19 22 } 20 23 21 24 return ocolor; 22 25 } 23 -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/media/general/indirectTexturingPointBasedGeneration_FP20.cg
r786 r861 1 1 void main(float4 colour: COLOR0, 2 uniform float textureSize,2 float4 texCoord: TEXCOORD0, 3 3 out float4 ocolor: COLOR) 4 4 { 5 ocolor = float4(0.0, 0.0, 1.0 - (1.0/textureSize), 1.0 - (1.0/textureSize));5 ocolor = float4(0.0, 0.0, texCoord.xy); 6 6 } -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/scripts/IBRBillboardCloudTreeGenerator.vcproj
r778 r861 22 22 AdditionalOptions="/D "TIXML_USE_STL" /D "OBA_LIB_BUILD" /D "IMG_LIB_BUILD"" 23 23 Optimization="0" 24 AdditionalIncludeDirectories=" "$(OGRE_PATH)/OgreMain/include";"$(OGRE_PATH)/Samples/Common/include";"$(OGRE_PATH)/Tools/XMLConverter/include";../include/IMG;../include/BBC;../include/LBBC;../include/OBA;D:\design_04_11_2005\svn\NonGTP\Boost;D:\design_04_11_2005\svn\NonGTP\ImageDebugger\include"24 AdditionalIncludeDirectories="../../../../../../../OGRE/trunk/ogrenew/OgreMain/include;../../../../../../../OGRE/trunk/ogrenew/Samples/Common/include;../../../../../../../OGRE/trunk/ogrenew/Tools/XMLConverter/include;../include/IMG;../include/BBC;../include/LBBC;../include/OBA;../../../../../../../NonGTP\Boost;../../../../../../../NonGTP\ImageDebugger\include" 25 25 PreprocessorDefinitions="WIN32;_DEBUG;_USRDLL;_MT" 26 26 MinimalRebuild="TRUE" … … 44 44 LinkIncremental="2" 45 45 SuppressStartupBanner="TRUE" 46 AdditionalLibraryDirectories="" $(OGRE_PATH)/OgreMain/lib/$(ConfigurationName)";"$(OGRE_PATH)/OgreMain/lib/Release";D:\design_04_11_2005\svn\NonGTP\ImageDebugger\lib"46 AdditionalLibraryDirectories=""../../../../../../../OGRE/trunk/ogrenew/OgreMain/lib/$(ConfigurationName)";../../../../../../../OGRE/trunk/ogrenew/OgreMain/lib/Release;../../../../../../../NonGTP\ImageDebugger\lib" 47 47 IgnoreDefaultLibraryNames="LIBCD;LIBCMTD" 48 48 GenerateDebugInformation="TRUE" … … 81 81 Name="VCCLCompilerTool" 82 82 AdditionalOptions="/D "TIXML_USE_STL" /D "TIXML_USE_STL" /D "OBA_LIB_BUILD" /D "IMG_LIB_BUILD"" 83 AdditionalIncludeDirectories=""$(OGRE_PATH)/OgreMain/include";"$(OGRE_PATH)/Tools/XMLConverter/include";"$(OGRE_PATH)/Samples/Common/include";../include/IMG;../include/BBC;../include/LBBC;../include/OBA; D:\design_04_11_2005\svn\NonGTP\Boost;D:\design_04_11_2005\svn\NonGTP\ImageDebugger\include"83 AdditionalIncludeDirectories=""$(OGRE_PATH)/OgreMain/include";"$(OGRE_PATH)/Tools/XMLConverter/include";"$(OGRE_PATH)/Samples/Common/include";../include/IMG;../include/BBC;../include/LBBC;../include/OBA;../../../../../../../NonGTP\Boost;../../../../../../../NonGTP\ImageDebugger\include" 84 84 PreprocessorDefinitions="WIN32;NDEBUG;_LIB" 85 85 RuntimeLibrary="2" … … 97 97 LinkIncremental="1" 98 98 SuppressStartupBanner="TRUE" 99 AdditionalLibraryDirectories="" $(OGRE_PATH)/OgreMain/lib/$(ConfigurationName)";D:\design_04_11_2005\svn\NonGTP\ImageDebugger\lib"99 AdditionalLibraryDirectories=""../../../../../../../OGRE/trunk/ogrenew/OgreMain/lib/$(ConfigurationName)";../../../../../../../NonGTP\ImageDebugger\lib" 100 100 SubSystem="1" 101 101 OptimizeReferences="2" -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/scripts/IBRBillboardCloudTreeGeneratorCommandLine.vcproj
r751 r861 20 20 Name="VCCLCompilerTool" 21 21 Optimization="0" 22 AdditionalIncludeDirectories="../include;../include/BBC;../include/IMG;../include/OBA;../include/LBBC; "$(OGRE_PATH)/OgreMain/include";"$(OGRE_PATH)/Tools/XMLConverter/include";D:\design_04_11_2005\svn\NonGTP\Boost;D:\design_04_11_2005\svn\NonGTP\ImageDebugger\include"22 AdditionalIncludeDirectories="../include;../include/BBC;../include/IMG;../include/OBA;../include/LBBC;../../../../../../../OGRE/trunk/ogrenew/OgreMain/include;../../../../../../../OGRE/trunk/ogrenew/Tools/XMLConverter/include;../../../../../../../NonGTP/Boost;../../../../../../../NonGTP/ImageDebugger\include" 23 23 PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE" 24 24 MinimalRebuild="TRUE" … … 37 37 OutputFile="$(OutDir)/IBRBillboardCloudTreeGeneratorCmd_d.exe" 38 38 LinkIncremental="2" 39 AdditionalLibraryDirectories=""../bin/$(ConfigurationName)";" $(OGRE_PATH)/OgreMain/lib/$(ConfigurationName)";"$(OGRE_PATH)/OgreMain/lib/Release";D:\design_04_11_2005\svn\NonGTP\ImageDebugger\lib"39 AdditionalLibraryDirectories=""../bin/$(ConfigurationName)";"../../../../../../../OGRE/trunk/ogrenew/OgreMain/lib/$(ConfigurationName)";../../../../../../../OGRE/trunk/ogrenew/OgreMain/lib/Release;../../../../../../../NonGTP\ImageDebugger\lib" 40 40 GenerateDebugInformation="TRUE" 41 41 ProgramDatabaseFile="$(OutDir)/scripts.pdb" … … 71 71 <Tool 72 72 Name="VCCLCompilerTool" 73 AdditionalIncludeDirectories="../include;../include/OBA;../include/BBC;../include/IMG;../include/LBBC; "$(OGRE_PATH)/OgreMain/include";"$(OGRE_PATH)/Tools/XMLConverter/include";D:\design_04_11_2005\svn\NonGTP\Boost;D:\design_04_11_2005\svn\NonGTP\ImageDebugger\include"73 AdditionalIncludeDirectories="../include;../include/OBA;../include/BBC;../include/IMG;../include/LBBC;../../../../../../../OGRE/trunk/ogrenew/OgreMain/include;../../../../../../../OGRE/trunk/ogrenew/Tools/XMLConverter/include;../../../../../../../NonGTP\Boost;../../../../../../../NonGTP\ImageDebugger\include" 74 74 PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE" 75 75 RuntimeLibrary="0" … … 86 86 OutputFile="$(OutDir)/IBRBillboardCloudTreeGeneratorCmd.exe" 87 87 LinkIncremental="1" 88 AdditionalLibraryDirectories=""../bin/$(ConfigurationName)";" $(OGRE_PATH)/OgreMain/lib/$(ConfigurationName)";D:\design_04_11_2005\svn\NonGTP\ImageDebugger\lib"88 AdditionalLibraryDirectories=""../bin/$(ConfigurationName)";"../../../../../../../OGRE/trunk/ogrenew/OgreMain/lib/$(ConfigurationName)";../../../../../../../NonGTP\ImageDebugger\lib" 89 89 GenerateDebugInformation="TRUE" 90 90 SubSystem="1" -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/src/IBRBillboardCloudTreeApplication.cpp
r778 r861 206 206 207 207 { 208 LBBC::EntityTextureAtlasViewMode *textureAtlasFrameListenerMode; 209 textureAtlasFrameListenerMode = new LBBC::EntityTextureAtlasViewMode(mWindow,mFrameListener->getNumFrameListenerModes()); 210 textureAtlasFrameListenerMode->chooseSceneManager(); 211 textureAtlasFrameListenerMode->createCamera(); 212 textureAtlasFrameListenerMode->createViewports(); 213 textureAtlasFrameListenerMode->setTextureAtlasSize(mSampleConfigFile->getBillboardCloudDiffuseColorEntityTextureAtlasSize()); 214 textureAtlasFrameListenerMode->setTextureAtlasBitRange(mSampleConfigFile->getBillboardCloudDiffuseColorEntityTextureAtlasBitRange()); 215 textureAtlasFrameListenerMode->setTextureAtlasNumSamples(mSampleConfigFile->getBillboardCloudDiffuseColorEntityTextureAtlasNumSamples()); 216 textureAtlasFrameListenerMode->setTextureName(mSampleConfigFile->getBillboardCloudDiffuseColorEntityTextureName()); 217 textureAtlasFrameListenerMode->setTextureAtlasName(mSampleConfigFile->getBillboardCloudDiffuseColorEntityTextureAtlasName()); 218 textureAtlasFrameListenerMode->setTextureAtlasFolder(mSampleConfigFile->getBillboardCloudFolder()); 219 220 mFrameListener->addFrameListenerMode(textureAtlasFrameListenerMode); 221 textureAtlasFrameListenerMode->createScene(); 222 } 223 224 { 208 225 LBBC::BillboardViewMode *anotherFrameListenerMode; 209 226 anotherFrameListenerMode = new LBBC::BillboardViewMode(mWindow,mFrameListener->getNumFrameListenerModes()); … … 211 228 anotherFrameListenerMode->createCamera(); 212 229 anotherFrameListenerMode->createViewports(); 213 //anotherFrameListenerMode->setBillboardCloudMeshName(mSampleConfigFile->getBillboardCloudGroupedMeshName());230 anotherFrameListenerMode->setBillboardCloudMeshName(mSampleConfigFile->getBillboardCloudGroupedMeshName()); 214 231 anotherFrameListenerMode->createScene(); 215 232 mFrameListener->addFrameListenerMode(anotherFrameListenerMode); … … 222 239 anotherFrameListenerMode->createCamera(); 223 240 anotherFrameListenerMode->createViewports(); 224 //anotherFrameListenerMode->setEntityClustersMeshName(mSampleConfigFile->getEntityClustersGroupedMeshName());241 anotherFrameListenerMode->setEntityClustersMeshName(mSampleConfigFile->getEntityClustersGroupedMeshName()); 225 242 anotherFrameListenerMode->createScene(); 226 243 mFrameListener->addFrameListenerMode(anotherFrameListenerMode); -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/src/IBRBillboardCloudTreeFrameListener.cpp
r721 r861 2 2 #include "IBRBillboardCloudTreeFrameListener.h" 3 3 4 IBRBillboardCloudTreeFrameListener::IBRBillboardCloudTreeFrameListener(Ogre::RenderWindow *win, bool useBufferedInputKeys, bool useBufferedInputMouse) 5 : OgreFrameListener(win, useBufferedInputKeys, useBufferedInputMouse) 6 { 7 } 8 9 IBRBillboardCloudTreeFrameListener::~IBRBillboardCloudTreeFrameListener() 10 { 11 } 12 13 bool IBRBillboardCloudTreeFrameListener::frameStarted(const Ogre::FrameEvent& evt) 14 { 15 if (!mInputTypeSwitchingOn) 16 { 17 mInputDevice->capture(); 18 } 19 20 if ( !mUseBufferedInputMouse || !mUseBufferedInputKeys) 21 { 22 // one of the input modes is immediate, so setup what is needed for immediate mouse/key movement 23 if (mTimeUntilNextToggle >= 0) 24 { 25 mTimeUntilNextToggle -= evt.timeSinceLastFrame; 26 } 27 } 28 29 if (mUseBufferedInputKeys) 30 { 31 // no need to do any processing here, it is handled by event processor and 32 // you get the results as KeyEvents 33 } 34 else 35 { 36 if (processUnbufferedKeyInput(evt) == false) 37 { 38 return false; 39 } 40 } 41 42 //mWindow->setDebugText("P: " + mDefaultOgreFrameListenerMode->getSceneManager()->getName() + " -- " + Ogre::StringConverter::toString(mTimeUntilNextToggle)); 43 44 return mDefaultOgreFrameListenerMode->frameStarted(evt,mInputDevice); 45 } 46 47 bool IBRBillboardCloudTreeFrameListener::processUnbufferedKeyInput(const Ogre::FrameEvent& evt) 48 { 49 if( mInputDevice->isKeyDown(Ogre::KC_ESCAPE) ) 50 { 51 return false; 52 } 53 54 if (mInputDevice->isKeyDown(Ogre::KC_F1)) 55 { 56 mCurrentOgreFrameListenerMode = 0; 57 this->setEnabledFrameListenerMode(mCurrentOgreFrameListenerMode); 58 mWindow->setDebugText("P: " + mDefaultOgreFrameListenerMode->getSceneManager()->getName()); 59 60 //mTimeUntilNextToggle = 0.25; 61 } 62 63 if (mInputDevice->isKeyDown(Ogre::KC_F2)) 64 { 65 mCurrentOgreFrameListenerMode = 1; 66 this->setEnabledFrameListenerMode(mCurrentOgreFrameListenerMode); 67 mWindow->setDebugText("P: " + mDefaultOgreFrameListenerMode->getSceneManager()->getName()); 68 69 //mTimeUntilNextToggle = 0.25; 70 } 71 72 if (mInputDevice->isKeyDown(Ogre::KC_F3)) 73 { 74 mCurrentOgreFrameListenerMode = 2; 75 this->setEnabledFrameListenerMode(mCurrentOgreFrameListenerMode); 76 mWindow->setDebugText("P: " + mDefaultOgreFrameListenerMode->getSceneManager()->getName()); 77 78 //mTimeUntilNextToggle = 0.25; 79 } 80 81 if (mInputDevice->isKeyDown(Ogre::KC_F4)) 82 { 83 mCurrentOgreFrameListenerMode = 3; 84 this->setEnabledFrameListenerMode(mCurrentOgreFrameListenerMode); 85 mWindow->setDebugText("P: " + mDefaultOgreFrameListenerMode->getSceneManager()->getName()); 86 87 //mTimeUntilNextToggle = 0.25; 88 } 89 90 if (mInputDevice->isKeyDown(Ogre::KC_F5)) 91 { 92 mCurrentOgreFrameListenerMode = 4; 93 this->setEnabledFrameListenerMode(mCurrentOgreFrameListenerMode); 94 mWindow->setDebugText("P: " + mDefaultOgreFrameListenerMode->getSceneManager()->getName()); 95 96 //mTimeUntilNextToggle = 0.25; 97 } 98 99 // Return true to continue rendering 100 return true; 101 } -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/src/LBBCBillboardCloudIndirectTextureViewMode.cpp
r821 r861 164 164 Ogre::GpuProgramParametersSharedPtr fragParams; 165 165 166 fragParams = mBillboardCloudPointClusters->getSubEntity(mCurrentTexture % mBillboardCloudPointClusters->getNumSubEntities())->getMaterial()->getTechnique(0)->getPass(0)->getFragmentProgramParameters();167 fragParams->setNamedConstant("textureSize", (Ogre::Real)mTextureSize);168 mBillboardCloudPointClusters->getSubEntity(mCurrentTexture % mBillboardCloudPointClusters->getNumSubEntities())->getMaterial()->reload();169 170 166 if (mDebugTextureAtlasGeneration) 171 167 { … … 403 399 404 400 mTextureAtlas = IMG::TextureAtlasPtr( new IMG::TextureAtlas() ); 405 mTextureAtlas->create("IndirectTextureAtlas", mTextureAtlasSize, mTextureAtlasSize, mSrcPixelFormat, mCamera, Ogre::ColourValue(0.0, 0.0, 0.0 ));401 mTextureAtlas->create("IndirectTextureAtlas", mTextureAtlasSize, mTextureAtlasSize, mSrcPixelFormat, mCamera, Ogre::ColourValue(0.0, 0.0, 0.0, 0.0)); 406 402 mTextureAtlas->setTextureAtlasSceneNode(mBillboardCloudPointClustersSceneNode); 407 403 Ogre::MaterialPtr materialPtr1 = Ogre::MaterialManager::getSingleton().create("IndirectTextureAtlasMaterial", Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME); … … 415 411 416 412 mClusterTexture = IMG::TexturePtr( new IMG::Texture() ); 417 mClusterTexture->create("ClusterIndirectTexture", mTextureSize, mTextureSize, mSrcPixelFormat, mCamera, Ogre::ColourValue(0.0, 0.0, 0.0 ));413 mClusterTexture->create("ClusterIndirectTexture", mTextureSize, mTextureSize, mSrcPixelFormat, mCamera, Ogre::ColourValue(0.0, 0.0, 0.0, 0.0)); 418 414 Ogre::MaterialPtr materialPtr = Ogre::MaterialManager::getSingleton().create("IndirectTextureMaterial", Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME); 419 415 if (!mDebugTextureAtlasGeneration) -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/src/LBBCManager.cpp
r778 r861 192 192 void LBBCManager::generateEntityDistribution() 193 193 { 194 if (mSampleConfigFile->getEntityDistributionGeneration()) 195 { 196 createEntityDistribution(); 197 saveEntityDistributionSplitted(); 198 saveEntityDistributionXML(); 199 } 194 createEntityDistribution(); 195 saveEntityDistributionSplitted(); 196 saveEntityDistributionXML(); 200 197 } 201 198 … … 552 549 553 550 //vertex.uv[0] = Ogre::Vector3(wDistance / width, hDistance / height, 0.0); 554 vertex.uv[0] = Ogre::Vector3(1.0 - (hDistance / height), 1.0 - (wDistance / width), 0.0); 551 //vertex.uv[0] = Ogre::Vector3(1.0 - (hDistance / height), 1.0 - (wDistance / width), 0.0); 552 Ogre::Real numSamples = mSampleConfigFile->getBillboardCloudDiffuseColorEntityTextureAtlasNumSamples(); 553 Ogre::Real randomInt = Ogre::Math::Ceil(Ogre::Math::RangeRandom(0.5,numSamples)); 554 555 Ogre::Vector2 topLeftCorner[16]; 556 topLeftCorner[0] = Ogre::Vector2(0.0, 0.0); 557 topLeftCorner[1] = Ogre::Vector2(0.25, 0.0); 558 topLeftCorner[2] = Ogre::Vector2(0.5, 0.0); 559 topLeftCorner[3] = Ogre::Vector2(0.75, 0.0); 560 topLeftCorner[4] = Ogre::Vector2(0.0, 0.25); 561 topLeftCorner[5] = Ogre::Vector2(0.25, 0.25); 562 topLeftCorner[6] = Ogre::Vector2(0.5, 0.25); 563 topLeftCorner[7] = Ogre::Vector2(0.75, 0.25); 564 topLeftCorner[8] = Ogre::Vector2(0.0, 0.5); 565 topLeftCorner[9] = Ogre::Vector2(0.25, 0.5); 566 topLeftCorner[10] = Ogre::Vector2(0.5, 0.5); 567 topLeftCorner[11] = Ogre::Vector2(0.75, 0.5); 568 topLeftCorner[12] = Ogre::Vector2(0.0, 0.75); 569 topLeftCorner[13] = Ogre::Vector2(0.25, 0.75); 570 topLeftCorner[14] = Ogre::Vector2(0.5, 0.75); 571 topLeftCorner[15] = Ogre::Vector2(0.75, 0.75); 572 573 //vertex.uv[0] = Ogre::Vector3(randomInt / numSamples, 0.0, 0.0); 574 575 vertex.uv[0] = Ogre::Vector3(1.0 - topLeftCorner[(unsigned int)randomInt-1][0], 1.0 - topLeftCorner[(unsigned int)randomInt-1][1], 0.0); 555 576 vertex.colour = Ogre::ColourValue(Ogre::Math::RangeRandom(0.0, 1.0), Ogre::Math::RangeRandom(0.0, 1.0), Ogre::Math::RangeRandom(0.0, 1.0), 1.0).getAsRGBA(); 556 577 entity->getSubEntity(numSubEntities)->addUniqueVertex(vertex);
Note: See TracChangeset
for help on using the changeset viewer.