[13.5.3] Normal maps are not loaded when using AssimpLoader and RTSS

Problems building or running the engine, queries about how to use features etc.
Post Reply
Markellus
Gnoblar
Posts: 2
Joined: Tue Dec 06, 2022 12:33 pm
x 1

[13.5.3] Normal maps are not loaded when using AssimpLoader and RTSS

Post by Markellus »

Ogre Version: 13.5.2
Operating System: Windows 11
Render System: OpenGL3+

Hi guys,

I have a problem when loading an FBX model via Assimp. The model has normal maps, but it seems that they are not loaded correctly into the RTSS. I used some console outputs to check if normal maps are found, and i can see that the following lines of code in AssimpLoader.cpp are called correctly and i am getting the correct console output if i set mQuitMode to false:

Code: Select all

    if (mat->GetTexture(aiTextureType_NORMALS, 0, &path) == AI_SUCCESS)
    {
        if (!mQuietMode)
        {
            LogManager::getSingleton().logMessage("Found normal map: " + String(path.data));
        }

    shaderGen->createShaderBasedTechnique(omat->getTechnique(0), dstScheme);
    auto rs = shaderGen->getRenderState(MSN_SHADERGEN, *omat, 0);
    auto srs = shaderGen->createSubRenderState("NormalMap");

    StringUtil::splitFilename(String(path.data), basename, outPath);
    srs->setParameter("texture", basename);
    rs->addTemplateSubRenderState(srs);
}

However, the normal map is definitely not used in the rendering process. I have also found out that if i use the mesh converter tool to create a .mesh and .material file out of the FBX, the rtshader stage for the normal maps is missing in the materials. in fact, no rtshader stage can be found at all.

Is there any known bug in the assimp loader, or are there additional steps required to make this work?

paroj
OGRE Team Member
OGRE Team Member
Posts: 1995
Joined: Sun Mar 30, 2014 2:51 pm
x 1075
Contact:

Re: [13.5.3] Normal maps are not loaded when using AssimpLoader and RTSS

Post by paroj »

Markellus wrote: Tue Dec 06, 2022 12:46 pm

I have also found out that if i use the mesh converter tool to create a .mesh and .material file out of the FBX, the rtshader stage for the normal maps is missing in the materials. in fact, no rtshader stage can be found at all.

this should be fixed by https://github.com/OGRECave/ogre/pull/2698

please open an issue and attach the fbx for testing, if this does not point you to the solution

Markellus
Gnoblar
Posts: 2
Joined: Tue Dec 06, 2022 12:33 pm
x 1

Re: [13.5.3] Normal maps are not loaded when using AssimpLoader and RTSS

Post by Markellus »

Thanks, normal maps are now loading. I tried something similar while waiting for an answer in AssimpConverter but I think I missed validateScheme() because i didn't know that this was necessary.

Post Reply