Explorar o código

libobs,obs-filters: Fix NAN when tonemapping

Can happen when colors are wider than Rec. 2020.
jpark37 %!s(int64=2) %!d(string=hai) anos
pai
achega
e11e2133e2
Modificáronse 2 ficheiros con 2 adicións e 0 borrados
  1. 1 0
      libobs/data/color.effect
  2. 1 0
      plugins/obs-filters/data/color.effect

+ 1 - 0
libobs/data/color.effect

@@ -45,6 +45,7 @@ float3 rec2020_to_rec709(float3 v)
 float3 reinhard(float3 rgb)
 {
 	rgb /= rgb + float3(1., 1., 1.);
+	rgb = saturate(rgb);
 	rgb = pow(rgb, float3(1. / 2.4, 1. / 2.4, 1. / 2.4));
 	rgb = srgb_nonlinear_to_linear(rgb);
 	return rgb;

+ 1 - 0
plugins/obs-filters/data/color.effect

@@ -37,6 +37,7 @@ float3 rec2020_to_rec709(float3 v)
 float3 reinhard(float3 rgb)
 {
 	rgb /= rgb + float3(1., 1., 1.);
+	rgb = saturate(rgb);
 	rgb = pow(rgb, float3(1. / 2.4, 1. / 2.4, 1. / 2.4));
 	rgb = srgb_nonlinear_to_linear(rgb);
 	return rgb;