[SOLVED] Lack of textures once that the scene is being loaded

Problems building or running the engine, queries about how to use features etc.
HarlockOne
Gnoblar
Posts: 24
Joined: Tue May 04, 2021 4:21 pm
x 2

[SOLVED] Lack of textures once that the scene is being loaded

Post by HarlockOne »

Ogre Version: 1.14
Operating System: win 10
Render System: opengl

Hi All,
I recently did come back to my project as the time seems to be enough.
I have a scene in blender with all the assets set in place, textures included.
When I do export the scene with blender2ogre I get all the textures missing, the log file does not report any error.
But, the textures files on the file system seems too few and I can see that they are missing.
Does anybody knows which the issue is with the exporter?
Thanks!
This is the result.

Image

Image

[edit]
I ve seen that in the log file more then half of the textures report:
[WARNING] Roughness input is not connected

[edit 2]
Have opened the blender shader editor to check the material nodes and as for the roughness there is no texture specified, there is only the value which should be ok.
Instead it is clear that the blender2ogre plugin did not manage to export many textures, for instance: DiffuseColor_Texture_2 which is used by the vase model - you can see it on the file system.
Going to attach other two screenshots.

Image

Image

At a first glance it seemed that I was not instantiating the RTSS.
I have added the rtss setup after the scene manager creation with such a function:

Code: Select all

void BaseApplication::setupRTSS()
{
    OgreAssert(mSceneMgr, "SceneManager is null - can not setup RTSS");

if(mSceneMgr) {
  // Step 1: Initialize the RTShader system
  if (!Ogre::RTShader::ShaderGenerator::getSingletonPtr())
  {
      Ogre::RTShader::ShaderGenerator::initialize();
  }

  // Step 2: Retrieve the Shader Generator instance
  Ogre::RTShader::ShaderGenerator* shaderGenerator = Ogre::RTShader::ShaderGenerator::getSingletonPtr();

  // Step 3: Attach the SceneManager to the Shader Generator
  shaderGenerator->addSceneManager(mSceneMgr);

  // Step 4: Activate the RTSS material scheme
  Ogre::MaterialManager::getSingleton().setActiveScheme(Ogre::RTShader::ShaderGenerator::DEFAULT_SCHEME_NAME);
}
}

The order of the resources setup is as follows:

chooseSceneManager(cameraMode);
createCamera(cameraMode, cameraStyle);
createViewports();

// Set default mipmap level (NB some APIs ignore this)
Ogre::TextureManager::getSingleton().setDefaultNumMipmaps(5);

initializeComponents(); // this calls setupRTSS

// Create any resource listeners (for loading screens)
createResourceListener();

// Load resources
loadResources();

// Create the scene
createScene();

createFrameListener();

However I can not get the materials loaded correctly.
Thanks!

Last edited by HarlockOne on Wed Jan 01, 2025 3:13 pm, edited 1 time in total.
User avatar
sercero
Bronze Sponsor
Bronze Sponsor
Posts: 487
Joined: Sun Jan 18, 2015 4:20 pm
Location: Buenos Aires, Argentina
x 170

Re: Lack of textures once that the scene is being loaded

Post by sercero »

I imagine that all of this worked at some time.

What did you update? Blender? blender2ogre? Or both?

Which versions did work for you?

HarlockOne
Gnoblar
Posts: 24
Joined: Tue May 04, 2021 4:21 pm
x 2

Re: Lack of textures once that the scene is being loaded

Post by HarlockOne »

sercero wrote: Fri Dec 20, 2024 12:35 pm

I imagine that all of this worked at some time.

What did you update? Blender? blender2ogre? Or both?

Which versions did work for you?

Hi, actually I have started to use another scene for my work and this is what I got.
Have also set the log level to BOREME but the DotSceneLoader does not prompy any error, from the log level everything seems ok.
As about the textures, have noticed that they are renamed during the export procedure, so that's ok.

HarlockOne
Gnoblar
Posts: 24
Joined: Tue May 04, 2021 4:21 pm
x 2

Re: Lack of textures once that the scene is being loaded

Post by HarlockOne »

Hi all again,
Have uploaded a footage of the scene.
Managed to get rid of the yellow painted all over color but that was only an effect of the directional light hitting all the surfaces.
The lack of the roughness and metalness properties in all the materials still continue to bother me and it can be seen clearly in the footage.
Thanks in advance for any help.

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

Re: Lack of textures once that the scene is being loaded

Post by paroj »

just tried exporting the default cube with blender 4.2, and roughness and metalness get correctly written to specular as described here:
https://ogrecave.github.io/ogre/api/lat ... otoc_md250

maybe you did not properly enable the RTSS? Try disabling the fixed function pipeline for OpenGL or switching to GL3+ to verify.

HarlockOne
Gnoblar
Posts: 24
Joined: Tue May 04, 2021 4:21 pm
x 2

Re: Lack of textures once that the scene is being loaded

Post by HarlockOne »

paroj wrote: Sun Dec 22, 2024 8:18 am

just tried exporting the default cube with blender 4.2, and roughness and metalness get correctly written to specular as described here:
https://ogrecave.github.io/ogre/api/lat ... otoc_md250

maybe you did not properly enable the RTSS? Try disabling the fixed function pipeline for OpenGL or switching to GL3+ to verify.

Hi paroj,
the code for the RTSS initialization is written above.
From the documentation that you have referenced it is clear that the roughness and metalness are picked up from a grayscale image using the respective Green and Blue channels:
texturename texture for spatially varying parametrization. In accordance to the glTF2.0 specification, roughness is sampled from the G channel and metalness from the B channel.
This is what I ve started to argue about.
However can it be that the ogre2blender exporter really has an issue to solve?
In this exported material:

