Ogre - Cannot find requested emitter type. in ParticleSystem

Anything and everything that's related to OGRE or the wider graphics field that doesn't fit into the other forums.
Post Reply
mcajkovs
Gnoblar
Posts: 1
Joined: Sat Mar 11, 2017 2:16 pm

Ogre - Cannot find requested emitter type. in ParticleSystem

Post by mcajkovs »

Hello, I'm trying to run TinyOgre from this tutorial but I still get the following message:
OGRE EXCEPTION(2:InvalidParameterException): Cannot find requested emitter type. in ParticleSystemManager::_createEmitter at C:/Intel/INDE/OgreSDK_1-9-0/Ogre/OgreMain/src/OgreParticleSystemManager.cpp (line 270)
Here is my code:

TinyOgre.cpp

Code: Select all

    /*
    -----------------------------------------------------------------------------
    Filename:    TinyOgre.cpp
    -----------------------------------------------------------------------------
    
    This source file is part of the
       ___                 __    __ _ _    _ 
      /___\__ _ _ __ ___  / / /\ \ (_) | _(_)
     //  // _` | '__/ _ \ \ \/  \/ / | |/ / |
    / \_// (_| | | |  __/  \  /\  /| |   <| |
    \___/ \__, |_|  \___|   \/  \/ |_|_|\_\_|
          |___/                              
          Tutorial Framework
          http://www.ogre3d.org/tikiwiki/
    -----------------------------------------------------------------------------
    */
    #include "TinyOgre.h"
    
    #include <OgreLogManager.h>
    #include <OgreViewport.h>
    #include <OgreConfigFile.h>
    #include <OgreEntity.h>
    #include <OgreWindowEventUtilities.h>
    
    //-------------------------------------------------------------------------------------
    TinyOgre::TinyOgre(void)
        : mRoot(0),
        mCamera(0),
        mSceneMgr(0),
        mWindow(0),
        mResourcesCfg(Ogre::StringUtil::BLANK),
        mPluginsCfg(Ogre::StringUtil::BLANK)
    {
    }
    //-------------------------------------------------------------------------------------
    TinyOgre::~TinyOgre(void)
    {
        delete mRoot;
    }
    
    bool TinyOgre::go(void)
    {
    #ifdef _DEBUG
        mResourcesCfg = "resources_d.cfg";
        mPluginsCfg = "plugins_d.cfg";
    #else
        mResourcesCfg = "resources.cfg";
        mPluginsCfg = "plugins.cfg";
    #endif
    
        // construct Ogre::Root
        mRoot = new Ogre::Root(mPluginsCfg);
    
    //-------------------------------------------------------------------------------------
        // setup resources
        // Load resource paths from config file
        Ogre::ConfigFile cf;
        cf.load(mResourcesCfg);
    
        // Go through all sections & settings in the file
        Ogre::ConfigFile::SectionIterator seci = cf.getSectionIterator();
    
        Ogre::String secName, typeName, archName;
        while (seci.hasMoreElements())
        {
            secName = seci.peekNextKey();
            Ogre::ConfigFile::SettingsMultiMap *settings = seci.getNext();
            Ogre::ConfigFile::SettingsMultiMap::iterator i;
            for (i = settings->begin(); i != settings->end(); ++i)
            {
                typeName = i->first;
                archName = i->second;
                Ogre::ResourceGroupManager::getSingleton().addResourceLocation(
                    archName, typeName, secName);
            }
        }
    //-------------------------------------------------------------------------------------
        // configure
        // Show the configuration dialog and initialise the system
        // You can skip this and use root.restoreConfig() to load configuration
        // settings if you were sure there are valid ones saved in ogre.cfg
        if(mRoot->restoreConfig() || mRoot->showConfigDialog())
        {
            // If returned true, user clicked OK so initialise
            // Here we choose to let the system create a default rendering window by passing 'true'
            mWindow = mRoot->initialise(true, "TinyOgre Render Window");
        }
        else
        {
            return false;
        }
    //-------------------------------------------------------------------------------------
        // choose scenemanager
        // Get the SceneManager, in this case a generic one
        mSceneMgr = mRoot->createSceneManager(Ogre::ST_GENERIC);
    //-------------------------------------------------------------------------------------
        // create camera
        // Create the camera
        mCamera = mSceneMgr->createCamera("PlayerCam");
    
        // Position it at 500 in Z direction
        mCamera->setPosition(Ogre::Vector3(0,0,80));
        // Look back along -Z
        mCamera->lookAt(Ogre::Vector3(0,0,-300));
        mCamera->setNearClipDistance(5);
    
    //-------------------------------------------------------------------------------------
        // create viewports
        // Create one viewport, entire window
        Ogre::Viewport* vp = mWindow->addViewport(mCamera);
        vp->setBackgroundColour(Ogre::ColourValue(0,0,0));
    
        // Alter the camera aspect ratio to match the viewport
        mCamera->setAspectRatio(
            Ogre::Real(vp->getActualWidth()) / Ogre::Real(vp->getActualHeight()));
    //-------------------------------------------------------------------------------------
        // Set default mipmap level (NB some APIs ignore this)
        Ogre::TextureManager::getSingleton().setDefaultNumMipmaps(5);
    //-------------------------------------------------------------------------------------
        // Create any resource listeners (for loading screens)
        //createResourceListener();
    //-------------------------------------------------------------------------------------
        // load resources
        Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
    //-------------------------------------------------------------------------------------
        // Create the scene
        Ogre::Entity* ogreHead = mSceneMgr->createEntity("Head", "ogrehead.mesh");
    
        Ogre::SceneNode* headNode = mSceneMgr->getRootSceneNode()->createChildSceneNode();
        headNode->attachObject(ogreHead);
    
        // Set ambient light
        mSceneMgr->setAmbientLight(Ogre::ColourValue(0.5, 0.5, 0.5));
    
        // Create a light
        Ogre::Light* l = mSceneMgr->createLight("MainLight");
        l->setPosition(20,80,50);
    //-------------------------------------------------------------------------------------
    
        while(true)
        {
            // Pump window messages for nice behaviour
            Ogre::WindowEventUtilities::messagePump();
    
            if(mWindow->isClosed())
            {
                return false;
            }
    
            // Render a frame
            if(!mRoot->renderOneFrame()) return false;
        }
    
        // We should never be able to reach this corner
        // but return true to calm down our compiler
        return true;
    }
    
    
    #if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
    #define WIN32_LEAN_AND_MEAN
    #include "windows.h"
    #endif
    
    #ifdef __cplusplus
    extern "C" {
    #endif
    
    #if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
        INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT )
    #else
        int main(int argc, char *argv[])
    #endif
        {
            // Create application object
            TinyOgre app;
    
            try {
                app.go();
            } catch( Ogre::Exception& e ) {
    #if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
                MessageBox( NULL, e.getFullDescription().c_str(), "An exception has occured!", MB_OK | MB_ICONERROR | MB_TASKMODAL);
    #else
                std::cerr << "An exception has occured: " <<
                    e.getFullDescription().c_str() << std::endl;
    #endif
            }
    
            return 0;
        }
    
    #ifdef __cplusplus
    }
    #endif
