PagedGeometry in Ubuntu

Sami

29-11-2007 14:07:31

Hi,

I downloaded PagedGeometry SDK v1.02 for Linux. The package did not contain Makefiles, so I wrote two. See below.

I use ubuntu Gutsy. I have libogre-dev and libogre14 packages installed. With the Makefiles I created I am able to produce example1 binary. However, running the binary gives:

"terminate called after throwing an instance of 'Ogre::InternalErrorException'
what(): OGRE EXCEPTION(7:InternalErrorException): Could not load dynamic library OGRE_PLUGINDIRPlugin_CgProgramManager. System Error: OGRE_PLUGINDIRPlugin_CgProgramManager.so: cannot open shared object file: No such file or directory in DynLib::load at OgreDynLib.cpp (line 80)"

Am I missing some ubuntu packages (libraries)? Generally, what I need to do in order to be able to compile and run the examples (in Ubuntu)?

I have one additional question. I would like to have a forest produced by this plugin and have roads on the forest. Is this easy to do with PagedGeometry plugin?

Thanks



---- PagedGeometry/source/Makefile ------

DEFINES =
LIBS = OGRE OIS
CXX = g++
CXXFLAGS = -I ../include $(shell pkg-config --cflags $(LIBS)) $(DEFINES)
LDFLAGS =

all: BatchedGeometry.o \
BatchPage.o \
GrassLoader.o \
ImpostorPage.o \
PagedGeometry.o \
PropertyMaps.o \
StaticBillboardSet.o \
TreeLoader2D.o \
TreeLoader3D.o
ld -r -o libPagedGeometry.a $^
.cc.o:
$(CXX) -c $(CXXFLAGS) $<

clean:
rm -f *a *o

------ END -----


----- PagedGeometry/examples/source/Makefile --------

DEFINES =
LIBS = OGRE OIS
CXX = g++
CXXFLAGS = $(shell pkg-config --cflags $(LIBS)) $(DEFINES) -I ../../include/
LDFLAGS = $(shell pkg-config --libs $(LIBS))

all:
$(CXX) $(CXXFLAGS) $(LDFLAGS) -o example1 Example1.cpp ../../source/libPagedGeometry.a

------ END -----

JohnJ

29-11-2007 15:39:24

I downloaded PagedGeometry SDK v1.02 for Linux. The package did not contain Makefiles, so I wrote two. See below.
The make files that are included in the Linux release are using a build system called "cmake", according to the person who donated the setup. I can include your standard make files in the Linux release if you want, since that will probably be more compatible with most people.

"terminate called after throwing an instance of 'Ogre::InternalErrorException'
what(): OGRE EXCEPTION(7:InternalErrorException): Could not load dynamic library OGRE_PLUGINDIRPlugin_CgProgramManager. System Error: OGRE_PLUGINDIRPlugin_CgProgramManager.so: cannot open shared object file: No such file or directory in DynLib::load at OgreDynLib.cpp (line 80)"

It looks like it's having trouble loading Ogre's Plugin_CgProgramManager plugin (which is necessary for PagedGeometry to work properly). The examples load plugins under linux like this:
root->loadPlugin(EXPAND(OGRE_PLUGINDIR) "Plugin_CgProgramManager");
root->loadPlugin(EXPAND(OGRE_PLUGINDIR) "Plugin_OctreeSceneManager");
root->loadPlugin(EXPAND(OGRE_PLUGINDIR) "RenderSystem_GL");

So if any of the CgProgramManager, OctreeSceneManager, or RenderSystem_GL plugins aren't compiled, the examples won't be able to run.

Sami

30-11-2007 11:57:35


The make files that are included in the Linux release are using a build system called "cmake", according to the person who donated the setup. I can include your standard make files in the Linux release if you want, since that will probably be more compatible with most people.


Yes, it might be good idea to have standard make files included. The Makefiles, however, should be tuned a little bit first. Does the example binaries run as a such from directory PagedGeometry/examples/source or should they be copied to some other location?


It looks like it's having trouble loading Ogre's Plugin_CgProgramManager plugin (which is necessary for PagedGeometry to work properly).


Strange, it seem as if CgProgramManager is not part of ogre library of ubuntu. I think I'll ask from ubuntu project. Seems OctreeSceneManager and RenderSystem_GL are part of the library in ubuntu.

Do you know if it is easy to add roads to the scene greated with PagedGeometry plugin?

JohnJ

30-11-2007 15:29:44

Does the example binaries run as a such from directory PagedGeometry/examples/source or should they be copied to some other location?
The examples usually compile to PagedGeometry/examples/bin.

Strange, it seem as if CgProgramManager is not part of ogre library of ubuntu. I think I'll ask from ubuntu project. Seems OctreeSceneManager and RenderSystem_GL are part of the library in ubuntu.
Yes, that is strange; the CG plugin is pretty important to a lot of Ogre projects, so it doesn't seem like it should just be "missing". I suspect it might have something to do with CG being nVidia's property (non open-source), though, so maybe that causes issues with whatever method you used to download/install Ogre.

