hlms pbs material textures not loading

A place for users of OGRE to discuss ideas and experiences of utilitising OGRE in their games / demos / applications.
User avatar
jordiperezarti
Kobold
Posts: 35
Joined: Sun Sep 01, 2024 7:50 pm

hlms pbs material textures not loading

Post by jordiperezarti »

I have the followind hlms material:

hlms Examples/floor pbs
{
depth_check on
depth_write on
cull_mode none

Code: Select all

diffuse 1 1 1
specular 1 1 1
emissive 0.4 0.4 0.4
diffuse_map floor_diffuse.PNG

}

if i set it as unlit (hlms Examples/floor unlit), this is working. But if i set as obs (hlms Examples/floor pbs), the program doesn't crash but the texture is not showing, i see a lighgrey falloff shader.

what can be the cause?

User avatar
jordiperezarti
Kobold
Posts: 35
Joined: Sun Sep 01, 2024 7:50 pm

Re: hlms pbs material textures not loading

Post by jordiperezarti »

If is set emissive_map floor_diffuse.PNG i can see the scene textured in pbs material.
So i think that the lights in the scene are having some problem, that are not affecting the diffuse contribution.

User avatar
jordiperezarti
Kobold
Posts: 35
Joined: Sun Sep 01, 2024 7:50 pm

Re: hlms pbs material textures not loading

Post by jordiperezarti »

Setting the "gamma" option in createWindow makes the difuse work.

Now i am adding lights, but seems only the directional light works, the spot light and the point light seems to do nothing.
Is this some common problem? what could be happening with the lights?

User avatar
Crystal Hammer
Gnome
Posts: 390
Joined: Sat Jun 23, 2007 5:16 pm
x 99

Re: hlms pbs material textures not loading

Post by Crystal Hammer »

jordiperezarti wrote: Sat Oct 19, 2024 5:09 pm

Now i am adding lights, but seems only the directional light works, the spot light and the point light seems to do nothing.

If you mean that the lights don't lit anything then maybe those calls are bad or missing:

Code: Select all

light->setPowerScale(...);
// or this, needed for having more lights:
// arguments e.g.:
// bEnable, width, height, numSlices |  lightsPerCell, decalsPerCell, cubeProbesPerCel  | float minDist, maxDist
mSceneMgr->setForwardClustered(true, 32, 16, 24,  16, 0, 2,  2, 150);

If this is about shadows:
This I think could mean you have only shadow maps set up for directional lights.
There are another maps for spot light and for point light needed.
I based my code on this sample:
Ogre/ogre-next/Samples/2.0/ApiUsage/ShadowMapFromCode/ShadowMapFromCode.cpp
https://github.com/OGRECave/ogre-next/b ... de.cpp#L63
See the comments and code under:

Code: Select all

            // First light, directional
            // Second light, directional, spot or point
            // Third light, directional, spot or point

etc.
Or if you're using .compositor file, then
https://github.com/OGRECave/ogre-next/b ... positor.md
the second example under compositor_node_shadow myShadowNode
shows it for spot light, so another would be needed for point light too.

User avatar
jordiperezarti
Kobold
Posts: 35
Joined: Sun Sep 01, 2024 7:50 pm

Re: hlms pbs material textures not loading

Post by jordiperezarti »

The directionalLight->setPowerScale(5) runs, makes the light be stronger.

But i still seeing only the directional light, i atach the code:

Code: Select all

 Light* directionalLight = this->sceneManager->createLight();
directionalLight->setType(Light::LT_DIRECTIONAL);
directionalLight->setDiffuseColour(ColourValue(0.4, 0.4, 0.4));
directionalLight->setSpecularColour(ColourValue(0.4, 0.1, 0.1));
directionalLight->setPowerScale(5);

SceneNode* directionalLightNode = this->sceneManager->getRootSceneNode()->createChildSceneNode();
directionalLightNode->attachObject(directionalLight);
directionalLightNode->setDirection(Vector3(1, -1, 0));

the point light that is not present in the render, neither with powerScale at 100, code:

Code: Select all

Light* pointLight = this->sceneManager->createLight();
pointLight->setType(Light::LT_POINT);
pointLight->setDiffuseColour(1, 1, 1);
pointLight->setSpecularColour(1, 1, 1);
pointLight->setPowerScale(500);

SceneNode* pointLightNode = this->sceneManager->getRootSceneNode()->createChildSceneNode();
pointLightNode->attachObject(pointLight);
pointLightNode->setPosition(Vector3(0, 200, 0));