I made my own GUI interface using screen-aligned quads and I use 24-bit png textures in their materials.
Is there a way to both use those textures with alpha channel and set the node opacity?
Until now, I was using a "diffuse" fragment shader which get the opacity value from a shader constant callback class and apply it. But if I can have opacity without a shader, that would be even better.
- cpp Code: Select all
//! 2D Hud element constructor
CHud2DElement::CHud2DElement(f32 x, f32 y, f32 w, f32 h) : CHud()
{
// [...]
Material.DiffuseColor.setAlpha(Opacity);
// Apply diffuse shader (based on video::EMT_TRANSPARENT_ALPHA_CHANNEL)
Material.MaterialType = (video::E_MATERIAL_TYPE)nEngine::CGame::Shaders.Diffuse;
// [...]
}
Thanks
