improve u_gamma support & update default dense-render-distance value

This commit is contained in:
MihailRis 2025-07-25 21:21:18 +03:00
parent 6d88b7c3d1
commit 705e398bc3
4 changed files with 5 additions and 2 deletions

View File

@ -18,6 +18,7 @@ uniform mat4 u_view;
uniform mat4 u_inverseView; uniform mat4 u_inverseView;
uniform vec3 u_sunDir; uniform vec3 u_sunDir;
uniform vec3 u_cameraPos; uniform vec3 u_cameraPos;
uniform float u_gamma;
#include <__effect__> #include <__effect__>

View File

@ -29,6 +29,8 @@ vec4 effect() {
light = max(light, emission); light = max(light, emission);
light = pow(light, u_gamma);
vec3 fogColor = texture(u_skybox, dir).rgb; vec3 fogColor = texture(u_skybox, dir).rgb;
float fog = calc_fog(length(u_view * vec4((modelpos.xyz - u_cameraPos) * FOG_POS_SCALE, 0.0)) / 256.0); float fog = calc_fog(length(u_view * vec4((modelpos.xyz - u_cameraPos) * FOG_POS_SCALE, 0.0)) / 256.0);
return vec4(mix(texture(u_screen, v_uv).rgb * mix(1.0, light, 1.0), fogColor, fog), 1.0); return vec4(mix(texture(u_screen, v_uv).rgb * mix(1.0, light, 1.0), fogColor, fog), 1.0);

View File

@ -35,7 +35,7 @@ float calc_shadow(
} }
shadow /= 9.0; shadow /= 9.0;
} else { } else {
shadow = 0.5; shadow = 0.0;
} }
return shadow; return shadow;
} }

View File

@ -82,7 +82,7 @@ struct GraphicsSettings {
/// @brief Shadows quality /// @brief Shadows quality
IntegerSetting shadowsQuality {0, 0, 3}; IntegerSetting shadowsQuality {0, 0, 3};
/// @brief Dense render distance /// @brief Dense render distance
IntegerSetting denseRenderDistance {40, 0, 10'000}; IntegerSetting denseRenderDistance {56, 0, 10'000};
}; };
struct DebugSettings { struct DebugSettings {