|
|
|
@ -27,6 +27,7 @@ ChunkManager::ChunkManager(Storage *storage, Resource::SceneManager *sceneMgr, T
|
|
|
|
|
, mTextureManager(textureManager)
|
|
|
|
|
, mCompositeMapRenderer(renderer)
|
|
|
|
|
, mCompositeMapSize(512)
|
|
|
|
|
, mCullingActive(true)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
@ -53,6 +54,11 @@ void ChunkManager::reportStats(unsigned int frameNumber, osg::Stats *stats) cons
|
|
|
|
|
stats->setAttribute(frameNumber, "Terrain Chunk", mCache->getCacheSize());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ChunkManager::setCullingActive(bool active)
|
|
|
|
|
{
|
|
|
|
|
mCullingActive = active;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
osg::ref_ptr<osg::Texture2D> ChunkManager::createCompositeMapRTT()
|
|
|
|
|
{
|
|
|
|
|
osg::ref_ptr<osg::Texture2D> texture = new osg::Texture2D;
|
|
|
|
@ -207,6 +213,12 @@ osg::ref_ptr<osg::Node> ChunkManager::createChunk(float chunkSize, const osg::Ve
|
|
|
|
|
|
|
|
|
|
transform->addChild(geometry);
|
|
|
|
|
|
|
|
|
|
if (!mCullingActive)
|
|
|
|
|
{
|
|
|
|
|
transform->setCullingActive(false);
|
|
|
|
|
geometry->setCullingActive(false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (mSceneManager->getIncrementalCompileOperation())
|
|
|
|
|
{
|
|
|
|
|
mSceneManager->getIncrementalCompileOperation()->add(geometry);
|
|
|
|
|