Changeset 745 for GTP/trunk/Lib/Illum/IBRBillboardCloudTrees
- Timestamp:
- 04/11/06 09:20:23 (19 years ago)
- Location:
- GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE
- Files:
-
- 2 added
- 30 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/include/BBC/BBC.h
r700 r745 11 11 #include <BBCBillboard.h> 12 12 #include <BBCBillboardCloud.h> 13 #include <BBCBillboardGroup.h> 14 #include <BBCBillboardClusterData.h> 13 15 #include <BBCBillboardCloudGenerator.h> 14 16 #include <BBCEntityDistributionGenerator.h> -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/include/BBC/BBCBillboard.h
r721 r745 31 31 protected: 32 32 unsigned int mBillboardHandle; 33 34 33 35 34 public: -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/include/BBC/BBCBillboardCloudSerializer.h
r721 r745 30 30 BillboardCloud * getBillboardCloud(); 31 31 32 virtual void writeBillboardCloud(TiXmlDocument *document); 32 virtual void writeBillboardCloud(TiXmlDocument *document, bool groupedBillboards); 33 34 virtual void readBillboardCloud(TiXmlDocument *document, bool groupedBillboards); 33 35 34 36 }; -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/include/BBC/BBCBillboardCloudUVMapper.h
r721 r745 46 46 void generateTextureAtlasTextureCoords(bool mergeBillboards, bool groupedBillboards = false, unsigned int numberGroups = 1); 47 47 48 void addTextureAtlasTextureCoords(bool mergeBillboards, bool groupedBillboards, unsigned int numGeneratedBillboardClouds, unsigned int iBillboardGroup );48 void addTextureAtlasTextureCoords(bool mergeBillboards, bool groupedBillboards, unsigned int numGeneratedBillboardClouds, unsigned int iBillboardGroup, unsigned int iBillboard); 49 49 50 50 void setBillboardCloud(BillboardCloud *billboardCloud); -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/include/BBC/BBCBillboardClusterData.h
r721 r745 39 39 void setEntityCluster(EntityClusterPtr value); 40 40 41 virtual void readBillboardClusterData(TiXmlNode *parentNode );41 virtual void readBillboardClusterData(TiXmlNode *parentNode, int iBillboardGroup); 42 42 43 virtual void writeBillboardClusterData(TiXmlNode *parentNode );43 virtual void writeBillboardClusterData(TiXmlNode *parentNode, int iBillboardGroup); 44 44 45 45 virtual void generateBillboardBoundingQuad(); 46 47 unsigned int getNumUVMapGroups(); 46 48 47 49 Ogre::Vector3 getQuadTopLeftCorner(); … … 53 55 Ogre::Vector3 getQuadBottomRightCorner(); 54 56 57 void setQuadTopLeftCorner(Ogre::Vector3 topLeft); 58 59 void setQuadTopRightCorner(Ogre::Vector3 topRight); 60 61 void setQuadBottomLeftCorner(Ogre::Vector3 bottomLeft); 62 63 void setQuadBottomRightCorner(Ogre::Vector3 bottomRight); 64 55 65 Ogre::Vector3 getAxisX(); 56 66 … … 59 69 Ogre::Vector3 getAxisZ(); 60 70 71 void setAxisX(Ogre::Vector3 axisX); 72 73 void setAxisY(Ogre::Vector3 axisY); 74 75 void setAxisZ(Ogre::Vector3 axisZ); 76 77 Ogre::Vector2 getBillboardUVMapMin(unsigned int iBillboardGroup); 78 79 void addBillboardUVMapMin(Ogre::Vector2 min); 80 81 void removeBillboardUVMapMin(unsigned int iBillboardGroup); 82 83 Ogre::Vector2 getBillboardUVMapMax(unsigned int iBillboardGroup); 84 85 void addBillboardUVMapMax(Ogre::Vector2 max); 86 87 void removeBillboardUVMapMax(unsigned int iBillboardGroup); 61 88 62 89 … … 80 107 81 108 Ogre::Vector3 mNormal; 109 110 std::vector<Ogre::Vector2> mGroupedBillboardUVMapMinList; 111 112 std::vector<Ogre::Vector2> mGroupedBillboardUVMapMaxList; 82 113 83 114 float mD; -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/include/BBC/BBCBillboardGroup.h
r721 r745 5 5 6 6 namespace BBC { 7 8 typedef struct9 {10 unsigned int billboardHandle;11 unsigned int width;12 unsigned int height;13 Ogre::Vector2 min;14 Ogre::Vector2 max;15 } BillboardGroupedInfo;16 7 17 8 // Forward declarations -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/include/IMG/IMGTexture.h
r731 r745 44 44 bool mCalculatedAvgColour; 45 45 46 Ogre::Camera *mCamera; 47 48 Ogre::PixelFormat mPixelFormat; 49 46 50 public: 47 51 Texture(); 48 52 49 53 virtual ~Texture(); 54 55 void setRenderTargetListener(Ogre::RenderTargetListener *renderTargetListener); 56 57 virtual void create(Ogre::String fileName, unsigned int width, unsigned int height, Ogre::PixelFormat pixelFormat, Ogre::Camera *camera); 50 58 51 59 Ogre::ColourValue getAvgColour(); … … 61 69 virtual void save(Ogre::String folderName, Ogre::String filename); 62 70 63 v oid rotate(Ogre::Real rRotation);71 virtual void update(); 64 72 65 73 void setCorners(Ogre::Real left, Ogre::Real top, Ogre::Real right, Ogre::Real bottom); … … 89 97 void bind(Ogre::String textureName); 90 98 99 void setCamera(Ogre::Camera *camera); 100 101 void setFormat(Ogre::PixelFormat pixelFormat); 102 91 103 }; 92 104 -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/include/IMG/IMGTextureAtlas.h
r731 r745 25 25 26 26 protected: 27 enum CurrentTextureAtlas 28 { 29 TEXTURE_ATLAS_PING, 30 TEXTURE_ATLAS_PONG 31 }; 32 27 33 Ogre::String mTextureAtlasName; 28 34 29 Ogre::TexturePtr mTextureAtlas; 30 31 Ogre::Camera *mCamera; 35 Ogre::Texture *mTextureAtlasPong; 32 36 33 37 Ogre::SceneNode *mTextureAtlasSceneNode; … … 35 39 std::vector<TexturePtr> mTextureList; 36 40 37 Ogre::PixelFormat mPixelFormat; 41 unsigned int mCurrentTextureAtlas; 42 43 bool mFirstUpdate; 38 44 39 45 public: … … 43 49 virtual ~TextureAtlas(); 44 50 45 unsigned int getReference(); 46 47 void setFormat(Ogre::PixelFormat pixelFormat); 51 void debug(); 48 52 49 53 void create(Ogre::String fileName, unsigned int width, unsigned int height, Ogre::PixelFormat pixelFormat, Ogre::Camera *camera); 50 54 51 void setCamera(Ogre::Camera *camera);55 void update(); 52 56 53 void update();57 unsigned int getReference(); 54 58 55 59 void setTextureAtlasSceneNode(Ogre::SceneNode *textureAtlasSceneNode); -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/include/LBBC/LBBC.h
r731 r745 10 10 #include <LBBCClusterViewMode.h> 11 11 #include <LBBCEntityTextureAtlasViewMode.h> 12 #include <LBBCBillboardCloudTextureViewMode.h> 12 13 #endif -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/include/LBBC/LBBCBillboardKMeansClusterData.h
r721 r745 14 14 virtual ~BillboardKMeansClusterData(); 15 15 16 virtual void readBillboardClusterData(TiXmlNode *parentNode );16 virtual void readBillboardClusterData(TiXmlNode *parentNode, int iBillboardGroup); 17 17 18 virtual void writeBillboardClusterData(TiXmlNode *parentNode );18 virtual void writeBillboardClusterData(TiXmlNode *parentNode, int iBillboardGroup); 19 19 20 20 virtual void generateBillboardBoundingQuad(); -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/include/LBBC/LBBCEntityTextureAtlasViewMode.h
r731 r745 40 40 virtual ~EntityTextureAtlasViewMode(); 41 41 42 void setTextureAtlasFolder(Ogre::String textureAtlasFolder);43 44 42 unsigned int nextPowerOf2(unsigned int nPlanes); 45 43 … … 58 56 void setTextureAtlasName(Ogre::String textureAtlasName); 59 57 58 void setTextureAtlasFolder(Ogre::String textureAtlasFolder); 59 60 60 void setTextureAtlasSize(unsigned int size); 61 61 }; -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/include/LBBC/LBBCKMeansClusterSerializer.h
r721 r745 15 15 virtual ~KMeansClusterSerializer(); 16 16 17 virtual void writeBillboardCloud(TiXmlDocument *document );17 virtual void writeBillboardCloud(TiXmlDocument *document, bool groupedBillboards); 18 18 19 virtual void readBillboardCloud(TiXmlDocument *document, bool groupedBillboards); 19 20 }; 20 21 -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/include/LBBC/LBBCKdTreeClusterSerializer.h
r721 r745 12 12 virtual ~KdTreeClusterSerializer(); 13 13 14 void writeBillboardCloud(TiXmlDocument *document); 14 virtual void writeBillboardCloud(TiXmlDocument *document, bool groupedBillboards); 15 16 virtual void readBillboardCloud(TiXmlDocument *document, bool groupedBillboards); 15 17 16 18 }; -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/include/LBBC/LBBCManager.h
r731 r745 21 21 ~LBBCManager(); 22 22 23 void runSampleConfigFile();24 25 23 void loadSampleConfigFile(Ogre::String sampleConfigFile); 26 24 27 25 SampleConfigFile* getSampleConfigFile(); 26 27 void initialize(); 28 28 29 29 void setSampleConfigFile(SampleConfigFile *sampleConfigFile); … … 57 57 void saveBillboardCloudXML(); 58 58 59 void saveBillboardCloudMergedXML(); 60 61 void saveBillboardCloudGroupedXML(); 62 59 63 Leaves* getLeaves(); 64 65 void loadBillboardCloudXML(); 66 67 void loadBillboardCloudGroupedXML(); 68 69 void loadBillboardCloudMergedXML(); 70 60 71 61 72 protected: -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/include/LBBC/LBBCSampleConfigFile.h
r731 r745 52 52 Ogre::String getEntityClustersMeshPrefixName(); 53 53 54 Ogre::String getEntityClustersMaterialPrefixName(); 54 Ogre::String getEntityClustersMergedMaterialPrefixName(); 55 56 Ogre::String getEntityClustersSplittedMaterialPrefixName(); 55 57 56 58 bool getBillboardCloudMergedBillboards(); -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/scripts/IBRBillboardCloudTreeGenerator.vcproj
r731 r745 162 162 </File> 163 163 <File 164 RelativePath="..\src\BBCBillboardCloudTextureGenerator.cpp">165 </File>166 <File167 164 RelativePath="..\src\BBCBillboardCloudUVMapper.cpp"> 168 165 </File> … … 213 210 Name="LBBC" 214 211 Filter=""> 212 <File 213 RelativePath="..\src\LBBCBillboardCloudTextureViewMode.cpp"> 214 </File> 215 215 <File 216 216 RelativePath="..\src\LBBCBillboardKdTreeClusterData.cpp"> … … 353 353 </File> 354 354 <File 355 RelativePath="..\include\Bbc\BBCBillboardCloudTextureGenerator.h">356 </File>357 <File358 355 RelativePath="..\include\Bbc\BBCBillboardCloudUVMapper.h"> 359 356 </File> … … 415 412 <File 416 413 RelativePath="..\include\Lbbc\LBBC.h"> 414 </File> 415 <File 416 RelativePath="..\include\Lbbc\LBBCBillboardCloudTextureViewMode.h"> 417 417 </File> 418 418 <File -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/src/BBCBillboardCloud.cpp
r721 r745 136 136 void BillboardCloud::initializeBillboardCloudGroups(unsigned int numberGroups) 137 137 { 138 139 138 Ogre::LogManager::getSingleton().logMessage("Ini.Num.Billboard Groups:" + Ogre::StringConverter::toString(getNumBillboardGroups())); 140 139 … … 164 163 if (entityCluster->getNumEntitiesClusterData() > 0) 165 164 { 165 for (unsigned int iBillboardGroup = 0; iBillboardGroup < billboard->getBillboardClusterData()->getNumUVMapGroups(); iBillboardGroup++) 166 { 167 billboard->getBillboardClusterData()->removeBillboardUVMapMax(iBillboardGroup); 168 } 166 169 numGeneratedBillboardClouds++; 167 170 } -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/src/BBCBillboardCloudSerializer.cpp
r699 r745 20 20 } 21 21 22 void BillboardCloudSerializer::writeBillboardCloud(TiXmlDocument *document )22 void BillboardCloudSerializer::writeBillboardCloud(TiXmlDocument *document, bool groupedBillboards) 23 23 { 24 24 Ogre::LogManager::getSingleton().logMessage("BillboardCloudSerializer::writeBillboardCloud method not implemented."); 25 25 } 26 26 27 void BillboardCloudSerializer::readBillboardCloud(TiXmlDocument *document, bool groupedBillboards) 28 { 29 Ogre::LogManager::getSingleton().logMessage("BillboardCloudSerializer::readBillboardCloud method not implemented."); 27 30 } 31 32 } -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/src/BBCBillboardCloudUVMapper.cpp
r731 r745 118 118 } 119 119 120 void BillboardCloudUVMapper::addTextureAtlasTextureCoords(bool mergeBillboards, bool groupedBillboards, unsigned int numGeneratedBillboardClouds, unsigned int iBillboardGroup )120 void BillboardCloudUVMapper::addTextureAtlasTextureCoords(bool mergeBillboards, bool groupedBillboards, unsigned int numGeneratedBillboardClouds, unsigned int iBillboardGroup, unsigned int iBillboard) 121 121 { 122 122 unsigned int iUniqueVertex = 0; … … 130 130 Ogre::Vector2 max = box->getMaximum(); 131 131 Ogre::Vector2 min = box->getMinimum(); 132 133 Ogre::LogManager::getSingleton().logMessage("max:" + Ogre::StringConverter::toString(Ogre::Vector3(max[0], max[1], 0.0)) ); 134 Ogre::LogManager::getSingleton().logMessage("min:" + Ogre::StringConverter::toString(Ogre::Vector3(min[0], min[1], 0.0)) ); 135 136 Ogre::Vector2 umax; 137 umax[0] = (max[0] / mTextureAtlasWidth); 138 umax[1] = (max[1] / mTextureAtlasHeight); 139 140 Ogre::Vector2 umin; 141 umin[0] = (min[0] / mTextureAtlasWidth); 142 umin[1] = (min[1] / mTextureAtlasHeight); 143 144 umin = umin * 2.0 - 1.0; 145 umax = umax * 2.0 - 1.0; 146 147 Ogre::LogManager::getSingleton().logMessage("Umax:" + Ogre::StringConverter::toString(Ogre::Vector3(umax[0], umax[1], 0.0)) ); 148 Ogre::LogManager::getSingleton().logMessage("Umin:" + Ogre::StringConverter::toString(Ogre::Vector3(umin[0], umin[1], 0.0)) ); 149 150 mBillboardCloud->getBillboard(iBillboard)->getBillboardClusterData()->addBillboardUVMapMin(umin); 151 mBillboardCloud->getBillboard(iBillboard)->getBillboardClusterData()->addBillboardUVMapMax(umax); 152 132 153 Ogre::LogManager::getSingleton().logMessage("Max:" + Ogre::StringConverter::toString(Ogre::Vector3(max[0],max[1],0)) + 133 154 "\tMin:" + Ogre::StringConverter::toString(Ogre::Vector3(min[0],min[1],0)) + 134 155 "\tSize(" + Ogre::StringConverter::toString(max[0]-min[0]) + 135 156 "," + Ogre::StringConverter::toString(max[1]-min[1]) + ")"); 157 158 Ogre::LogManager::getSingleton().logMessage( 159 "UMax:" + Ogre::StringConverter::toString(Ogre::Vector3(umax[0], umax[1],0)) + 160 "\tUMin:" + Ogre::StringConverter::toString(Ogre::Vector3(umin[0], umin[1],0)) + 161 "\tUSize(" + Ogre::StringConverter::toString(umax[0]-umin[0]) + 162 "," + Ogre::StringConverter::toString(umax[1]-umin[1]) + ")"); 163 164 std::cin.get(); 165 136 166 137 167 SubEntityPtr subEntity; … … 382 412 383 413 addTextureInBsp(iBillboardGroup, iBillboard); 384 385 addTextureAtlasTextureCoords(mergeBillboards, groupedBillboards, numGeneratedBillboardClouds, iBillboardGroup); 414 addTextureAtlasTextureCoords(mergeBillboards, groupedBillboards, numGeneratedBillboardClouds, iBillboardGroup, iBillboard); 386 415 iBillboardsInGroup++; 387 416 } … … 394 423 395 424 addTextureInBsp(iBillboardGroup, iBillboard); 396 397 addTextureAtlasTextureCoords(mergeBillboards, groupedBillboards, numGeneratedBillboardClouds, iBillboardGroup); 425 addTextureAtlasTextureCoords(mergeBillboards, groupedBillboards, numGeneratedBillboardClouds, iBillboardGroup, iBillboard); 398 426 iBillboardsInGroup++; 399 427 } … … 407 435 408 436 addTextureInBsp(iBillboardGroup, iBillboard); 409 410 addTextureAtlasTextureCoords(mergeBillboards, groupedBillboards, numGeneratedBillboardClouds, iBillboardGroup); 437 addTextureAtlasTextureCoords(mergeBillboards, groupedBillboards, numGeneratedBillboardClouds, iBillboardGroup, iBillboard); 411 438 iBillboardsInGroup++; 412 439 } -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/src/BBCBillboardClusterData.cpp
r721 r745 10 10 BillboardClusterData::~BillboardClusterData() 11 11 { 12 mGroupedBillboardUVMapMaxList.clear(); 13 mGroupedBillboardUVMapMinList.clear(); 12 14 } 13 15 … … 32 34 } 33 35 34 void BillboardClusterData::writeBillboardClusterData(TiXmlNode *parentNode )36 void BillboardClusterData::writeBillboardClusterData(TiXmlNode *parentNode, int iBillboardGroup) 35 37 { 36 38 Ogre::LogManager::getSingleton().logMessage("writeBillboardClusterData method not implemented."); 37 39 } 38 40 39 void BillboardClusterData::readBillboardClusterData(TiXmlNode *parentNode )41 void BillboardClusterData::readBillboardClusterData(TiXmlNode *parentNode, int iBillboardGroup) 40 42 { 41 43 Ogre::LogManager::getSingleton().logMessage("readBillboardClusterData method not implemented."); … … 77 79 } 78 80 81 void BillboardClusterData::setQuadTopLeftCorner(Ogre::Vector3 topLeft) 82 { 83 mBillboardCorners[QUAD_TOP_LEFT] = topLeft; 84 } 85 86 void BillboardClusterData::setQuadTopRightCorner(Ogre::Vector3 topRight) 87 { 88 mBillboardCorners[QUAD_TOP_RIGHT] = topRight; 89 } 90 91 void BillboardClusterData::setQuadBottomLeftCorner(Ogre::Vector3 bottomLeft) 92 { 93 mBillboardCorners[QUAD_BOTTOM_LEFT] = bottomLeft; 94 } 95 96 void BillboardClusterData::setQuadBottomRightCorner(Ogre::Vector3 bottomRight) 97 { 98 mBillboardCorners[QUAD_BOTTOM_RIGHT] = bottomRight; 99 } 100 79 101 Ogre::Vector3 BillboardClusterData::getAxisX() 80 102 { … … 92 114 } 93 115 116 void BillboardClusterData::setAxisX(Ogre::Vector3 axisX) 117 { 118 mAxisX = axisX; 94 119 } 120 121 void BillboardClusterData::setAxisY(Ogre::Vector3 axisY) 122 { 123 mAxisY = axisY; 124 } 125 126 void BillboardClusterData::setAxisZ(Ogre::Vector3 axisZ) 127 { 128 mAxisZ = axisZ; 129 } 130 131 Ogre::Vector2 BillboardClusterData::getBillboardUVMapMin(unsigned int iBillboardGroup) 132 { 133 return mGroupedBillboardUVMapMinList[iBillboardGroup]; 134 } 135 136 void BillboardClusterData::addBillboardUVMapMin(Ogre::Vector2 min) 137 { 138 mGroupedBillboardUVMapMinList.push_back(min); 139 } 140 141 void BillboardClusterData::removeBillboardUVMapMin(unsigned int iBillboardGroup) 142 { 143 mGroupedBillboardUVMapMinList.erase(mGroupedBillboardUVMapMinList.begin() + iBillboardGroup); 144 } 145 146 Ogre::Vector2 BillboardClusterData::getBillboardUVMapMax(unsigned int iBillboardGroup) 147 { 148 return mGroupedBillboardUVMapMaxList[iBillboardGroup]; 149 } 150 151 void BillboardClusterData::addBillboardUVMapMax(Ogre::Vector2 max) 152 { 153 mGroupedBillboardUVMapMaxList.push_back(max); 154 } 155 156 void BillboardClusterData::removeBillboardUVMapMax(unsigned int iBillboardGroup) 157 { 158 mGroupedBillboardUVMapMaxList.erase(mGroupedBillboardUVMapMaxList.begin() + iBillboardGroup); 159 } 160 161 unsigned int BillboardClusterData::getNumUVMapGroups() 162 { 163 if (mGroupedBillboardUVMapMaxList.size() == mGroupedBillboardUVMapMinList.size()) 164 { 165 return mGroupedBillboardUVMapMaxList.size(); 166 } 167 else 168 { 169 return 0; 170 } 171 } 172 173 } -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/src/IBRBillboardCloudTreeApplication.cpp
r731 r745 21 21 mSampleConfigFile = new LBBC::SampleConfigFile(); 22 22 mSampleConfigFile->load(mOpts.cfg); 23 24 this->setup(false); 23 //this->setup(false); 24 //mLBBCManager = new LBBC::LBBCManager(); 25 //mLBBCManager->setSampleConfigFile(mSampleConfigFile); 26 ////mLBBCManager->loadSampleConfigFile(mOpts.cfg); 27 //mLBBCManager->initialize(); 28 29 //if (mSampleConfigFile->getEntityDistributionGeneration()) 30 //{ 31 // mLBBCManager->generateEntityDistribution(); 32 //} 33 //else 34 //{ 35 // mLBBCManager->loadEntityDistribution(); 36 //} 37 //if (mSampleConfigFile->getEntitySampleMeshGeneration()) 38 //{ 39 // mLBBCManager->saveSingleEntity(); 40 //} 41 //if (mSampleConfigFile->getEntityClustersGeneration()) 42 //{ 43 // mLBBCManager->generateEntityClusters(); 44 //} 45 //if (mSampleConfigFile->getBillboardCloudGeneration()) 46 //{ 47 // mLBBCManager->generateBillboardCloud(); 48 //} 49 50 //mLBBCManager->shutdown(); 51 //delete mLBBCManager; 52 //mOgreBase->shutdown(); 53 //delete mOgreBase; 54 //---------------------------------------------------------------------------- 55 this->setup(true); 25 56 mLBBCManager = new LBBC::LBBCManager(); 26 57 mLBBCManager->setSampleConfigFile(mSampleConfigFile); 27 58 //mLBBCManager->loadSampleConfigFile(mOpts.cfg); 28 mLBBCManager->runSampleConfigFile(); 29 mLBBCManager->shutdown(); 30 delete mLBBCManager; 31 mOgreBase->shutdown(); 32 delete mOgreBase; 33 //---------------------------------------------------------------------------- 34 this->setup(true); 59 mLBBCManager->initialize(); 60 mLBBCManager->loadBillboardCloudMergedXML(); 35 61 this->go(); 36 62 for (unsigned int iFrameListenerMode = 0; iFrameListenerMode < mFrameListener->getNumFrameListenerModes(); iFrameListenerMode++) … … 39 65 } 40 66 mRoot->shutdown(); 41 mWindow->destroy(); 67 mWindow->destroy(); 42 68 delete mRoot; 43 69 delete mSampleConfigFile; 44 70 } 71 45 72 46 73 } … … 117 144 118 145 { 119 LBBC:: ClusterViewMode *anotherFrameListenerMode;120 anotherFrameListenerMode = new LBBC:: ClusterViewMode(mWindow,mFrameListener->getNumFrameListenerModes());146 LBBC::BillboardCloudTextureViewMode *anotherFrameListenerMode; 147 anotherFrameListenerMode = new LBBC::BillboardCloudTextureViewMode(mWindow,mFrameListener->getNumFrameListenerModes()); 121 148 anotherFrameListenerMode->chooseSceneManager(); 122 149 anotherFrameListenerMode->createCamera(); 123 150 anotherFrameListenerMode->createViewports(); 151 //anotherFrameListenerMode->setEntityName(Ogre::String(mSampleConfigFile->getEntityClustersMeshPrefixName() + "Merged.mesh")); 152 anotherFrameListenerMode->setTextureAtlasSize(mSampleConfigFile->getBillboardCloudDiffuseColorMergedBillboardsTextureAtlasSize()); 153 anotherFrameListenerMode->setTextureSize(mSampleConfigFile->getBillboardCloudDiffuseColorMergedBillboardsTextureSize()); 154 anotherFrameListenerMode->setTextureAtlasBitRange(mSampleConfigFile->getBillboardCloudDiffuseColorMergedBillboardsTextureAtlasBitRange()); 155 anotherFrameListenerMode->setTextureAtlasName(mSampleConfigFile->getBillboardCloudDiffuseColorMergedBillboardsTextureAtlasPrefixName()); 156 anotherFrameListenerMode->setTextureAtlasFolder(mSampleConfigFile->getBillboardCloudFolder()); 124 157 anotherFrameListenerMode->createScene(); 125 158 mFrameListener->addFrameListenerMode(anotherFrameListenerMode); 126 159 } 160 161 //{ 162 // LBBC::ClusterViewMode *anotherFrameListenerMode; 163 // anotherFrameListenerMode = new LBBC::ClusterViewMode(mWindow,mFrameListener->getNumFrameListenerModes()); 164 // anotherFrameListenerMode->chooseSceneManager(); 165 // anotherFrameListenerMode->createCamera(); 166 // anotherFrameListenerMode->createViewports(); 167 // anotherFrameListenerMode->createScene(); 168 // mFrameListener->addFrameListenerMode(anotherFrameListenerMode); 169 //} 127 170 128 171 //{ -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/src/IMGTexture.cpp
r731 r745 29 29 // delete mMaterial; 30 30 //} 31 } 32 33 void Texture::setRenderTargetListener(Ogre::RenderTargetListener *renderTargetListener) 34 { 35 mTexture->getBuffer(0, 0)->getRenderTarget()->addListener(renderTargetListener); 31 36 } 32 37 … … 140 145 } 141 146 142 void Texture:: rotate(Ogre::Real rRotation)143 { 144 //mTexture->setTextureRotate( Degree( -rRotation ));147 void Texture::update() 148 { 149 mTexture->getBuffer(0, 0)->getRenderTarget()->update(); 145 150 } 146 151 … … 186 191 } 187 192 188 } 193 void Texture::create(Ogre::String fileName, unsigned int width, unsigned int height, Ogre::PixelFormat pixelFormat, Ogre::Camera *camera) 194 { 195 mCamera = camera; 196 mWidth = width; 197 mHeight = height; 198 mPixelFormat = pixelFormat; 199 mTexture = Ogre::TextureManager::getSingleton().createManual(fileName, "General", Ogre::TEX_TYPE_2D, mWidth, mHeight, 0, mPixelFormat, Ogre::TU_RENDERTARGET).getPointer(); 200 mTexture->getBuffer(0, 0)->getRenderTarget(); 201 Ogre::RenderTexture *rt = mTexture->getBuffer()->getRenderTarget(); 202 rt->setAutoUpdated(false); 203 Ogre::Viewport *v = rt->addViewport(mCamera); 204 v->setClearEveryFrame(true); 205 v->setBackgroundColour(Ogre::ColourValue(1.0f, 1.0f, 1.0f, 0.0f)); 206 v->setOverlaysEnabled(false); 207 v->setDimensions(0,0,1.0,1.0); 208 Ogre::Root::getSingleton().getRenderSystem()->clearFrameBuffer(Ogre::FBT_COLOUR, Ogre::ColourValue(1.0f,1.0f,1.0f,0.0f) ); 209 } 210 211 void Texture::setCamera(Ogre::Camera *camera) 212 { 213 mCamera = camera; 214 } 215 216 217 void Texture::setFormat(Ogre::PixelFormat pixelFormat) 218 { 219 mPixelFormat = pixelFormat; 220 } 221 222 } -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/src/IMGTextureAtlas.cpp
r731 r745 8 8 mRectangle2D->setBoundingBox(Ogre::AxisAlignedBox(-100000.0 * Ogre::Vector3::UNIT_SCALE, 100000.0 * Ogre::Vector3::UNIT_SCALE)); 9 9 mRectangle2D->setRenderQueueGroup(Ogre::RENDER_QUEUE_BACKGROUND); 10 mCurrentTextureAtlas = TEXTURE_ATLAS_PING; 11 mFirstUpdate = true; 10 12 } 11 13 … … 18 20 { 19 21 return references; 22 } 23 24 void TextureAtlas::update() 25 { 26 if (mCurrentTextureAtlas == TEXTURE_ATLAS_PING) 27 { 28 if (!mFirstUpdate) 29 { 30 mMaterial->getTechnique(0)->getPass(0)->getTextureUnitState(0)->setTextureName(mTextureAtlasPong->getName()); 31 mMaterial->reload(); 32 mTexture->getBuffer(0, 0)->getRenderTarget()->update(); 33 } 34 35 if (mFirstUpdate) 36 { 37 mFirstUpdate = false; 38 mTexture->getBuffer(0, 0)->getRenderTarget()->update(); 39 } 40 } 41 else 42 { 43 mMaterial->getTechnique(0)->getPass(0)->getTextureUnitState(0)->setTextureName(mTexture->getName()); 44 mMaterial->reload(); 45 mTextureAtlasPong->getBuffer(0, 0)->getRenderTarget()->update(); 46 } 47 48 mCurrentTextureAtlas++; 49 mCurrentTextureAtlas = mCurrentTextureAtlas % 2; 20 50 } 21 51 … … 57 87 } 58 88 89 void TextureAtlas::create(Ogre::String fileName, unsigned int width, unsigned int height, Ogre::PixelFormat pixelFormat, Ogre::Camera *camera) 90 { 91 mCamera = camera; 92 mWidth = width; 93 mHeight = height; 94 mPixelFormat = pixelFormat; 95 96 { 97 mTexture = Ogre::TextureManager::getSingleton().createManual(fileName, Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, Ogre::TEX_TYPE_2D, mWidth, mHeight, 0, mPixelFormat, Ogre::TU_RENDERTARGET).getPointer(); 98 mTexture->getBuffer(0, 0)->getRenderTarget(); 99 Ogre::RenderTexture *rt = mTexture->getBuffer()->getRenderTarget(); 100 rt->setAutoUpdated(false); 101 Ogre::Viewport *v = rt->addViewport(mCamera); 102 v->setClearEveryFrame(true); 103 v->setBackgroundColour(Ogre::ColourValue(1.0f, 1.0f, 1.0f, 0.0f)); 104 v->setOverlaysEnabled(false); 105 v->setDimensions(0,0,1.0,1.0); 106 } 107 108 { 109 mTextureAtlasPong = Ogre::TextureManager::getSingleton().createManual("PONG" + fileName, Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, Ogre::TEX_TYPE_2D, mWidth, mHeight, 0, mPixelFormat, Ogre::TU_RENDERTARGET).getPointer(); 110 mTextureAtlasPong->getBuffer(0, 0)->getRenderTarget(); 111 Ogre::RenderTexture *rt = mTextureAtlasPong->getBuffer()->getRenderTarget(); 112 rt->setAutoUpdated(false); 113 Ogre::Viewport *v = rt->addViewport(mCamera); 114 v->setClearEveryFrame(true); 115 v->setBackgroundColour(Ogre::ColourValue(1.0f, 1.0f, 1.0f, 0.0f)); 116 v->setOverlaysEnabled(false); 117 v->setDimensions(0,0,1.0,1.0); 118 } 119 Ogre::Root::getSingleton().getRenderSystem()->clearFrameBuffer(Ogre::FBT_COLOUR, Ogre::ColourValue(1.0f,1.0f,1.0f,0.0f) ); 120 } 121 59 122 Ogre::SceneNode* TextureAtlas::getTextureAtlasSceneNode() 60 123 { … … 62 125 } 63 126 64 void TextureAtlas::setCamera(Ogre::Camera *camera) 65 { 66 mCamera = camera; 67 } 68 69 void TextureAtlas::update() 70 { 71 mTexture->getBuffer(0, 0)->getRenderTarget()->update(); 127 void TextureAtlas::debug() 128 { 129 Ogre::Texture *texture; 130 if (mCurrentTextureAtlas == TEXTURE_ATLAS_PONG) 131 { 132 texture = mTexture; 133 } 134 else 135 { 136 texture = mTextureAtlasPong; 137 } 138 139 unsigned char* pBufferBox = new unsigned char[texture->getBuffer(0, 0)->getSizeInBytes()]; 140 141 // Read pixels 142 Ogre::PixelBox pBox(mWidth, mHeight, 1, mPixelFormat, pBufferBox); 143 144 texture->getBuffer(0, 0)->blitToMemory(pBox); 145 146 if (mPixelFormat == Ogre::PF_FLOAT32_RGBA) 147 { 148 imdebug("rgba w=%d h=%d %p b=32f",pBox.getWidth(), pBox.getHeight(), pBox.data); 149 } 150 151 if (mPixelFormat == Ogre::PF_A8R8G8B8) 152 { 153 //unsigned char* pBufferDest = new unsigned char[pBox.getWidth()*pBox.getHeight()*4]; 154 unsigned char* pBufferDest = new unsigned char[pBox.getWidth()*pBox.getHeight()*4]; 155 Ogre::PixelBox pDest(mWidth, mHeight, 1, Ogre::PF_BYTE_RGBA, pBufferDest); 156 Ogre::PixelUtil::bulkPixelConversion(pBox.data, mPixelFormat, pDest.data, Ogre::PF_BYTE_RGBA, pBox.getWidth()*pBox.getHeight()); 157 158 imdebug("rgba w=%d h=%d %p ", pDest.getWidth(), pDest.getHeight(), pDest.data); 159 160 delete [] pBufferDest; 161 } 162 163 delete [] pBufferBox; 72 164 } 73 165 74 166 void TextureAtlas::save(Ogre::String folderName, Ogre::String fileName, Ogre::PixelFormat pixelFormat) 75 167 { 76 unsigned char* pBufferBox = new unsigned char[mTexture->getBuffer(0, 0)->getSizeInBytes()]; 77 unsigned char* pBufferDest = new unsigned char[mTexture->getBuffer(0, 0)->getSizeInBytes()]; 168 Ogre::Texture *texture; 169 170 if (mCurrentTextureAtlas == TEXTURE_ATLAS_PONG) 171 { 172 texture = mTexture; 173 } 174 else 175 { 176 texture = mTextureAtlasPong; 177 } 178 179 unsigned char* pBufferBox = new unsigned char[texture->getBuffer(0, 0)->getSizeInBytes()]; 180 unsigned char* pBufferDest = new unsigned char[texture->getBuffer(0, 0)->getSizeInBytes()]; 78 181 79 182 // Read pixels 80 183 Ogre::PixelBox pBox(mWidth, mHeight, 1, mPixelFormat, pBufferBox); 81 184 Ogre::PixelBox pDest(mWidth, mHeight, 1, pixelFormat, pBufferDest); 82 mTexture->getBuffer(0, 0)->blitToMemory(pBox);185 texture->getBuffer(0, 0)->blitToMemory(pBox); 83 186 Ogre::PixelUtil::bulkPixelConversion(pBox.data,mPixelFormat,pDest.data,pixelFormat,pBox.getWidth()*pBox.getHeight()); 84 187 … … 97 200 98 201 // Wrap buffer in a chunk 99 Ogre::MemoryDataStreamPtr stream(new Ogre::MemoryDataStream(pBufferDest, mTexture->getBuffer(0, 0)->getSizeInBytes(), false));202 Ogre::MemoryDataStreamPtr stream(new Ogre::MemoryDataStream(pBufferDest, texture->getBuffer(0, 0)->getSizeInBytes(), false)); 100 203 101 204 // Get codec … … 124 227 } 125 228 126 void TextureAtlas::setFormat(Ogre::PixelFormat pixelFormat) 127 { 128 mPixelFormat = pixelFormat; 129 } 130 131 void TextureAtlas::create(Ogre::String fileName, unsigned int width, unsigned int height, Ogre::PixelFormat pixelFormat, Ogre::Camera *camera) 132 { 133 mCamera = camera; 134 mWidth = width; 135 mHeight = height; 136 mPixelFormat = pixelFormat; 137 mTexture = Ogre::TextureManager::getSingleton().createManual(fileName, "General", Ogre::TEX_TYPE_2D, mWidth, mHeight, 0, mPixelFormat, Ogre::TU_RENDERTARGET).getPointer(); 138 mTexture->getBuffer(0, 0)->getRenderTarget(); 139 Ogre::RenderTexture *rt = mTexture->getBuffer()->getRenderTarget(); 140 rt->setAutoUpdated(false); 141 Ogre::Viewport *v = rt->addViewport(mCamera); 142 v->setClearEveryFrame(true); 143 v->setBackgroundColour(Ogre::ColourValue(1.0f, 1.0f, 1.0f, 0.0f)); 144 v->setOverlaysEnabled(false); 145 v->setDimensions(0,0,1.0,1.0); 146 Ogre::Root::getSingleton().getRenderSystem()->clearFrameBuffer(Ogre::FBT_COLOUR, Ogre::ColourValue(1.0f,1.0f,1.0f,0.0f) ); 147 } 148 149 } 229 } -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/src/LBBCBillboardKMeansClusterData.cpp
r731 r745 10 10 } 11 11 12 void BillboardKMeansClusterData::readBillboardClusterData(TiXmlNode * parentNode)12 void BillboardKMeansClusterData::readBillboardClusterData(TiXmlNode *billboardNode, int iBillboardGroup) 13 13 { 14 15 } 16 17 void BillboardKMeansClusterData::writeBillboardClusterData(TiXmlNode *parentNode) 14 TiXmlNode *coord4dNode = billboardNode->FirstChild("coord4d"); 15 Ogre::Vector3 normal; 16 normal[0] = Ogre::StringConverter::parseReal(coord4dNode->ToElement()->Attribute("nx")); 17 normal[1] = Ogre::StringConverter::parseReal(coord4dNode->ToElement()->Attribute("ny")); 18 normal[2] = Ogre::StringConverter::parseReal(coord4dNode->ToElement()->Attribute("nz")); 19 this->setNormal(normal); 20 21 TiXmlNode *topLeftNode = billboardNode->FirstChild("topLeft"); 22 Ogre::Vector3 topLeft; 23 topLeft[0] = Ogre::StringConverter::parseReal(topLeftNode->ToElement()->Attribute("x")); 24 topLeft[1] = Ogre::StringConverter::parseReal(topLeftNode->ToElement()->Attribute("y")); 25 topLeft[2] = Ogre::StringConverter::parseReal(topLeftNode->ToElement()->Attribute("z")); 26 this->setQuadTopLeftCorner(topLeft); 27 28 TiXmlNode *topRightNode = billboardNode->FirstChild("topRight"); 29 Ogre::Vector3 topRight; 30 topRight[0] = Ogre::StringConverter::parseReal(topRightNode->ToElement()->Attribute("x")); 31 topRight[1] = Ogre::StringConverter::parseReal(topRightNode->ToElement()->Attribute("y")); 32 topRight[2] = Ogre::StringConverter::parseReal(topRightNode->ToElement()->Attribute("z")); 33 this->setQuadTopRightCorner(topRight); 34 35 TiXmlNode *bottomRightNode = billboardNode->FirstChild("bottomRight"); 36 Ogre::Vector3 bottomRight; 37 bottomRight[0] = Ogre::StringConverter::parseReal(bottomRightNode->ToElement()->Attribute("x")); 38 bottomRight[1] = Ogre::StringConverter::parseReal(bottomRightNode->ToElement()->Attribute("y")); 39 bottomRight[2] = Ogre::StringConverter::parseReal(bottomRightNode->ToElement()->Attribute("z")); 40 this->setQuadBottomRightCorner(bottomRight); 41 42 TiXmlNode *bottomLeftNode = billboardNode->FirstChild("bottomLeft"); 43 Ogre::Vector3 bottomLeft; 44 bottomLeft[0] = Ogre::StringConverter::parseReal(bottomLeftNode->ToElement()->Attribute("x")); 45 bottomLeft[1] = Ogre::StringConverter::parseReal(bottomLeftNode->ToElement()->Attribute("y")); 46 bottomLeft[2] = Ogre::StringConverter::parseReal(bottomLeftNode->ToElement()->Attribute("z")); 47 this->setQuadBottomLeftCorner(bottomLeft); 48 49 TiXmlNode *axisXNode = billboardNode->FirstChild("axisX"); 50 Ogre::Vector3 axisX; 51 axisX[0] = Ogre::StringConverter::parseReal(axisXNode->ToElement()->Attribute("x")); 52 axisX[1] = Ogre::StringConverter::parseReal(axisXNode->ToElement()->Attribute("y")); 53 axisX[2] = Ogre::StringConverter::parseReal(axisXNode->ToElement()->Attribute("z")); 54 this->setAxisX(axisX); 55 56 TiXmlNode *axisYNode = billboardNode->FirstChild("axisY"); 57 Ogre::Vector3 axisY; 58 axisY[0] = Ogre::StringConverter::parseReal(axisYNode->ToElement()->Attribute("x")); 59 axisY[1] = Ogre::StringConverter::parseReal(axisYNode->ToElement()->Attribute("y")); 60 axisY[2] = Ogre::StringConverter::parseReal(axisYNode->ToElement()->Attribute("z")); 61 this->setAxisY(axisY); 62 63 TiXmlNode *axisZNode = billboardNode->FirstChild("axisZ"); 64 Ogre::Vector3 axisZ; 65 axisZ[0] = Ogre::StringConverter::parseReal(axisZNode->ToElement()->Attribute("x")); 66 axisZ[1] = Ogre::StringConverter::parseReal(axisZNode->ToElement()->Attribute("y")); 67 axisZ[2] = Ogre::StringConverter::parseReal(axisZNode->ToElement()->Attribute("z")); 68 this->setAxisZ(axisZ); 69 70 if (iBillboardGroup >= 0) 71 { 72 TiXmlNode *uvMapMinNode = billboardNode->FirstChild("uvMapMin"); 73 Ogre::Vector2 uvMapMin; 74 uvMapMin[0] = Ogre::StringConverter::parseReal(uvMapMinNode->ToElement()->Attribute("x")); 75 uvMapMin[1] = Ogre::StringConverter::parseReal(uvMapMinNode->ToElement()->Attribute("y")); 76 this->addBillboardUVMapMin(uvMapMin); 77 78 TiXmlNode *uvMapMaxNode = billboardNode->FirstChild("uvMapMax"); 79 Ogre::Vector2 uvMapMax; 80 uvMapMax[0] = Ogre::StringConverter::parseReal(uvMapMaxNode->ToElement()->Attribute("x")); 81 uvMapMax[1] = Ogre::StringConverter::parseReal(uvMapMaxNode->ToElement()->Attribute("y")); 82 this->addBillboardUVMapMax(uvMapMax); 83 } 84 } 85 86 void BillboardKMeansClusterData::writeBillboardClusterData(TiXmlNode *parentNode, int iBillboardGroup) 18 87 { 19 88 BBC::EntityClusterPtr entityCluster = getEntityCluster(); … … 32 101 TiXmlNode *billboardNode; 33 102 TiXmlNode *coord4dNode; 103 TiXmlNode *uvMapMin; 104 TiXmlNode *uvMapMax; 34 105 TiXmlNode *quadTopRightCornerNode; 35 106 TiXmlNode *quadTopLeftCornerNode; … … 107 178 Ogre::String sAZZ = Ogre::StringConverter::toString(getAxisZ().z); 108 179 axisZNode->ToElement()->SetAttribute("z",sAZZ.c_str()); 180 181 if (iBillboardGroup >= 0) 182 { 183 uvMapMin = billboardNode->ToElement()->InsertEndChild(TiXmlElement("uvMapMin"))->ToElement(); 184 Ogre::String sUvMapMinX = Ogre::StringConverter::toString(this->getBillboardUVMapMin(iBillboardGroup).x); 185 uvMapMin->ToElement()->SetAttribute("x",sUvMapMinX.c_str()); 186 Ogre::String sUvMapMinY = Ogre::StringConverter::toString(this->getBillboardUVMapMin(iBillboardGroup).y); 187 uvMapMin->ToElement()->SetAttribute("y",sUvMapMinY.c_str()); 188 189 uvMapMax = billboardNode->ToElement()->InsertEndChild(TiXmlElement("uvMapMax"))->ToElement(); 190 Ogre::String suvMapMaxX = Ogre::StringConverter::toString(this->getBillboardUVMapMax(iBillboardGroup).x); 191 uvMapMax->ToElement()->SetAttribute("x",suvMapMaxX.c_str()); 192 Ogre::String suvMapMaxY = Ogre::StringConverter::toString(this->getBillboardUVMapMax(iBillboardGroup).y); 193 uvMapMax->ToElement()->SetAttribute("y",suvMapMaxY.c_str()); 194 } 109 195 110 196 leavesNode = billboardNode->ToElement()->InsertEndChild(TiXmlElement("leaves"))->ToElement(); -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/src/LBBCEntityTextureAtlasViewMode.cpp
r731 r745 75 75 else // mBitRange == 8 76 76 { 77 mDestPixelFormat = Ogre::PF_ A8R8G8B8;77 mDestPixelFormat = Ogre::PF_BYTE_RGBA; 78 78 } 79 79 80 80 mTextureAtlas->update(); 81 mTextureAtlas->debug(); 82 std::cin.get(); 81 83 mTextureAtlas->save(mTextureAtlasFolder, mTextureAtlasName, mDestPixelFormat); 82 84 mTextureAtlasGenerated = true; … … 122 124 IMG::TexturePtr texturePtr ( new IMG::Texture() ); 123 125 texturePtr->bind(mTextureName); 124 Ogre::MaterialPtr materialPtr = Ogre::MaterialManager::getSingleton().create("TextureAtlas" + Ogre::StringConverter::toString(numSubTextures), "General");126 Ogre::MaterialPtr materialPtr = Ogre::MaterialManager::getSingleton().create("TextureAtlas" + Ogre::StringConverter::toString(numSubTextures), Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME); 125 127 materialPtr->getTechnique(0)->getPass(0)->setDiffuse( 1.0, 1.0, 1.0, 0.0); 126 materialPtr->getTechnique(0)->getPass(0)->setAmbient( texturePtr->getAvgColour() ); 127 128 materialPtr->getTechnique(0)->getPass(0)->setAmbient( texturePtr->getAvgColour() ); 128 129 mTextureAtlas->setMaterial(materialPtr.getPointer()); 129 130 mTextureAtlas->setCorners(-1.0, 1.0, 1.0, -1.0); … … 132 133 { 133 134 IMG::TexturePtr texturePtr = IMG::TexturePtr( new IMG::Texture() ); 134 Ogre::MaterialPtr materialPtr = Ogre::MaterialManager::getSingleton().create("TextureAtlas" + Ogre::StringConverter::toString(iSubTexture), "General"); 135 materialPtr->getTechnique(0)->getPass(0)->setAmbient( 1.0, Ogre::Math::RangeRandom(0.5,1.0), 1.0 ); 135 Ogre::MaterialPtr materialPtr = Ogre::MaterialManager::getSingleton().create("TextureAtlas" + Ogre::StringConverter::toString(iSubTexture), Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME); 136 136 materialPtr->getTechnique(0)->getPass(0)->setAmbient(maxTexCoords[0], maxTexCoords[1], 1.0 ); 137 137 materialPtr->getTechnique(0)->getPass(0)->setDiffuse( 1.0, 1.0, 1.0, 1.0); 138 138 materialPtr->getTechnique(0)->getPass(0)->setAlphaRejectSettings(Ogre::CMPF_GREATER_EQUAL, 10); 139 139 materialPtr->getTechnique(0)->getPass(0)->createTextureUnitState(mTextureName, 0); 140 materialPtr->getTechnique(0)->getPass(0)->getTextureUnitState(0)->setTextureFiltering(Ogre::FO_NONE, Ogre::FO_NONE, Ogre::FO_NONE); 140 141 materialPtr->getTechnique(0)->getPass(0)->getTextureUnitState(0)->setTextureAddressingMode(Ogre::TextureUnitState::TAM_CLAMP); 141 142 materialPtr->getTechnique(0)->getPass(0)->getTextureUnitState(0)->setTextureRotate(Ogre::Radian(Ogre::Degree(degree))); 142 materialPtr->getTechnique(0)->getPass(0)->getTextureUnitState(0)->setTextureFiltering(Ogre::FO_NONE, Ogre::FO_NONE, Ogre::FO_NONE);143 143 materialPtr->getTechnique(0)->getPass(0)->setLightingEnabled(false); 144 144 -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/src/LBBCKMeansClusterSerializer.cpp
r721 r745 10 10 } 11 11 12 void KMeansClusterSerializer::writeBillboardCloud(TiXmlDocument *document) 12 void KMeansClusterSerializer::readBillboardCloud(TiXmlDocument *document, bool groupedBillboards) 13 { 14 TiXmlNode *billboardCloudNode = document->FirstChild("billboardCloud"); 15 TiXmlNode *billboardGroupsNode = billboardCloudNode->FirstChild("billboardGroups"); 16 17 unsigned int numBillboardGroups = Ogre::StringConverter::parseInt(billboardGroupsNode->ToElement()->Attribute("count")); 18 19 for (unsigned int iBillboardGroup = 0; iBillboardGroup < numBillboardGroups; iBillboardGroup++) 20 { 21 TiXmlNode *billboardGroupNode = billboardGroupsNode->FirstChild("billboardGroup"); 22 23 unsigned int numBillboards = Ogre::StringConverter::parseInt(billboardGroupNode->ToElement()->Attribute("count")); 24 25 if (!groupedBillboards) 26 { 27 for (TiXmlNode *billboardNode = billboardGroupNode->FirstChild("billboard"); billboardNode; billboardNode = billboardNode->NextSibling() ) 28 { 29 BBC::BillboardPtr billboard = BBC::BillboardPtr( new BBC::Billboard() ); 30 BBC::BillboardClusterDataPtr billboardClusterData = BBC::BillboardClusterDataPtr( new BillboardKMeansClusterData() ); 31 mBillboardCloud->addBillboard(billboard); 32 billboard->setBillboardClusterData(billboardClusterData); 33 billboard->getBillboardClusterData()->readBillboardClusterData(billboardNode, -1); 34 } 35 } 36 else 37 { 38 BBC::BillboardGroupPtr billboardGroup = BBC::BillboardGroupPtr( new BBC::BillboardGroup() ); 39 mBillboardCloud->addBillboardGroup(billboardGroup); 40 41 for (TiXmlNode *billboardNode = billboardGroupNode->FirstChild("billboard"); billboardNode; billboardNode = billboardNode->NextSibling() ) 42 { 43 BBC::BillboardPtr billboard = BBC::BillboardPtr( new BBC::Billboard() ); 44 BBC::BillboardClusterDataPtr billboardClusterData = BBC::BillboardClusterDataPtr( new BillboardKMeansClusterData() ); 45 mBillboardCloud->addBillboard(billboard); 46 billboard->setBillboardClusterData(billboardClusterData); 47 billboard->getBillboardClusterData()->readBillboardClusterData(billboardNode, iBillboardGroup); 48 billboardGroup->addBillboardHandle(billboard->getBillboardHandle()); 49 } 50 } 51 } 52 } 53 54 void KMeansClusterSerializer::writeBillboardCloud(TiXmlDocument *document, bool groupedBillboards) 13 55 { 14 56 TiXmlNode *billboardCloudNode = document->InsertEndChild(TiXmlElement("billboardCloud"))->ToElement(); 15 57 16 unsigned int numSerializedBillboards = 0;17 unsigned int numSerializedEntities = 0; 18 for (unsigned int iBillboard = 0; iBillboard < mBillboardCloud->getNumBillboards(); iBillboard++)58 TiXmlNode *billboardGroupsNode = billboardCloudNode->InsertEndChild(TiXmlElement("billboardGroups"))->ToElement(); 59 60 if (!groupedBillboards) 19 61 { 20 BBC::BillboardPtr billboard = mBillboardCloud->getBillboard(iBillboard);21 BBC::EntityClusterPtr entityCluster = billboard->getBillboardClusterData()->getEntityCluster();62 billboardGroupsNode->ToElement()->SetAttribute("count",Ogre::StringConverter::toString(1)); 63 TiXmlNode *billboardGroupNode = billboardGroupsNode->InsertEndChild(TiXmlElement("billboardGroup"))->ToElement(); 22 64 23 // If the Billboard has Entities... 24 if (entityCluster->getNumEntitiesClusterData() > 0) 65 unsigned int numSerializedBillboards = 0; 66 unsigned int numSerializedEntities = 0; 67 for (unsigned int iBillboard = 0; iBillboard < mBillboardCloud->getNumBillboards(); iBillboard++) 25 68 { 26 BillboardKMeansClusterData *billboardKMeansClusterData = (BillboardKMeansClusterData*)billboard->getBillboardClusterData().get(); 27 billboardKMeansClusterData->writeBillboardClusterData(billboardCloudNode); 28 numSerializedBillboards++; 29 numSerializedEntities = numSerializedEntities + entityCluster->getNumEntitiesClusterData(); 69 BBC::BillboardPtr billboard = mBillboardCloud->getBillboard(iBillboard); 70 BBC::EntityClusterPtr entityCluster = billboard->getBillboardClusterData()->getEntityCluster(); 71 72 // If the Billboard has Entities... 73 if (entityCluster->getNumEntitiesClusterData() > 0) 74 { 75 BillboardKMeansClusterData *billboardKMeansClusterData = (BillboardKMeansClusterData*)billboard->getBillboardClusterData().get(); 76 billboardKMeansClusterData->writeBillboardClusterData(billboardGroupNode, -1); 77 numSerializedBillboards++; 78 numSerializedEntities = numSerializedEntities + entityCluster->getNumEntitiesClusterData(); 79 } 30 80 } 81 billboardGroupNode->ToElement()->SetAttribute("count",Ogre::StringConverter::toString(numSerializedBillboards)); 82 Ogre::LogManager::getSingleton().logMessage("Num.Serialized Billboards:" + Ogre::StringConverter::toString(numSerializedBillboards) + " with " + Ogre::StringConverter::toString(numSerializedEntities) + " Entities"); 31 83 } 32 billboardCloudNode->ToElement()->SetAttribute("count",Ogre::StringConverter::toString(numSerializedBillboards)); 33 34 Ogre::LogManager::getSingleton().logMessage("Num.Serialized Billboards:" + Ogre::StringConverter::toString(numSerializedBillboards) + " with " + Ogre::StringConverter::toString(numSerializedEntities) + " Entities"); 84 else 85 { 86 billboardGroupsNode->ToElement()->SetAttribute("count",Ogre::StringConverter::toString(mBillboardCloud->getNumBillboardGroups())); 87 88 unsigned int numSerializedBillboards = 0; 89 unsigned int numSerializedEntities = 0; 90 91 for (unsigned int iBillboardGroup = 0; iBillboardGroup < mBillboardCloud->getNumBillboardGroups(); iBillboardGroup++) 92 { 93 TiXmlNode *billboardGroupNode = billboardGroupsNode->InsertEndChild(TiXmlElement("billboardGroup"))->ToElement(); 94 95 for (unsigned int iBillboard = 0; iBillboard < mBillboardCloud->getBillboardGroup(iBillboardGroup)->getNumBillboards(); iBillboard++) 96 { 97 BBC::BillboardPtr billboard = mBillboardCloud->getBillboard(mBillboardCloud->getBillboardGroup(iBillboardGroup)->getBillboardHandle(iBillboard)); 98 BBC::EntityClusterPtr entityCluster = billboard->getBillboardClusterData()->getEntityCluster(); 99 100 // If the Billboard has Entities... 101 if (entityCluster->getNumEntitiesClusterData() > 0) 102 { 103 BillboardKMeansClusterData *billboardKMeansClusterData = (BillboardKMeansClusterData*)billboard->getBillboardClusterData().get(); 104 billboardKMeansClusterData->writeBillboardClusterData(billboardGroupNode, iBillboardGroup); 105 numSerializedBillboards++; 106 numSerializedEntities = numSerializedEntities + entityCluster->getNumEntitiesClusterData(); 107 } 108 } 109 billboardGroupNode->ToElement()->SetAttribute("count",Ogre::StringConverter::toString(mBillboardCloud->getBillboardGroup(iBillboardGroup)->getNumBillboards())); 110 } 111 112 Ogre::LogManager::getSingleton().logMessage("Num.Serialized Billboards:" + Ogre::StringConverter::toString(numSerializedBillboards) + " with " + Ogre::StringConverter::toString(numSerializedEntities) + " Entities"); 113 } 35 114 } 36 115 -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/src/LBBCKdTreeClusterSerializer.cpp
r721 r745 4 4 namespace LBBC { 5 5 6 KdTreeClusterSerializer::KdTreeClusterSerializer() { 6 KdTreeClusterSerializer::KdTreeClusterSerializer() 7 { 7 8 } 8 9 9 KdTreeClusterSerializer::~KdTreeClusterSerializer() { 10 KdTreeClusterSerializer::~KdTreeClusterSerializer() 11 { 10 12 } 11 13 12 void KdTreeClusterSerializer::writeBillboardCloud(TiXmlDocument *document) { 14 void KdTreeClusterSerializer::writeBillboardCloud(TiXmlDocument *document, bool groupedBillboards) 15 { 13 16 } 14 17 18 void KdTreeClusterSerializer::readBillboardCloud(TiXmlDocument *document, bool groupedBillboards) 19 { 20 } 15 21 16 22 } -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/src/LBBCLeafDistributionSerializer.cpp
r721 r745 33 33 34 34 unsigned numEntities = Ogre::StringConverter::parseInt(leavesNode->ToElement()->Attribute("count")); 35 float dMin = Ogre::StringConverter::parse Int(leavesNode->ToElement()->Attribute("dMin"));36 float dMax = Ogre::StringConverter::parse Int(leavesNode->ToElement()->Attribute("dMax"));37 float nXMin = Ogre::StringConverter::parse Int(leavesNode->ToElement()->Attribute("nXMin"));38 float nXMax = Ogre::StringConverter::parse Int(leavesNode->ToElement()->Attribute("nXMax"));39 float nYMin = Ogre::StringConverter::parse Int(leavesNode->ToElement()->Attribute("nYMin"));40 float nYMax = Ogre::StringConverter::parse Int(leavesNode->ToElement()->Attribute("nYMax"));41 float nZMin = Ogre::StringConverter::parse Int(leavesNode->ToElement()->Attribute("nZMin"));42 float nZMax = Ogre::StringConverter::parse Int(leavesNode->ToElement()->Attribute("nZMax"));35 float dMin = Ogre::StringConverter::parseReal(leavesNode->ToElement()->Attribute("dMin")); 36 float dMax = Ogre::StringConverter::parseReal(leavesNode->ToElement()->Attribute("dMax")); 37 float nXMin = Ogre::StringConverter::parseReal(leavesNode->ToElement()->Attribute("nXMin")); 38 float nXMax = Ogre::StringConverter::parseReal(leavesNode->ToElement()->Attribute("nXMax")); 39 float nYMin = Ogre::StringConverter::parseReal(leavesNode->ToElement()->Attribute("nYMin")); 40 float nYMax = Ogre::StringConverter::parseReal(leavesNode->ToElement()->Attribute("nYMax")); 41 float nZMin = Ogre::StringConverter::parseReal(leavesNode->ToElement()->Attribute("nZMin")); 42 float nZMax = Ogre::StringConverter::parseReal(leavesNode->ToElement()->Attribute("nZMax")); 43 43 44 44 mLeafDistribution->setMinD(dMin); -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/src/LBBCManager.cpp
r731 r745 69 69 } 70 70 71 void LBBCManager:: runSampleConfigFile()71 void LBBCManager::initialize() 72 72 { 73 73 mLeaves = new Leaves(); 74 75 74 BBC::EntityPtr entityLeaves(new BBC::Entity); 76 75 BBC::MeshPtr meshLeaves(new BBC::Mesh(this->loadMesh(mSampleConfigFile->getEntitiesFolder(), mSampleConfigFile->getEntitiesMeshPrefixName() + ".mesh")) ); … … 78 77 mLeaves->setEntity(entityLeaves); 79 78 mLeaves->getEntity()->setMesh(meshLeaves); 80 81 if (mSampleConfigFile->getEntityDistributionGeneration())82 {83 generateEntityDistribution();84 }85 else86 {87 loadEntityDistribution();88 }89 90 if (mSampleConfigFile->getEntitySampleMeshGeneration())91 {92 saveSingleEntity();93 }94 95 if (mSampleConfigFile->getEntityClustersGeneration())96 {97 generateEntityClusters();98 }99 100 if (mSampleConfigFile->getBillboardCloudGeneration())101 {102 generateBillboardCloud();103 }104 105 79 } 106 80 … … 265 239 void LBBCManager::saveBillboardCloudMerged() 266 240 { 267 //mLeaves->getBillboardCloud()->getEntity()->getSubEntity(0)->setMaterialName(mSampleConfigFile->getBillboardCloudMaterialPrefixName());268 //mOgreMeshSerializer->setEntity(mLeaves->getBillboardCloud()->getEntity());269 //mOgreMeshSerializer->exportMesh(mSampleConfigFile->getBillboardCloudFolder() +270 // mSampleConfigFile->getBillboardCloudMeshPrefixName() + "Merged.mesh", mSampleConfigFile->getBillboardCloudMergedBillboards(), false);271 //OBA::OgreBase::getSingleton().getMeshSerializer()->exportMesh(mLeaves->getBillboardCloud()->getEntity()->getMesh(),272 // mSampleConfigFile->getBillboardCloudFolder() + mSampleConfigFile->getBillboardCloudMeshPrefixName() + "Merged.mesh");273 //OBA::OgreBase::getSingleton().getXMLMeshSerializer()->exportMesh(mLeaves->getBillboardCloud()->getEntity()->getMesh(), mSampleConfigFile->getBillboardCloudFolder() + mSampleConfigFile->getBillboardCloudMeshPrefixName() + "Merged.mesh.xml");274 275 276 241 for (unsigned int iSubEntity = 0; iSubEntity < mLeaves->getBillboardCloud()->getEntity()->getNumSubEntities(); iSubEntity++) 277 242 { … … 290 255 void LBBCManager::saveBillboardCloudXML() 291 256 { 292 //saveBillboardCloud()293 257 TiXmlDocument *document2 = mBillboardCloudSerializer->create( 294 258 mSampleConfigFile->getBillboardCloudFolder() + 295 259 mSampleConfigFile->getBillboardCloudXMLPrefixName() + ".xml"); 296 260 mBillboardCloudSerializer->setBillboardCloud(mLeaves->getBillboardCloud()); 297 mBillboardCloudSerializer->writeBillboardCloud(document2 );261 mBillboardCloudSerializer->writeBillboardCloud(document2, false); 298 262 mBillboardCloudSerializer->save(); 263 } 264 265 void LBBCManager::saveBillboardCloudGroupedXML() 266 { 267 TiXmlDocument *document2 = mBillboardCloudSerializer->create( 268 mSampleConfigFile->getBillboardCloudFolder() + 269 mSampleConfigFile->getBillboardCloudXMLPrefixName() + "Grouped.xml"); 270 mBillboardCloudSerializer->setBillboardCloud(mLeaves->getBillboardCloud()); 271 mBillboardCloudSerializer->writeBillboardCloud(document2, true); 272 mBillboardCloudSerializer->save(); 273 } 274 275 void LBBCManager::saveBillboardCloudMergedXML() 276 { 277 TiXmlDocument *document2 = mBillboardCloudSerializer->create( 278 mSampleConfigFile->getBillboardCloudFolder() + 279 mSampleConfigFile->getBillboardCloudXMLPrefixName() + "Merged.xml"); 280 mBillboardCloudSerializer->setBillboardCloud(mLeaves->getBillboardCloud()); 281 mBillboardCloudSerializer->writeBillboardCloud(document2, true); 282 mBillboardCloudSerializer->save(); 283 } 284 285 void LBBCManager::loadBillboardCloudXML() 286 { 287 TiXmlDocument *document = mBillboardCloudSerializer->load( 288 mSampleConfigFile->getBillboardCloudFolder() + 289 mSampleConfigFile->getBillboardCloudXMLPrefixName() + ".xml"); 290 291 mBillboardCloudSerializer->setBillboardCloud(mLeaves->getBillboardCloud()); 292 mBillboardCloudSerializer->readBillboardCloud(document, false); 293 } 294 295 void LBBCManager::loadBillboardCloudGroupedXML() 296 { 297 TiXmlDocument *document = mBillboardCloudSerializer->load( 298 mSampleConfigFile->getBillboardCloudFolder() + 299 mSampleConfigFile->getBillboardCloudXMLPrefixName() + "Grouped.xml"); 300 301 mBillboardCloudSerializer->setBillboardCloud(mLeaves->getBillboardCloud()); 302 mBillboardCloudSerializer->readBillboardCloud(document, true); 303 } 304 305 void LBBCManager::loadBillboardCloudMergedXML() 306 { 307 TiXmlDocument *document = mBillboardCloudSerializer->load( 308 mSampleConfigFile->getBillboardCloudFolder() + 309 mSampleConfigFile->getBillboardCloudXMLPrefixName() + "Merged.xml"); 310 311 mBillboardCloudSerializer->setBillboardCloud(mLeaves->getBillboardCloud()); 312 mBillboardCloudSerializer->readBillboardCloud(document, true); 299 313 } 300 314 … … 316 330 { 317 331 BBC::EntityPtr entityClusterized = entityCluster->getEntity(); 318 entityClusterized->getSubEntity(0)->setMaterialName(mSampleConfigFile->getEntityClusters MaterialPrefixName());332 entityClusterized->getSubEntity(0)->setMaterialName(mSampleConfigFile->getEntityClustersSplittedMaterialPrefixName()); 319 333 mOgreMeshSerializer->setEntity(entityClusterized); 320 334 mOgreMeshSerializer->exportMesh(mSampleConfigFile->getEntityDistributionFolder() + … … 346 360 { 347 361 BBC::EntityPtr entityClusterized = entityCluster->getEntity(); 348 entityClusterized->getSubEntity(0)->setMaterialName(mSampleConfigFile->getEntityClustersM aterialPrefixName());362 entityClusterized->getSubEntity(0)->setMaterialName(mSampleConfigFile->getEntityClustersMergedMaterialPrefixName()); 349 363 BBC::SubEntityPtr subEntity = entityClusterized->getSubEntity(0); 350 364 … … 367 381 368 382 Ogre::LogManager::getSingleton().logMessage(" Mesh Generation --" + Ogre::StringConverter::toString(numSerializedBillboards)); 369 383 370 384 mOgreMeshSerializer->setEntity(entity); 371 385 mOgreMeshSerializer->exportMesh(mSampleConfigFile->getEntityClustersFolder() + … … 409 423 void LBBCManager::generateBillboardCloud() 410 424 { 425 426 if (mSampleConfigFile->getBillboardCloudGroupedBillboards()) 427 { 428 mLeaves->getBillboardCloud()->generateBillboardCloud(false); 429 mLeaves->getBillboardCloud()->initializeBillboardCloudGroups(mSampleConfigFile->getBillboardCloudGroups()); 430 431 if (mSampleConfigFile->getBillboardCloudDiffuseColorBillboardGroupTextureAtlasGeneration()) 432 { 433 mBillboardCloudUVMapper->shutdown(); 434 mBillboardCloudUVMapper->setBillboardCloud(mLeaves->getBillboardCloud()); 435 mBillboardCloudUVMapper->setTextureWidth(mSampleConfigFile->getBillboardCloudDiffuseColorBillboardGroupTextureSize()); 436 mBillboardCloudUVMapper->setTextureHeight(mSampleConfigFile->getBillboardCloudDiffuseColorBillboardGroupTextureSize()); 437 mBillboardCloudUVMapper->setTextureAtlasWidth(mSampleConfigFile->getBillboardCloudDiffuseColorBillboardGroupTextureAtlasSize()); 438 mBillboardCloudUVMapper->setTextureAtlasHeight(mSampleConfigFile->getBillboardCloudDiffuseColorBillboardGroupTextureAtlasSize()); 439 mBillboardCloudUVMapper->initialize(); 440 mBillboardCloudUVMapper->generateTextureAtlasTextureCoords(false, mSampleConfigFile->getBillboardCloudGroupedBillboards(), mSampleConfigFile->getBillboardCloudGroups()); 441 442 mLeaves->getBillboardCloud()->generateBillboardCloudGroups(); 443 //saveBillboardCloudGrouped(); 444 //saveBillboardCloudGroupedXML(); 445 } 446 } 447 411 448 if (mSampleConfigFile->getBillboardCloudMergedBillboards()) 412 449 { … … 424 461 mBillboardCloudUVMapper->setTextureAtlasHeight(mSampleConfigFile->getBillboardCloudDiffuseColorMergedBillboardsTextureAtlasSize()); 425 462 mBillboardCloudUVMapper->initialize(); 426 427 463 mBillboardCloudUVMapper->generateTextureAtlasTextureCoords(false, mSampleConfigFile->getBillboardCloudGroupedBillboards(), 1); 464 465 mLeaves->getBillboardCloud()->generateBillboardCloudGroups(); 466 saveBillboardCloudMerged(); 467 saveBillboardCloudMergedXML(); 428 468 } 429 430 mLeaves->getBillboardCloud()->generateBillboardCloudGroups();431 432 saveBillboardCloudMerged();433 434 }435 436 if (mSampleConfigFile->getBillboardCloudGroupedBillboards())437 {438 mLeaves->getBillboardCloud()->generateBillboardCloud(false);439 mLeaves->getBillboardCloud()->initializeBillboardCloudGroups(mSampleConfigFile->getBillboardCloudGroups());440 441 if (mSampleConfigFile->getBillboardCloudDiffuseColorBillboardGroupTextureAtlasGeneration())442 {443 mBillboardCloudUVMapper->shutdown();444 mBillboardCloudUVMapper->setBillboardCloud(mLeaves->getBillboardCloud());445 mBillboardCloudUVMapper->setTextureWidth(mSampleConfigFile->getBillboardCloudDiffuseColorBillboardGroupTextureSize());446 mBillboardCloudUVMapper->setTextureHeight(mSampleConfigFile->getBillboardCloudDiffuseColorBillboardGroupTextureSize());447 mBillboardCloudUVMapper->setTextureAtlasWidth(mSampleConfigFile->getBillboardCloudDiffuseColorBillboardGroupTextureAtlasSize());448 mBillboardCloudUVMapper->setTextureAtlasHeight(mSampleConfigFile->getBillboardCloudDiffuseColorBillboardGroupTextureAtlasSize());449 mBillboardCloudUVMapper->initialize();450 mBillboardCloudUVMapper->generateTextureAtlasTextureCoords(false, mSampleConfigFile->getBillboardCloudGroupedBillboards(), mSampleConfigFile->getBillboardCloudGroups());451 }452 453 mLeaves->getBillboardCloud()->generateBillboardCloudGroups();454 455 saveBillboardCloudGrouped();456 469 } 457 470 … … 471 484 //} 472 485 saveBillboardCloudSplitted(); 473 } 474 475 saveBillboardCloudXML(); 486 saveBillboardCloudXML(); 487 } 476 488 } 477 489 -
GTP/trunk/Lib/Illum/IBRBillboardCloudTrees/OGRE/src/LBBCSampleConfigFile.cpp
r731 r745 132 132 } 133 133 134 Ogre::String SampleConfigFile::getEntityClustersMaterialPrefixName() 135 { 136 return getSetting("Entity Clusters Material Prefix Name"); 134 Ogre::String SampleConfigFile::getEntityClustersMergedMaterialPrefixName() 135 { 136 return getSetting("Entity Clusters Merged Material Prefix Name"); 137 } 138 139 Ogre::String SampleConfigFile::getEntityClustersSplittedMaterialPrefixName() 140 { 141 return getSetting("Entity Clusters Splitted Material Prefix Name"); 137 142 } 138 143
Note: See TracChangeset
for help on using the changeset viewer.