File: test.effect

package info (click to toggle)
obs-studio 30.2.3%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 47,852 kB
  • sloc: ansic: 202,137; cpp: 112,402; makefile: 868; python: 599; sh: 275; javascript: 19
file content (37 lines) | stat: -rw-r--r-- 659 bytes parent folder | download | duplicates (6)
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
uniform float4x4 ViewProj;
uniform texture2d image;

uniform float4 color = {0.5, 1.0, 0.5, 1.0};

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

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

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

float4 PShader(VertexInOut fragment_in) : TARGET
{
	return image.Sample(texSampler, fragment_in.uv) * color;
}

technique Draw
{
	pass
	{
		vertex_shader = VShader(vert_in);
		pixel_shader  = PShader(fragment_in);
	}
}