-
Notifications
You must be signed in to change notification settings - Fork 0
/
basicEffect.fx
48 lines (41 loc) · 1.32 KB
/
basicEffect.fx
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
//--------------------------------------------------------------------------------------
// basicEffect.fx
//
//--------------------------------------------------------------------------------------
matrix World;
matrix View;
matrix Projection;
struct PS_INPUT
{
float4 Pos : SV_POSITION;
float4 Color : COLOR0;
};
//--------------------------------------------------------------------------------------
// Vertex Shader
//--------------------------------------------------------------------------------------
PS_INPUT VS( float4 Pos : POSITION, float4 Color : COLOR )
{
PS_INPUT psInput;
Pos = mul( Pos, World );
Pos = mul( Pos, View );
psInput.Pos = mul( Pos, Projection );
psInput.Color = Color;
return psInput;
}
//--------------------------------------------------------------------------------------
// Pixel Shader
//--------------------------------------------------------------------------------------
float4 PS( PS_INPUT psInput ) : SV_Target
{
return psInput.Color;
}
//--------------------------------------------------------------------------------------
technique10 Render
{
pass P0
{
SetVertexShader( CompileShader( vs_4_0, VS() ) );
SetGeometryShader( NULL );
SetPixelShader( CompileShader( ps_4_0, PS() ) );
}
}