[Solved] How to make a material use RTSS Topic is solved

Problems building or running the engine, queries about how to use features etc.
Post Reply
Oogst
OGRE Expert User
OGRE Expert User
Posts: 1067
Joined: Mon Mar 29, 2004 8:49 pm
Location: the Netherlands
x 43
Contact:

[Solved] How to make a material use RTSS

Post by Oogst »

Ogre Version: 1.12.11
Operating System: Windows 10
Render System: DirectX11

I'm migrating an Ogre 1.9 project to 1.12. Right now the game doesn't start because it gives an RTSS error. I think I've added the right things to make RTSS work, but apparently I haven't. What step am I missing here?

This is the error I get:
Ogre::InvalidStateException::InvalidStateException: RenderSystem does not support FixedFunction, but technique of 'LoadingScreen' has no Vertex Shader. Use the RTSS or write custom shaders, in SceneManager::_setPass at [...]OgreSceneManager.cpp (line 885)
This is how I initialise RTSS (plus some maybe relevant code around it):

Code: Select all

#include "OgreRTShaderSystem.h"
[...]
sceneManager = root->createSceneManager(Ogre::ST_GENERIC);
Ogre::RTShader::ShaderGenerator::initialize();
Ogre::RTShader::ShaderGenerator* shaderGenerator = Ogre::RTShader::ShaderGenerator::getSingletonPtr();
shaderGenerator->addSceneManager(sceneManager);
Ogre::OverlaySystem* overlaySystem = new Ogre::OverlaySystem();
sceneManager->addRenderQueueListener(overlaySystem);
OgreRTShaderSystem.dll is put in the same folder as the executable, and shaderGenerator isn't nullptr, so I'm guessing it is loading? I didn't put that DLL in Plugins.cfg, because it seems like OgreRTShaderSystem.dll isn't a plugin of the type that should be added there (it gives an error if I try that).

The material is very simple:

Code: Select all

material LoadingScreen
{
	technique
	{
		pass
		{
			texture_unit
			{
				texture LoadingScreen.png
				filtering linear linear none
			}
			lighting off
			depth_check off
			scene_blend alpha_blend
		}
	}
}
This material doesn't reference the RTSS at all, but I read here that "For fixed function function properties, the RTSS will read the standard pass and texture_unit definitions, so no changes are required.", so I figured that material script was still fine?

I'm using this specific material in an Overlay. Is the problem maybe that the OverlayManager doesn't use the SceneManager and isn't registered at RTSS? Or is that not relevant or not the case?

How can I make this material work with RTSS?
Last edited by Oogst on Sun Apr 04, 2021 12:41 pm, edited 1 time in total.
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
paroj
OGRE Team Member
OGRE Team Member
Posts: 1993
Joined: Sun Mar 30, 2014 2:51 pm
x 1073
Contact:

Re: How to make a material use RTSS

Post by paroj »

sounds legit. However, if you dont use the ApplicationContext, you also need this:
https://github.com/OGRECave/ogre/blob/7 ... p#L92-L109
Oogst
OGRE Expert User
OGRE Expert User
Posts: 1067
Joined: Mon Mar 29, 2004 8:49 pm
Location: the Netherlands
x 43
Contact:

Re: How to make a material use RTSS

Post by Oogst »

Yes, that fixes the particular error I was getting! Thanks!

However, now I get another error which seems to be something inside RTSS?

Image

I've copied the shader files it was asking for to my project. Is there anything else I need to do?

Also, I see the exception mentions GLSL shaders in DX11, is that some cross-language stuff Ogre does, or is that the actual problem?

While the exception doesn't mention the particular material that RTSS is trying to generate, I see in Ogre.log that it's likely the simple LoadingScreen material I mentioned in my starting post: "Error: RTSS - creating GpuPrograms for pass 0 of 'LoadingScreen' failed."

By the way, I don't use ApplicationContext because I'm migrating an older project that's built on top of the old ExampleApplication. Ogre has apparently changed a LOT since 1.9, so I keep bumping into stuff that doesn't work anymore. Most of it I've managed to figure out myself so far, but not all.
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
Oogst
OGRE Expert User
OGRE Expert User
Posts: 1067
Joined: Mon Mar 29, 2004 8:49 pm
Location: the Netherlands
x 43
Contact:

Re: How to make a material use RTSS

Post by Oogst »

That one is solved now as well! Turns out I needed to include more folders with Ogre core files, and include them in resources.cfg in the correct order. This is what I ended up with in resources.cfg:

Code: Select all

[Bootstrap]
FileSystem=OgreCore
FileSystem=OgreCore/ShadowVolume
FileSystem=OgreCore/RTShaderLib/materials
FileSystem=OgreCore/RTShaderLib/GLSL
FileSystem=OgreCore/RTShaderLib/HLSL_Cg
FileSystem=OgreCore/Terrain/
FileSystem=OgreCore/HLMS
I now get something rendering on screen. Still not actually functional, but I'll get there one step at a time.

Thanks again for your help!
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
paroj
OGRE Team Member
OGRE Team Member
Posts: 1993
Joined: Sun Mar 30, 2014 2:51 pm
x 1073
Contact:

Re: How to make a material use RTSS

Post by paroj »

Oogst wrote: Sun Apr 04, 2021 11:39 am Also, I see the exception mentions GLSL shaders in DX11, is that some cross-language stuff Ogre does
yes, see
https://www.ogre3d.org/2020/07/26/ogre- ... eplacement
Oogst wrote: Sun Apr 04, 2021 11:39 am Ogre has apparently changed a LOT since 1.9, so I keep bumping into stuff that doesn't work anymore. Most of it I've managed to figure out myself so far, but not all.
there is an overview of the major changes in:
https://github.com/OGRECave/ogre/blob/m ... 2-Notes.md

(also for 1.10, 1.11)

as for deprecated symbols, this page tells you what to use instead:
https://ogrecave.github.io/ogre/api/lat ... cated.html
Oogst
OGRE Expert User
OGRE Expert User
Posts: 1067
Joined: Mon Mar 29, 2004 8:49 pm
Location: the Netherlands
x 43
Contact:

Re: [Solved] How to make a material use RTSS

Post by Oogst »

Thanks! I'm going through the changes lists for 1.10, 1.11 and 1.12 now.

I've got the game to actually start, but a lot of stuff still looks garbled, so I might have more questions in the coming days. But for now I'm going to investigate the issues myself first: hopefully I can fix them all myself. :)
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