Hi, all!
I'd appreciate example of creation of single color unlit materials from code. It is needed for a debug tool
and manual creation gets messy... Also that will get me started with other things.
Need help with generating of single color material from code. Topic is solved
-
- Bronze Sponsor
- Posts: 107
- Joined: Fri May 23, 2025 5:04 pm
- x 4
Need help with generating of single color material from code.
-
- Bronze Sponsor
- Posts: 107
- Joined: Fri May 23, 2025 5:04 pm
- x 4
Re: Need help with generating of single color material from code.
Code: Select all
Ogre::MaterialPtr mat =
Ogre::static_pointer_cast<Ogre::Material>(
Ogre::MaterialManager::getSingleton()
.createOrRetrieve("Debug/Red2",
"General")
.first);
mat->removeAllTechniques();
Ogre::Technique *tech = mat->createTechnique();
tech->setDiffuse(Ogre::ColourValue(1, 0, 0, 1));
tech->setName("Debug/S");
tech->setDepthCheckEnabled(false);
tech->setLightingEnabled(false);
This is what I try to do and it silently doesn't work...
-
- Bronze Sponsor
- Posts: 107
- Joined: Fri May 23, 2025 5:04 pm
- x 4
Re: Need help with generating of single color material from code.
The problem is still actual. Is it even possible to create single-color materials with diffuse-only without textures?
-
- OGRE Team Member
- Posts: 2189
- Joined: Sun Mar 30, 2014 2:51 pm
- x 1179
Re: Need help with generating of single color material from code.
there is no "unlit", only ffp. Enable lighting and set emissive.