TinyOgre.h

Code: Select all

    /*
    -----------------------------------------------------------------------------
    Filename:    TinyOgre.h
    -----------------------------------------------------------------------------
    
    This source file is part of the
       ___                 __    __ _ _    _ 
      /___\__ _ _ __ ___  / / /\ \ (_) | _(_)
     //  // _` | '__/ _ \ \ \/  \/ / | |/ / |
    / \_// (_| | | |  __/  \  /\  /| |   <| |
    \___/ \__, |_|  \___|   \/  \/ |_|_|\_\_|
          |___/                              
          Tutorial Framework
          http://www.ogre3d.org/tikiwiki/
    -----------------------------------------------------------------------------
    */
    #ifndef __TinyOgre_h_
    #define __TinyOgre_h_
    
    #include <OgreRoot.h>
    #include <OgreCamera.h>
    #include <OgreSceneManager.h>
    #include <OgreRenderWindow.h>
    
    class TinyOgre
    {
    public:
        TinyOgre(void);
        virtual ~TinyOgre(void);
        bool go(void);
    protected:
        Ogre::Root *mRoot;
        Ogre::Camera* mCamera;
        Ogre::SceneManager* mSceneMgr;
        Ogre::RenderWindow* mWindow;
        Ogre::String mResourcesCfg;
        Ogre::String mPluginsCfg;
    };
    
    #endif // #ifndef __TinyOgre_h_
