diff --git a/src/graphics/draw_calls.cpp b/src/graphics/draw_calls.cpp index 02153a870..830aa6718 100644 --- a/src/graphics/draw_calls.cpp +++ b/src/graphics/draw_calls.cpp @@ -50,8 +50,9 @@ void DrawCalls::clearLists() { ListBlendTransparent::getInstance()->clear(); ListAdditiveTransparent::getInstance()->clear(); - ListGhostKart::getInstance()->clear(); - ListGhostKartTangents::getInstance()->clear(); + ListTranslucentStandard::getInstance()->clear(); + ListTranslucentTangents::getInstance()->clear(); + ListTranslucent2TCoords::getInstance()->clear(); ListBlendTransparentFog::getInstance()->clear(); ListAdditiveTransparentFog::getInstance()->clear(); ListDisplacement::getInstance()->clear(); @@ -175,10 +176,12 @@ void DrawCalls::handleSTKCommon(scene::ISceneNode *Node, custom_alpha = y > 128.0f ? 0.5f : 0.35f; } - for (GLMesh *mesh : node->TransparentMesh[TM_GHOST_KART]) - pushVector(ListGhostKart::getInstance(), mesh, Node->getAbsoluteTransformation(), mesh->TextureMatrix, custom_alpha); - for (GLMesh *mesh : node->TransparentMesh[TM_GHOST_KART_TANGENTS]) - pushVector(ListGhostKartTangents::getInstance(), mesh, Node->getAbsoluteTransformation(), mesh->TextureMatrix, custom_alpha); + for (GLMesh *mesh : node->TransparentMesh[TM_TRANSLUCENT_STD]) + pushVector(ListTranslucentStandard::getInstance(), mesh, Node->getAbsoluteTransformation(), mesh->TextureMatrix, custom_alpha); + for (GLMesh *mesh : node->TransparentMesh[TM_TRANSLUCENT_TAN]) + pushVector(ListTranslucentTangents::getInstance(), mesh, Node->getAbsoluteTransformation(), mesh->TextureMatrix, custom_alpha); + for (GLMesh *mesh : node->TransparentMesh[TM_TRANSLUCENT_2TC]) + pushVector(ListTranslucent2TCoords::getInstance(), mesh, Node->getAbsoluteTransformation(), mesh->TextureMatrix, custom_alpha); for (GLMesh *mesh : node->TransparentMesh[TM_DISPLACEMENT]) pushVector(ListDisplacement::getInstance(), mesh, Node->getAbsoluteTransformation()); diff --git a/src/graphics/geometry_passes.cpp b/src/graphics/geometry_passes.cpp index 999b15fd9..76c0e2db9 100644 --- a/src/graphics/geometry_passes.cpp +++ b/src/graphics/geometry_passes.cpp @@ -250,11 +250,15 @@ void AbstractGeometryPasses::renderTransparent(const DrawCalls& draw_calls, glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA); renderTransparenPass( TexUnits(RenderGeometry::TexUnit(0, true)), - ListGhostKart::getInstance()); + ListTranslucentStandard::getInstance()); renderTransparenPass( TexUnits(RenderGeometry::TexUnit(0, true)), - ListGhostKartTangents::getInstance()); + ListTranslucentTangents::getInstance()); + + renderTransparenPass( + TexUnits(RenderGeometry::TexUnit(0, true)), + ListTranslucent2TCoords::getInstance()); glDepthMask(GL_FALSE); glDisable(GL_CULL_FACE); diff --git a/src/graphics/stk_animated_mesh.cpp b/src/graphics/stk_animated_mesh.cpp index 5bc634a9f..1697acf18 100644 --- a/src/graphics/stk_animated_mesh.cpp +++ b/src/graphics/stk_animated_mesh.cpp @@ -170,9 +170,9 @@ void STKAnimatedMesh::updateNoGL() else if (mesh.m_render_info != NULL && mesh.m_render_info->isTransparent()) { if (mesh.VAOType == video::EVT_TANGENTS) - TransparentMesh[TM_GHOST_KART_TANGENTS].push_back(&mesh); + TransparentMesh[TM_TRANSLUCENT_TAN].push_back(&mesh); else - TransparentMesh[TM_GHOST_KART].push_back(&mesh); + TransparentMesh[TM_TRANSLUCENT_STD].push_back(&mesh); } else { diff --git a/src/graphics/stk_mesh.cpp b/src/graphics/stk_mesh.cpp index c12dd8426..35dd33fa9 100644 --- a/src/graphics/stk_mesh.cpp +++ b/src/graphics/stk_mesh.cpp @@ -57,7 +57,12 @@ TransparentMaterial getTransparentMaterialFromType(video::E_MATERIAL_TYPE type, Material* material) { if (type == Shaders::getShader(ES_DISPLACE)) - return TM_DISPLACEMENT; + { + if (CVS->isDefferedEnabled()) + return TM_DISPLACEMENT; + else + return TM_TRANSLUCENT_2TC; + } if (material->getShaderType() == Material::SHADERTYPE_ADDITIVE) return TM_ADDITIVE; return TM_DEFAULT; diff --git a/src/graphics/stk_mesh.hpp b/src/graphics/stk_mesh.hpp index 3340f3294..fbe502b4a 100644 --- a/src/graphics/stk_mesh.hpp +++ b/src/graphics/stk_mesh.hpp @@ -37,8 +37,9 @@ enum TransparentMaterial TM_DEFAULT, TM_ADDITIVE, TM_DISPLACEMENT, - TM_GHOST_KART, - TM_GHOST_KART_TANGENTS, + TM_TRANSLUCENT_STD, + TM_TRANSLUCENT_TAN, + TM_TRANSLUCENT_2TC, TM_COUNT }; // TransparentMaterial @@ -169,13 +170,19 @@ class ListAdditiveTransparent : public MiscList {}; // ---------------------------------------------------------------------------- -class ListGhostKartTangents : public MiscList +{}; + +// ---------------------------------------------------------------------------- +class ListTranslucent2TCoords : public MiscList {}; diff --git a/src/graphics/stk_mesh_scene_node.cpp b/src/graphics/stk_mesh_scene_node.cpp index 03f71e73c..87c09e8d3 100644 --- a/src/graphics/stk_mesh_scene_node.cpp +++ b/src/graphics/stk_mesh_scene_node.cpp @@ -209,9 +209,9 @@ void STKMeshSceneNode::updateNoGL() { assert(!immediate_draw); if (mesh.VAOType == video::EVT_TANGENTS) - TransparentMesh[TM_GHOST_KART_TANGENTS].push_back(&mesh); + TransparentMesh[TM_TRANSLUCENT_TAN].push_back(&mesh); else - TransparentMesh[TM_GHOST_KART].push_back(&mesh); + TransparentMesh[TM_TRANSLUCENT_STD].push_back(&mesh); } else if (rnd->isTransparent()) {