Basic tutorial 6 throws exception (File not found)

Problems building or running the engine, queries about how to use features etc.
Post Reply
danielspengler99
Gnoblar
Posts: 16
Joined: Mon Oct 16, 2017 1:47 am
x 2

Basic tutorial 6 throws exception (File not found)

Post by danielspengler99 »

Hello together,
I found an tutorial which is providing a overview about building an ogre program yourself (without any appContexts or stuff like that). I read over the sections which are loading and initializing the resources for ogre and I am getting a file not found exception. Here is the log entry:
17:47:02: Parsing scripts for resource group Autodetect
17:47:02: Finished parsing scripts for resource group Autodetect
17:47:02: Creating resources for group Autodetect
17:47:02: All done
17:47:02: Parsing scripts for resource group General
17:47:02: Parsing script DualQuaternion.program
17:47:02: FileNotFoundException: Cannot locate resource DualQuaternion_Common.glsl in resource group General. in ResourceGroupManager::openResource at D:\SDKs\ogre-1.10.8\OgreMain\src\OgreResourceGroupManager.cpp (line 708)

I provide you my function which is doing all the stuff with resources and scenes below. Note: I didn't implement the sceneManager or anything to display because I wanted to check if everything is working and now I am getting this log-messages...

I am wondering why it is searching in this file. I mean this is really not the location of my program. This is the location of where I built my OgreSDK. Can you give me a hint what I can do?

I already tried to debug the program, but the exception is acurring in the last line, everytime. When I add for example a scene manager the exception is thrown in this part of code.

Also I am wondering that I can't find log-messages about the creation of the group [Essentials] which should be the very first one... What are I am doing wrong?

Code: Select all

bool Application::init()
{
  
  //setting names for config files.
  pluginsCFG = "plugins.cfg";
  resourcesCFG = "resources.cfg";

  // creating the root object which will load plugins.
  root = new Ogre::Root(pluginsCFG);

  //creating config file and loading resources.cfg in it.
  Ogre::ConfigFile configFile;
  configFile.load(resourcesCFG);


  // creating strings in which filepath and location type 
  //for resources are saved
  Ogre::String filePath, locationType;

  //Getting Section iterator for sections like [general]
  Ogre::ConfigFile::SectionIterator sectionIterator = configFile.getSectionIterator();

  //getting all sections:
  while (sectionIterator.hasMoreElements()) {
    //Iterator for items in the sections
    Ogre::ConfigFile::SettingsMultiMap* items= sectionIterator.getNext();
    Ogre::ConfigFile::SettingsMultiMap::iterator itemIterator;
    
    //Get Items in section
    for (itemIterator = items->begin(); itemIterator != items->end(); ++itemIterator) {
      //Saving pair in our strings (filePath and locationType)
      locationType = itemIterator->first;
      filePath = itemIterator->second;

      // Adding this to resource locations
      Ogre::ResourceGroupManager::getSingleton().addResourceLocation(filePath, locationType);

    }
  }


  //Renderwindow
  Ogre::RenderWindow* renderWindow;

  //showing config dialog just when ogre.cfg couldn't be find.
  if (!(root->restoreConfig() || root->showConfigDialog())) return false;

  renderWindow = root->initialise(true, "renderWindow");

  //Set number of default mipmaps.
  Ogre::TextureManager::getSingleton().setDefaultNumMipmaps(5);

  //Initialize all resource groups.
  Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups();

  return true;
}


Regards,
Daniel
danielspengler99
Gnoblar
Posts: 16
Joined: Mon Oct 16, 2017 1:47 am
x 2

Re: Basic tutorial 6 throws exception (File not found)

Post by danielspengler99 »

Hello,

I could solve this issue after some time:

The log message is confusing on the one hand and on the other it is clear. You need to add some additional paths to your resources.cfg. Just use the search function from windows for the missing file and use the path to get the resources.

Now I am getting another error in the log:

00:59:49: InvalidStateException: RenderSystem does not support FixedFunction, but technique has no Vertex Shader: Ogre/Tusks in SceneManager::_setPass at D:\SDKs\ogre-1.10.8\OgreMain\src\OgreSceneManager.cpp (line 1034)


