Capped LoD dragging

This commit is contained in:
Joshua Barretto 2020-02-21 15:04:44 +00:00
parent 8aafc559f8
commit 7b42aebd70
4 changed files with 4 additions and 4 deletions

View File

@ -25,7 +25,7 @@ void main() {
float((v_pos_norm >> 16) & 0x1FFFu)
) + model_offs;
f_pos.z *= min(1.0001 - 0.02 / pow(tick.x - load_time, 10.0), 1.0);
f_pos.z -= 25.0 * pow(distance(focus_pos.xy, f_pos.xy) / view_distance.x, 20.0);
f_pos.z -= min(32.0, pow(distance(focus_pos.xy, f_pos.xy) / view_distance.x, 20.0));
f_col = vec3(
float((v_col_light >> 8) & 0xFFu),

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 -= 1.0 / pow(distance(focus_pos.xy, f_pos.xy) / (view_distance.x * 0.95), 20.0);
f_pos.z -= min(32.0, 1.0 / pow(distance(focus_pos.xy, f_pos.xy) / (view_distance.x * 0.95), 20.0));
f_light = 1.0;

View File

@ -30,7 +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);
f_pos.z -= min(32.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 -= 1.0 * pow(distance(focus_pos.xy, f_pos.xy) / (view_distance.x * 0.95), 20.0);
f_pos.z -= min(32.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;