Better blending between LoD and terrain border

This commit is contained in:
Joshua Barretto 2020-02-21 14:54:37 +00:00
parent edd3455d51
commit 8aafc559f8
4 changed files with 4 additions and 2 deletions

View File

@ -33,6 +33,7 @@ void main() {
f_pos = (
combined_mat *
vec4(v_pos, 1)).xyz;
f_pos.z -= 1.0 * pow(distance(focus_pos.xy, f_pos.xy) / (view_distance.x * 0.95), 20.0);
f_col = v_col;

View File

@ -17,7 +17,7 @@ out float f_light;
void main() {
f_pos = lod_pos(v_pos + vec2(0, -v_pos.x * 0.5));
f_pos.z -= 5.0 / pow(distance(focus_pos.xy, f_pos.xy) / (view_distance.x * 0.9), 20.0);
f_pos.z -= 1.0 / pow(distance(focus_pos.xy, f_pos.xy) / (view_distance.x * 0.95), 20.0);
f_light = 1.0;

View File

@ -30,6 +30,7 @@ void main() {
vec3 sprite_pos = (inst_mat * vec4(0, 0, 0, 1)).xyz;
f_pos = (inst_mat * vec4(v_pos * SCALE, 1)).xyz;
f_pos.z -= 1.0 * pow(distance(focus_pos.xy, f_pos.xy) / (view_distance.x * 0.95), 20.0);
// Wind waving
f_pos += inst_wind_sway * vec3(

View File

@ -21,7 +21,7 @@ void main() {
f_pos = vec3((uvec3(v_pos_norm) >> uvec3(0, 8, 16)) & uvec3(0xFFu, 0xFFu, 0x1FFFu)) + model_offs;
f_pos.z *= min(1.0001 - 0.02 / pow(tick.x - load_time, 10.0), 1.0);
f_pos.z -= 5.0 * pow(distance(focus_pos.xy, f_pos.xy) / (view_distance.x * 0.9), 20.0);
f_pos.z -= 1.0 * pow(distance(focus_pos.xy, f_pos.xy) / (view_distance.x * 0.95), 20.0);
f_col = vec3((uvec3(v_col_light) >> uvec3(8, 16, 24)) & uvec3(0xFFu)) / 255.0;