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

Fix model[] being lit wrongly if shaders are disabled (#15364)

This commit is contained in:
Lars Müller 2024-11-03 15:10:21 +01:00 committed by GitHub
parent 0e06590ffd
commit 3064f3ccb7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 0 deletions

View file

@ -9,6 +9,8 @@
#include <IVideoDriver.h>
#include "IAttributes.h"
#include "porting.h"
#include "client/mesh.h"
#include "settings.h"
GUIScene::GUIScene(gui::IGUIEnvironment *env, scene::ISceneManager *smgr,
gui::IGUIElement *parent, core::recti rect, s32 id)
@ -96,6 +98,11 @@ void GUIScene::draw()
if (m_inf_rot)
rotateCamera(v3f(0.f, -0.03f * (float)dtime_ms, 0.f));
// HACK restore mesh vertex colors to full brightness:
// They may have been mutated in entity rendering code before.
if (!g_settings->getBool("enable_shaders"))
setMeshColor(m_mesh->getMesh(), irr::video::SColor(0xFFFFFFFF));
m_smgr->drawAll();
if (m_initial_rotation && m_mesh) {