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

Lots of changes

some redundant stuff in vertex shaders needs fixing
This commit is contained in:
Gefüllte Taubenbrust 2024-05-12 14:44:13 +02:00
parent ded1b09838
commit ca4f04ecab
9 changed files with 138 additions and 23 deletions

View file

@ -409,6 +409,8 @@ class GameGlobalShaderConstantSetter : public IShaderConstantSetter
CachedPixelShaderSetting<float> m_bloom_radius_pixel{"bloomRadius"};
float m_bloom_radius;
CachedPixelShaderSetting<float> m_saturation_pixel{"saturation"};
float m_gamma;
CachedPixelShaderSetting<float> m_gamma_pixel{"gamma"};
bool m_volumetric_light_enabled;
CachedPixelShaderSetting<float, 3>
m_sun_position_pixel{"sunPositionScreen"};
@ -419,11 +421,12 @@ class GameGlobalShaderConstantSetter : public IShaderConstantSetter
CachedPixelShaderSetting<float>
m_volumetric_light_strength_pixel{"volumetricLightStrength"};
static constexpr std::array<const char*, 4> SETTING_CALLBACKS = {
static constexpr std::array<const char*, 5> SETTING_CALLBACKS = {
"exposure_compensation",
"bloom_intensity",
"bloom_strength_factor",
"bloom_radius"
"bloom_radius",
"gamma"
};
public:
@ -437,6 +440,8 @@ public:
m_bloom_strength = RenderingEngine::BASE_BLOOM_STRENGTH * g_settings->getFloat("bloom_strength_factor", 0.1f, 10.0f);
if (name == "bloom_radius")
m_bloom_radius = g_settings->getFloat("bloom_radius", 0.1f, 8.0f);
if (name == "gamma")
m_gamma = g_settings->getFloat("gamma", 1.0f, 5.0f);
}
static void settingsCallback(const std::string &name, void *userdata)
@ -458,6 +463,7 @@ public:
m_bloom_intensity = g_settings->getFloat("bloom_intensity", 0.01f, 1.0f);
m_bloom_strength = RenderingEngine::BASE_BLOOM_STRENGTH * g_settings->getFloat("bloom_strength_factor", 0.1f, 10.0f);
m_bloom_radius = g_settings->getFloat("bloom_radius", 0.1f, 8.0f);
m_gamma = g_settings->getFloat("gamma", 1.0f, 5.0f);
m_volumetric_light_enabled = g_settings->getBool("enable_volumetric_lighting") && m_bloom_enabled;
}
@ -523,6 +529,8 @@ public:
m_bloom_strength_pixel.set(&m_bloom_strength, services);
}
m_gamma_pixel.set(&m_gamma, services);
const auto &lighting = m_client->getEnv().getLocalPlayer()->getLighting();
float saturation = lighting.saturation;
m_saturation_pixel.set(&saturation, services);