mirror of
https://github.com/Xaymar/obs-StreamFX
synced 2024-12-28 18:41:14 +00:00
filter-sdf-effects: Fix colored shadows changing image
Colored shadows previously had an effect on the image color, but this is incorrect if the image is fully opaque. This fixes it by using premultiplied alpha mixing instead.
This commit is contained in:
parent
75009c617a
commit
ecd17cff6c
1 changed files with 5 additions and 2 deletions
|
@ -118,11 +118,14 @@ float4 PS_SDFShadow_v1_1(VertDataOut v_in) : TARGET
|
|||
float t1 = sdf_distance - _outer_min;
|
||||
float t2 = clamp(t1 / delta, 0., 1.);
|
||||
|
||||
final = lerp(final, _outer_color, 1. - t2);
|
||||
final = lerp(final, _outer_color, (1. - t2) * _outer_color.a);
|
||||
}
|
||||
|
||||
// Base Image
|
||||
final += base;
|
||||
if (base.a > 0.) {
|
||||
float3 rgb = base.rgb / base.a;
|
||||
final = lerp(final, base, base.a);
|
||||
}
|
||||
|
||||
//! Inner Shadow
|
||||
// Are we allowed to draw an inner shadow?
|
||||
|
|
Loading…
Reference in a new issue