diff options
author | David Walter Seikel | 2016-03-28 22:28:34 +1000 |
---|---|---|
committer | David Walter Seikel | 2016-03-28 22:28:34 +1000 |
commit | 7028cbe09c688437910a25623098762bf0fa592d (patch) | |
tree | 10b5af58277d9880380c2251f109325542c4e6eb /libraries/irrlicht-1.8.1/media/opengl.vsh | |
parent | Move lemon to the src/others directory. (diff) | |
download | SledjHamr-7028cbe09c688437910a25623098762bf0fa592d.zip SledjHamr-7028cbe09c688437910a25623098762bf0fa592d.tar.gz SledjHamr-7028cbe09c688437910a25623098762bf0fa592d.tar.bz2 SledjHamr-7028cbe09c688437910a25623098762bf0fa592d.tar.xz |
Move Irrlicht to src/others.
Diffstat (limited to 'libraries/irrlicht-1.8.1/media/opengl.vsh')
-rw-r--r-- | libraries/irrlicht-1.8.1/media/opengl.vsh | 60 |
1 files changed, 0 insertions, 60 deletions
diff --git a/libraries/irrlicht-1.8.1/media/opengl.vsh b/libraries/irrlicht-1.8.1/media/opengl.vsh deleted file mode 100644 index 9cd71bf..0000000 --- a/libraries/irrlicht-1.8.1/media/opengl.vsh +++ /dev/null | |||
@@ -1,60 +0,0 @@ | |||
1 | !!ARBvp1.0 | ||
2 | # part of the Irrlicht Engine Shader example. | ||
3 | # Please note that these example shaders don't do anything really useful. | ||
4 | # They only demonstrate that shaders can be used in Irrlicht. | ||
5 | |||
6 | #input | ||
7 | ATTRIB InPos = vertex.position; | ||
8 | ATTRIB InColor = vertex.color; | ||
9 | ATTRIB InNormal = vertex.normal; | ||
10 | ATTRIB InTexCoord = vertex.texcoord; | ||
11 | |||
12 | #output | ||
13 | OUTPUT OutPos = result.position; | ||
14 | OUTPUT OutColor = result.color; | ||
15 | OUTPUT OutTexCoord = result.texcoord; | ||
16 | |||
17 | PARAM MVP[4] = { state.matrix.mvp }; # modelViewProjection matrix. | ||
18 | TEMP Temp; | ||
19 | TEMP TempColor; | ||
20 | TEMP TempNormal; | ||
21 | TEMP TempPos; | ||
22 | |||
23 | #transform position to clip space | ||
24 | DP4 Temp.x, MVP[0], InPos; | ||
25 | DP4 Temp.y, MVP[1], InPos; | ||
26 | DP4 Temp.z, MVP[2], InPos; | ||
27 | DP4 Temp.w, MVP[3], InPos; | ||
28 | |||
29 | #transform normal | ||
30 | DP3 TempNormal.x, InNormal.x, program.local[0]; | ||
31 | DP3 TempNormal.y, InNormal.y, program.local[1]; | ||
32 | DP3 TempNormal.z, InNormal.z, program.local[2]; | ||
33 | |||
34 | #renormalize normal | ||
35 | DP3 TempNormal.w, TempNormal, TempNormal; | ||
36 | RSQ TempNormal.w, TempNormal.w; | ||
37 | MUL TempNormal, TempNormal, TempNormal.w; | ||
38 | |||
39 | # calculate light vector | ||
40 | DP4 TempPos.x, InPos, program.local[10]; # vertex into world position | ||
41 | DP4 TempPos.y, InPos, program.local[11]; | ||
42 | DP4 TempPos.z, InPos, program.local[12]; | ||
43 | DP4 TempPos.w, InPos, program.local[13]; | ||
44 | |||
45 | ADD TempPos, program.local[8], -TempPos; # vtxpos - lightpos | ||
46 | |||
47 | # normalize light vector | ||
48 | DP3 TempPos.w, TempPos, TempPos; | ||
49 | RSQ TempPos.w, TempPos.w; | ||
50 | MUL TempPos, TempPos, TempPos.w; | ||
51 | |||
52 | # calculate light color | ||
53 | DP3 TempColor, TempNormal, TempPos; # dp3 with negative light vector | ||
54 | LIT OutColor, TempColor; # clamp to zero if r3 < 0, r5 has diffuce component in r5.y | ||
55 | MUL OutColor, TempColor.y, program.local[9]; # ouput diffuse color | ||
56 | MOV OutColor.w, 1.0; # we want alpha to be always 1 | ||
57 | MOV OutTexCoord, InTexCoord; # store texture coordinate | ||
58 | MOV OutPos, Temp; | ||
59 | |||
60 | END \ No newline at end of file | ||