Non-linear depth buffer

This commit is contained in:
Joshua Barretto 2019-11-20 09:59:27 +00:00
parent c60799de3d
commit 8745d0a3af
6 changed files with 7 additions and 2 deletions

View File

@ -43,4 +43,5 @@ void main() {
).xyz);
gl_Position = proj_mat * view_mat * vec4(f_pos, 1);
gl_Position.z = 1.0 / (1.0 - gl_Position.z - 10.0);
}

View File

@ -39,4 +39,5 @@ void main() {
proj_mat *
view_mat *
vec4(f_pos, 1);
gl_Position.z = 1.0 / (1.0 - gl_Position.z - 10.0);
}

View File

@ -18,5 +18,6 @@ void main() {
gl_Position =
proj_mat *
view_mat *
vec4(v_pos * 2500.0 + cam_pos.xyz, 1);
vec4(v_pos * 100000.0 + cam_pos.xyz, 1);
gl_Position.z = 0.0;
}

View File

@ -53,4 +53,5 @@ void main() {
proj_mat *
view_mat *
vec4(f_pos, 1);
gl_Position.z = 1.0 / (1.0 - gl_Position.z - 10.0);
}

View File

@ -40,4 +40,5 @@ void main() {
proj_mat *
view_mat *
vec4(f_pos, 1);
gl_Position.z = 1.0 / (1.0 - gl_Position.z - 10.0);
}

View File

@ -5,7 +5,7 @@ use std::f32::consts::PI;
use vek::*;
const NEAR_PLANE: f32 = 0.5;
const FAR_PLANE: f32 = 5000.0;
const FAR_PLANE: f32 = 100000.0;
const FIRST_PERSON_INTERP_TIME: f32 = 0.05;
const THIRD_PERSON_INTERP_TIME: f32 = 0.1;