Ogre .overlay and .fontdef is not parsing

Problems building or running the engine, queries about how to use features etc.
Post Reply
YukiML
Gnoblar
Posts: 3
Joined: Fri Apr 16, 2021 8:43 pm

Ogre .overlay and .fontdef is not parsing

Post by YukiML »

Operating System: Windows
Hi! I have problems with the parsing of both files. I've initialized the Overlay System before doing Ogre::ResourceGroupManager::getSingleton().addResourceLocation(). The files where the .fontdf and .overlay are found, are well located.

Code: Select all

_overlaySystem = new Ogre::OverlaySystem();
Ogre::ResourceGroupManager::getSingleton().addResourceLocation(arch, type, sec); 
Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
Console Log

Code: Select all

Added resource location 'Assets/Imagenes' of type 'FileSystem' to resource group 'General'
Added resource location 'Assets/fonts' of type 'FileSystem' to resource group 'General'
Also i have a problem with the default material BaseWhite-no-ligthting, which is used in Ogre to define flat materials(for example Panel material). I've initialized RTSS(because of BaseWhite material, and that actually works, but with BaseWhite no lighting material doesn't works)
Oogst
OGRE Expert User
OGRE Expert User
Posts: 1066
Joined: Mon Mar 29, 2004 8:49 pm
Location: the Netherlands
x 42
Contact:

Re: Ogre .overlay and .fontdef is not parsing

Post by Oogst »

I'm not sure I inderstand what you problem is exactly. You say ".overlay and .fontdef is not parsing", but what does that mean exactly? Are you getting an error/warning printed in Ogre.log, or a crash or an exception, or something looks different from what you were expecting?

I don't know whether this is what you're looking for, but I struggled with this myself when moving to Ogre 1.12, so for reference, this is how I initialise RTSS and overlays in my own project (and this works for me):

Code: Select all

Ogre::RTShader::ShaderGenerator::initialize();
auto shaderGenerator = Ogre::RTShader::ShaderGenerator::getSingletonPtr();
shaderGenerator->addSceneManager(sceneManager);
shaderGeneratorMaterialManagerListener = std::make_unique<OgreBites::SGTechniqueResolverListener>(shaderGenerator);
Ogre::MaterialManager::getSingleton().addListener(shaderGeneratorMaterialManagerListener.get());

overlaySystem = std::make_unique<Ogre::OverlaySystem>();
sceneManager->addRenderQueueListener(overlaySystem.get());
My dev blog
Awesomenauts: platforming MOBA (PC/Mac/Linux/XBox360/X1/PS3/PS4)
Blightbound: coop online dungeon crawler (PC)
Swords & Soldiers: side-scrolling RTS (Switch/PS3/Wii/PC/Mac/Linux/iPhone/iPad/Android)
Proun: abstract racing game (PC)
Cello Fortress: mixing game and live cello performance
The Ageless Gate: cello album
YukiML
Gnoblar
Posts: 3
Joined: Fri Apr 16, 2021 8:43 pm

Re: Ogre .overlay and .fontdef is not parsing

Post by YukiML »

Regarding parsing scripts it is alredy solved, but thanks! :D
However I'm trying to use a material in a overlay element but i got this Exception:

Code: Select all

Ogre::InvalidStateException::InvalidStateException: RenderSystem does not support FixedFunction, but technique of 'BaseWhiteNoLighting' has no Vertex Shader. Use the RTSS or write custom shaders. in SceneManager::_setPass at XXX
I initialize RTSS manually without using Ogre Bites by this way:

Code: Select all

if (Ogre::RTShader::ShaderGenerator::initialize())
	{
		// Grab the shader generator pointer.
		_mShaderGenerator = Ogre::RTShader::ShaderGenerator::getSingletonPtr();

		Ogre::String cachePath = _mFSLayer->getConfigFilePath("/Assets/ShaderCache");
		// Set shader cache path.
		_mShaderGenerator->setShaderCachePath(cachePath);

		// Set the scene manager.
		_mShaderGenerator->addSceneManager(_sceneManager);

		// Add a specialized sub-render (per-pixel lighting) state to the default scheme render state
		Ogre::RTShader::RenderState* pMainRenderState =
			_mShaderGenerator->createOrRetrieveRenderState(Ogre::RTShader::ShaderGenerator::DEFAULT_SCHEME_NAME).first;
		pMainRenderState->reset();

		//added
		_mTechniqueListener = new RTSSDefaultTechniqueListener(_mShaderGenerator);
		Ogre::MaterialManager::getSingleton().addListener(_mTechniqueListener);
I have no problem rendering materials for 3D Objects(they use BaseWhite) but with Overlay Elements Ogre needs a flat material called "BaseWhiteNoLighting"
Oogst
OGRE Expert User
OGRE Expert User
Posts: 1066
Joined: Mon Mar 29, 2004 8:49 pm
Location: the Netherlands
x 42
Contact:

Re: Ogre .overlay and .fontdef is not parsing

Post by Oogst »

I don't know what OgreBites does exactly, but I got the same error as you when I didn't use OgreBites::SGTechniqueResolverListener. Have you tried simply using that instead, or copying whatever is in it?
My dev blog
Awesomenauts: platforming MOBA (PC/Mac/Linux/XBox360/X1/PS3/PS4)
Blightbound: coop online dungeon crawler (PC)
Swords & Soldiers: side-scrolling RTS (Switch/PS3/Wii/PC/Mac/Linux/iPhone/iPad/Android)
Proun: abstract racing game (PC)
Cello Fortress: mixing game and live cello performance
The Ageless Gate: cello album
YukiML
Gnoblar
Posts: 3
Joined: Fri Apr 16, 2021 8:43 pm

Re: Ogre .overlay and .fontdef is not parsing

Post by YukiML »

Oogst wrote: Sat Apr 17, 2021 7:31 pm I don't know what OgreBites does exactly, but I got the same error as you when I didn't use OgreBites::SGTechniqueResolverListener. Have you tried simply using that instead, or copying whatever is in it?
I can't use OgreBites because in my application because I don't want to let OgreBites take control to execution loop.
Oogst
OGRE Expert User
OGRE Expert User
Posts: 1066
Joined: Mon Mar 29, 2004 8:49 pm
Location: the Netherlands
x 42
Contact:

Re: Ogre .overlay and .fontdef is not parsing

Post by Oogst »

I also don't use OgreBites for my main loop, but I use that one class from OgreBites nevertheless. As far as I can tell you don't need to use all of OgreBites to benefit from some parts of it.

Anyway, even if you don't want to use OgreBites at all, you could look at OgreBites::SGTechniqueResolverListener to see what it does, or give it a quick try to see whether it would fix your problem, and then investigate further.
My dev blog
Awesomenauts: platforming MOBA (PC/Mac/Linux/XBox360/X1/PS3/PS4)
Blightbound: coop online dungeon crawler (PC)
Swords & Soldiers: side-scrolling RTS (Switch/PS3/Wii/PC/Mac/Linux/iPhone/iPad/Android)
Proun: abstract racing game (PC)
Cello Fortress: mixing game and live cello performance
The Ageless Gate: cello album
Post Reply