Coder Social home page Coder Social logo

Can't get metalness to work about ogre HOT 7 CLOSED

snowPu avatar snowPu commented on June 11, 2024
Can't get metalness to work

from ogre.

Comments (7)

paroj avatar paroj commented on June 11, 2024

did you see the parameter mapping of specular here: https://ogrecave.github.io/ogre/api/latest/rtss.html#autotoc_md255 ?

as you set roughness=1.0, your material should be just slightly darker compared to blinn phong.

Also verify that the RTSS is active for your viewport (in case you are on D3D9 or GL1)

from ogre.

snowPu avatar snowPu commented on June 11, 2024
  1. What should I check for in parameter mapping exactly? This is what it says:
    By default, roughness is read from specular[0] and metalness from specular[1].

  2. Also verify that the RTSS is active for your viewport (in case you are on D3D9 or GL1) --
    how do I check this?

  3. I wanted to post this ogre forum but my gmail id isn't being accepted for registration. I keep getting this:

verification mail delivery to gmail currently broken
The solution you provided was incorrect

from ogre.

paroj avatar paroj commented on June 11, 2024

What should I check for in parameter mapping exactly?

your specular[0] and specular[1] values, which are both 1.0 as you posted above

how do I check this?

you should a snippet like this in your code:

// Make this viewport work with shader generator
mViewport->setMaterialScheme(MSN_SHADERGEN);

I wanted to post this ogre forum but my gmail id isn't being accepted for registration. I keep getting this:

gmail just does not work. we are aware of this #2924

from ogre.

snowPu avatar snowPu commented on June 11, 2024

Unfotunately it still doesn't work :( Should I be looking out for something else?

from ogre.

paroj avatar paroj commented on June 11, 2024

does it work if you modify one of the materials used in the PBR sample that is referenced above?

from ogre.

snowPu avatar snowPu commented on June 11, 2024

So it works for me now.
What I was doing earlier:

material Electrode
{
    technique
    {
        pass
        {
        specular 0.5 0.5 0.2 64
        rtshader_system
        {
           lighting_stage metal_roughness
        }
        diffuse 0.7 0.7 0.7 1.0
        }
    }
}
auto mat = Ogre::MaterialManager::getSingleton().getByName("Electrode", ogreResources::RESOURCE_GROUP)->clone(newMatName);
mat->setDiffuse(this->definition_.display.color);
entity->setMaterial(mat)

I was doing this so that I can set the metallic properties for all electrodes in my scene, but set the diffuse properties per electrode type. So I create a clone and set diffuse properties for the cloned material.

Somehow this doesn't work to set metal properties of the material.

If I do this, however,

auto mat = Ogre::MaterialManager::getSingleton().getByName("Electrode", ogreResources::RESOURCE_GROUP);
entity->setMaterial(mat)

so not use a clone, but the original material, it works.

Do you know why?

from ogre.

paroj avatar paroj commented on June 11, 2024

you must explicitly clone the RTSS parts, see:

auto mat =
baseMat->clone(StringUtil::format("Examples/PBR_Sphere%d", idx), String(TRANSIENT_RESOURCE_GROUP));
#ifdef OGRE_BUILD_COMPONENT_RTSHADERSYSTEM
RTShader::ShaderGenerator::getSingleton().cloneShaderBasedTechniques(*baseMat, *mat);
#endif

from ogre.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.