My resources.cfg is following (I've composed it from some other tutorials on web):

Code: Select all

    # Resources required by the sample browser and most samples.
    [Essential]
    Zip=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/packs/SdkTrays.zip
    Zip=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/packs/profiler.zip
    FileSystem=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/thumbnails
    
    # Common sample resources needed by many of the samples.
    # Rarely used resources should be separately loaded by the
    # samples which require them.
    [Popular]
    FileSystem=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/fonts
    FileSystem=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/materials/programs
    FileSystem=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/materials/programs/Cg
    FileSystem=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/materials/programs/GLSL
    FileSystem=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/materials/programs/GLSL150
    FileSystem=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/materials/programs/GLSL400
    FileSystem=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/materials/programs/GLSLES
    FileSystem=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/materials/programs/HLSL
    FileSystem=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/materials/scripts
    FileSystem=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/materials/textures
    FileSystem=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/materials/textures/nvidia
    FileSystem=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/materials/scripts/SSAO
    FileSystem=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/materials/textures/SSAO
    FileSystem=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/RTShaderLib/Cg
    FileSystem=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/RTShaderLib/GLSL
    FileSystem=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/models
    FileSystem=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/particle
    FileSystem=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/DeferredShadingMedia
    FileSystem=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/PCZAppMedia
    FileSystem=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/RTShaderLib
    FileSystem=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/RTShaderLib/materials
    FileSystem=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/PCZAppMedia
    FileSystem=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/volumeTerrain
    Zip=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/packs/cubemap.zip
    Zip=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/packs/cubemapsJS.zip
    Zip=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/packs/dragon.zip
    Zip=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/packs/fresneldemo.zip
    Zip=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/packs/ogretestmap.zip
    Zip=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/packs/ogredance.zip
    Zip=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/packs/Sinbad.zip
    Zip=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/packs/skybox.zip
    Zip=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/volumeTerrain/volumeTerrainBig.zip
    
    FileSystem=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/ParticleFX
    
    [General]
    FileSystem=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media
    
    # Materials for visual tests
    [Tests]
    FileSystem=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Tests/Media
I have noticed that when I comment following lines:

Code: Select all

    #FileSystem=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/materials/programs/GLSL
    #FileSystem=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/materials/programs/GLSL150
    #FileSystem=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/materials/programs/GLSL400
    #FileSystem=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/materials/programs/GLSLES
    #FileSystem=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/materials/programs/HLSL
    #FileSystem=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/RTShaderLib/Cg
    #FileSystem=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/RTShaderLib/GLSL
then I get different error message:
OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource DualQuaternion_Common.glsl in resource group Popular or any other group. in ResourceGroupManager::openResource at C:/Intel/INDE/OgreSDK_1-9-0/Ogre/OgreMain/src/OgreResourceGroupManager.cpp (line 756)

If I comment following lines:

Code: Select all

    #FileSystem=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/materials/programs/GLSL
    #FileSystem=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/materials/programs/GLSL150
    #FileSystem=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/materials/programs/GLSL400
    #FileSystem=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/materials/programs/GLSLES
    #FileSystem=C:/Intel/INDE/OgreSDK_1-9-0/Ogre/Samples/Media/materials/programs/HLSL
then I get this error message:
OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource shadows.glsl in resource group Popular or any other group. in ResourceGroupManager::openResource at C:/Intel/INDE/OgreSDK_1-9-0/Ogre/OgreMain/src/OgreResourceGroupManager.cpp (line 756)
Let me further clarify my situation; we are using ogre in our current project for some visualization and math that it provides (personally I do not do ogre but other project parts). Nowadays I wanted to compile "hello world" ogre project and start to playing with. I'm using VisualStudio 2013 and Ogre 1.9. I suspect that the problem might be that I have ogre installed not according to wiki but instead it is copied from another PC. But I'm 100% sure that this is working installation because I have several team members which are using same installation (same paths, same environment variables etc) and for our project it is working fine, so I would not to like mess with current installation. For example following code which is also using ogre is working fine for me (but this example is not using resources.cfg).

PS: I've cross posted the question also here and I got the answer that I should load "Plugin_ParticleFX" but I do not know how. How can I debug those problems? Thanks.
Post Reply