mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Better LoD smoothing
This commit is contained in:
parent
2400786c13
commit
b9b0674462
@ -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),
|
||||
|
Loading…
Reference in New Issue
Block a user