3
|
1 |
vs.2.0
|
|
2 |
|
|
3 |
//------------------------------------------------------------------------------
|
|
4 |
// Simple Vertex Shader
|
|
5 |
//
|
|
6 |
// Constants Registers:
|
|
7 |
//
|
|
8 |
// c0-c3 = combined model-view-projection matrix
|
|
9 |
// c4 = constant color (defined by the application)
|
|
10 |
//
|
|
11 |
// Input Registers:
|
|
12 |
//
|
|
13 |
// v0 = per-vertex position
|
|
14 |
// v1 = per-vertex color
|
|
15 |
//
|
|
16 |
// Output Registers:
|
|
17 |
//
|
|
18 |
// oPos = homogeneous position
|
|
19 |
// oD0 = diffuse color
|
|
20 |
//
|
|
21 |
//------------------------------------------------------------------------------
|
|
22 |
|
|
23 |
dcl_position v0
|
|
24 |
dcl_color v1
|
|
25 |
|
|
26 |
m4x4 oPos, v0, c0 // Transform the per-vertex position into clip-space
|
|
27 |
mov oD0, v1 // Use the original per-vertex color specified
|
|
28 |
|
|
29 |
//mov oD0, c4 // Uncomment this to use the constant color stored at c4
|
|
30 |
|