Made sprite/block selection effect more subtle

This commit is contained in:
Joshua Barretto 2021-04-18 12:25:41 +01:00 committed by Monty Marz
parent 483276b082
commit 11ba02130c
2 changed files with 5 additions and 7 deletions

View File

@ -181,12 +181,11 @@ void main() {
emitted_light *= ao;
reflected_light *= ao;
f_col += f_select * 0.05;
reflected_light += f_select * 0.03 * max_light / PERSISTENT_AMBIANCE;
surf_color = illuminate(max_light, view_dir, surf_color * emitted_light, surf_color * reflected_light);
// vec3 surf_color = illuminate(f_col, light, diffuse_light, ambient_light);
surf_color += f_select * (surf_color + 0.1) * vec3(0.15, 0.15, 0.15);
// tgt_color = vec4(color, 1.0);
tgt_color = vec4(surf_color, 1.0 - clamp((distance(focus_pos.xy, f_pos.xy) - (sprite_render_distance - FADE_DIST)) / FADE_DIST, 0, 1));
}

View File

@ -268,10 +268,6 @@ void main() {
vec3 glow = glow_light(f_pos) * (pow(f_glow, 6) * 5 + pow(f_glow, 1.5) * 2);
reflected_light += glow;
float f_select = (select_pos.w > 0 && select_pos.xyz == floor(f_pos - f_norm * 0.5)) ? 1.0 : 0.0;
f_col += f_select * 0.05;
reflected_light += f_select * 0.03 * max_light / PERSISTENT_AMBIANCE;
max_light += lights_at(f_pos, f_norm, view_dir, mu, cam_attenuation, fluid_alt, k_a, k_d, k_s, alpha, f_norm, 1.0, emitted_light, reflected_light);
// float f_ao = 1.0;
@ -372,5 +368,8 @@ void main() {
// vec3 col = /*srgb_to_linear*/(f_col + hash(vec4(floor(f_pos * 3.0 - f_norm * 0.5), 0)) * 0.01); // Small-scale noise
vec3 surf_color = illuminate(max_light, view_dir, col * emitted_light, col * reflected_light);
float f_select = (select_pos.w > 0 && select_pos.xyz == floor(f_pos - f_norm * 0.5)) ? 1.0 : 0.0;
surf_color += f_select * (surf_color + 0.1) * vec3(0.5, 0.5, 0.5);
tgt_color = vec4(surf_color, 1.0);
}