// generated by blender2ogre 0.9.0 on 2024-12-21 17:53:38
material Dungeon_Material_01 {
receive_shadows on
technique {
pass {
diffuse 1.0 1.0 1.0 1.0
specular 0.552786 1.0 0 0 0

Code: Select all

        // additional maps - requires RTSS
        rtshader_system {
            lighting_stage metal_roughness
            texturing_stage late_add_blend // needed for emissive to work
        }

        // - base_color_texture
        texture_unit {
            texture Dungeons_Texture_01.png
            tex_address_mode wrap
            colour_op modulate
        }

        // - emission_color_texture
        texture_unit {
            texture Emmisive_01.png
            tex_address_mode wrap
            colour_op add
        }
    }
}

}

The specular color seems to be badly written, as it should be: specular 0 0.552786 0 - while we have: specular 0.552786 1.0 0 0 0

I will be able to test the changes once I come back from my vacancy after xmas.
In the meantime, thanks a lot!

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

Re: Lack of textures once that the scene is being loaded

Post by paroj »

the texture parameter is optional though. If it is absent then the following applies:

roughness is read from specular[0] and metalness from specular[1]

HarlockOne
Gnoblar
Posts: 24
Joined: Tue May 04, 2021 4:21 pm
x 2

Re: Lack of textures once that the scene is being loaded

Post by HarlockOne »

Hi paroj,
Just as I have written I will not be in front of my PC for a week.
Anyway the value for specular has 5 digits instead of the expected 3.
Crossing fingers this can be the issue, otherwise it will be a hard fight to fix what's wrong.
For sure I can export a single model/mesh out of the scene and see what happens.

User avatar
sercero
Bronze Sponsor
Bronze Sponsor
Posts: 487
Joined: Sun Jan 18, 2015 4:20 pm
Location: Buenos Aires, Argentina
x 170

Re: Lack of textures once that the scene is being loaded

Post by sercero »

Hello,

Can you tell us what Blender version are you using?

There might be issues with Blender 4.3, in fact there is an open issue still unresolved.

Another thing: can you create a micro sample of your level (or just a couple of assets) that exports wrongly and share the .blend file?

So that we can see what is happening.

Thanks!

HarlockOne
Gnoblar
Posts: 24
Joined: Tue May 04, 2021 4:21 pm
x 2

Re: Lack of textures once that the scene is being loaded

Post by HarlockOne »

Hi,
I am using blender 3.6 LTS, this version should not give issues with the blender2ogre plugin, afaik.
Absolutely!
In a couple of days (I am still far from the reach of my PC) I am going to arrange a very simple scene with few models.
Going to export a single model as well.
So then you can give a look at it and see if it is my fault, or the blender2ogre plugin.
Thank you so much!

HarlockOne
Gnoblar
Posts: 24
Joined: Tue May 04, 2021 4:21 pm
x 2

Re: Lack of textures once that the scene is being loaded

Post by HarlockOne »

[Edited]
Hi @paroj @sercero
Just as you have asked me sercero, going to attach a portion of the scene.

Image

This is the link to the .blend file:
https://drive.google.com/file/d/1DR2GqQ ... sp=sharing

You do not have the required permissions to view the files attached to this post.
Last edited by HarlockOne on Sun Dec 29, 2024 2:52 am, edited 3 times in total.
HarlockOne
Gnoblar
Posts: 24
Joined: Tue May 04, 2021 4:21 pm
x 2

Re: Lack of textures once that the scene is being loaded

Post by HarlockOne »

[removed]

Last edited by HarlockOne on Sun Dec 29, 2024 2:55 am, edited 2 times in total.
HarlockOne
Gnoblar
Posts: 24
Joined: Tue May 04, 2021 4:21 pm
x 2

Re: Lack of textures once that the scene is being loaded

Post by HarlockOne »

[removed]

Last edited by HarlockOne on Sun Dec 29, 2024 2:55 am, edited 2 times in total.
HarlockOne
Gnoblar
Posts: 24
Joined: Tue May 04, 2021 4:21 pm
x 2

Re: Lack of textures once that the scene is being loaded

Post by HarlockOne »

Much better with blender 4.2 LTS ^.^
Going to attach two screenshots, the second one has been taken from the Ogre viewport.
There are a lot more surface details, it can be seen that the ambient light, the one and one only light I have is starting to show the real models curves and joints.

Image

Image

Will try to add some lights to the scene.
Also, going to re-export a single model to see how it will interact with different kind of lights.
As for now it seems promising ^.^

HarlockOne
Gnoblar
Posts: 24
Joined: Tue May 04, 2021 4:21 pm
x 2

Re: Lack of textures once that the scene is being loaded

Post by HarlockOne »

Hi,
Can mark the issue as solved ^.^
Have configured three lights, directional, point, and ambient and they seem to work well.
The phong like effect is due to the lack of metalness and roughness PBR textures.
Using a normal map it could help a bit but it will not give the desired result.
For now I can survive with that ^.^
As for the blender2ogre plugin, I was almost sure I had found which the issue was with all those flattened meshes, but I did not. For now I am using blender 4.2 which seems to work better.

Image

User avatar
sercero
Bronze Sponsor
Bronze Sponsor
Posts: 487
Joined: Sun Jan 18, 2015 4:20 pm
Location: Buenos Aires, Argentina
x 170

Re: [SOLVED] Lack of textures once that the scene is being loaded

Post by sercero »

It seems that some things have changed in the Blender 4.3 API regarding materials, there is already an open issue in blender2ogre github

HarlockOne
Gnoblar
Posts: 24
Joined: Tue May 04, 2021 4:21 pm
x 2

Re: [SOLVED] Lack of textures once that the scene is being loaded

Post by HarlockOne »

Hi sercero,
I will check it out but I seriously doubt I will put my fingers on it :mrgreen: