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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -211,7 +211,7 @@ void Clouds::updateMesh()
|
||||||
switch (i)
|
switch (i)
|
||||||
{
|
{
|
||||||
case 0: // top
|
case 0: // top
|
||||||
for (video::S3DVertex& vertex : v) {
|
for (video::S3DVertex &vertex : v) {
|
||||||
vertex.Normal.set(0, 1, 0);
|
vertex.Normal.set(0, 1, 0);
|
||||||
}
|
}
|
||||||
v[0].Pos.set(-rx, ry,-rz);
|
v[0].Pos.set(-rx, ry,-rz);
|
||||||
|
@ -226,14 +226,14 @@ void Clouds::updateMesh()
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (soft_clouds_enabled) {
|
if (soft_clouds_enabled) {
|
||||||
for (video::S3DVertex& vertex : v) {
|
for (video::S3DVertex &vertex : v) {
|
||||||
vertex.Normal.set(0, 0, -1);
|
vertex.Normal.set(0, 0, -1);
|
||||||
}
|
}
|
||||||
v[2].Color = c_bottom;
|
v[2].Color = c_bottom;
|
||||||
v[3].Color = c_bottom;
|
v[3].Color = c_bottom;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
for (video::S3DVertex& vertex : v) {
|
for (video::S3DVertex &vertex : v) {
|
||||||
vertex.Color = c_side_1;
|
vertex.Color = c_side_1;
|
||||||
vertex.Normal.set(0, 0, -1);
|
vertex.Normal.set(0, 0, -1);
|
||||||
}
|
}
|
||||||
|
@ -250,14 +250,14 @@ void Clouds::updateMesh()
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (soft_clouds_enabled) {
|
if (soft_clouds_enabled) {
|
||||||
for (video::S3DVertex& vertex : v) {
|
for (video::S3DVertex &vertex : v) {
|
||||||
vertex.Normal.set(1, 0, 0);
|
vertex.Normal.set(1, 0, 0);
|
||||||
}
|
}
|
||||||
v[2].Color = c_bottom;
|
v[2].Color = c_bottom;
|
||||||
v[3].Color = c_bottom;
|
v[3].Color = c_bottom;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
for (video::S3DVertex& vertex : v) {
|
for (video::S3DVertex &vertex : v) {
|
||||||
vertex.Color = c_side_2;
|
vertex.Color = c_side_2;
|
||||||
vertex.Normal.set(1, 0, 0);
|
vertex.Normal.set(1, 0, 0);
|
||||||
}
|
}
|
||||||
|
@ -274,14 +274,14 @@ void Clouds::updateMesh()
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (soft_clouds_enabled) {
|
if (soft_clouds_enabled) {
|
||||||
for (video::S3DVertex& vertex : v) {
|
for (video::S3DVertex &vertex : v) {
|
||||||
vertex.Normal.set(0, 0, -1);
|
vertex.Normal.set(0, 0, -1);
|
||||||
}
|
}
|
||||||
v[2].Color = c_bottom;
|
v[2].Color = c_bottom;
|
||||||
v[3].Color = c_bottom;
|
v[3].Color = c_bottom;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
for (video::S3DVertex& vertex : v) {
|
for (video::S3DVertex &vertex : v) {
|
||||||
vertex.Color = c_side_1;
|
vertex.Color = c_side_1;
|
||||||
vertex.Normal.set(0, 0, -1);
|
vertex.Normal.set(0, 0, -1);
|
||||||
}
|
}
|
||||||
|
@ -298,14 +298,14 @@ void Clouds::updateMesh()
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (soft_clouds_enabled) {
|
if (soft_clouds_enabled) {
|
||||||
for (video::S3DVertex& vertex : v) {
|
for (video::S3DVertex &vertex : v) {
|
||||||
vertex.Normal.set(-1, 0, 0);
|
vertex.Normal.set(-1, 0, 0);
|
||||||
}
|
}
|
||||||
v[2].Color = c_bottom;
|
v[2].Color = c_bottom;
|
||||||
v[3].Color = c_bottom;
|
v[3].Color = c_bottom;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
for (video::S3DVertex& vertex : v) {
|
for (video::S3DVertex &vertex : v) {
|
||||||
vertex.Color = c_side_2;
|
vertex.Color = c_side_2;
|
||||||
vertex.Normal.set(-1, 0, 0);
|
vertex.Normal.set(-1, 0, 0);
|
||||||
}
|
}
|
||||||
|
@ -316,7 +316,7 @@ void Clouds::updateMesh()
|
||||||
v[3].Pos.set(-rx, 0, rz);
|
v[3].Pos.set(-rx, 0, rz);
|
||||||
break;
|
break;
|
||||||
case 5: // bottom
|
case 5: // bottom
|
||||||
for (video::S3DVertex& vertex : v) {
|
for (video::S3DVertex &vertex : v) {
|
||||||
vertex.Color = c_bottom;
|
vertex.Color = c_bottom;
|
||||||
vertex.Normal.set(0, -1, 0);
|
vertex.Normal.set(0, -1, 0);
|
||||||
}
|
}
|
||||||
|
@ -327,7 +327,7 @@ void Clouds::updateMesh()
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (video::S3DVertex& vertex : v) {
|
for (video::S3DVertex &vertex : v) {
|
||||||
vertex.Pos += pos;
|
vertex.Pos += pos;
|
||||||
vertices.push_back(vertex);
|
vertices.push_back(vertex);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1813,13 +1813,13 @@ 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
|
||||||
>> lighting.vignette.power;
|
>> lighting.vignette.power;
|
||||||
*pkt >> lighting.cdl.slope;
|
*pkt >> lighting.cdl.slope;
|
||||||
*pkt >> lighting.cdl.offset;
|
*pkt >> lighting.cdl.offset;
|
||||||
*pkt >> lighting.cdl.power;
|
*pkt >> lighting.cdl.power;
|
||||||
|
|
|
@ -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