Better falloff

This commit is contained in:
Joshua Barretto 2020-02-23 16:04:03 +00:00
parent be775c9484
commit 3d027aebe8
2 changed files with 6 additions and 3 deletions

View File

@ -50,8 +50,8 @@ vec3 lod_norm(vec2 pos) {
}
vec3 lod_col(vec2 pos) {
return texture(t_map, pos_to_uv(pos)).rgb;
//+ texture(t_noise, pos * 0.02 + texture(t_noise, pos * 1.0).xy * 2.0).x * 0.2;
return texture(t_map, pos_to_uv(pos)).rgb
+ texture(t_noise, pos * 0.04 + texture(t_noise, pos * 0.01).xy * 2.0 + texture(t_noise, pos * 0.06).xy * 0.6).x * 0.1;
vec3 warmth = mix(
vec3(0.05, 0.4, 0.1),

View File

@ -17,7 +17,10 @@ out float f_light;
void main() {
f_pos = lod_pos(v_pos);
f_pos.z -= 1.0 / pow(distance(focus_pos.xy, f_pos.xy) / (view_distance.x * 0.95), 20.0);
//f_pos.z -= 1.0 / pow(distance(focus_pos.xy, f_pos.xy) / (view_distance.x * 0.95), 20.0);
//f_pos.z -= 100.0 * pow(1.0 + 0.01 / view_distance.x, -pow(distance(focus_pos.xy, f_pos.xy), 2.0));
f_pos.z -= max(view_distance.x - distance(focus_pos.xy, f_pos.xy), 0.0);
f_light = 1.0;