Crashing after Upgrade

Problems building or running the engine, queries about how to use features etc.
chilly willy
Halfling
Posts: 72
Joined: Tue Jun 02, 2020 4:11 am
x 22

Crashing after Upgrade

Post by chilly willy »

Ogre Version: 14.5.0
Operating System: macOS Catalina
Render System: OpenGL 3+

I upgraded from 14.0 to the latest repo and now it crashes with this message:

RenderSystem does not support FixedFunction, but technique of 'Blue' has no Vertex Shader. Use the RTSS or write custom shaders. in SceneManager::_setPass at /Users/chillywilly/Documents/Projects/ogre/OgreMain/src/OgreSceneManager.cpp (line 682)

in SceneManager::_setPass() after it fails this test:

Code: Select all

    else if (!mDestRenderSystem->getCapabilities()->hasCapability(RSC_FIXED_FUNCTION) &&
             !pass->hasGpuProgram(GPT_MESH_PROGRAM))

I am using the RTSS but I do not use material scripts. I create a material programmatically, assign a color to the first technique and then let the RTSS generate a second technique with shaders. I have verified that the second technique with shaders IS being created but it is the first technique without shaders that is causing the crash in _setPass(). It only crashes when (SHADOWTYPE_STENCIL_ADDITIVE) shadows are enabled.

Any ideas where to look/what to do?

paroj
OGRE Team Member
OGRE Team Member
Posts: 2257
Joined: Sun Mar 30, 2014 2:51 pm
x 1228

Re: Crashing after Upgrade

Post by paroj »

Tested the Shadow Sample in the Sample Browser and it works.

probably your viewport is not using the RTSS material scheme.

chilly willy
Halfling
Posts: 72
Joined: Tue Jun 02, 2020 4:11 am
x 22

Re: Crashing after Upgrade

Post by chilly willy »

I am setting the scheme with:

Code: Select all

mViewport->setMaterialScheme(Ogre::MSN_SHADERGEN);

I tried different kinds of shadows. Everything works with modulative shadows (both stencil and texture). It only crashes with additive shadows (both stencil and texture).

Any help or ideas is appreciated.

paroj
OGRE Team Member
OGRE Team Member
Posts: 2257
Joined: Sun Mar 30, 2014 2:51 pm
x 1228

Re: Crashing after Upgrade

Post by paroj »

ok, I could reproduce it with the Shadow Sample. It only happens when you start with additive, not when you switch from modulative to additive

chilly willy
Halfling
Posts: 72
Joined: Tue Jun 02, 2020 4:11 am
x 22

Re: Crashing after Upgrade

Post by chilly willy »

It seems that SGTechniqueResolverListener::handleSchemeNotFound() is not creating techniques for the MSN_SHADOWCASTER scheme...

paroj
OGRE Team Member
OGRE Team Member
Posts: 2257
Joined: Sun Mar 30, 2014 2:51 pm
x 1228

Re: Crashing after Upgrade

Post by paroj »

this is the commit introducing this: https://github.com/OGRECave/ogre/commit ... 5f8d1df217

It seems bestTechnique is not correctly updated now.

Note that I do see a RTSS technique with shaders in the debugger - it just does not get picked.

The solution would be to call rend->getTechnique again, but at the correct place now

paroj
OGRE Team Member
OGRE Team Member
Posts: 2257
Joined: Sun Mar 30, 2014 2:51 pm
x 1228

Re: Crashing after Upgrade

Post by paroj »

I narrowed it down to this:
https://github.com/OGRECave/ogre/pull/3496

it seems something breaks if Material::compile is called before Material::getBestTechnique (the latter triggers the RTSS).
Not sure if I will have the time to track it further though..

paroj
OGRE Team Member
OGRE Team Member
Posts: 2257
Joined: Sun Mar 30, 2014 2:51 pm
x 1228

Re: Crashing after Upgrade

Post by paroj »

that was a tough one..
The issue was that RTSS passes were added to the queue, but then the material was reloaded which destroyed the RTSS Shaders.

still not 100% sure about the root cause, but this is a fix:

https://github.com/OGRECave/ogre/pull/3498

chilly willy
Halfling
Posts: 72
Joined: Tue Jun 02, 2020 4:11 am
x 22

Re: Crashing after Upgrade

Post by chilly willy »

Awesome that you found it. Thank you.
Maybe someday I will understand all this stuff...