A few issues

Discussion area about developing or extending OGRE, adding plugins for it or building applications on it. No newbie questions please, use the Help forum for that.
User avatar
volca
Gnome
Posts: 393
Joined: Thu Dec 08, 2005 9:57 pm
x 1

A few issues

Post by volca »

Hey Guys,

yesterday I spent my evening porting my project from ogre 1.7 to ogre 1.9 and encountered a few troubling bugs. So I'd like you to tell me I'm doing something wrong :)

1. OGRE.pc on Arch

Code: Select all

prefix=/usr
exec_prefix=${prefix}
libdir=${prefix}/lib
includedir=${prefix}/include
plugindir=${libdir}/OGRE

Name: OGRE
Description: Object-Oriented Graphics Rendering Engine
Version: 1.9.0
URL: http://www.ogre3d.org
Libs: -L${libdir} -lOgreMain
Cflags: -I${includedir} -I${includedir}/OGRE -pthread
and the same lib in lib deps:

Code: Select all

ldd /usr/lib/libOgreMain.so
	linux-vdso.so.1 (0x00007fff2f7fe000)
	libX11.so.6 => /usr/lib/libX11.so.6 (0x00007fdfbcd26000)
	libXt.so.6 => /usr/lib/libXt.so.6 (0x00007fdfbcabf000)
	libXaw.so.7 => /usr/lib/libXaw.so.7 (0x00007fdfbc84d000)
	libpthread.so.0 => /usr/lib/libpthread.so.0 (0x00007fdfbc62f000)
	libdl.so.2 => /usr/lib/libdl.so.2 (0x00007fdfbc42b000)
	libboost_thread.so.1.55.0 => /usr/lib/libboost_thread.so.1.55.0 (0x00007fdfbc213000)
	libboost_system.so.1.55.0 => /usr/lib/libboost_system.so.1.55.0 (0x00007fdfbc00e000)
	libfreeimage.so.3 => /usr/lib/libfreeimage.so.3 (0x00007fdfbb9be000)
	libzzip-0.so.13 => /usr/lib/libzzip-0.so.13 (0x00007fdfbb7b6000)
	libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007fdfbb4b1000)
	libm.so.6 => /usr/lib/libm.so.6 (0x00007fdfbb1b0000)
	libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x00007fdfbaf9a000)
	libc.so.6 => /usr/lib/libc.so.6 (0x00007fdfbabf1000)
	libxcb.so.1 => /usr/lib/libxcb.so.1 (0x00007fdfba9d1000)
	libSM.so.6 => /usr/lib/libSM.so.6 (0x00007fdfba7c9000)
	libICE.so.6 => /usr/lib/libICE.so.6 (0x00007fdfba5ac000)
	libXext.so.6 => /usr/lib/libXext.so.6 (0x00007fdfba39a000)
	libXmu.so.6 => /usr/lib/libXmu.so.6 (0x00007fdfba17f000)
	libXpm.so.4 => /usr/lib/libXpm.so.4 (0x00007fdfb9f6c000)
	/usr/lib64/ld-linux-x86-64.so.2 (0x00007fdfbd79e000)
	librt.so.1 => /usr/lib/librt.so.1 (0x00007fdfb9d64000)
	libz.so.1 => /usr/lib/libz.so.1 (0x00007fdfb9b4d000)
	libXau.so.6 => /usr/lib/libXau.so.6 (0x00007fdfb9949000)
	libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0x00007fdfb9743000)
	libuuid.so.1 => /usr/lib/libuuid.so.1 (0x00007fdfb953d000)
The boost deps are missing from the pkgconfig script. I had to edit that file manually for now, but as it seems ogre generates these, so am reporting.

2. FileInfo for zip files
It seems ZipArchive has a bug, at least I could not get it to work as intended. filename part of this struct contained basename, without path, and all searches with full path then fail.

I had to jump through loops to get it working. This:

Code: Select all

StringVectorPtr texnames = ResourceGroupManager::getSingleton().findResourceNames(resourceGroup, textureName + ".*");
Did not work for resources (textureName == "VicM01/VIC61CO") etc.

I had to list all file info's matching the filename part only and then match the path in cycle. I still have some problems in other parts of the code because of this.

3. There seems to be no check when loading images through codec on the validity of the stream - Codec gets NULL DataStreamPtr if the texture in question does not exist (?)
Now I don't have the backtrace handy now, but my custom image codec (decode method) receives null DataStreamPtrs and sure enough it segfaulted on them. Hotfixed this by checking this and throwing exception but then:

4. SubEntities sometimes have NULL MaterialPtr then


Please tell me I'm doing something wrong, and not that Ogre has so many issues now :)

