-
Notifications
You must be signed in to change notification settings - Fork 1
/
HLSL_passthrough
53 lines (42 loc) · 995 Bytes
/
HLSL_passthrough
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
//####### Vertex Shader
struct Attribute
{
float4 vPosition : POSITION;
float4 vColor : COLOR0;
float2 vTexcoord : TEXCOORD0;
};
struct Fragment
{
float4 vPosition : SV_POSITION;
float4 vColor : COLOR0;
float2 vCoord : TEXCOORD0;
};
Fragment main(Attribute INPUT)
{
Fragment OUTPUT;
float4 matrixWVP = mul(gm_Matrices[MATRIX_WORLD_VIEW_PROJECTION], INPUT.vPosition);
OUTPUT.vPosition = matrixWVP;
OUTPUT.vColor = INPUT.vColor;
OUTPUT.vCoord = INPUT.vTexcoord;
return OUTPUT;
}
//####### Frag Shader
struct Fragment
{
float4 vPosition : SV_POSITION;
float4 vColor : COLOR0;
float2 vCoord : TEXCOORD0;
};
struct Render
{
float4 Col1 : SV_TARGET0;
float4 Col2 : SV_TARGET1;
};
Render main(Fragment INPUT)
{
Render OUTPUT;
float4 Color = INPUT.vColor * gm_BaseTextureObject.Sample(gm_BaseTexture,INPUT.vCoord);
OUTPUT.Col1 = Color;
OUTPUT.Col2 = Color;
return OUTPUT;
}