Page 1 of 1

Cannot run the Sample Broser

Posted: Sun Apr 07, 2019 2:36 am
by hiroo
Ogre Version: :1.11.5:
Operating System: :FreeBSD (12-stable):
Render System: :OpenGL Rendering Subsystem:

I am building and trying to run the SampleBroser, but did not succeed running SampleBrowser yet.
It seems that sample resources.cfg is not suitable for SampleBrowser. Where can I find configuration for SampleBrowser?


First, when I set parameters in initial window and pressed "accept" button, Exception that says ResouceGroup "Essential" does not exist.
I forgot to save ogre.log for this, sorry.

From the ResourceGroupManager constructor, the Resource Group "Essential" is not included in the default Resource Groups
https://github.com/OGRECave/ogre/blob/v ... anager.cpp

and I could not find the code that createResourceGroup("Essential"), but initialiseResourceGroup("Essential") happens in loadResources() function of
https://github.com/OGRECave/ogre/blob/v ... eBrowser.h

Second, I added createResourceGroup("Essential") as below (though it is certainly wrong to add here. Just an ad-hoc trial.)

Code: Select all

--- Samples/Browser/include/SampleBrowser.h.orig        2018-12-20 21:51:13 UTC
+++ Samples/Browser/include/SampleBrowser.h
@@ -870,6 +870,8 @@ namespace OgreBites
           -----------------------------------------------------------------------------*/
         virtual void loadResources()
         {
+            if (! Ogre::ResourceGroupManager::getSingleton().resourceGroupExists("Essential"))
+              Ogre::ResourceGroupManager::getSingleton().createResourceGroup("Essential", true);
             Ogre::ResourceGroupManager::getSingleton().initialiseResourceGroup("Essential");
             mTrayMgr = new TrayManager("BrowserControls", getRenderWindow(), this);
             mTrayMgr->showBackdrop("SdkTrays/Bands"); 
Running SampleBrowser with this code showed the error below:

Code: Select all

An exception has occurred: ItemIdentityException: OverlayElement with name SdkTrays/Cursor not found. in OverlayManager::getOverlayElementImpl at /wrkdirs/usr/ports/graphics/ogre3d/work/ogre-1.11.5/Components/Overlay/src/OgreOverlayManager.cpp (line 693)
resources.cfg is what was installed under /usr/local/share/OGRE and its content is:

Code: Select all

# Resources required by the sample browser and most samples.
[Essential]
Zip=/usr/local/share/OGRE/Media/packs/SdkTrays.zip
Zip=/usr/local/share/OGRE/Media/packs/profiler.zip
FileSystem=/usr/local/share/OGRE/Media/thumbnails

# Common sample resources needed by many of the samples.
# Rarely used resources should be separately loaded by the
# samples which require them.
[General]
# Bites uses the next entry to discover the platform shaders
FileSystem=/usr/local/share/OGRE/Media
FileSystem=/usr/local/share/OGRE/Media/fonts
FileSystem=/usr/local/share/OGRE/Media/materials/programs
FileSystem=/usr/local/share/OGRE/Media/materials/scripts
FileSystem=/usr/local/share/OGRE/Media/materials/textures
FileSystem=/usr/local/share/OGRE/Media/materials/textures/nvidia
FileSystem=/usr/local/share/OGRE/Media/models
FileSystem=/usr/local/share/OGRE/Media/particle
FileSystem=/usr/local/share/OGRE/Media/DeferredShadingMedia
FileSystem=/usr/local/share/OGRE/Media/DeferredShadingMedia/DeferredShading/post
FileSystem=/usr/local/share/OGRE/Media/PCZAppMedia
FileSystem=/usr/local/share/OGRE/Media/materials/scripts/SSAO
FileSystem=/usr/local/share/OGRE/Media/materials/textures/SSAO
FileSystem=/usr/local/share/OGRE/Media/volumeTerrain
Zip=/usr/local/share/OGRE/Media/packs/cubemap.zip
Zip=/usr/local/share/OGRE/Media/packs/cubemapsJS.zip
Zip=/usr/local/share/OGRE/Media/packs/dragon.zip
Zip=/usr/local/share/OGRE/Media/packs/fresneldemo.zip
Zip=/usr/local/share/OGRE/Media/packs/ogretestmap.zip
Zip=/usr/local/share/OGRE/Media/packs/ogredance.zip
Zip=/usr/local/share/OGRE/Media/packs/Sinbad.zip
Zip=/usr/local/share/OGRE/Media/packs/skybox.zip
Zip=/usr/local/share/OGRE/Media/volumeTerrain/volumeTerrainBig.zip

FileSystem=/usr/local/share/OGRE/Media/PBR
FileSystem=/usr/local/share/OGRE/Media/materials/textures/glTF2_IBL
Zip=/usr/local/share/OGRE/Media/packs/DamagedHelmet.zip

FileSystem=/usr/local/share/OGRE/Media/HLMS

# Materials for visual tests
[Tests]
FileSystem=/usr/local/Tests/Media
Full ogre.log is at: https://barleycorn.oikumene.net/ports-patch/ogre.log

Other changes I made to build Ogre 1.11.5 are as below, but it should not be the cause of the problem, I think.

Code: Select all

--- OgreMain/include/Ogre.i.orig        2019-03-30 12:47:36 UTC                
+++ OgreMain/include/Ogre.i
@@ -386,7 +386,7 @@ SHARED_PTR(HardwareUniformBuffer);
 %ignore Ogre::ResourceGroupManager::openResource(const String&, const String&, bool, Resource*) const;
 %ignore Ogre::ResourceGroupManager::openResource(const String&, const String&, bool) const;
 %include "OgreResourceGroupManager.h"
-#if SWIG_VERSION < 0x030012 || defined(SWIGJAVA)
+#if SWIG_VERSION <= 0x030012 || defined(SWIGJAVA)
 // conflicts with overloaded versions (GpuProgram, Texture)
 %ignore Ogre::ResourceManager::getResourceByName;

Code: Select all

--- OgreMain/include/OgreBitwise.h.orig 2019-03-30 05:11:05 UTC                
+++ OgreMain/include/OgreBitwise.h
@@ -29,6 +29,9 @@ THE SOFTWARE.
 #define _Bitwise_H__

 #include "OgrePrerequisites.h"
+#undef bswap16
+#undef bswap32
+#undef bswap64

 #ifndef __has_builtin
     // Compatibility with non-clang compilers  

Re: Cannot run the Sample Broser

Posted: Sun Apr 07, 2019 1:52 pm
by paroj
by the looks of it you have an empty resources.cfg in the same folder where the SampleBrowser executable is. It gets preferred over the system wide resource.cfg.
There are only the fallback resource locations in the ogre.log.

The changes in SampleBrowser.h are not needed. The group gets created automatically if an according location is added.

For details see: https://github.com/OGRECave/ogre/blob/v ... t.cpp#L550

Re: Cannot run the Sample Broser

Posted: Tue Apr 09, 2019 7:07 am
by hiroo
Thank you. I just wanted to see that the sample program works to submit package for FreeBSD.
It turned out that I forgot -DNDEBUG when building and failed at an assert, just after finishing loading modules.

Code: Select all

Assertion failed: (minval <= maxval && "Invalid clamp range"), function Clamp, file /wrkdirs/usr/ports/graphics/ogre3d/work/ogre-1.11.5/OgreMain/include/OgreMath.h, line 706.
I rebuilt with -DNDEBUG flag and it worked. (No samples appear in sample menu, but at least I reached there and could select configure or quit.)