Various tiny fixes:

Text over lootbags no longer scales with distance due to performance

Fixed meshing panic

Fixed ambiant lighting default
This commit is contained in:
Treeco 2020-11-26 20:11:49 +00:00
parent 19eee6dad3
commit ca2e4080c0
3 changed files with 11 additions and 8 deletions

View File

@ -90,11 +90,14 @@ impl<'a> Widget for Overitem<'a> {
// | E |
// ———
// scale at max distance is 10, and at min distance is 30
let scale: f64 = ((1.5
- (self.distance_from_player_sqr / common::consts::MAX_PICKUP_RANGE.powi(2)))
* 20.0)
.into();
// Scale at max distance is 10, and at min distance is 30. Disabled since the
// scaling ruins glyph caching, causing performance issues near lootbags
// let scale: f64 = ((1.5
// - (self.distance_from_player_sqr /
// common::consts::MAX_PICKUP_RANGE.powi(2)))
// * 20.0)
// .into();
let scale = 30.0;
let text_font_size = scale * 1.0;
let text_pos_y = scale * 1.2;
let btn_rect_size = scale * 0.8;

View File

@ -46,8 +46,8 @@ fn calc_light<V: RectRasterableVol<Vox = Block> + ReadVol + Debug>(
const OPAQUE: u8 = 254;
let outer = Aabb {
min: bounds.min - Vec3::new(SUNLIGHT as i32 - 1, SUNLIGHT as i32 - 1, 1),
max: bounds.max + Vec3::new(SUNLIGHT as i32 - 1, SUNLIGHT as i32 - 1, 1),
min: bounds.min - Vec3::new(SUNLIGHT as i32, SUNLIGHT as i32, 1),
max: bounds.max + Vec3::new(SUNLIGHT as i32, SUNLIGHT as i32, 1),
};
let mut vol_cached = vol.cached();

View File

@ -651,7 +651,7 @@ impl Default for GraphicsSettings {
fov: 70,
gamma: 1.0,
exposure: 1.0,
ambiance: 0.0,
ambiance: 10.0,
render_mode: RenderMode::default(),
window_size: [1920, 1080],
fullscreen: FullScreenSettings::default(),