mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Sprite render distance tweaks and optimisations
This commit is contained in:
parent
245c9af2e8
commit
4ed21a2e59
@ -12,7 +12,7 @@ out vec4 tgt_color;
|
|||||||
#include <sky.glsl>
|
#include <sky.glsl>
|
||||||
#include <light.glsl>
|
#include <light.glsl>
|
||||||
|
|
||||||
const float RENDER_DIST = 128.0;
|
const float RENDER_DIST = 112.0;
|
||||||
const float FADE_DIST = 32.0;
|
const float FADE_DIST = 32.0;
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
|
@ -437,7 +437,9 @@ impl Terrain {
|
|||||||
let chunk_center = pos.map2(Vec2::from(TerrainChunkSize::SIZE), |e, sz: u32| {
|
let chunk_center = pos.map2(Vec2::from(TerrainChunkSize::SIZE), |e, sz: u32| {
|
||||||
(e as f32 + 0.5) * sz as f32
|
(e as f32 + 0.5) * sz as f32
|
||||||
});
|
});
|
||||||
if Vec2::from(focus_pos).distance(chunk_center) < SPRITE_RENDER_DISTANCE {
|
if Vec2::from(focus_pos).distance_squared(chunk_center)
|
||||||
|
< SPRITE_RENDER_DISTANCE * SPRITE_RENDER_DISTANCE
|
||||||
|
{
|
||||||
for (kind, instances) in &chunk.sprite_instances {
|
for (kind, instances) in &chunk.sprite_instances {
|
||||||
renderer.render_sprites(
|
renderer.render_sprites(
|
||||||
&self.sprite_models[&kind],
|
&self.sprite_models[&kind],
|
||||||
|
Loading…
Reference in New Issue
Block a user