mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Lower near distance.
This commit is contained in:
parent
0e66f02b25
commit
90c5d1ca36
@ -3,7 +3,7 @@ use std::f32::consts::PI;
|
|||||||
use treeculler::Frustum;
|
use treeculler::Frustum;
|
||||||
use vek::*;
|
use vek::*;
|
||||||
|
|
||||||
pub const NEAR_PLANE: f32 = 0.5;
|
pub const NEAR_PLANE: f32 = 0.25;
|
||||||
pub const FAR_PLANE: f32 = 100000.0;
|
pub const FAR_PLANE: f32 = 100000.0;
|
||||||
|
|
||||||
const FIRST_PERSON_INTERP_TIME: f32 = 0.1;
|
const FIRST_PERSON_INTERP_TIME: f32 = 0.1;
|
||||||
|
@ -740,7 +740,7 @@ impl Scene {
|
|||||||
/* let all_mat = /*proj_mat * */view_mat
|
/* let all_mat = /*proj_mat * */view_mat
|
||||||
.scaled_3d(Vec3::new(proj_mat[(0, 0)], proj_mat[(1, 1)], 1.0));
|
.scaled_3d(Vec3::new(proj_mat[(0, 0)], proj_mat[(1, 1)], 1.0));
|
||||||
let focus_off = focus_pos.map(|e| e.trunc()); */
|
let focus_off = focus_pos.map(|e| e.trunc()); */
|
||||||
let z_n = f64::from(camera::NEAR_PLANE);
|
let z_n = 1.0; //f64::from(camera::NEAR_PLANE);
|
||||||
let _z_f = f64::from(camera::FAR_PLANE);
|
let _z_f = f64::from(camera::FAR_PLANE);
|
||||||
let _scalar_fov = f64::from(fov / 2.0); // compute_scalar_fov(z_n, f64::from(fov), f64::from(aspect_ratio));
|
let _scalar_fov = f64::from(fov / 2.0); // compute_scalar_fov(z_n, f64::from(fov), f64::from(aspect_ratio));
|
||||||
shadow_mats.extend(directed_shadow_mats.iter().map(move |&light_view_mat| {
|
shadow_mats.extend(directed_shadow_mats.iter().map(move |&light_view_mat| {
|
||||||
@ -935,11 +935,11 @@ impl Scene {
|
|||||||
|
|
||||||
// Vague idea: project z_n from the camera view to the light view (where it's
|
// Vague idea: project z_n from the camera view to the light view (where it's
|
||||||
// tilted by γ).
|
// tilted by γ).
|
||||||
let z_0 = z_n / sin_gamma;// / sin_gamma;
|
let z_0 = z_n;// / sin_gamma;// / sin_gamma;
|
||||||
// let z_1 = z_0 + d;
|
// let z_1 = z_0 + d;
|
||||||
// Vague idea: project d from the light view back to the camera view (undoing the
|
// Vague idea: project d from the light view back to the camera view (undoing the
|
||||||
// tilt by γ).
|
// tilt by γ).
|
||||||
let z_1 = /*z_n*/z_0 + d/* * sin_gamma*/;
|
let z_1 = /*z_n*/z_0 + d * sin_gamma;
|
||||||
let w_l_y = /* z_f - z_n */d;/*/*f64::from(camera::FAR_PLANE - camera::NEAR_PLANE)*//*(z_f - z_n)*/d * scalar_fov.cos();*/
|
let w_l_y = /* z_f - z_n */d;/*/*f64::from(camera::FAR_PLANE - camera::NEAR_PLANE)*//*(z_f - z_n)*/d * scalar_fov.cos();*/
|
||||||
// let z_f = z_n + d;
|
// let z_f = z_n + d;
|
||||||
// let near_dist = directed_near;
|
// let near_dist = directed_near;
|
||||||
|
Loading…
Reference in New Issue
Block a user