aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/irrlicht-1.8/media/d3d8.vsh
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--libraries/irrlicht-1.8/media/d3d8.vsh74
1 files changed, 37 insertions, 37 deletions
diff --git a/libraries/irrlicht-1.8/media/d3d8.vsh b/libraries/irrlicht-1.8/media/d3d8.vsh
index e0c24f7..e25a4c9 100644
--- a/libraries/irrlicht-1.8/media/d3d8.vsh
+++ b/libraries/irrlicht-1.8/media/d3d8.vsh
@@ -1,37 +1,37 @@
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
6vs.1.1 6vs.1.1
7 7
8; transpose and transform position to clip space 8; transpose and transform position to clip space
9mul r0, v0.x, c4 9mul r0, v0.x, c4
10mad r0, v0.y, c5, r0 10mad r0, v0.y, c5, r0
11mad r0, v0.z, c6, r0 11mad r0, v0.z, c6, r0
12add oPos, c7, r0 12add oPos, c7, r0
13 13
14; transform normal 14; transform normal
15dp3 r1.x, v1, c0 15dp3 r1.x, v1, c0
16dp3 r1.y, v1, c1 16dp3 r1.y, v1, c1
17dp3 r1.z, v1, c2 17dp3 r1.z, v1, c2
18 18
19; renormalize normal 19; renormalize normal
20dp3 r1.w, r1, r1 20dp3 r1.w, r1, r1
21rsq r1.w, r1.w 21rsq r1.w, r1.w
22mul r1, r1, r1.w 22mul r1, r1, r1.w
23 23
24; calculate light vector 24; calculate light vector
25m4x4 r6, v0, c10 ; vertex into world position 25m4x4 r6, v0, c10 ; vertex into world position
26add r2, c8, -r6 ; vtxpos - lightpos 26add r2, c8, -r6 ; vtxpos - lightpos
27 27
28; normalize light vector 28; normalize light vector
29dp3 r2.w, r2, r2 29dp3 r2.w, r2, r2
30rsq r2.w, r2.w 30rsq r2.w, r2.w
31mul r2, r2, r2.w 31mul r2, r2, r2.w
32 32
33; calculate light color 33; calculate light color
34dp3 r3, r1, r2 ; dp3 with negative light vector 34dp3 r3, r1, r2 ; dp3 with negative light vector
35lit r5, r3 ; clamp to zero if r3 < 0, r5 has diffuce component in r5.y 35lit r5, r3 ; clamp to zero if r3 < 0, r5 has diffuce component in r5.y
36mul oD0, r5.y, c9 ; ouput diffuse color 36mul oD0, r5.y, c9 ; ouput diffuse color
37mov oT0, v3 ; store texture coordinates 37mov oT0, v3 ; store texture coordinates