Fixed LoD z depth, added sea level offset

This commit is contained in:
Joshua Barretto 2020-02-21 14:40:19 +00:00
parent b9b0674462
commit edd3455d51
2 changed files with 2 additions and 2 deletions

View File

@ -8,7 +8,7 @@ vec2 pos_to_uv(vec2 pos) {
} }
float alt_at(vec2 pos) { float alt_at(vec2 pos) {
return texture(t_map, pos_to_uv(pos)).a * (1450.0); return texture(t_map, pos_to_uv(pos)).a * (1310.0) + 140.0;
return 0.0 return 0.0
+ pow(texture(t_noise, pos * 0.00005).x * 1.4, 3.0) * 1000.0 + pow(texture(t_noise, pos * 0.00005).x * 1.4, 3.0) * 1000.0

View File

@ -25,5 +25,5 @@ void main() {
proj_mat * proj_mat *
view_mat * view_mat *
vec4(f_pos, 1); vec4(f_pos, 1);
gl_Position.z = 1.0 / (1.0 - gl_Position.z * 0.001 - 100.0); gl_Position.z = -1000.0 / (gl_Position.z + 10000.0);
} }