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;
|
|
|
|
out float f_light;
|
|
|
|
|
|
|
|
void main() {
|
2020-02-21 13:48:40 +00:00
|
|
|
f_pos = lod_pos(v_pos + vec2(0, -v_pos.x * 0.5));
|
2019-11-21 11:03:40 +00:00
|
|
|
|
2020-02-21 13:48:40 +00:00
|
|
|
f_pos.z -= 5.0 / pow(distance(focus_pos.xy, f_pos.xy) / (view_distance.x * 0.9), 20.0);
|
2019-11-21 11:03:40 +00:00
|
|
|
|
|
|
|
f_light = 1.0;
|
|
|
|
|
|
|
|
gl_Position =
|
|
|
|
proj_mat *
|
|
|
|
view_mat *
|
|
|
|
vec4(f_pos, 1);
|
2019-11-22 10:09:00 +00:00
|
|
|
gl_Position.z = 1.0 / (1.0 - gl_Position.z * 0.001 - 100.0);
|
2019-11-21 11:03:40 +00:00
|
|
|
}
|