From 06300bc75fb94743b89187d995afcae6d472b373 Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Tue, 10 May 2022 12:56:24 +0100 Subject: [PATCH] Updated changelog --- CHANGELOG.md | 2 ++ voxygen/src/render/pipelines/lod_object.rs | 7 +------ voxygen/src/render/renderer.rs | 2 +- voxygen/src/render/renderer/binding.rs | 4 ++-- voxygen/src/render/renderer/drawer.rs | 2 +- voxygen/src/scene/lod.rs | 21 +++++---------------- 6 files changed, 12 insertions(+), 26 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a662753018..df637bcfd1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] ### Added + - Waypoints saved between sessions and shared with group members. - New rocks - Weapon trails @@ -19,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - NPCs now have rudimentary personalities - Added Belarusian translation - Add FOV check for agents scanning for targets they are hostile to +- Implemented an LoD system for objects, making trees visible far beyond the view distance ### Changed diff --git a/voxygen/src/render/pipelines/lod_object.rs b/voxygen/src/render/pipelines/lod_object.rs index b6a40a6d1e..6f2b2716b3 100644 --- a/voxygen/src/render/pipelines/lod_object.rs +++ b/voxygen/src/render/pipelines/lod_object.rs @@ -1,9 +1,4 @@ -use super::{ - super::{ - buffer::Buffer, AaMode, GlobalsLayouts, Mesh, TerrainLayout, Texture, Vertex as VertexTrait, - }, - lod_terrain, GlobalModel, -}; +use super::super::{AaMode, GlobalsLayouts, Vertex as VertexTrait}; use bytemuck::{Pod, Zeroable}; use std::mem; use vek::*; diff --git a/voxygen/src/render/renderer.rs b/voxygen/src/render/renderer.rs index 33dd38667e..4f8a17baf2 100644 --- a/voxygen/src/render/renderer.rs +++ b/voxygen/src/render/renderer.rs @@ -21,7 +21,7 @@ use super::{ mesh::Mesh, model::{DynamicModel, Model}, pipelines::{ - blit, bloom, clouds, debug, figure, lod_object, postprocess, shadow, sprite, terrain, ui, + blit, bloom, clouds, debug, figure, postprocess, shadow, sprite, terrain, ui, GlobalsBindGroup, GlobalsLayouts, ShadowTexturesBindGroup, }, texture::Texture, diff --git a/voxygen/src/render/renderer/binding.rs b/voxygen/src/render/renderer/binding.rs index 3730886d0b..f42808c0a8 100644 --- a/voxygen/src/render/renderer/binding.rs +++ b/voxygen/src/render/renderer/binding.rs @@ -1,8 +1,8 @@ use super::{ super::{ pipelines::{ - debug, figure, lod_object, lod_terrain, shadow, sprite, terrain, ui, ColLights, - GlobalModel, GlobalsBindGroup, + debug, figure, lod_terrain, shadow, sprite, terrain, ui, ColLights, GlobalModel, + GlobalsBindGroup, }, texture::Texture, }, diff --git a/voxygen/src/render/renderer/drawer.rs b/voxygen/src/render/renderer/drawer.rs index f7cdfa8e8e..4d0912c25c 100644 --- a/voxygen/src/render/renderer/drawer.rs +++ b/voxygen/src/render/renderer/drawer.rs @@ -765,7 +765,7 @@ impl<'pass> FirstPassDrawer<'pass> { } } - pub fn draw_lod_objects<'data: 'pass>(&mut self) -> LodObjectDrawer<'_, 'pass> { + pub fn draw_lod_objects(&mut self) -> LodObjectDrawer<'_, 'pass> { let mut render_pass = self.render_pass.scope("lod objects", self.borrow.device); render_pass.set_pipeline(&self.pipelines.lod_object.pipeline); diff --git a/voxygen/src/scene/lod.rs b/voxygen/src/scene/lod.rs index ec82b6be4e..bebbcc202b 100644 --- a/voxygen/src/scene/lod.rs +++ b/voxygen/src/scene/lod.rs @@ -4,7 +4,6 @@ use crate::{ FirstPassDrawer, Instances, LodObjectInstance, LodObjectVertex, LodTerrainVertex, Mesh, Model, Quad, Renderer, Tri, }, - scene::GlobalModel, settings::Settings, }; use client::Client; @@ -44,21 +43,15 @@ impl Lod { * water_color().into_array().into(), */ ); Self { + model: None, + data, zone_objects: HashMap::new(), object_data: [ - ( - lod::ObjectKind::Oak, - make_lod_object("oak", renderer, &data), - ), - ( - lod::ObjectKind::Pine, - make_lod_object("pine", renderer, &data), - ), + (lod::ObjectKind::Oak, make_lod_object("oak", renderer)), + (lod::ObjectKind::Pine, make_lod_object("pine", renderer)), ] .into_iter() .collect(), - model: None, - data, } } @@ -161,11 +154,7 @@ fn create_lod_terrain_mesh(detail: u32) -> Mesh { .collect() } -fn make_lod_object( - name: &str, - renderer: &mut Renderer, - lod_data: &LodData, -) -> Model { +fn make_lod_object(name: &str, renderer: &mut Renderer) -> Model { let model = ObjAsset::load_expect(&format!("voxygen.lod.{}", name)); let mesh = model .read()