Installing PLSM

wizumwalt

15-02-2009 06:21:22

I'm trying to make use of PLSM2, but these docs are un-followable. So I've done the following ...

- downloaded the latest SVN source of ogre (which I think is 1.7.0).
- downloaded the gnu tarball on sourceforge of PLSM2.

But before I expand paginglandscape.tar into ogre, I can already tell that the Makefile.am in paginglandscape (and others) will overwrite the ones in the ogre dir. Is this the correct thing to do?

So ./Plugins, ./Samples, ./Tools, etc... of ./paginglandscape of the plsm gnu tarball seems like it should go in ./ogre ... but then things get overwritten.

Any help much appreciated.

jacmoe

15-02-2009 06:37:21

I just use it as-is, separate to the Ogre source tree.
It's actually meant to (IIRC) be in ogreaddons folder, not ogre folder. :wink:

wizumwalt

15-02-2009 07:27:58

As far as ogreaddons dir goes, I didn't see one of those in the entire ogre tree. But I did give it a go at building it separately.

Anyways, here's a make after a ./bootstrap and ./configure.


g++ -DHAVE_CONFIG_H -I. -I. -I../../.. -DOGRE_GUI_GLX -DOGRE_CONFIG_LITTLE_ENDI AN -I/usr/local/include -I/usr/local/include/OGRE -I../../../PlugIns/PagingLandS cape2/include -g -O2 -MT Plugin_PagingLandScape2_la-OgrePagingLandScapeOctreeSce neManager.lo -MD -MP -MF .deps/Plugin_PagingLandScape2_la-OgrePagingLandScapeOct reeSceneManager.Tpo -c OgrePagingLandScapeOctreeSceneManager.cpp -fPIC -DPIC -o .libs/Plugin_PagingLandScape2_la-OgrePagingLandScapeOctreeSceneManager.o
In file included from OgrePagingLandScapeOctreeSceneManager.cpp:59:
../../../PlugIns/PagingLandScape2/include/OgrePagingLandScapeOcclusionVisibility Data.h:45:28: warning: no newline at end of file
OgrePagingLandScapeOctreeSceneManager.cpp:721:24: warning: extra tokens at end o f #endif directive
OgrePagingLandScapeOctreeSceneManager.cpp: In member function 'void Ogre::Paging LandScapeOctreeSceneManager::directRenderSingleObject(Ogre::Renderable*)':
OgrePagingLandScapeOctreeSceneManager.cpp:1148: error: no matching function for call to 'Ogre::PagingLandScapeOctreeSceneManager::useRenderableViewProjMode(Ogre ::Renderable*&)'
/usr/local/include/OGRE/OgreSceneManager.h:582: note: candidates are: virtual vo id Ogre::SceneManager::useRenderableViewProjMode(const Ogre::Renderable*, bool)
make[4]: *** [Plugin_PagingLandScape2_la-OgrePagingLandScapeOctreeSceneManager.l o] Error 1
make[4]: Leaving directory `/home/winky/Tools/paginglandscape/PlugIns/PagingLan dScape2/src'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/home/winky/Tools/paginglandscape/PlugIns/PagingLan dScape2'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/winky/Tools/paginglandscape/PlugIns'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/winky/Tools/paginglandscape'
make: *** [all] Error 2


I pulled ogre from the svn trunk. Should I be using an earlier version w/ PLSM (I read somewhere's to use the latest).

wizumwalt

16-02-2009 17:53:06

This is from trying to build paginglandscape w/ ogre 1.6.1 installed.


In file included from OgrePagingLandScapeAxisAlignedBoxSceneQuery.cpp:40:
../../../PlugIns/PagingLandScape2/include/OgrePagingLandScapeSceneManager.h:24:37: error: OgreOctreeSceneManager.h: No such file or directory
../../../PlugIns/PagingLandScape2/include/OgrePagingLandScapeSceneManager.h:62: error: expected class-name before '{' token
OgrePagingLandScapeAxisAlignedBoxSceneQuery.cpp: In member function 'virtual void Ogre::PagingLandScapeAxisAlignedBoxSceneQuery::execute(Ogre::SceneQueryListener*)':
OgrePagingLandScapeAxisAlignedBoxSceneQuery.cpp:490: error: invalid static_cast from type 'Ogre::SceneManager*' to type 'Ogre::PagingLandScapeSceneManager*'
make[4]: *** [Plugin_PagingLandScape2_la-OgrePagingLandScapeAxisAlignedBoxSceneQuery.lo] Error 1
make[4]: Leaving directory `/home/winky/Tools/paginglandscape/PlugIns/PagingLandScape2/src'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/home/winky/Tools/paginglandscape/PlugIns/PagingLandScape2'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/winky/Tools/paginglandscape/PlugIns'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/winky/Tools/paginglandscape'
make: *** [all] Error 2


