From b9b06744620114dd5556e73f64fa93c145503a7c Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Fri, 21 Feb 2020 14:27:43 +0000 Subject: [PATCH] Better LoD smoothing --- assets/voxygen/shaders/include/lod.glsl | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/assets/voxygen/shaders/include/lod.glsl b/assets/voxygen/shaders/include/lod.glsl index 704d0a35b4..49354b1131 100644 --- a/assets/voxygen/shaders/include/lod.glsl +++ b/assets/voxygen/shaders/include/lod.glsl @@ -8,7 +8,7 @@ vec2 pos_to_uv(vec2 pos) { } float alt_at(vec2 pos) { - return texture(t_map, pos_to_uv(pos)).a * (1500.0); + return texture(t_map, pos_to_uv(pos)).a * (1450.0); return 0.0 + pow(texture(t_noise, pos * 0.00005).x * 1.4, 3.0) * 1000.0 @@ -21,18 +21,19 @@ vec2 splay(vec2 pos, float e) { } float splay_scale(vec2 pos, float e) { - return distance(splay(pos, e), splay(pos + 0.001, e)) * 500000.0; + return distance(splay(pos, e), splay(pos + 0.001, e)) * 5000000.0; } vec3 lod_pos(vec2 v_pos) { vec2 hpos = focus_pos.xy + splay(v_pos, 5.0) * 1000000.0; float splay = splay_scale(v_pos, 5.0); return vec3(hpos, ( + alt_at(hpos) + alt_at(hpos + vec2(-1, 1) * splay) + alt_at(hpos + vec2(1, 1) * splay) + alt_at(hpos + vec2(1, -1) * splay) + alt_at(hpos + vec2(-1, -1) * splay) - ) / 4.0); + ) / 5.0); } vec3 lod_norm(vec2 pos) { @@ -50,6 +51,7 @@ 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; vec3 warmth = mix( vec3(0.05, 0.4, 0.1),