mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Apply suggestions
This commit is contained in:
parent
442245599b
commit
cb5d97e751
5 changed files with 30 additions and 28 deletions
|
@ -270,16 +270,17 @@ void main(void)
|
||||||
|
|
||||||
sunTint = vec3(1.0);
|
sunTint = vec3(1.0);
|
||||||
nightFactor = 0.;
|
nightFactor = 0.;
|
||||||
if (f_timeofday < 0.21) {
|
// The sun rises at 5:00 and sets at 19:00, which corresponds to 5/24=0.208 and 19/24 = 0.792.
|
||||||
|
if (f_timeofday < 0.208) {
|
||||||
adj_shadow_strength = f_shadow_strength * 0.5 *
|
adj_shadow_strength = f_shadow_strength * 0.5 *
|
||||||
(1.0 - mtsmoothstep(0.18, 0.21, f_timeofday));
|
(1.0 - mtsmoothstep(0.178, 0.208, f_timeofday));
|
||||||
} else if (f_timeofday >= 0.793) {
|
} else if (f_timeofday >= 0.792) {
|
||||||
adj_shadow_strength = f_shadow_strength * 0.5 *
|
adj_shadow_strength = f_shadow_strength * 0.5 *
|
||||||
mtsmoothstep(0.793, 0.823, f_timeofday);
|
mtsmoothstep(0.792, 0.822, f_timeofday);
|
||||||
} else {
|
} else {
|
||||||
adj_shadow_strength = f_shadow_strength *
|
adj_shadow_strength = f_shadow_strength *
|
||||||
mtsmoothstep(0.21, 0.24, f_timeofday) *
|
mtsmoothstep(0.208, 0.238, f_timeofday) *
|
||||||
(1.0 - mtsmoothstep(0.763, 0.793, f_timeofday));
|
(1.0 - mtsmoothstep(0.762, 0.792, f_timeofday));
|
||||||
nightFactor = adj_shadow_strength / f_shadow_strength;
|
nightFactor = adj_shadow_strength / f_shadow_strength;
|
||||||
#ifdef ENABLE_TINTED_SUNLIGHT
|
#ifdef ENABLE_TINTED_SUNLIGHT
|
||||||
sunTint = mix(vec3(1.0), getDirectLightScatteringAtGround(v_LightDirection), adj_shadow_strength / f_shadow_strength);
|
sunTint = mix(vec3(1.0), getDirectLightScatteringAtGround(v_LightDirection), adj_shadow_strength / f_shadow_strength);
|
||||||
|
|
|
@ -173,17 +173,18 @@ void main(void)
|
||||||
shadow_position.z -= z_bias;
|
shadow_position.z -= z_bias;
|
||||||
perspective_factor = pFactor;
|
perspective_factor = pFactor;
|
||||||
|
|
||||||
|
// The sun rises at 5:00 and sets at 19:00, which corresponds to 5/24=0.208 and 19/24 = 0.792.
|
||||||
sunTint = vec3(1.0);
|
sunTint = vec3(1.0);
|
||||||
if (f_timeofday < 0.21) {
|
if (f_timeofday < 0.208) {
|
||||||
adj_shadow_strength = f_shadow_strength * 0.5 *
|
adj_shadow_strength = f_shadow_strength * 0.5 *
|
||||||
(1.0 - mtsmoothstep(0.18, 0.21, f_timeofday));
|
(1.0 - mtsmoothstep(0.178, 0.208, f_timeofday));
|
||||||
} else if (f_timeofday >= 0.793) {
|
} else if (f_timeofday >= 0.792) {
|
||||||
adj_shadow_strength = f_shadow_strength * 0.5 *
|
adj_shadow_strength = f_shadow_strength * 0.5 *
|
||||||
mtsmoothstep(0.793, 0.823, f_timeofday);
|
mtsmoothstep(0.792, 0.822, f_timeofday);
|
||||||
} else {
|
} else {
|
||||||
adj_shadow_strength = f_shadow_strength *
|
adj_shadow_strength = f_shadow_strength *
|
||||||
mtsmoothstep(0.21, 0.24, f_timeofday) *
|
mtsmoothstep(0.208, 0.238, f_timeofday) *
|
||||||
(1.0 - mtsmoothstep(0.763, 0.793, f_timeofday));
|
(1.0 - mtsmoothstep(0.762, 0.792, f_timeofday));
|
||||||
sunTint = mix(vec3(1.0), getDirectLightScatteringAtGround(v_LightDirection), adj_shadow_strength / f_shadow_strength);
|
sunTint = mix(vec3(1.0), getDirectLightScatteringAtGround(v_LightDirection), adj_shadow_strength / f_shadow_strength);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1813,9 +1813,9 @@ void Client::handleCommand_SetLighting(NetworkPacket *pkt)
|
||||||
*pkt >> lighting.bloom_intensity
|
*pkt >> lighting.bloom_intensity
|
||||||
>> lighting.bloom_strength_factor
|
>> lighting.bloom_strength_factor
|
||||||
>> lighting.bloom_radius;
|
>> lighting.bloom_radius;
|
||||||
if (pkt->getRemainingBytes() >= 4)
|
}
|
||||||
|
if (pkt->getRemainingBytes() >= 72) {
|
||||||
*pkt >> lighting.artificial_light_color;
|
*pkt >> lighting.artificial_light_color;
|
||||||
if (pkt->getRemainingBytes() >= 68)
|
|
||||||
*pkt >> lighting.volumetric_beta_r0;
|
*pkt >> lighting.volumetric_beta_r0;
|
||||||
*pkt >> lighting.vignette.dark
|
*pkt >> lighting.vignette.dark
|
||||||
>> lighting.vignette.bright
|
>> lighting.vignette.bright
|
||||||
|
|
|
@ -58,10 +58,10 @@
|
||||||
Rename TOCLIENT_DEATHSCREEN to TOCLIENT_DEATHSCREEN_LEGACY
|
Rename TOCLIENT_DEATHSCREEN to TOCLIENT_DEATHSCREEN_LEGACY
|
||||||
Rename TOSERVER_RESPAWN to TOSERVER_RESPAWN_LEGACY
|
Rename TOSERVER_RESPAWN to TOSERVER_RESPAWN_LEGACY
|
||||||
Support float animation frame numbers in TOCLIENT_LOCAL_PLAYER_ANIMATIONS
|
Support float animation frame numbers in TOCLIENT_LOCAL_PLAYER_ANIMATIONS
|
||||||
Add beta_r0, vignette, specular intensity, foliage translucency and cdl parameters to Lighting packets
|
|
||||||
[scheduled bump for 5.10.0]
|
[scheduled bump for 5.10.0]
|
||||||
PROTOCOL VERSION 47
|
PROTOCOL VERSION 47
|
||||||
Add particle blend mode "clip"
|
Add particle blend mode "clip"
|
||||||
|
Add artificial light color, beta_r0, vignette, specular intensity, foliage translucency and cdl parameters to Lighting packets
|
||||||
[scheduled bump for 5.11.0]
|
[scheduled bump for 5.11.0]
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue