Fix split_stream wrong blending op

"immediate_draw" objects were assumed to be always blended but
splitstream is additive.
This commit is contained in:
Vincent Lejeune 2014-12-06 02:06:59 +01:00
parent 8a2128fe7e
commit 7367342755
2 changed files with 7 additions and 1 deletions

View File

@ -142,6 +142,8 @@ void STKMeshSceneNode::updateNoGL()
TransparentMaterial TranspMat = MaterialTypeToTransparentMaterial(type, MaterialTypeParam, material);
if (!immediate_draw)
TransparentMesh[TranspMat].push_back(&mesh);
else
additive = (TranspMat == TM_ADDITIVE);
}
else
{
@ -370,7 +372,10 @@ void STKMeshSceneNode::render()
{
if (update_each_frame)
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())
{

View File

@ -21,6 +21,7 @@ protected:
bool isMaterialInitialized;
bool isGLInitialized;
bool immediate_draw;
bool additive;
bool update_each_frame;
bool isDisplacement;
bool isGlow;