Do you know if it is easy to add roads to the scene greated with PagedGeometry plugin?
(Sorry I forgot you asked this earlier). Yes, you can easily add roads with PagedGeometry, if by roads you mean full control over the flow of trees, grass, etc. to the point where you can remove grass on roadways, etc. Of course you have full control over the trees since you place them manually with TreeLoader2D or TreeLoader3D, but grass is a little different.

By default, grass appears everywhere, but you can apply a density map which controls where grass will grow. Carving out grass where your roads are is as easy as drawing a black line in your density map. The only disadvantage to a density map is that it is, of course, of a limited resolution, so the larger your world is, the larger you'll want to make your density map (which uses memory). I've found that for a terrain like Ogre's default one, a small 256x256 resolution density map provides more than enough resolution.

Sami

30-11-2007 19:09:48


Yes, that is strange; the CG plugin is pretty important to a lot of Ogre projects, so it doesn't seem like it should just be "missing". I suspect it might have something to do with CG being nVidia's property (non open-source), though, so maybe that causes issues with whatever method you used to download/install Ogre.

The examples usually compile to PagedGeometry/examples/bin.


Ubuntu repositories did not contain the CG plugin, I downloaded the sources from debian unstable and managed to compile them. After that, PagedGeometry examples compiled without problems.

I updated the Makefiles, they can be located from http://users.utu.fi/sampie/ogre/. Makefile-1 should be copied to PagedGeometry/source/Makefile. Makefle-2 should be copied to PagedGeometry/examples/source/Makefile.

The PagedGeometry can be compiled by first running make in PagedGeometry/source and then running make in PagedGeometry/examples/source. The example binaries are located in PagedGeometry/examples/bin/release.


Yes, you can easily add roads with PagedGeometry, if by roads you mean full control over the flow of trees, grass, etc. to the point where you can remove grass on roadways, etc. Of course you have full control over the trees since you place them manually with TreeLoader2D or TreeLoader3D, but grass is a little different.


Ok. And thank you for creating such a promising plugin.


By default, grass appears everywhere, but you can apply a density map which controls where grass will grow. Carving out grass where your roads are is as easy as drawing a black line in your density map. The only disadvantage to a density map is that it is, of course, of a limited resolution, so the larger your world is, the larger you'll want to make your density map (which uses memory). I've found that for a terrain like Ogre's default one, a small 256x256 resolution density map provides more than enough resolution.


Ok. I'll keep this in mind. I'll look this more closely when I get that far.

Amenothep

06-05-2008 12:31:17

I get on cmake and the Makefile linked in this thread (tried both), trying to compile PG on Ubuntu 64bit (Ogre is installed and running successfully)

g++ -I ../include -DOGRE_GUI_gtk -DOGRE_CONFIG_LITTLE_ENDIAN -I/usr/local/include -I/usr/local/include/OGRE -I/usr/local/include/OIS -c -o GrassLoader.o GrassLoader.cpp

In Datei, eingefügt von ../include/GrassLoader.h:15,
von GrassLoader.cpp:11:
../include/PropertyMaps.h:245:7: Warning: no new line at the eof
In Datei, eingefügt von GrassLoader.cpp:13:
../include/PropertyMaps.h:245:7: Warning: no new line at the eof
In file included from GrassLoader.cpp:11:
../include/GrassLoader.h:184: Error: zusätzliche Qualifizierung »Forests::GrassLoader::« an Element »generateGrass_QUAD«
../include/GrassLoader.h:185: Fehler: zusätzliche Qualifizierung »Forests::GrassLoader::« an Element »generateGrass_CROSSQUADS«
../include/GrassLoader.h:186: Fehler: zusätzliche Qualifizierung »Forests::GrassLoader::« an Element »generateGrass_SPRITE«
me@Lin-VLC:~/Desktop/ogrenew/forests/forests/source$


zusätzliche Qualifizierung = additional Qualification


Any ideas :?: :?

Amenothep

06-05-2008 13:25:28

Ok

GrassLoader.h lines 184-6 have to look like this

//Helper functions
Ogre::Mesh *generateGrass_QUAD(PageInfo &page, GrassLayer *layer, float *grassPositions, unsigned int grassCount);
Ogre::Mesh *generateGrass_CROSSQUADS(PageInfo &page, GrassLayer *layer, float *grassPositions, unsigned int grassCount);
Ogre::Mesh *generateGrass_SPRITE(PageInfo &page, GrassLayer *layer, float *grassPositions, unsigned int grassCount);


to compile on my Ubuntu

apparently the compiler can't handle the old input any more.

Nodrev

14-05-2008 20:49:34

I made a patch to eliminate those errors on this thread some times ago.
It clean also a lot of warnings that appears using GCC, but it was for version 1.04 of paged geometry...
Maybe it's possible to merge with the last version, i haven"t try it for the moment.