2019-11-21 11:03:40 +00:00
|
|
|
#version 330 core
|
|
|
|
|
|
|
|
#include <globals.glsl>
|
|
|
|
#include <srgb.glsl>
|
2019-11-21 20:57:46 +00:00
|
|
|
#include <lod.glsl>
|
2019-11-21 11:03:40 +00:00
|
|
|
|
|
|
|
in vec2 v_pos;
|
|
|
|
|
|
|
|
layout (std140)
|
|
|
|
uniform u_locals {
|
|
|
|
vec4 nul;
|
|
|
|
};
|
|
|
|
|
|
|
|
out vec3 f_pos;
|
2020-02-23 16:53:17 +00:00
|
|
|
out vec3 f_norm;
|
2019-11-21 11:03:40 +00:00
|
|
|
out float f_light;
|
|
|
|
|
|
|
|
void main() {
|
2020-02-24 11:22:50 +00:00
|
|
|
f_pos = lod_pos(v_pos, focus_pos.xy);
|
2019-11-21 11:03:40 +00:00
|
|
|
|
2020-02-23 16:53:17 +00:00
|
|
|
f_norm = lod_norm(f_pos.xy);
|
|
|
|
|
2020-02-23 16:04:03 +00:00
|
|
|
//f_pos.z -= 1.0 / pow(distance(focus_pos.xy, f_pos.xy) / (view_distance.x * 0.95), 20.0);
|
|
|
|
|
|
|
|
//f_pos.z -= 100.0 * pow(1.0 + 0.01 / view_distance.x, -pow(distance(focus_pos.xy, f_pos.xy), 2.0));
|
|
|
|
f_pos.z -= max(view_distance.x - distance(focus_pos.xy, f_pos.xy), 0.0);
|
2019-11-21 11:03:40 +00:00
|
|
|
|
|
|
|
f_light = 1.0;
|
|
|
|
|
|
|
|
gl_Position =
|
|
|
|
proj_mat *
|
|
|
|
view_mat *
|
|
|
|
vec4(f_pos, 1);
|
2020-02-21 14:40:19 +00:00
|
|
|
gl_Position.z = -1000.0 / (gl_Position.z + 10000.0);
|
2019-11-21 11:03:40 +00:00
|
|
|
}
|