I'd be happy just to find any 1.6+ version of ogre that builds w/ PLSM. I've tried 1.6, 1.6.1, and what's in SVN. All give different errors.

jacmoe

16-02-2009 20:46:37

ogreaddons folder is separate to ogre folder. Two separate folders. For two separate projects. :wink:

It looks like you didn't inform your compiler where OgreOctreeSceneManager.h is.
Add the location of the OctreeSceneManager to your projects include paths, and tell it to link to OgreOctreeSceneManager library too. (If needed on Linux / GCC).
(I am pulling the names from the top of my head, because I haven't the Ogre source handy atm). :)

wizumwalt

17-02-2009 00:28:44

So my layout looks like this ...


- ogre (1.6.1)
|
- ogreaddons
|- paginglandscape


I've built ogre. Then I run the following in ./paginglandscape ...

./bootstrap
./configure --includedir=/home/winky/Tools/ogre/Plugins/OctreeSceneManager
make

And even though this file is located in the ./configure --includedir given above, I still get ...

g++ -DHAVE_CONFIG_H -I. -I. -I../../.. -DOGRE_GUI_GLX -DOGRE_CONFIG_LITTLE_ENDIAN -I/usr/local/include -I/usr/local/include/OGRE -I../../../PlugIns/PagingLandScape2/include -g -O2 -MT Plugin_PagingLandScape2_la-OgrePagingLandScapeAxisAlignedBoxSceneQuery.lo -MD -MP -MF .deps/Plugin_PagingLandScape2_la-OgrePagingLandScapeAxisAlignedBoxSceneQuery.Tpo -c OgrePagingLandScapeAxisAlignedBoxSceneQuery.cpp -fPIC -DPIC -o .libs/Plugin_PagingLandScape2_la-OgrePagingLandScapeAxisAlignedBoxSceneQuery.o
In file included from OgrePagingLandScapeAxisAlignedBoxSceneQuery.cpp:40:
../../../PlugIns/PagingLandScape2/include/OgrePagingLandScapeSceneManager.h:24:37: error: OgreOctreeSceneManager.h: No such file or directory
../../../PlugIns/PagingLandScape2/include/OgrePagingLandScapeSceneManager.h:62: error: expected class-name before '{' token
OgrePagingLandScapeAxisAlignedBoxSceneQuery.cpp: In member function 'virtual void Ogre::PagingLandScapeAxisAlignedBoxSceneQuery::execute(Ogre::SceneQueryListener*)':
OgrePagingLandScapeAxisAlignedBoxSceneQuery.cpp:490: error: invalid static_cast from type 'Ogre::SceneManager*' to type 'Ogre::PagingLandScapeSceneManager*'
make[4]: *** [Plugin_PagingLandScape2_la-OgrePagingLandScapeAxisAlignedBoxSceneQuery.lo] Error 1
make[4]: Leaving directory `/home/winky/Tools/ogreaddons/paginglandscape/PlugIns/PagingLandScape2/src'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/home/winky/Tools/ogreaddons/paginglandscape/PlugIns/PagingLandScape2'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/winky/Tools/ogreaddons/paginglandscape/PlugIns'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/winky/Tools/ogreaddons/paginglandscape'
make: *** [all] Error 2


Did you do this differently?

jacmoe

17-02-2009 00:48:33

I did it like this:
./aclocal
./bootstrap
./configure
make
sudo make install

It was some time ago, but it should still work. :)

wizumwalt

17-02-2009 01:28:05

Heh, if it were that easy, it would have worked for me days ago.

jacmoe

17-02-2009 01:41:00

Heh, if it were that easy, it would have worked for me days ago.
I didn't mean to call it easy.
There's something wrong here.
You're using Ogre 1.6 and PLSM2 from trunk?
That should definitely work. :?
Did you install Ogre in /usr/local or just /usr ?

wizumwalt

17-02-2009 01:51:14

No, not from trunk, it's the source tarball of 1.6 I downloaded (which I guess should be from trunk). I installed ogre by default, /usr/local.
Same results. I build ogre, then in a separate ogreaddons dir, I build paginglandscape ...

In file included from OgrePagingLandScapeAxisAlignedBoxSceneQuery.cpp:40:
../../../PlugIns/PagingLandScape2/include/OgrePagingLandScapeSceneManager.h:24:37: error: OgreOctreeSceneManager.h: No such file or directory
../../../PlugIns/PagingLandScape2/include/OgrePagingLandScapeSceneManager.h:62: error: expected class-name before '{' token
OgrePagingLandScapeAxisAlignedBoxSceneQuery.cpp: In member function 'virtual void Ogre::PagingLandScapeAxisAlignedBoxSceneQuery::execute(Ogre::SceneQueryListener*)':
OgrePagingLandScapeAxisAlignedBoxSceneQuery.cpp:490: error: invalid static_cast from type 'Ogre::SceneManager*' to type 'Ogre::PagingLandScapeSceneManager*'
make[4]: *** [Plugin_PagingLandScape2_la-OgrePagingLandScapeAxisAlignedBoxSceneQuery.lo] Error 1


I downloaded the GNU tarball from this page ...
http://ogreaddons.svn.sourceforge.net/v ... landscape/

Untarred it in the ogreaddons dir ...

|- ogre
|- ogreaddons
|- paginglandscape


And ran the commands after ogre was installed.

dermont

17-02-2009 03:06:52

You could try building with _PLSM_OCTREE defined:

CXXFLAGS='-D_PLSM_OCTREE' ./configure

or if you want to build against the OctreeSceneManager try playing about with the configure flags, e.g:

CPPFLAGS='-I/media/sda1/LIBRARIES/OGRE/ogre-v1-6-1/PlugIns/OctreeSceneManager/include' LDFLAGS='-Wl,-rpath,/usr/local/lib/OGRE -Wl,--start-group -Wl,/usr/local/lib/OGRE/Plugin_OctreeSceneManager.so -Wl,--end-group' ./configure


There are also appears to be a few ifdef/enum problems on linux:

Index: PlugIns/PagingLandScape2/include/OgrePagingLandScapePrerequisites.h
===================================================================
--- PlugIns/PagingLandScape2/include/OgrePagingLandScapePrerequisites.h (revision 2648)
+++ PlugIns/PagingLandScape2/include/OgrePagingLandScapePrerequisites.h (working copy)
@@ -76,7 +76,7 @@
class Leaf;





- typedef enum culling_modes

+ enum culling_modes

{

// STANDARD_WALK = 0,

// VIEW_FRUSTUM,

@@ -133,7 +133,7 @@
#define PAGE_OUTSIDE 0x00000004





-typedef enum PageState

+enum PageState

{

inited,

Preloaded,

@@ -141,7 +141,7 @@
Loaded

};



-typedef enum PageQueuingState

+enum PageQueuingState

{

queuednone,

queuedPreload,

Index: PlugIns/PagingLandScape2/src/OgrePagingLandScapeOptions.cpp
===================================================================
--- PlugIns/PagingLandScape2/src/OgrePagingLandScapeOptions.cpp (revision 2648)
+++ PlugIns/PagingLandScape2/src/OgrePagingLandScapeOptions.cpp (working copy)
@@ -205,7 +205,7 @@
ZHorizon = false;
SRTM_water = false;

-#endif _MAPSPLITTER
+#endif //_MAPSPLITTER
}
//-----------------------------------------------------------------------
void PagingLandScapeOptions::init()
Index: PlugIns/PagingLandScape2/src/OgrePagingLandScapeOctree.cpp
===================================================================
--- PlugIns/PagingLandScape2/src/OgrePagingLandScapeOctree.cpp (revision 2648)
+++ PlugIns/PagingLandScape2/src/OgrePagingLandScapeOctree.cpp (working copy)
@@ -314,7 +314,7 @@

#ifdef _DEBUG
std::cout << "new Child\n";
-#endif _DEBUG
+#endif //_DEBUG

PagingLandScapeOctree *newChild = scn->getNewOctree();
newChild->setParent (this);
Index: PlugIns/PagingLandScape2/src/OgrePagingLandScapeOctreeSceneManager.cpp
===================================================================
--- PlugIns/PagingLandScape2/src/OgrePagingLandScapeOctreeSceneManager.cpp (revision 2648)
+++ PlugIns/PagingLandScape2/src/OgrePagingLandScapeOctreeSceneManager.cpp (working copy)
@@ -718,7 +718,7 @@
std::cout << "Depth Placement "
<< StringConverter::toString (depth)
<< " \n";
- #endif _DEBUG
+ #endif //_DEBUG

octant->_addNode(n);
}
Index: Tools/MapSplitter/src/MapUtil.cpp
===================================================================
--- Tools/MapSplitter/src/MapUtil.cpp (revision 2648)
+++ Tools/MapSplitter/src/MapUtil.cpp (working copy)
@@ -348,7 +348,7 @@
delete mData2dManager;

delete mOptions;

delete mRoot;

-#endif _MAPEDITOR

+#endif //_MAPEDITOR



delete mSplitter;

delete mMergeModulater;

wizumwalt

17-02-2009 18:53:53

It actually compiled all the way through using ...


$ CXXFLAGS='-D_PLSM_OCTREE' ./configure


So I try to run the Samples/PagingLandScape2/src PagingLandScape2 executable, and in the plsm2.log I see ...

...
12:47:11: *-*-* OGRE Initialising
12:47:11: *-*-* Version 1.6.1 (Shoggoth)
12:47:11: Loading library Plugin_PagingLandScapeSceneManager2
12:47:11: OGRE EXCEPTION(7:InternalErrorException): Could not load dynamic library Plugin_PagingLandScapeSceneManager2. System Error: Plugin_PagingLandScapeSceneManager2.so: cannot open shared object file: No such file or directory in DynLib::load at OgreDynLib.cpp (line 80)
12:47:11: *-*-* OGRE Shutdown


Now, there's a Plugin_PagingLandScape2.so that has been built, but nowhere's on my system in the src or install dir is there a Plugin_PagingLandScapeSceneManager2.so.

Is this a confusion of the two or should there really be a Plugin_PagingLandScapeSceneManager2.so? I don't see any errors during the build process.

dermont

18-02-2009 04:59:47

The plugin on linux is named "Plugin_PagingLandScape2.so" for some reason. You could either:

a) update the map splitter source to reflect this, see last post here
viewtopic.php?f=2&t=8708
b) as a quick work around to run the map splitter create a soft link to Plugin_PagingLandScapeSceneManager2
>> cd /usr/local/lib/OGRE
>> sudo ln -s Plugin_PagingLandScape2.so Plugin_PagingLandScapeSceneManager2.so

Also you should run MapSplitter from paginglandscape/Samples/Common/bin where everything is set up.

wizumwalt

19-02-2009 02:44:46

Ok, almost there. Thanks for the other links. After getting past a few hf.cfg errors, other assertion failuers, etc ... I'm getting the following startup error ... seems to be looking for a file named hf129_3.0.0.png which I know doesn't exist.


Finished parsing scripts for resource group PLSM2
Initialising resource group PLSM2
Added resource location '../../Media/paginglandscape2/terrains/hf129_3' of type 'FileSystem' to resource group 'PLSM2'
Initialising resource group PLSM2
Texture: flare.png: Loading 1 faces(PF_R8G8B8,256x256x1) with 8 generated mipmaps from Image. Internal format is PF_X8R8G8B8,256x256x1.
Texture: cursor.png: Loading 1 faces(PF_R8G8B8,32x32x1) with 5 generated mipmaps from Image. Internal format is PF_X8R8G8B8,32x32x1.
PLSM2 : Cannot find map named hf129_3.0.0.png
Error loading texture hf129_3.Base.0.0.png. Texture layer will be blank. Loading the texture failed with the following exception: OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource hf129_3.Base.0.0.png in resource group PLSM2 or any other group. in ResourceGroupManager::openResource at OgreResourceGroupManager.cpp (line 753)
Error loading texture hf129_3.Base.0.0.png. Texture layer will be blank. Loading the texture failed with the following exception: OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource hf129_3.Base.0.0.png in resource group PLSM2 or any other group. in ResourceGroupManager::openResource at OgreResourceGroupManager.cpp (line 753)
Texture: Detail3.jpg: Loading 1 faces(PF_R8G8B8,512x512x1) with 9 generated mipmaps from Image. Internal format is PF_X8R8G8B8,512x512x1.
PagingLandScape2: OgreGLTexture.cpp:410: virtual Ogre::HardwarePixelBufferSharedPtr Ogre::GLTexture::getBuffer(size_t, size_t): Assertion `idx < mSurfaceList.size()' failed.
Aborted


Any ideas?

wizumwalt

19-02-2009 03:55:42

Not really sure what's going on with it. I somehow thought to run MapSplitter, and it ends w/ a Segmentation Fault.


Bpp : 4
hf129_3.HSP.png
Width : 513
Height : 513
Bpp : 4
hf129_3.HSN.png
*-*-* OGRE Shutdown
Unregistering ResourceManager for type Compositor
Unregistering ResourceManager for type Font
Unregistering ResourceManager for type Skeleton
Unregistering ResourceManager for type Mesh
Unregistering ResourceManager for type HighLevelGpuProgram
Unloading library Plugin_PagingLandScape2
Segmentation fault


However, after that, I was finally able to get the demo working, but don't quite understand how to use it. With the orange square around the cursor, if I click on the map, it crashes with more segmentation faults.

All I see is what looks like a birds eye view of a single square (tile?) of land. Not other tiles around it. In fact, it seems as if I do anything w/ swapping tiles, N, L, P ... it will crash, as if the MapSplitter didn't cut things up correctly.

dermont

19-02-2009 05:13:21

I think the problem with the seg fault is that the plugin is being loaded from the cfg file and in code. To resolve the seg fault try commenting out Plugin_PagingLandScape2 in plugins.cfg and
uncomment to run the demo.

With regards to the demo, sorry I don't know. I have the same problems, it's never worked properly for me on Linux or Windows.

You could check the wiki for a sample PLMS2 application (though it probably needs updating).
Also the ogreode Landscape demo from svn(ogreode/demos/Landscape) has a sample using PLSM2, try stripping out the physics related code. Sorry can't post link's since my internet connection is in meltdown.


Edit: Ok here is stripped down version, you will have to update camera position etc. yourself.
Landscape.h

#include "ExampleApplication.h"

class LandscapeFrameListener : public ExampleFrameListener
{
public:
LandscapeFrameListener(Ogre::RenderWindow* win, Ogre::Camera* cam, Ogre::Root* root);
~LandscapeFrameListener();

private:
void updateInfo();
Ogre::RaySceneQuery *_ray_query;
Ogre::Ray ray;
bool frameStarted(const Ogre::FrameEvent& evt);
//virtual Ogre::Real heightAt(const Ogre::Vector3& position);

protected:
Ogre::SceneManager *mSceneMgr;
};

class LandscapeApplication : public ExampleApplication
{
public:
LandscapeApplication();
~LandscapeApplication();

protected:
virtual bool setup(void);
virtual void chooseSceneManager(void);
virtual void setupResources(void);
virtual void createCamera(void);
void createScene(void);
void createFrameListener(void);
};

Landscape.cpp

#include "Landscape.h"
static String config_file ("paginglandscape2.cfg");
int main(int argc, char *argv[])
{
LandscapeApplication app;
try
{
app.go();
}
catch( Ogre::Exception& e )
{
std::cerr << "An exception has occured: " << e.getFullDescription().c_str() << std::endl;
}
return 0;
}

using namespace Ogre;

//------------------------------------------------------------------------------------------------
LandscapeFrameListener::LandscapeFrameListener(RenderWindow* win, Camera* cam,
Root *root) :
ExampleFrameListener(win, cam),
mSceneMgr (mCamera->getSceneManager())
{

bool does_center_is_corner = false;
Ogre::Vector3 scale = Ogre::Vector3::ZERO;
int nodes_per_side = 0;
int nodes_per_side_all_pagesW = 0;
int nodes_per_side_all_pagesH = 0;
bool center;
// Terrain Scene Manager should support those...
mSceneMgr->getOption("Scale", &scale);
mSceneMgr->getOption("PageSize", &nodes_per_side);

Ogre::Real worldWidth, worldHeight;
center = true;
int w=0;
int h=0;

mSceneMgr->getOption("Width", &w);
mSceneMgr->getOption("Height", &h);
worldWidth = w * (nodes_per_side - 1) * scale.x;
worldHeight = h * (nodes_per_side - 1) * scale.z;
nodes_per_side_all_pagesW = w * (nodes_per_side);
nodes_per_side_all_pagesH = h * (nodes_per_side);

bool noInterpolation = true;
mSceneMgr->setOption("queryNoInterpolation", &noInterpolation);
mSceneMgr->setOption("LoadNow", 0);

_ray_query = mCamera->getSceneManager()->createRayQuery(ray);
_ray_query->setQueryTypeMask(Ogre::SceneManager::WORLD_GEOMETRY_TYPE_MASK );
_ray_query->setWorldFragmentType(Ogre::SceneQuery::WFT_SINGLE_INTERSECTION);
ray.setDirection(Vector3::NEGATIVE_UNIT_Y);

Root::getSingleton().setFrameSmoothingPeriod(5.0f);
}

LandscapeFrameListener::~LandscapeFrameListener()
{
mCamera->getSceneManager()->destroyQuery(_ray_query);
}

//------------------------------------------------------------------------------------------------
bool LandscapeFrameListener::frameStarted(const FrameEvent& evt)
{
Real time = evt.timeSinceLastFrame;
bool ret = ExampleFrameListener::frameStarted(evt);
}

//------------------------------------------------------------------------------------------------
//Real LandscapeFrameListener::heightAt(const Ogre::Vector3& position)
//{
// return _terrain->getHeightAt(position); //this is the get height function
//}

//------------------------------------------------------------------------------------------------
LandscapeApplication::LandscapeApplication()
{
}

//------------------------------------------------------------------------------------------------
bool LandscapeApplication::setup(void)
{
mRoot = new Root("plugins.cfg", "plsm2_display.cfg", "ogreode_landscape_plsm2.log");
setupResources();
bool carryOn = configure();
if (!carryOn) return false;
chooseSceneManager();
createCamera();
createViewports();
// Set default mipmap level (NB some APIs ignore this)
TextureManager::getSingleton().setDefaultNumMipmaps(20);
// Create any resource listeners (for loading screens)
createResourceListener();
// Load resources
loadResources();
// Create the scene
createScene();
createFrameListener();
return true;
}

//------------------------------------------------------------------------------------------------
void LandscapeApplication::chooseSceneManager(void)
{
mSceneMgr = mRoot->createSceneManager( "PagingLandScapeSceneManager", "basicsm" );
assert(mSceneMgr);
}

//------------------------------------------------------------------------------------------------
void LandscapeApplication::setupResources(void)
{
ExampleApplication::setupResources();
}
//------------------------------------------------------------------------------------------------
void LandscapeApplication::createCamera(void)
{
// Create the camera
mCamera = mSceneMgr->createCamera("PlayerCam");

// Set a nice viewpoint
mCamera->setPosition(25,15,25);
mCamera->setOrientation(Quaternion(-0.3486, 0.0122, 0.9365, 0.0329));

mCamera->setNearClipDistance( 1 );
mCamera->setFarClipDistance( 1000 );
}

//------------------------------------------------------------------------------------------------
// Just override the mandatory create scene method
void LandscapeApplication::createScene(void)
{
// Set ambient light
mSceneMgr->setAmbientLight(ColourValue(0.9, 0.9, 0.9));

// Create a light
Light* l = mSceneMgr->createLight("MainLight");

// Accept default settings: point light, white diffuse, just set position
// NB I could attach the light to a SceneNode if I wanted it to move automatically with
// other objects, but I don't
l->setPosition(20,800,50);
//l->setSpecularColour(1,0.9,0);
//l->setCastShadows(true);

//#ifndef _DEBUG
// mSceneMgr->setShadowTechnique(SHADOWTYPE_STENCIL_MODULATIVE);
// mSceneMgr->setShadowColour(ColourValue(0.5,0.5,0.5));
//#else
// mSceneMgr->setShadowTechnique(SHADOWTYPE_NONE);
//#endif

// Fog
// NB it's VERY important to set this before calling setWorldGeometry
// because the vertex program picked will be different
//ColourValue fadeColour(0.93, 0.86, 0.76);
//mSceneMgr->setFog( FOG_LINEAR, fadeColour, .001, 500, 1000);
//mWindow->getViewport(0)->setBackgroundColour(fadeColour);

// Set up the terrain according to our own settings

DataStreamPtr cfgFile = ResourceGroupManager::getSingleton().openResource (config_file, "General");
mSceneMgr -> setWorldGeometry( cfgFile );


//String blank("");
//mSceneMgr->setOption("CustomMaterialName",&blank);

// Infinite far plane?
if (mRoot->getRenderSystem()->getCapabilities()->hasCapability(RSC_INFINITE_FAR_PLANE))
{
mCamera->setFarClipDistance(0);
}

// Define the required skyplane
Plane plane;

plane.d = 5000;
plane.normal = -Vector3::UNIT_Y;
}

//------------------------------------------------------------------------------------------------
// Create new frame listener
void LandscapeApplication::createFrameListener(void)
{
mFrameListener= new LandscapeFrameListener(mWindow, mCamera,mRoot);
mRoot->addFrameListener(mFrameListener);
}

//------------------------------------------------------------------------------------------------
LandscapeApplication::~LandscapeApplication()
{
}


And to build something like this:

g++ -o Landscape Landscape.cpp -I. `pkg-config --cflags --libs OGRE OIS` -I/media/sda1/LIBRARIES/OGRE/ogre-v1-6-1/Samples/Common/include

wizumwalt

20-02-2009 03:53:11

Man, this is taking some serious time to get up and running. So, while I keep trying to get this stuff going, not even knowing if it eventually will ...

Can I ask ... what other paged terrain packages are out there that will run on linux?

dermont

20-02-2009 04:16:35


Man, this is taking some serious time to get up and running. So, while I keep trying to get this stuff going, not even knowing if it eventually will ...

Did you try running and building the above demo?


Can I ask ... what other paged terrain packages are out there that will run on linux?

Try searching on the main forum for threads such as the Simple Paged Terrain:
http://www.ogre3d.org/forums/viewtopic.php?f=11&t=31674

wizumwalt

20-02-2009 04:32:45


Did you try running and building the above demo?


Yeah, I've got added in what you posted. But I can't get the extra paged tiles to appear outside of the one in the center that I've got in my small app.

I couldn't find the example that you were talking about in the ode 0.11 src which I grabbed.

Update:
I just feel I'm so close. My problem is just that my terrain isn't there, I can't see it, after a bit of moving around, then it crashes and I don't know why yet. :(

And simple paged terrain is a project that is now dead, or at least till the entire rewrite comes out. Ugh.

dermont

22-02-2009 05:28:16

The demo I referred to was the OgreOde Landscape demo which is pretty much the above code with the physics stuff taken out.
http://ogreaddons.svn.sourceforge.net/v ... Landscape/

Regarding your problem with paged tiles, I don't know. On Linux I had problems with loading terrains such as alpes. It appears that MapSplitter didn't create alpes0.0.png and the demo failed loading "alpesx.x.png", as a workaround I renamed the files to "alpes.x.x.png".

wizumwalt

24-02-2009 02:53:59

Ok, I think I may have found something that results in the following error.


ResourceBackgroundQueue - threading disabled
Particle Renderer Type 'billboard' registered
SceneManagerFactory for type 'BspSceneManager' registered.
Registering ResourceManager for type BspLevel
SceneManagerFactory for type 'OctreeSceneManager' registered.
SceneManagerFactory for type 'TerrainSceneManager' registered.
An exception has occured: OGRE EXCEPTION(5:ItemIdentityException): No factory found for scene manager of type 'PagingLandScapeSceneManager' in SceneManagerEnumerator::createSceneManager at OgreSceneManagerEnumerator.cpp (line 181)


Is the scenemanager not being found, and if so, what is it that I'm missing here?

I think I have the necessary libs here ...

/usr/local/lib/OGRE $ ls -l
total 32840
-rwxr-xr-x 1 root root 1167 Feb 16 22:48 Plugin_BSPSceneManager.la
-rwxr-xr-x 1 root root 2735023 Feb 16 22:48 Plugin_BSPSceneManager.so
-rwxr-xr-x 1 root root 1173 Feb 16 22:48 Plugin_CgProgramManager.la
-rwxr-xr-x 1 root root 815703 Feb 16 22:48 Plugin_CgProgramManager.so
-rwxr-xr-x 1 root root 1185 Feb 16 22:48 Plugin_OctreeSceneManager.la
-rwxr-xr-x 1 root root 3492811 Feb 16 22:48 Plugin_OctreeSceneManager.so
-rwxr-xr-x 1 root root 1240 Feb 16 22:48 Plugin_OctreeZone.la
-rwxr-xr-x 1 root root 2437140 Feb 16 22:48 Plugin_OctreeZone.so
-rw-r--r-- 1 root root 7220996 Feb 18 20:37 Plugin_PagingLandScape2.a
-rwxr-xr-x 1 root root 1176 Feb 18 20:37 Plugin_PagingLandScape2.la
-rwxr-xr-x 1 root root 2759925 Feb 18 20:37 Plugin_PagingLandScape2.so
lrwxrwxrwx 1 root root 26 Feb 18 20:12 Plugin_PagingLandScapeSceneManager2.so -> Plugin_PagingLandScape2.so
-rwxr-xr-x 1 root root 1137 Feb 16 22:48 Plugin_ParticleFX.la
-rwxr-xr-x 1 root root 3055441 Feb 16 22:48 Plugin_ParticleFX.so
-rwxr-xr-x 1 root root 1316 Feb 16 22:48 RenderSystem_GL.la
-rwxr-xr-x 1 root root 7746752 Feb 16 22:48 RenderSystem_GL.so
-rwxr-xr-x 1 root root 1185 Feb 16 22:48 libPlugin_PCZSceneManager.la
-rwxr-xr-x 1 root root 3316105 Feb 16 22:48 libPlugin_PCZSceneManager.so

guru

24-02-2009 12:04:25

I thought I'd post what I had to get PLSM2 to work on linux, for reference to others (I hope I didn't forget anything).
Make sure you use ogre svn v1-6, not trunk: https://svn.ogre3d.org/svnroot/ogre/branches/v1-6

chmod +x bootstrap.sh
edit bootstrap.sh and comment out the three lines about libtool check
edit Samples/Common/include/PagingLandScape2Application.h not to load Plugin_PagingLandScapeSceneManager2
./bootstrap
CXXFLAGS='-D_PLSM_OCTREE' ./configure
make
sudo make install
go into Samples/Common/bin/ and make sure resources.cfg is fine
run MapSplitter
use the code dermont posted to test PLSM

Nems

25-02-2009 20:10:59

Hello everybody.
I need help to install PLSM2 with Ogre SDK 1.6 on Windows for Visual Studio 2005 (2008 is ok too).
I read all the topic but I can't understand the parts with Linux (should I leave windows ? :wink: )
I tried also the directives shown on the Ogre wiki to install the PLSM2 http://www.ogre3d.org/wiki/index.php/Paging_Scene_Manager_Installation, but it still not working.

It will be great if someone can tell us how do get it run, we need the pOwer of this plugin !
Moreover a tutorial will help a lot to everybody.


[other]
I am french, so I am apologize if there are some mistakes in the post.

tuan kuranes

23-03-2009 17:53:27

@dermont: Thx, patch applied.

dermont

23-03-2009 20:25:16

I think with DragonM's patch for MapSplitter the hack to add the initial String(".") to the filename isn't required:


Index: Tools/MapSplitter/src/MapSplitter.cpp
===================================================================
--- Tools/MapSplitter/src/MapSplitter.cpp (revision 2673)
+++ Tools/MapSplitter/src/MapSplitter.cpp (working copy)
@@ -309,7 +309,7 @@

// make up filename with tile indexes
String SplitFileName;
- SplitFileName = pure_file_name + String(".") + StringConverter::toString(i) + String(".") + StringConverter::toString(j) + String(".") + ext_name;
+ SplitFileName = pure_file_name + StringConverter::toString(i) + String(".") + StringConverter::toString(j) + String(".") + ext_name;
save (const_cast< char * > (SplitFileName.c_str()),
SplittedData,
page_size + tile_spacing,
@@ -337,7 +337,7 @@

// make up filename with tile indexes
String SplitFileName;
- SplitFileName = pure_file_name + String(".") + StringConverter::toString(height_split_count) + String(".") + StringConverter::toString(j) + String(".") + ext_name;
+ SplitFileName = pure_file_name + StringConverter::toString(height_split_count) + String(".") + StringConverter::toString(j) + String(".") + ext_name;
save (const_cast< char * > (SplitFileName.c_str()),
SplittedData,
page_size + tile_spacing,
@@ -362,7 +362,7 @@

// make up filename with tile indexes
String SplitFileName;
- SplitFileName = pure_file_name + String(".") + StringConverter::toString(i) + String(".") + StringConverter::toString(width_split_count) + String(".") + ext_name;
+ SplitFileName = pure_file_name + StringConverter::toString(i) + String(".") + StringConverter::toString(width_split_count) + String(".") + ext_name;
save (const_cast< char * > (SplitFileName.c_str()),
SplittedData,
page_size + tile_spacing,
@@ -384,7 +384,7 @@
base_image_bypp);
// make up filename with tile indexes
String SplitFileName;
- SplitFileName = pure_file_name + String(".") + StringConverter::toString(height_split_count) +
+ SplitFileName = pure_file_name + StringConverter::toString(height_split_count) +
String(".") + StringConverter::toString(width_split_count) + String(".") + ext_name;
save (const_cast< char * > (SplitFileName.c_str()),
SplittedData,