diff --git a/Resource/model/CModel.cpp b/Resource/model/CModel.cpp index 2be49bfb..a2f8c1b2 100644 --- a/Resource/model/CModel.cpp +++ b/Resource/model/CModel.cpp @@ -122,14 +122,16 @@ void CModel::DrawSurface(ERenderOptions Options, u32 Surface, u32 MatSet) mVBO.Unbind(); } -void CModel::DrawWireframe(ERenderOptions Options, const CColor& WireColor) +void CModel::DrawWireframe(ERenderOptions Options, CColor WireColor /*= CColor::skWhite*/) { if (!mBuffered) BufferGL(); // Set up wireframe + WireColor.a = 0; CDrawUtil::UseColorShader(WireColor); Options |= eNoMaterialSetup; glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); + glBlendFunc(GL_ONE, GL_ZERO); // Draw surfaces for (u32 iSurf = 0; iSurf < mSurfaces.size(); iSurf++) diff --git a/Resource/model/CModel.h b/Resource/model/CModel.h index 2c9f7192..db109b77 100644 --- a/Resource/model/CModel.h +++ b/Resource/model/CModel.h @@ -27,7 +27,7 @@ public: void ClearGLBuffer(); void Draw(ERenderOptions Options, u32 MatSet); void DrawSurface(ERenderOptions Options, u32 Surface, u32 MatSet); - void DrawWireframe(ERenderOptions Options, const CColor& WireColor = CColor::skWhite); + void DrawWireframe(ERenderOptions Options, CColor WireColor = CColor::skWhite); u32 GetMatSetCount(); u32 GetMatCount(); diff --git a/Resource/model/CStaticModel.cpp b/Resource/model/CStaticModel.cpp index 53a53f22..c4dd2579 100644 --- a/Resource/model/CStaticModel.cpp +++ b/Resource/model/CStaticModel.cpp @@ -144,14 +144,16 @@ void CStaticModel::DrawSurface(ERenderOptions Options, u32 Surface) mVBO.Unbind(); } -void CStaticModel::DrawWireframe(ERenderOptions Options, const CColor& WireColor) +void CStaticModel::DrawWireframe(ERenderOptions Options, CColor WireColor /*= CColor::skWhite*/) { if (!mBuffered) BufferGL(); // Set up wireframe + WireColor.a = 0; CDrawUtil::UseColorShader(WireColor); Options |= eNoMaterialSetup; glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); + glBlendFunc(GL_ONE, GL_ZERO); // Draw surfaces for (u32 iSurf = 0; iSurf < mSurfaces.size(); iSurf++) diff --git a/Resource/model/CStaticModel.h b/Resource/model/CStaticModel.h index 68105ec6..7f8bd1e5 100644 --- a/Resource/model/CStaticModel.h +++ b/Resource/model/CStaticModel.h @@ -26,7 +26,7 @@ public: void ClearGLBuffer(); void Draw(ERenderOptions Options); void DrawSurface(ERenderOptions Options, u32 Surface); - void DrawWireframe(ERenderOptions Options, const CColor& WireColor); + void DrawWireframe(ERenderOptions Options, CColor WireColor = CColor::skWhite); CMaterial* GetMaterial(); void SetMaterial(CMaterial *pMat);