diff options
author | David Walter Seikel | 2013-01-13 18:54:10 +1000 |
---|---|---|
committer | David Walter Seikel | 2013-01-13 18:54:10 +1000 |
commit | 959831f4ef5a3e797f576c3de08cd65032c997ad (patch) | |
tree | e7351908be5995f0b325b2ebeaa02d5a34b82583 /libraries/irrlicht-1.8/media/d3d9.vsh | |
parent | Add info about changes to Irrlicht. (diff) | |
download | SledjHamr-959831f4ef5a3e797f576c3de08cd65032c997ad.zip SledjHamr-959831f4ef5a3e797f576c3de08cd65032c997ad.tar.gz SledjHamr-959831f4ef5a3e797f576c3de08cd65032c997ad.tar.bz2 SledjHamr-959831f4ef5a3e797f576c3de08cd65032c997ad.tar.xz |
Remove damned ancient DOS line endings from Irrlicht. Hopefully I did not go overboard.
Diffstat (limited to 'libraries/irrlicht-1.8/media/d3d9.vsh')
-rw-r--r-- | libraries/irrlicht-1.8/media/d3d9.vsh | 82 |
1 files changed, 41 insertions, 41 deletions
diff --git a/libraries/irrlicht-1.8/media/d3d9.vsh b/libraries/irrlicht-1.8/media/d3d9.vsh index 0d1dfe9..c1a4fbe 100644 --- a/libraries/irrlicht-1.8/media/d3d9.vsh +++ b/libraries/irrlicht-1.8/media/d3d9.vsh | |||
@@ -1,42 +1,42 @@ | |||
1 | ; part of the Irrlicht Engine Shader example. | 1 | ; part of the Irrlicht Engine Shader example. |
2 | ; This Direct3D9 vertex shader will be loaded by the engine. | 2 | ; This Direct3D9 vertex shader will be loaded by the engine. |
3 | ; Please note that these example shaders don't do anything really useful. | 3 | ; Please note that these example shaders don't do anything really useful. |
4 | ; They only demonstrate that shaders can be used in Irrlicht. | 4 | ; They only demonstrate that shaders can be used in Irrlicht. |
5 | 5 | ||
6 | vs.1.1 | 6 | vs.1.1 |
7 | 7 | ||
8 | dcl_position v0; ; declare position | 8 | dcl_position v0; ; declare position |
9 | dcl_normal v1; ; declare normal | 9 | dcl_normal v1; ; declare normal |
10 | dcl_color v2; ; declare color | 10 | dcl_color v2; ; declare color |
11 | dcl_texcoord0 v3; ; declare texture coordinate | 11 | dcl_texcoord0 v3; ; declare texture coordinate |
12 | 12 | ||
13 | ; transpose and transform position to clip space | 13 | ; transpose and transform position to clip space |
14 | mul r0, v0.x, c4 | 14 | mul r0, v0.x, c4 |
15 | mad r0, v0.y, c5, r0 | 15 | mad r0, v0.y, c5, r0 |
16 | mad r0, v0.z, c6, r0 | 16 | mad r0, v0.z, c6, r0 |
17 | add oPos, c7, r0 | 17 | add oPos, c7, r0 |
18 | 18 | ||
19 | ; transform normal | 19 | ; transform normal |
20 | dp3 r1.x, v1, c0 | 20 | dp3 r1.x, v1, c0 |
21 | dp3 r1.y, v1, c1 | 21 | dp3 r1.y, v1, c1 |
22 | dp3 r1.z, v1, c2 | 22 | dp3 r1.z, v1, c2 |
23 | 23 | ||
24 | ; renormalize normal | 24 | ; renormalize normal |
25 | dp3 r1.w, r1, r1 | 25 | dp3 r1.w, r1, r1 |
26 | rsq r1.w, r1.w | 26 | rsq r1.w, r1.w |
27 | mul r1, r1, r1.w | 27 | mul r1, r1, r1.w |
28 | 28 | ||
29 | ; calculate light vector | 29 | ; calculate light vector |
30 | m4x4 r6, v0, c10 ; vertex into world position | 30 | m4x4 r6, v0, c10 ; vertex into world position |
31 | add r2, c8, -r6 ; vtxpos - lightpos | 31 | add r2, c8, -r6 ; vtxpos - lightpos |
32 | 32 | ||
33 | ; normalize light vector | 33 | ; normalize light vector |
34 | dp3 r2.w, r2, r2 | 34 | dp3 r2.w, r2, r2 |
35 | rsq r2.w, r2.w | 35 | rsq r2.w, r2.w |
36 | mul r2, r2, r2.w | 36 | mul r2, r2, r2.w |
37 | 37 | ||
38 | ; calculate light color | 38 | ; calculate light color |
39 | dp3 r3, r1, r2 ; dp3 with negative light vector | 39 | dp3 r3, r1, r2 ; dp3 with negative light vector |
40 | lit r5, r3 ; clamp to zero if r3 < 0, r5 has diffuce component in r5.y | 40 | lit r5, r3 ; clamp to zero if r3 < 0, r5 has diffuce component in r5.y |
41 | mul oD0, r5.y, c9 ; ouput diffuse color | 41 | mul oD0, r5.y, c9 ; ouput diffuse color |
42 | mov oT0, v3 ; store texture coordinates \ No newline at end of file | 42 | mov oT0, v3 ; store texture coordinates \ No newline at end of file |