Fixed sprite select flickering

This commit is contained in:
Joshua Barretto 2020-07-06 22:41:21 +01:00
parent fd6c2547da
commit e7726f61de
3 changed files with 11 additions and 3 deletions

View File

@ -5,4 +5,12 @@ vec3 srgb_to_linear(vec3 srgb) {
vec3 lower = srgb/vec3(12.92);
return mix(higher, lower, cutoff);
}
}
vec3 linear_to_srgb(vec3 linear) {
bvec3 cutoff = lessThan(linear, vec3(0.0031308));
vec3 higher = vec3(1.055) * pow(linear, vec3(1.0 / 2.4)) - vec3(0.055);
vec3 lower = linear * vec3(12.92);
return mix(higher, lower, cutoff);
}

View File

@ -50,7 +50,7 @@ void main() {
// Select glowing
if (select_pos.w > 0 && select_pos.xyz == floor(sprite_pos)) {
f_col *= 4.0;
f_col = f_col * 8.0;
}
f_light = 1.0;

View File

@ -249,7 +249,7 @@ impl PlayState for SessionState {
{
(
Some((cam_pos + cam_dir * (cam_dist - 0.01)).map(|e| e.floor() as i32)),
Some((cam_pos + cam_dir * cam_dist).map(|e| e.floor() as i32)),
Some((cam_pos + cam_dir * (cam_dist + 0.01)).map(|e| e.floor() as i32)),
)
},
_ => (None, None),