Fix split_stream wrong blending op
"immediate_draw" objects were assumed to be always blended but splitstream is additive.
This commit is contained in:
parent
8a2128fe7e
commit
7367342755
@ -142,6 +142,8 @@ void STKMeshSceneNode::updateNoGL()
|
|||||||
TransparentMaterial TranspMat = MaterialTypeToTransparentMaterial(type, MaterialTypeParam, material);
|
TransparentMaterial TranspMat = MaterialTypeToTransparentMaterial(type, MaterialTypeParam, material);
|
||||||
if (!immediate_draw)
|
if (!immediate_draw)
|
||||||
TransparentMesh[TranspMat].push_back(&mesh);
|
TransparentMesh[TranspMat].push_back(&mesh);
|
||||||
|
else
|
||||||
|
additive = (TranspMat == TM_ADDITIVE);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -370,7 +372,10 @@ void STKMeshSceneNode::render()
|
|||||||
{
|
{
|
||||||
if (update_each_frame)
|
if (update_each_frame)
|
||||||
updatevbo();
|
updatevbo();
|
||||||
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
|
if (additive)
|
||||||
|
glBlendFunc(GL_ONE, GL_ONE);
|
||||||
|
else
|
||||||
|
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
|
||||||
|
|
||||||
if (World::getWorld() && World::getWorld()->isFogEnabled())
|
if (World::getWorld() && World::getWorld()->isFogEnabled())
|
||||||
{
|
{
|
||||||
|
@ -21,6 +21,7 @@ protected:
|
|||||||
bool isMaterialInitialized;
|
bool isMaterialInitialized;
|
||||||
bool isGLInitialized;
|
bool isGLInitialized;
|
||||||
bool immediate_draw;
|
bool immediate_draw;
|
||||||
|
bool additive;
|
||||||
bool update_each_frame;
|
bool update_each_frame;
|
||||||
bool isDisplacement;
|
bool isDisplacement;
|
||||||
bool isGlow;
|
bool isGlow;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user