Translucent mesh sorting fixes and improvements.
This commit is contained in:
+1
-1
@@ -45,7 +45,7 @@ void lcScene::End()
|
||||
|
||||
auto TranslucentMeshCompare = [this](int Index1, int Index2)
|
||||
{
|
||||
return mRenderMeshes[Index1].Distance < mRenderMeshes[Index2].Distance;
|
||||
return mRenderMeshes[Index1].Distance > mRenderMeshes[Index2].Distance;
|
||||
};
|
||||
|
||||
std::sort(mTranslucentMeshes.begin(), mTranslucentMeshes.end(), TranslucentMeshCompare);
|
||||
|
||||
@@ -27,6 +27,11 @@ public:
|
||||
return mActiveSubmodelInstance;
|
||||
}
|
||||
|
||||
const lcMatrix44& GetViewMatrix() const
|
||||
{
|
||||
return mViewMatrix;
|
||||
}
|
||||
|
||||
void SetDrawInterface(bool DrawInterface)
|
||||
{
|
||||
mDrawInterface = DrawInterface;
|
||||
|
||||
+6
-2
@@ -874,6 +874,12 @@ void View::OnDraw()
|
||||
mContext->SetProjectionMatrix(GetProjectionMatrix());
|
||||
}
|
||||
|
||||
if (DrawInterface)
|
||||
{
|
||||
mContext->SetViewMatrix(mScene.GetViewMatrix());
|
||||
DrawGrid();
|
||||
}
|
||||
|
||||
mContext->SetLineWidth(Preferences.mLineWidth);
|
||||
|
||||
mScene.Draw(mContext);
|
||||
@@ -912,8 +918,6 @@ void View::OnDraw()
|
||||
|
||||
mContext->SetLineWidth(1.0f);
|
||||
|
||||
DrawGrid();
|
||||
|
||||
if (Preferences.mDrawAxes)
|
||||
DrawAxes();
|
||||
|
||||
|
||||
@@ -12,6 +12,6 @@ void main()
|
||||
{
|
||||
LC_PIXEL_FAKE_LIGHTING
|
||||
LC_SHADER_PRECISION vec4 TexelColor = texture2D(Texture, PixelTexCoord);
|
||||
LC_SHADER_PRECISION vec4 DiffuseColor = mix(MaterialColor, TexelColor, TexelColor.a);
|
||||
gl_FragColor = vec4(vec3(DiffuseColor) * Diffuse + SpecularColor, DiffuseColor.a);
|
||||
LC_SHADER_PRECISION vec3 DiffuseColor = mix(MaterialColor.rgb, TexelColor.rgb, TexelColor.a);
|
||||
gl_FragColor = vec4(DiffuseColor * Diffuse + SpecularColor, max(TexelColor.a, MaterialColor.a));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user