Przeglądaj źródła

libobs,obs-filters: Fix NAN when tonemapping

Can happen when colors are wider than Rec. 2020.
jpark37 2 lat temu
rodzic
commit
e11e2133e2

+ 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;