mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Merge branch 'imbris/camera-hotfixes' into 'master'
Camera hot fixes See merge request veloren/veloren!2825
This commit is contained in:
commit
37a6ea7abc
@ -185,10 +185,11 @@ void main() {
|
|||||||
|
|
||||||
// float bright_color = (bright_color0 + bright_color1 + bright_color2 + bright_color3 + bright_color4) / 5.0;
|
// float bright_color = (bright_color0 + bright_color1 + bright_color2 + bright_color3 + bright_color4) / 5.0;
|
||||||
|
|
||||||
if (medium.x == 2u) {
|
// TODO: this causes flickering when the camera is moving into and out of solid blocks, resolve before uncommenting
|
||||||
tgt_color = vec4(0, 0.005, 0.01, 1) * (1 + hash_fast(uvec3(vec3(uv * screen_res.xy / 32.0, 0))));
|
// if (medium.x == 2u) {
|
||||||
return;
|
// tgt_color = vec4(0, 0.005, 0.01, 1) * (1 + hash_fast(uvec3(vec3(uv * screen_res.xy / 32.0, 0))));
|
||||||
}
|
// return;
|
||||||
|
// }
|
||||||
|
|
||||||
vec4 aa_color = aa_apply(t_src_color, s_src_color, uv * screen_res.xy, screen_res.xy);
|
vec4 aa_color = aa_apply(t_src_color, s_src_color, uv * screen_res.xy, screen_res.xy);
|
||||||
|
|
||||||
|
@ -655,10 +655,10 @@ impl FigureMgr {
|
|||||||
const MIN_PERFECT_RATE_DIST: f32 = 100.0;
|
const MIN_PERFECT_RATE_DIST: f32 = 100.0;
|
||||||
|
|
||||||
if (i as u64 + tick)
|
if (i as u64 + tick)
|
||||||
% (1 + ((pos.0.distance_squared(focus_pos).powf(0.25)
|
% (((pos.0.distance_squared(focus_pos).powf(0.25) - MIN_PERFECT_RATE_DIST.sqrt())
|
||||||
- MIN_PERFECT_RATE_DIST.sqrt())
|
.max(0.0)
|
||||||
.max(0.0)
|
|
||||||
/ 3.0) as u64)
|
/ 3.0) as u64)
|
||||||
|
.saturating_add(1)
|
||||||
!= 0
|
!= 0
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
|
@ -41,6 +41,8 @@ use num::traits::{Float, FloatConst};
|
|||||||
use specs::{Entity as EcsEntity, Join, WorldExt};
|
use specs::{Entity as EcsEntity, Join, WorldExt};
|
||||||
use vek::*;
|
use vek::*;
|
||||||
|
|
||||||
|
const ZOOM_CAP: f32 = 10000.0;
|
||||||
|
|
||||||
// TODO: Don't hard-code this.
|
// TODO: Don't hard-code this.
|
||||||
const CURSOR_PAN_SCALE: f32 = 0.005;
|
const CURSOR_PAN_SCALE: f32 = 0.005;
|
||||||
|
|
||||||
@ -357,7 +359,7 @@ impl Scene {
|
|||||||
// when zooming in the distance the camera travelles should be based on the
|
// when zooming in the distance the camera travelles should be based on the
|
||||||
// final distance. This is to make sure the camera travelles the
|
// final distance. This is to make sure the camera travelles the
|
||||||
// same distance when zooming in and out
|
// same distance when zooming in and out
|
||||||
let cap = (!client.is_moderator()).then_some(30.0);
|
let cap = (!client.is_moderator()).then_some(ZOOM_CAP);
|
||||||
if delta < 0.0 {
|
if delta < 0.0 {
|
||||||
self.camera.zoom_switch(
|
self.camera.zoom_switch(
|
||||||
// Thank you Imbris for doing the math
|
// Thank you Imbris for doing the math
|
||||||
|
Loading…
Reference in New Issue
Block a user