1af69d88dSmrg/**************************************************************************
2af69d88dSmrg *
3af69d88dSmrg * Copyright 2011 Lauri Kasanen
4af69d88dSmrg * All Rights Reserved.
5af69d88dSmrg *
6af69d88dSmrg * Permission is hereby granted, free of charge, to any person obtaining a
7af69d88dSmrg * copy of this software and associated documentation files (the
8af69d88dSmrg * "Software"), to deal in the Software without restriction, including
9af69d88dSmrg * without limitation the rights to use, copy, modify, merge, publish,
10af69d88dSmrg * distribute, sub license, and/or sell copies of the Software, and to
11af69d88dSmrg * permit persons to whom the Software is furnished to do so, subject to
12af69d88dSmrg * the following conditions:
13af69d88dSmrg *
14af69d88dSmrg * The above copyright notice and this permission notice (including the
15af69d88dSmrg * next paragraph) shall be included in all copies or substantial portions
16af69d88dSmrg * of the Software.
17af69d88dSmrg *
18af69d88dSmrg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19af69d88dSmrg * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20af69d88dSmrg * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
21af69d88dSmrg * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
22af69d88dSmrg * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23af69d88dSmrg * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24af69d88dSmrg * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25af69d88dSmrg *
26af69d88dSmrg **************************************************************************/
27af69d88dSmrg
28af69d88dSmrg#ifndef CELSHADE_H
29af69d88dSmrg#define CELSHADE_H
30af69d88dSmrg
31af69d88dSmrgstatic const char celshade[] = "FRAG\n"
32af69d88dSmrg   "PROPERTY FS_COLOR0_WRITES_ALL_CBUFS 1\n"
33af69d88dSmrg   "DCL IN[0], GENERIC[0], PERSPECTIVE\n"
34af69d88dSmrg   "DCL OUT[0], COLOR\n"
35af69d88dSmrg   "DCL SAMP[0]\n"
36af69d88dSmrg   "DCL TEMP[0..4]\n"
37af69d88dSmrg   "IMM FLT32 {    0.2126,     0.7152,     0.0722,     4.0000}\n"
38af69d88dSmrg   "IMM FLT32 {    0.5000,     2.0000,     1.0000,    -0.1250}\n"
39af69d88dSmrg   "IMM FLT32 {    0.2500,     0.1000,     0.1250,     3.0000}\n"
40af69d88dSmrg   "  0: TEX TEMP[0], IN[0].xyyy, SAMP[0], 2D\n"
41af69d88dSmrg   "  1: DP3 TEMP[1].x, TEMP[0].xyzz, IMM[0]\n"
42af69d88dSmrg   "  2: MUL TEMP[3].x, TEMP[1].xxxx, IMM[0].wwww\n"
43af69d88dSmrg   "  3: ROUND TEMP[2].x, TEMP[3].xxxx\n"
44af69d88dSmrg   "  4: MUL TEMP[3].x, TEMP[2].xxxx, IMM[2].xxxx\n"
45af69d88dSmrg   "  5: MOV TEMP[2].x, TEMP[3].xxxx\n"
46af69d88dSmrg   "  6: ADD TEMP[4].x, TEMP[1].xxxx, -TEMP[3].xxxx\n"
47af69d88dSmrg   "  7: SGT TEMP[1].w, TEMP[4].xxxx, IMM[2].yyyy\n"
48af69d88dSmrg   "  8: IF TEMP[1].wwww :19\n"
49af69d88dSmrg   "  9:   ADD TEMP[4].y, TEMP[3].xxxx, IMM[2].yyyy\n"
50af69d88dSmrg   " 10:   ADD TEMP[1].z, TEMP[1].xxxx, -TEMP[4].yyyy\n"
51af69d88dSmrg   " 11:   ADD TEMP[1].y, TEMP[3].xxxx, IMM[2].zzzz\n"
52af69d88dSmrg   " 12:   ADD TEMP[2].x, TEMP[1].yyyy, -TEMP[4].yyyy\n"
53af69d88dSmrg   " 13:   RCP TEMP[4].y, TEMP[2].xxxx\n"
54af69d88dSmrg   " 14:   MUL TEMP[2].x, TEMP[1].zzzz, TEMP[4].yyyy\n"
55af69d88dSmrg   " 15:   MAD TEMP[1].y, -IMM[1].yyyy, TEMP[2].xxxx, IMM[2].wwww\n"
56af69d88dSmrg   " 16:   MUL TEMP[1].z, TEMP[2].xxxx, TEMP[1].yyyy\n"
57af69d88dSmrg   " 17:   MUL TEMP[1].y, TEMP[2].xxxx, TEMP[1].zzzz\n"
58af69d88dSmrg   " 18:   MAD TEMP[2].x, TEMP[1].yyyy, IMM[2].zzzz, TEMP[3].xxxx\n"
59af69d88dSmrg   " 19: ENDIF\n"
60af69d88dSmrg   " 20: SLT TEMP[3].x, TEMP[4].xxxx, -IMM[2].yyyy\n"
61af69d88dSmrg   " 21: IF TEMP[3].xxxx :34\n"
62af69d88dSmrg   " 22:   ADD TEMP[3].x, TEMP[2].xxxx, -IMM[2].zzzz\n"
63af69d88dSmrg   " 23:   ADD TEMP[4].x, TEMP[1].xxxx, -TEMP[3].xxxx\n"
64af69d88dSmrg   " 24:   ADD TEMP[1].x, TEMP[2].xxxx, -IMM[2].yyyy\n"
65af69d88dSmrg   " 25:   ADD TEMP[4].y, TEMP[1].xxxx, -TEMP[3].xxxx\n"
66af69d88dSmrg   " 26:   RCP TEMP[3].x, TEMP[4].yyyy\n"
67af69d88dSmrg   " 27:   MUL TEMP[1].x, TEMP[4].xxxx, TEMP[3].xxxx\n"
68af69d88dSmrg   " 28:   MAD TEMP[4].x, -IMM[1].yyyy, TEMP[1].xxxx, IMM[2].wwww\n"
69af69d88dSmrg   " 29:   MUL TEMP[3].x, TEMP[1].xxxx, TEMP[4].xxxx\n"
70af69d88dSmrg   " 30:   MUL TEMP[4].x, TEMP[1].xxxx, TEMP[3].xxxx\n"
71af69d88dSmrg   " 31:   ADD TEMP[3].x, IMM[1].zzzz, -TEMP[4].xxxx\n"
72af69d88dSmrg   " 32:   MAD TEMP[1].x, TEMP[3].xxxx, -IMM[2].zzzz, TEMP[2].xxxx\n"
73af69d88dSmrg   " 33:   MOV TEMP[2].x, TEMP[1].xxxx\n"
74af69d88dSmrg   " 34: ENDIF\n"
75af69d88dSmrg   " 35: MAD TEMP[1].x, TEMP[2].xxxx, IMM[1].yyyy, IMM[2].yyyy\n"
76af69d88dSmrg   " 36: MUL OUT[0], TEMP[0], TEMP[1].xxxx\n"
77af69d88dSmrg   " 37: END\n";
78af69d88dSmrg
79af69d88dSmrg#endif
80