Edit: Fixed wording.
Also - should I just jump the gun and port to Ogre 2.0 to avoid these issues altogeter? It is my plan to do so anyway, but my custom SceneManager will need a big rewrite to comply with Ogre 2.0, so am hesitating.
Image
User avatar
volca
Gnome
Posts: 393
Joined: Thu Dec 08, 2005 9:57 pm
x 1

Re: A few issues

Post by volca »

Okay, looking at the source code, there seems to be an extra branch in OgreZip.cpp load method:

Code: Select all

+				else
+				{
+					info.filename = info.basename;
+				}
This seems to have been removed in changeset 3566:047d710287b5, and got back in 4740:0adb7d41cba9
Is there any agreement on how the archive should work? filename should contain the whole path, as indicated by the documentation, right? The fix seems invalid to me, as it breaks subfolder handling...
Image
Transporter
Minaton
Posts: 933
Joined: Mon Mar 05, 2012 11:37 am
Location: Germany
x 110

Re: A few issues

Post by Transporter »

volca wrote:The boost deps are missing from the pkgconfig script. I had to edit that file manually for now, but as it seems ogre generates these, so am reporting.
This looks like a bug. Could you please create tickets http://ogre3d.atlassian.net/browse/OGRE for bugs you've found? It would be nice if you could also add your fixes to the tickets to fix them bugs asap.
volca wrote:4. SubEntities sometimes have NULL MaterialPtr then
Could be possible if you don't setup a material for it.

Please tell me I'm doing something wrong, and not that Ogre has so many issues now :)
volca wrote:Also - should I just jump the gun and port to Ogre 2.0 to avoid these issues altogeter? It is my plan to do so anyway, but my custom SceneManager will need a big rewrite to comply with Ogre 2.0, so am hesitating.
I'm using Ogre 2.0 for all my projects now. It is really powerful but it's a large break to 1.x. If you need multithreading or if you have a few thousand objects you should move on to 2.0.
User avatar
volca
Gnome
Posts: 393
Joined: Thu Dec 08, 2005 9:57 pm
x 1

Re: A few issues

Post by volca »

Thanks for your reply, I'll report both issues as soon as I get the time to do it.

In the meantime I'll probably just clone and fix the OgreZip.cpp/.h anyway, so patch is not a problem.
Image
User avatar
volca
Gnome
Posts: 393
Joined: Thu Dec 08, 2005 9:57 pm
x 1

Re: A few issues

Post by volca »

I've posted a pull request on the zip archive issue and will look at the cmake scripts soon.
Image
User avatar
volca
Gnome
Posts: 393
Joined: Thu Dec 08, 2005 9:57 pm
x 1

Re: A few issues

Post by volca »

Looking at v2-0 the same problem is there in OgreZip.cpp, I'd be delighted if this bug wasn't there, at least in v2-0. The doc still says:

Code: Select all

 
        /// The file's fully qualified name
        String filename;
        /// Base filename
        String basename;
There is no reason to have a duplicit info in the FileInfo struct, AMIRITE?
Image
User avatar
volca
Gnome
Posts: 393
Joined: Thu Dec 08, 2005 9:57 pm
x 1

Re: A few issues

Post by volca »

Is ogre essentially a dead or undermanned project now? I have to admit I am quite unhappy with the way the patch was rejected. https://bitbucket.org/sinbad/ogre/pull- ... h/activity
Image
User avatar
Wolfmanfx
OGRE Team Member
OGRE Team Member
Posts: 1525
Joined: Fri Feb 03, 2006 10:37 pm
Location: Austria - Leoben
x 99

Re: A few issues

Post by Wolfmanfx »

Sorry but this patch come several times up - and when I apply it we loose the feature that materials get parsed inside subfolders. Maybe you can fix it in a way that both usecases are working.

Btw what has the patch rejection todo with the claim that ogre is dead?

[edit]
Also regarding the bug - we have unit tests which are testing the archive you are welcome to extend them so I can consider it as an bug.
There are many things done (and in progress) on the ogre core side which are not public just yet.
User avatar
volca
Gnome
Posts: 393
Joined: Thu Dec 08, 2005 9:57 pm
x 1

Re: A few issues

Post by volca »

You know, this was just a cold blooded experiment if someone replies when I write something off the charts.

Something has surely changed because this was not the behavior of ogre 1.4 or 1.6 (dunno about the lattter). I'll look into the problem you mention.

Don't you think this should all go into some automated test suite, does ogre have any?
Image
User avatar
Wolfmanfx
OGRE Team Member
OGRE Team Member
Posts: 1525
Joined: Fri Feb 03, 2006 10:37 pm
Location: Austria - Leoben
x 99

Re: A few issues

Post by Wolfmanfx »

Yes we have running CI (David is hosting it) using Bamboo.