mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Better blending between LoD and terrain border
This commit is contained in:
parent
edd3455d51
commit
8aafc559f8
@ -33,6 +33,7 @@ void main() {
|
|||||||
f_pos = (
|
f_pos = (
|
||||||
combined_mat *
|
combined_mat *
|
||||||
vec4(v_pos, 1)).xyz;
|
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;
|
f_col = v_col;
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ out float f_light;
|
|||||||
void main() {
|
void main() {
|
||||||
f_pos = lod_pos(v_pos + vec2(0, -v_pos.x * 0.5));
|
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;
|
f_light = 1.0;
|
||||||
|
|
||||||
|
@ -30,6 +30,7 @@ void main() {
|
|||||||
vec3 sprite_pos = (inst_mat * vec4(0, 0, 0, 1)).xyz;
|
vec3 sprite_pos = (inst_mat * vec4(0, 0, 0, 1)).xyz;
|
||||||
|
|
||||||
f_pos = (inst_mat * vec4(v_pos * SCALE, 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
|
// Wind waving
|
||||||
f_pos += inst_wind_sway * vec3(
|
f_pos += inst_wind_sway * vec3(
|
||||||
|
@ -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 = 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 *= 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;
|
f_col = vec3((uvec3(v_col_light) >> uvec3(8, 16, 24)) & uvec3(0xFFu)) / 255.0;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user