File: Tutorial02.fx

package info (click to toggle)
microprofile 4.0%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 2,960 kB
  • sloc: cpp: 17,692; asm: 372; ansic: 265; makefile: 257; sh: 36
file content (28 lines) | stat: -rw-r--r-- 967 bytes parent folder | download | duplicates (2)
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
//--------------------------------------------------------------------------------------
// File: Tutorial02.fx
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//--------------------------------------------------------------------------------------

//--------------------------------------------------------------------------------------
// Vertex Shader
//--------------------------------------------------------------------------------------
float4 VS( float4 Pos : POSITION ) : SV_POSITION
{
    return Pos;
}


//--------------------------------------------------------------------------------------
// Pixel Shader
//--------------------------------------------------------------------------------------
float4 PS( float4 Pos : SV_POSITION ) : SV_Target
{
	float x = Pos.x;
	[branch]
	for(int i = 0; i < 100; ++i)
	{
		x = sin(x + i * 0.2);
	}
    return float4( x, 1.0f, 0.0f, 1.0f );    // Yellow, with Alpha = 1
}