mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-25 05:35:25 +02:00
Visual Effects Vol. 1 (#14610)
This PR adds a variety of effects to enhance the visual experience.
"soft" clouds look
Tinted shadows
Crude water reflections (sky and sun) and waves
Translucent foliage
Node specular highlights
Adjusted fog color (more saturated where the fog is lighter)
Minor changes to volumetric lighting (crudely simulates the effect of depth)
Co-authored-by: sfan5 <sfan5@live.de>
This commit is contained in:
committed by
GitHub
parent
4ac86db8e3
commit
d8f1daac25
@@ -94,9 +94,11 @@ public:
|
||||
bool is_active() const { return m_shadows_enabled && shadowMapTextureFinal != nullptr; }
|
||||
void setTimeOfDay(float isDay) { m_time_day = isDay; };
|
||||
void setShadowIntensity(float shadow_intensity);
|
||||
void setShadowTint(video::SColor shadow_tint) { m_shadow_tint = shadow_tint; }
|
||||
|
||||
s32 getShadowSamples() const { return m_shadow_samples; }
|
||||
float getShadowStrength() const { return m_shadows_enabled ? m_shadow_strength : 0.0f; }
|
||||
video::SColor getShadowTint() const { return m_shadow_tint; }
|
||||
float getTimeOfDay() const { return m_time_day; }
|
||||
|
||||
f32 getPerspectiveBiasXY() { return m_perspective_bias_xy; }
|
||||
@@ -131,6 +133,7 @@ private:
|
||||
std::vector<NodeToApply> m_shadow_node_array;
|
||||
|
||||
float m_shadow_strength;
|
||||
video::SColor m_shadow_tint{ 255, 0, 0, 0 };
|
||||
float m_shadow_strength_gamma;
|
||||
float m_shadow_map_max_distance;
|
||||
float m_shadow_map_texture_size;
|
||||
|
||||
@@ -40,6 +40,9 @@ void ShadowConstantSetter::onSetConstants(video::IMaterialRendererServices *serv
|
||||
f32 ShadowStrength = shadow->getShadowStrength();
|
||||
m_shadow_strength.set(&ShadowStrength, services);
|
||||
|
||||
video::SColor ShadowTint = shadow->getShadowTint();
|
||||
m_shadow_tint.set(ShadowTint, services);
|
||||
|
||||
f32 timeOfDay = shadow->getTimeOfDay();
|
||||
m_time_of_day.set(&timeOfDay, services);
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@ class ShadowConstantSetter : public IShaderConstantSetter
|
||||
CachedPixelShaderSetting<f32, 3> m_light_direction{"v_LightDirection"};
|
||||
CachedPixelShaderSetting<f32> m_texture_res{"f_textureresolution"};
|
||||
CachedPixelShaderSetting<f32> m_shadow_strength{"f_shadow_strength"};
|
||||
CachedPixelShaderSetting<f32, 3> m_shadow_tint{ "shadow_tint" };
|
||||
CachedPixelShaderSetting<f32> m_time_of_day{"f_timeofday"};
|
||||
CachedPixelShaderSetting<f32> m_shadowfar{"f_shadowfar"};
|
||||
CachedPixelShaderSetting<f32, 4> m_camera_pos{"CameraPos"};
|
||||
|
||||
Reference in New Issue
Block a user