From 7382aab13a6136d1cd5f4e79bc3b5c9969f7feb4 Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Tue, 10 May 2022 17:12:12 +0100 Subject: [PATCH] Upped default LoD distance --- assets/voxygen/shaders/lod-object-frag.glsl | 17 +---------------- assets/voxygen/shaders/lod-object-vert.glsl | 1 - common/assets/Cargo.toml | 3 +-- voxygen/src/render/pipelines/lod_object.rs | 5 ----- voxygen/src/settings/graphics.rs | 2 +- 5 files changed, 3 insertions(+), 25 deletions(-) diff --git a/assets/voxygen/shaders/lod-object-frag.glsl b/assets/voxygen/shaders/lod-object-frag.glsl index e065a02e4d..a33f320469 100644 --- a/assets/voxygen/shaders/lod-object-frag.glsl +++ b/assets/voxygen/shaders/lod-object-frag.glsl @@ -104,38 +104,23 @@ void main() { vec3 emitted_light, reflected_light; - // This is a bit of a hack. Because we can't find the volumetric lighting of each particle (they don't talk to the - // CPU) we need to some how find an approximation of how much the sun is blocked. We do this by fading out the sun - // as the particle moves underground. This isn't perfect, but it does at least mean that particles don't look like - // they're exposed to the sun when in dungeons - const float SUN_FADEOUT_DIST = 20.0; - sun_info.block *= clamp((f_pos.z - f_alt) / SUN_FADEOUT_DIST + 1, 0, 1); - // To account for prior saturation. float max_light = 0.0; vec3 cam_attenuation = vec3(1); float fluid_alt = max(f_pos.z + 1, floor(f_alt + 1)); vec3 mu = medium.x == MEDIUM_WATER ? MU_WATER : vec3(0.0); - //#if (FLUID_MODE == FLUID_MODE_SHINY) - // cam_attenuation = - // medium.x == MEDIUM_WATER ? compute_attenuation_point(cam_pos.xyz, view_dir, MU_WATER, fluid_alt, /*cam_pos.z <= fluid_alt ? cam_pos.xyz : f_pos*/f_pos) - // : compute_attenuation_point(f_pos, -view_dir, vec3(0), fluid_alt, /*cam_pos.z <= fluid_alt ? cam_pos.xyz : f_pos*/cam_pos.xyz); - //#endif max_light += get_sun_diffuse2(sun_info, moon_info, voxel_norm, view_dir, f_pos, mu, cam_attenuation, fluid_alt, k_a, k_d, k_s, alpha, voxel_norm, 1.0, emitted_light, reflected_light); emitted_light *= f_ao; reflected_light *= f_ao; - //max_light += lights_at(f_pos, voxel_norm, view_dir, mu, cam_attenuation, fluid_alt, k_a, k_d, k_s, alpha, voxel_norm, 1.0, emitted_light, reflected_light); - vec3 side_color = mix(surf_color, vec3(0.5, 0.6, 1.0), snow_cover); vec3 top_color = mix(surf_color, surf_color * 0.3, 0.5 + snow_cover * 0.5); surf_color = mix(side_color, top_color, pow(fract(model_pos.z * 0.1), 2.0)); surf_color = illuminate(max_light, view_dir, surf_color * emitted_light, surf_color * reflected_light); - // Temporarily disable particle transparency to avoid artifacts - tgt_color = vec4(surf_color, 1.0 /*f_col.a*/); + tgt_color = vec4(surf_color, 1.0); } diff --git a/assets/voxygen/shaders/lod-object-vert.glsl b/assets/voxygen/shaders/lod-object-vert.glsl index 12a0c575b4..d5880ecae7 100644 --- a/assets/voxygen/shaders/lod-object-vert.glsl +++ b/assets/voxygen/shaders/lod-object-vert.glsl @@ -53,7 +53,6 @@ void main() { if ((inst_flags & FLAG_SNOW_COVERED) > 0u) { snow_cover = 1.0; - //f_col.rgb = mix(f_col.rgb, vec3(1), pow(max(f_norm.z, 0.0), 0.5)); } else { snow_cover = 0.0; } diff --git a/common/assets/Cargo.toml b/common/assets/Cargo.toml index ac60802103..dea2906e65 100644 --- a/common/assets/Cargo.toml +++ b/common/assets/Cargo.toml @@ -10,8 +10,7 @@ lazy_static = "1.4.0" assets_manager = {version = "0.7", features = ["bincode", "ron", "json"]} ron = { version = "0.7", default-features = false } dot_vox = "4.0" -wavefront = "0.2" -#wavefront = { path = "../../../../wavefront" } +wavefront = "0.2" # TODO: Use vertex-colors branch when we have models that have them image = { version = "0.23.12", default-features = false, features = ["png"] } tracing = "0.1" diff --git a/voxygen/src/render/pipelines/lod_object.rs b/voxygen/src/render/pipelines/lod_object.rs index 6f2b2716b3..fabcad7d18 100644 --- a/voxygen/src/render/pipelines/lod_object.rs +++ b/voxygen/src/render/pipelines/lod_object.rs @@ -31,13 +31,8 @@ impl Vertex { } } -// impl Default for Vertex { -// fn default() -> Self { Self::new(Vec2::zero(), Vec3::zero(), -// Vec3::zero()) } } - impl VertexTrait for Vertex { const QUADS_INDEX: Option = None; - //Some(wgpu::IndexFormat::Uint16); const STRIDE: wgpu::BufferAddress = mem::size_of::() as wgpu::BufferAddress; } diff --git a/voxygen/src/settings/graphics.rs b/voxygen/src/settings/graphics.rs index 08079e9fe7..708821252b 100644 --- a/voxygen/src/settings/graphics.rs +++ b/voxygen/src/settings/graphics.rs @@ -52,7 +52,7 @@ impl Default for GraphicsSettings { fn default() -> Self { Self { view_distance: 10, - lod_distance: 100, + lod_distance: 200, sprite_render_distance: 100, particles_enabled: true, lossy_terrain_compression: false,