The problem here is that I even don't know what this error means. At first I thought it had to do something with my graphics card and I started an Internet search and found that many are complaining that their program don't use the second GPU in laptops... I thought it was the same issue and changed the settings of my NVIDIA driver, so it uses the GPU for everything, but it seems I was wrong. The error is still there. I will post my function here which is setting up the scene. I hope you can help me!

Code: Select all

[code]
//See the first post in order to get the resource loader stuff

Ogre::SceneManager* sceneManager;
  sceneManager = root->createSceneManager(Ogre::ST_GENERIC);


  Ogre::Camera* camera;
  camera = sceneManager->createCamera("main");
  camera->setPosition(0, 0, 80);
  camera->lookAt(0, 0, -300);
  camera->setNearClipDistance(5);

  Ogre::Viewport* viewport = renderWindow->addViewport(camera);
  viewport->setBackgroundColour(Ogre::ColourValue(0, 0, 0));
  camera->setAspectRatio(Ogre::Real(viewport->getActualWidth()) / Ogre::Real(viewport->getActualHeight()));

  Ogre::Entity* ogreHeadEntity = sceneManager->createEntity("ogrehead.mesh");
  Ogre::SceneNode* ogreHeadSceneNode = sceneManager->getRootSceneNode()->createChildSceneNode();
  ogreHeadSceneNode->attachObject(ogreHeadEntity);

  sceneManager->setAmbientLight(Ogre::ColourValue(1.0, 1.0, 1.0));
  Ogre::Light* light = sceneManager->createLight("mainLight");
  light->setPosition(20, 80, 50);


  while (true) {
    Ogre::WindowEventUtilities::messagePump();

    if (renderWindow->isClosed()) return false;

    if (!root->renderOneFrame()) return false;
  }

  return true;
}


[/code]

Thank you in advance.


Short Update:
I tried now to use a mesh which should be indipendent from the media folder: The Sinbat file. But here I am getting the same error, atleast almost. This time it says that the RenderSystem doesn't support fixedFunction and the part Sinbat/clothes has now vertex shader....
I am using the openGL3+ RS. Any way to fix this?
Regards,
Daniel
James_W
Gnoblar
Posts: 13
Joined: Mon Mar 05, 2018 4:25 am

Re: Basic tutorial 6 throws exception (File not found)

Post by James_W »

I am trying the same example with the same missing vertex shader error message. For me it is the ogre "earring" that has the problem but I think it is the same issue (and same message).

All I can think of is that the sample browser is able to use these mesh models without problems so there should be a way to provide a vertex shader to make these meshes happy somehow. You can look at the code for the "CameraTrack" sample which also uses that ogrehead mesh in a similar way. When I run it via the samplebrowser it works just fine -- not sure what is different with the tutorial code.
James_W
Gnoblar
Posts: 13
Joined: Mon Mar 05, 2018 4:25 am

Re: Basic tutorial 6 throws exception (File not found)

Post by James_W »

For references this is the error message regarding the missing vertex shader:

Error message:
InvalidStateException: RenderSystem does not support
FixedFunction, but technique has no VertexShader:
Ogre/Earring in SceneManager::_setPass at
C:\ogre3d-1.10.11-src\ogre-1.10.11\OgreMain\src\OgreSceneManager.cpp (line 1035)

I think the tutorial is broken. Furthermore questions have been up on this forum asking for help for over 1 year with no response from the team.
My interpretation is that tutorial 6 is now orphaned -- the Ogre team has decided they like working in the training wheels tutorials where you rely heavily on the provided tutorial frameworks:
http://wiki.ogre3d.org/Ogre+Wiki+Tutorial+Framework
Unfortunately this means anyone wanting to try Ogre properly will have to look somewhere else for demo code.
Hilarius86
Halfling
Posts: 48
Joined: Thu Feb 14, 2019 11:27 am
x 8

Re: Basic tutorial 6 throws exception (File not found)

Post by Hilarius86 »

Even though I don't like to necropost: I had a similar mistake, was guided here via Google and found that I used the wrong ResourceGroup. Maybe it's helpful for the next one passing by.
Post Reply