Fixed Function pipeline is no longer allowed nor supported.

Problems building or running the engine, queries about how to use features etc.
Post Reply
bjf
Gnoblar
Posts: 7
Joined: Mon Sep 21, 2020 4:14 am

Fixed Function pipeline is no longer allowed nor supported.

Post by bjf »

Ogre Version: :2.3:
Operating System: :Linux:
Render System: :GL3Plus:

I was trying to render the sphere.mesh that comes with Ogre and I've used OgreMeshTool to convert it from 1.8 to 2.1. Problem is that I'm getting this error.

Code: Select all

Mesh: Loading sphere.mesh.
OGRE EXCEPTION(3:RenderingAPIException): Fixed Function pipeline is no longer allowed nor supported. The material BaseWhite must use shaders in HlmsLowLevel::calculateHashFor at /home/bjf/ogre/OgreMain/src/OgreHlmsLowLevel.cpp (line 157)
Couldn't apply datablock '[Hash 0xc4be0758]' to this renderable. Using default one. Check previous log messages to see if there's more information.
I've applied a an HlmsUnlitDatablock to it from the HLMS but wondering why the error says it's looking for a LowLevel.

Code: Select all

{
        Ogre::SceneManager *sm = getMainSceneManager();

        Ogre::HlmsUnlitDatablock *block = CGS::getColorBlock(Green); 

        Ogre::Item *item = sceneManager->createItem("sphere.mesh",
            Ogre::ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME,
            Ogre::SCENE_DYNAMIC);
        item->setDatablock(block); 

        Ogre::SceneNode *sn = 
            sm->getRootSceneNode(Ogre::SCENE_DYNAMIC)->
                createChildSceneNode(Ogre::SCENE_DYNAMIC);
        sn->attachObject(item);
        sn->setPosition(Ogre::Vector3(0.0f, 0.0f, 0.0f));
}
It does work as I can see the sphere and my coloring of it works, but not sure why I'm getting the OGRE EXCEPTION.
User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 5296
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 1278
Contact:

Re: Fixed Function pipeline is no longer allowed nor supported.

Post by dark_sylinc »

Hi!

BaseWhite material is an old vestige from Ogre 1.x, which was left there for compatibility. Basically it's a predefined low level material that doesn't really work because it's got no shaders.

The reason you see this exception is because meshes have a material name entry (SubMesh::mMaterialName, both v1 and v2) which is applied by default during Entity/Item construction; and can be stored in the file.

It seems the mesh asks for the BaseWhite material, finds it, and the exception is raised. Later you change it to a different material which is why it works.

I see two possible solutions:
  1. Modify the mesh to use a different material name (or leave it empty). You can use Ogre MeshMagick to rename the material name to the v1 mesh, then convert it to v2. Or you can do this programmatically: See Samples/2.0/ApiUsage/V2Mesh. But instead of converting a v1 mesh and saving it as v2, you open the v2 mesh, change the name, and save it again as v2 (you only need to do this once).
  2. Try creating an Unlit datablock named "BaseWhite" which I believe will take precedence over the low level material one. Although I'm not sure.
Post Reply