From ef74d395a6d0594ae0cc46d52aafea04a3aa989a Mon Sep 17 00:00:00 2001 From: Imbris Date: Sat, 19 Sep 2020 20:41:46 -0400 Subject: [PATCH] Improve figure and sprite highlighting --- assets/voxygen/shaders/figure-frag.glsl | 4 ++-- assets/voxygen/shaders/sprite-frag.glsl | 4 ++-- assets/voxygen/shaders/sprite-vert.glsl | 2 +- voxygen/src/scene/figure/mod.rs | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/assets/voxygen/shaders/figure-frag.glsl b/assets/voxygen/shaders/figure-frag.glsl index 315807549a..6a8015773d 100644 --- a/assets/voxygen/shaders/figure-frag.glsl +++ b/assets/voxygen/shaders/figure-frag.glsl @@ -149,7 +149,7 @@ void main() { DirectionalLight sun_info = get_sun_info(sun_dir, point_shadow * sun_shade_frac, /*sun_pos*/f_pos); DirectionalLight moon_info = get_moon_info(moon_dir, point_shadow * moon_shade_frac/*, light_pos*/); - vec3 surf_color = /*srgb_to_linear*/(model_col.rgb * f_col); + vec3 surf_color = /*srgb_to_linear*/f_col; float alpha = 1.0; const float n2 = 1.5; const float R_s2s0 = pow((1.0 - n2) / (1.0 + n2), 2); @@ -196,7 +196,7 @@ void main() { // diffuse_light += point_light; // reflected_light += point_light; // vec3 surf_color = illuminate(srgb_to_linear(model_col.rgb * f_col), light, diffuse_light, ambient_light); - surf_color = illuminate(max_light, view_dir, surf_color * emitted_light, surf_color * reflected_light); + surf_color = illuminate(max_light, view_dir, surf_color * emitted_light, surf_color * reflected_light) * model_col.rgb; #if (CLOUD_MODE == CLOUD_MODE_REGULAR) float fog_level = fog(f_pos.xyz, focus_pos.xyz, medium.x); diff --git a/assets/voxygen/shaders/sprite-frag.glsl b/assets/voxygen/shaders/sprite-frag.glsl index fd97f688ac..73bf5ee263 100644 --- a/assets/voxygen/shaders/sprite-frag.glsl +++ b/assets/voxygen/shaders/sprite-frag.glsl @@ -157,7 +157,7 @@ void main() { // vec3 surf_color = srgb_to_linear(vec3(0.2, 0.5, 1.0)); // vec3 cam_to_frag = normalize(f_pos - cam_pos.xyz); float max_light = 0.0; - max_light += get_sun_diffuse2(sun_info, moon_info, f_norm, /*time_of_day.x, *//*cam_to_frag*/view_dir, k_a * f_light/* * (shade_frac * 0.5 + light_frac * 0.5)*/, k_d, k_s, alpha, emitted_light, reflected_light); + max_light += get_sun_diffuse2(sun_info, moon_info, f_norm, /*time_of_day.x, *//*cam_to_frag*/view_dir, k_a/* * (shade_frac * 0.5 + light_frac * 0.5)*/, k_d, k_s, alpha, emitted_light, reflected_light); // reflected_light *= /*vert_light * */point_shadow * shade_frac; // emitted_light *= /*vert_light * */point_shadow * max(shade_frac, MIN_SHADOW); // max_light *= /*vert_light * */point_shadow * shade_frac; @@ -182,7 +182,7 @@ void main() { emitted_light *= ao; reflected_light *= ao; - surf_color = illuminate(max_light, view_dir, surf_color * emitted_light, surf_color * reflected_light); + surf_color = illuminate(max_light, view_dir, surf_color * emitted_light, surf_color * reflected_light) * f_light; // vec3 surf_color = illuminate(f_col, light, diffuse_light, ambient_light); #if (CLOUD_MODE == CLOUD_MODE_REGULAR) diff --git a/assets/voxygen/shaders/sprite-vert.glsl b/assets/voxygen/shaders/sprite-vert.glsl index e8c4c33270..4146be684d 100644 --- a/assets/voxygen/shaders/sprite-vert.glsl +++ b/assets/voxygen/shaders/sprite-vert.glsl @@ -222,7 +222,7 @@ void main() { // f_light = 1.0; // if (select_pos.w > 0) */{ vec3 sprite_pos = /*round*/floor(((inst_mat * vec4(-offs.xyz, 1)).xyz) * SCALE/* - vec3(0.5, 0.5, 0.0)*/) + inst_offs; - f_light = (select_pos.w > 0 && select_pos.xyz == sprite_pos/* - vec3(0.5, 0.5, 0.0) * SCALE*/) ? 1.0 / PERSISTENT_AMBIANCE : 1.0; + f_light = (select_pos.w > 0 && select_pos.xyz == sprite_pos/* - vec3(0.5, 0.5, 0.0) * SCALE*/) ? 5.0 : 1.0; // } gl_Position = diff --git a/voxygen/src/scene/figure/mod.rs b/voxygen/src/scene/figure/mod.rs index 70300051d1..b128ec0b3a 100644 --- a/voxygen/src/scene/figure/mod.rs +++ b/voxygen/src/scene/figure/mod.rs @@ -669,7 +669,7 @@ impl FigureMgr { .unwrap_or(vek::Rgba::broadcast(1.0)) // Highlight targeted collectible entities * if item.is_some() && scene_data.target_entity.map_or(false, |e| e == entity) { - vek::Rgba::new(2.0, 2.0, 2.0, 1.0) + vek::Rgba::new(5.0, 5.0, 5.0, 1.0) } else { vek::Rgba::one() };