Discard terrain base layer alpha in non-shader rendering path (bug #6657)

pull/3229/head
Alexei Kotov 2 years ago
parent f124c2c5f9
commit 0ba179c332

@ -17,6 +17,7 @@
Bug #6427: Enemy health bar disappears before damaging effect ends
Bug #6550: Cloned body parts don't inherit texture effects
Bug #6645: Enemy block sounds align with animation instead of blocked hits
Bug #6657: Distant terrain tiles become black when using FWIW mod
Bug #6661: Saved games that have no preview screenshot cause issues or crashes
Bug #6807: Ultimate Galleon is not working properly
Bug #6893: Lua: Inconsistent behavior with actors affected by Disable and SetDelete commands

@ -173,6 +173,27 @@ namespace
}
};
class DiscardAlphaCombine
{
public:
static const osg::ref_ptr<osg::TexEnvCombine>& value()
{
static DiscardAlphaCombine instance;
return instance.mValue;
}
private:
osg::ref_ptr<osg::TexEnvCombine> mValue;
DiscardAlphaCombine()
: mValue(new osg::TexEnvCombine)
{
mValue->setCombine_Alpha(osg::TexEnvCombine::REPLACE);
mValue->setSource0_Alpha(osg::TexEnvCombine::CONSTANT);
mValue->setConstantColor(osg::Vec4(0.0, 0.0, 0.0, 1.0));
}
};
class UniformCollection
{
public:
@ -287,6 +308,8 @@ namespace Terrain
stateset->setTextureAttributeAndModes(
0, LayerTexMat::value(layerTileSize), osg::StateAttribute::ON);
stateset->setTextureAttributeAndModes(0, DiscardAlphaCombine::value(), osg::StateAttribute::ON);
// Multiply by the alpha map
if (!blendmaps.empty())
{

Loading…
Cancel
Save