source: 2015/24/EemeliN/Space-adventure/Space-adventure/Space-adventureContent/Effect1.fx @ 6025

Revision 6025, 1.2 KB checked in by eeonilni, 6 years ago (diff)
Line 
1float4x4 World;
2float4x4 View;
3float4x4 Projection;
4
5// TODO: add effect parameters here.
6
7struct VertexShaderInput
8{
9    float4 Position : POSITION0;
10
11    // TODO: add input channels such as texture
12    // coordinates and vertex colors here.
13};
14
15struct VertexShaderOutput
16{
17    float4 Position : POSITION0;
18
19    // TODO: add vertex shader outputs such as colors and texture
20    // coordinates here. These values will automatically be interpolated
21    // over the triangle, and provided as input to your pixel shader.
22};
23
24VertexShaderOutput VertexShaderFunction(VertexShaderInput input)
25{
26    VertexShaderOutput output;
27
28    float4 worldPosition = mul(input.Position, World);
29    float4 viewPosition = mul(worldPosition, View);
30    output.Position = mul(viewPosition, Projection);
31
32    // TODO: add your vertex shader code here.
33
34    return output;
35}
36
37float4 PixelShaderFunction(VertexShaderOutput input) : COLOR0
38{
39    // TODO: add your pixel shader code here.
40
41    return float4(1, 0, 0, 1);
42}
43
44technique Technique1
45{
46    pass Pass1
47    {
48        // TODO: set renderstates here.
49
50        VertexShader = compile vs_2_0 VertexShaderFunction();
51        PixelShader = compile ps_2_0 PixelShaderFunction();
52    }
53}
Note: See TracBrowser for help on using the repository browser.