Overlay Engine: Outlines: Fix occluded alpha being too low

This commit is contained in:
Clément Foucault
2019-12-05 11:59:52 +01:00
parent 5356c90a46
commit 798b977d95
2 changed files with 2 additions and 2 deletions

View File

@@ -95,7 +95,7 @@ void OVERLAY_outline_cache_init(OVERLAY_Data *vedata)
grp = DRW_shgroup_create(sh, psl->outlines_detect_ps);
/* Don't occlude the "outline" detection pass if in xray mode (too much flickering). */
DRW_shgroup_uniform_float_copy(grp, "alphaOcclu", (pd->xray_enabled) ? 1.0f : 0.125f);
DRW_shgroup_uniform_float_copy(grp, "alphaOcclu", (pd->xray_enabled) ? 1.0f : 0.35f);
DRW_shgroup_uniform_bool_copy(grp, "doThickOutlines", do_expand);
DRW_shgroup_uniform_bool_copy(grp, "doAntiAliasing", pd->antialiasing.enabled);
DRW_shgroup_uniform_bool_copy(grp, "isXrayWires", pd->xray_enabled_and_not_wire);

View File

@@ -233,7 +233,7 @@ void main()
bool occluded = (ref_depth > scene_depth + epsilon);
/* NOTE: We never set alpha to 1.0 to avoid Antialiasing destroying the line. */
fragColor *= (occluded) ? alphaOcclu : (254.0 / 255.0);
fragColor *= (occluded ? alphaOcclu : 1.0) * (254.0 / 255.0);
int edge_case = 0;
edge_case += int(has_edge_pos_x) * XPOS;