File: default_rect.effect

package info (click to toggle)
obs-studio 30.2.3%2Bdfsg-3.2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 47,928 kB
  • sloc: ansic: 202,137; cpp: 112,403; makefile: 868; python: 599; sh: 275; javascript: 19
file content (84 lines) | stat: -rw-r--r-- 1,487 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#include "color.effect"

uniform float4x4 ViewProj;
uniform texture_rect image;

sampler_state def_sampler {
	Filter   = Linear;
	AddressU = Clamp;
	AddressV = Clamp;
};

struct VertInOut {
	float4 pos : POSITION;
	float2 uv  : TEXCOORD0;
};

VertInOut VSDefault(VertInOut vert_in)
{
	VertInOut vert_out;
	vert_out.pos = mul(float4(vert_in.pos.xyz, 1.0), ViewProj);
	vert_out.uv  = vert_in.uv;
	return vert_out;
}

float4 PSDrawBare(VertInOut vert_in) : TARGET
{
	return image.Sample(def_sampler, vert_in.uv);
}

float4 PSDrawD65P3(VertInOut vert_in) : TARGET
{
	float4 rgba = image.Sample(def_sampler, vert_in.uv);
	rgba.rgb = srgb_nonlinear_to_linear(rgba.rgb);
	rgba.rgb = d65p3_to_rec709(rgba.rgb);
	return rgba;
}

float4 PSDrawOpaque(VertInOut vert_in) : TARGET
{
	return float4(image.Sample(def_sampler, vert_in.uv).rgb, 1.0);
}

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

technique Draw
{
	pass
	{
		vertex_shader = VSDefault(vert_in);
		pixel_shader  = PSDrawBare(vert_in);
	}
}

technique DrawD65P3
{
	pass
	{
		vertex_shader = VSDefault(vert_in);
		pixel_shader  = PSDrawD65P3(vert_in);
	}
}

technique DrawOpaque
{
	pass
	{
		vertex_shader = VSDefault(vert_in);
		pixel_shader  = PSDrawOpaque(vert_in);
	}
}

technique DrawSrgbDecompress
{
	pass
	{
		vertex_shader = VSDefault(vert_in);
		pixel_shader  = PSDrawSrgbDecompress(vert_in);
	}
}