mirror of
https://github.com/italicsjenga/slang-shaders.git
synced 2024-11-23 00:01:31 +11:00
Merge pull request #359 from bearoso/royale
crt-royale: Fix division by zero when border is 0.
This commit is contained in:
commit
6cc3b3326f
|
@ -679,6 +679,8 @@ float get_border_dim_factor(const float2 video_uv, const float2 geom_aspect)
|
||||||
const float2 border_penetration =
|
const float2 border_penetration =
|
||||||
max(float2(border_size) - edge_dists, float2(0.0));
|
max(float2(border_size) - edge_dists, float2(0.0));
|
||||||
const float penetration_ratio = length(border_penetration)/border_size;
|
const float penetration_ratio = length(border_penetration)/border_size;
|
||||||
|
if (border_size == 0.0)
|
||||||
|
penetration_ratio = 0.0;
|
||||||
const float border_escape_ratio = max(1.0 - penetration_ratio, 0.0);
|
const float border_escape_ratio = max(1.0 - penetration_ratio, 0.0);
|
||||||
const float border_dim_factor =
|
const float border_dim_factor =
|
||||||
pow(border_escape_ratio, border_darkness) * max(1.0, border_compress);
|
pow(border_escape_ratio, border_darkness) * max(1.0, border_compress);
|
||||||
|
|
Loading…
Reference in a new issue