Is there a way to create unlit material that supports setting the alpha value?
(I do not have textures, just color).
I have not found a way to set the alpha value, closest I get is to set in the blend block, turns it somewhat transparent, but I cannot control the alpha strength.
Am I missing something obvious here? Or does it not work out of the box?
(For PBS materials it works, but I need unlit, since this is for debug shapes that does not need light).
[Solved] Unlit color + alpha
-
- Gremlin
- Posts: 180
- Joined: Tue Nov 25, 2008 10:58 am
- Location: Kristiansand, Norway
- x 23
- Contact:
[Solved] Unlit color + alpha
Last edited by hedphelym on Thu Feb 21, 2019 7:15 pm, edited 1 time in total.
- dark_sylinc
- OGRE Team Member
- Posts: 5299
- Joined: Sat Jul 21, 2007 4:55 pm
- Location: Buenos Aires, Argentina
- x 1279
- Contact:
Re: Unlit color + alpha
Call:
For scripts, setUseColour should be getting called automatically if we detect the colour isn't set to 100% opaque white.
Without the setUseColour, your setColour calls will be ignored and will trigger an assert in debug builds.
Code: Select all
datablock->setUseColour( true );
datablock->setColour( ColourValue( 1, 1, 1, alpha ) );
Without the setUseColour, your setColour calls will be ignored and will trigger an assert in debug builds.
-
- Gremlin
- Posts: 180
- Joined: Tue Nov 25, 2008 10:58 am
- Location: Kristiansand, Norway
- x 23
- Contact:
Re: Unlit color + alpha
Thank you I found the things you mention, buI then missed this:
This then solved it, it now works as expected!
Code: Select all
blendBlock.setBlendType(Ogre::SceneBlendType::SBT_TRANSPARENT_ALPHA);