1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Drop fixed pipeline lighting stuff (#15165)

This commit is contained in:
grorp 2024-09-18 12:18:28 +02:00 committed by GitHub
parent 6dfd61cba0
commit 70e169f165
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
34 changed files with 59 additions and 426 deletions

View file

@ -194,10 +194,9 @@ private:
static ExtrusionMeshCache *g_extrusion_mesh_cache = nullptr;
WieldMeshSceneNode::WieldMeshSceneNode(scene::ISceneManager *mgr, s32 id, bool lighting):
WieldMeshSceneNode::WieldMeshSceneNode(scene::ISceneManager *mgr, s32 id):
scene::ISceneNode(mgr->getRootSceneNode(), mgr, id),
m_material_type(video::EMT_TRANSPARENT_ALPHA_CHANNEL_REF),
m_lighting(lighting)
m_material_type(video::EMT_TRANSPARENT_ALPHA_CHANNEL_REF)
{
m_enable_shaders = g_settings->getBool("enable_shaders");
m_anisotropic_filter = g_settings->getBool("anisotropic_filter");
@ -390,8 +389,7 @@ void WieldMeshSceneNode::setItem(const ItemStack &item, Client *client, bool che
// overlay is white, if present
m_colors.emplace_back(true, video::SColor(0xFFFFFFFF));
// initialize the color
if (!m_lighting)
setColor(video::SColor(0xFFFFFFFF));
setColor(video::SColor(0xFFFFFFFF));
return;
}
@ -468,8 +466,7 @@ void WieldMeshSceneNode::setItem(const ItemStack &item, Client *client, bool che
}
// initialize the color
if (!m_lighting)
setColor(video::SColor(0xFFFFFFFF));
setColor(video::SColor(0xFFFFFFFF));
return;
} else {
const std::string inventory_image = item.getInventoryImage(idef);
@ -485,8 +482,7 @@ void WieldMeshSceneNode::setItem(const ItemStack &item, Client *client, bool che
m_colors.emplace_back(true, video::SColor(0xFFFFFFFF));
// initialize the color
if (!m_lighting)
setColor(video::SColor(0xFFFFFFFF));
setColor(video::SColor(0xFFFFFFFF));
return;
}
@ -496,7 +492,6 @@ void WieldMeshSceneNode::setItem(const ItemStack &item, Client *client, bool che
void WieldMeshSceneNode::setColor(video::SColor c)
{
assert(!m_lighting);
scene::IMesh *mesh = m_meshnode->getMesh();
if (!mesh)
return;
@ -535,7 +530,7 @@ void WieldMeshSceneNode::setNodeLightColor(video::SColor color)
if (m_enable_shaders) {
for (u32 i = 0; i < m_meshnode->getMaterialCount(); ++i) {
video::SMaterial &material = m_meshnode->getMaterial(i);
material.EmissiveColor = color;
material.ColorParam = color;
}
} else {
setColor(color);
@ -565,11 +560,6 @@ void WieldMeshSceneNode::changeToMesh(scene::IMesh *mesh)
mesh->setHardwareMappingHint(scene::EHM_DYNAMIC);
}
m_meshnode->forEachMaterial([this] (auto &mat) {
mat.Lighting = m_lighting;
// need to normalize normals when lighting is enabled (because of setScale())
mat.NormalizeNormals = m_lighting;
});
m_meshnode->setVisible(true);
}
@ -667,7 +657,6 @@ void getItemMesh(Client *client, const ItemStack &item, ItemMesh *result)
tex.MagFilter = video::ETMAGF_NEAREST;
});
material.BackfaceCulling = cull_backface;
material.Lighting = false;
}
rotateMeshXZby(mesh, -45);
@ -720,7 +709,6 @@ scene::SMesh *getExtrudedMesh(ITextureSource *tsrc,
tex.MagFilter = video::ETMAGF_NEAREST;
});
material.BackfaceCulling = true;
material.Lighting = false;
material.MaterialType = video::EMT_TRANSPARENT_ALPHA_CHANNEL;
material.MaterialTypeParam = 0.5f;
}