1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-13 16:45:20 +02:00

Drop fixed pipeline support code (#15421)

OpenGL 2.0 is now mandatory.
This commit is contained in:
sfan5
2024-11-13 14:24:01 +01:00
committed by GitHub
parent 0fde9ab7e8
commit 794aea8e92
35 changed files with 117 additions and 411 deletions

View File

@@ -84,15 +84,11 @@ Hud::Hud(Client *client, LocalPlayer *player,
}
// Initialize m_selection_material
if (g_settings->getBool("enable_shaders")) {
IShaderSource *shdrsrc = client->getShaderSource();
IShaderSource *shdrsrc = client->getShaderSource();
{
auto shader_id = shdrsrc->getShader(
m_mode == HIGHLIGHT_HALO ? "selection_shader" : "default_shader", TILE_MATERIAL_ALPHA);
m_selection_material.MaterialType = shdrsrc->getShaderInfo(shader_id).material;
} else {
m_selection_material.MaterialType = video::EMT_TRANSPARENT_ALPHA_CHANNEL;
}
if (m_mode == HIGHLIGHT_BOX) {
@@ -106,12 +102,9 @@ Hud::Hud(Client *client, LocalPlayer *player,
}
// Initialize m_block_bounds_material
if (g_settings->getBool("enable_shaders")) {
IShaderSource *shdrsrc = client->getShaderSource();
{
auto shader_id = shdrsrc->getShader("default_shader", TILE_MATERIAL_ALPHA);
m_block_bounds_material.MaterialType = shdrsrc->getShaderInfo(shader_id).material;
} else {
m_block_bounds_material.MaterialType = video::EMT_TRANSPARENT_ALPHA_CHANNEL;
}
m_block_bounds_material.Thickness =
rangelim(g_settings->getS16("selectionbox_width"), 1, 5);
@@ -1171,6 +1164,7 @@ void drawItemStack(
auto &p = imesh->buffer_colors[j];
p.applyOverride(c);
// TODO: could be moved to a shader
if (p.needColorize(c)) {
buf->setDirty(scene::EBT_VERTEX);
if (imesh->needs_shading)