Browse Source

libobs: Add DrawSrgbDecompress default technique

Useful when the texture does not support SRGB conversion on load.
jpark37 4 years ago
parent
commit
c9766d8e28
1 changed files with 16 additions and 0 deletions
  1. 16 0
      libobs/data/default.effect

+ 16 - 0
libobs/data/default.effect

@@ -62,6 +62,13 @@ float4 PSDrawNonlinearAlpha(VertInOut vert_in) : TARGET
 	return rgba;
 }
 
+float4 PSDrawSrgbDecompress(VertInOut vert_in) : TARGET
+{
+	float4 rgba = image.Sample(def_sampler, vert_in.uv);
+	rgba.rgb = srgb_nonlinear_to_linear(rgba.rgb);
+	return rgba;
+}
+
 float4 PSDrawSrgbDecompressPremultiplied(VertInOut vert_in) : TARGET
 {
 	float4 rgba = image.Sample(def_sampler, vert_in.uv);
@@ -97,6 +104,15 @@ technique DrawNonlinearAlpha
 	}
 }
 
+technique DrawSrgbDecompress
+{
+	pass
+	{
+		vertex_shader = VSDefault(vert_in);
+		pixel_shader  = PSDrawSrgbDecompress(vert_in);
+	}
+}
+
 technique DrawSrgbDecompressPremultiplied
 {
 	pass