source: GTP/trunk/App/Demos/Illum/Shark3D/version164x12u/IllumDemo/src/res/levelutil/shader/prog/bump_bright.s3d_shaderprog @ 2196

Revision 2196, 9.1 KB checked in by szirmay, 17 years ago (diff)
Line 
1///////////////////////////////////////////////////////////////////////////////
2//
3//      ##  ######
4//       ######  ###
5//  ## ###############        Shark 3D Engine (www.shark3d.com)
6//   ########## # # #
7//    ########                Copyright (c) 1996-2006 Spinor GmbH.
8//   ######### # # #          All rights reserved.
9//  ##   ##########
10//      ##
11//
12///////////////////////////////////////////////////////////////////////////////
13
14// Opengl Highlevel Shaderlanguage
15ogl
16{
17    glsl
18    {
19        vertshader
20        {
21            code_variant_array
22            {
23                req_ver "1x0"
24                code_array "levelutil/shader/prog/ogl_glsl/"
25                        & "bump_ogl_glsl_vs1x0.s3d_shadercode_run"
26            }
27            tracking
28            {
29                // uniform mat4 matBone[4];
30                cnt 4
31                codevar "matBone[$]"
32                chan "bone"
33                trans "identity"
34            }
35
36            //  attribute vec4 bone_wgh;
37            bone_wgh "boneWgh"
38            //bone_subscr "boneSubscr"
39
40            predefine_array
41            {
42                name "S3D_USE_BONEWGH"
43            }
44            {
45                name "S3D_LIGHT_BRIGHT"
46            }
47            {
48                name "S3D_LIGHT_BRIGHT_CARE"
49            }
50            {
51                name "S3D_PARALLAX_MAPPING"
52            }
53        }
54
55        fragshader
56        {
57            code_variant_array
58            {
59                req_ver "1x0"
60                code_array "levelutil/shader/prog/ogl_glsl/"
61                        & "bump_ogl_glsl_fs1x0.s3d_shadercode_run"
62            }
63            predefine_array
64            {
65                name "S3D_SPECULAR_EXP"
66                val "4.0"
67            }
68            {
69                name "S3D_GEOMETRIC_SHADOW"
70            }
71            {
72                name "S3D_PARALLAX_MAPPING"
73            }
74            {
75                name "S3D_PARALLAX_SCALE"
76                val "0.07"
77            }
78            {
79                name "S3D_PARALLAX_BIAS"
80                val "0.50196078431372549" // = 128/255
81            }
82            {
83                name "S3D_LIGHT_BRIGHT"
84            }
85            {
86                name "S3D_LIGHT_BRIGHT_CARE"
87            }
88        }
89
90        param_array
91        {
92            src_progvar "prog_light_cenrange"
93            dest_codevar "lightCenRange"
94            type "float4"
95        }
96        {
97            src_progvar "prog_light_ambient"
98            dest_codevar "lightAmbient"
99            type "float4"
100        }
101        {
102            src_progvar "prog_light_diffuse"
103            dest_codevar "lightDiffuse"
104            type "float4"
105        }
106        {
107            src_progvar "prog_light_specular"
108            dest_codevar "lightSpecular"
109            type "float4"
110        }
111        {
112            src_progvar "prog_light_brightmat"
113            dest_codevar "lightBrightMat"
114            type "float4x4"
115        }
116
117        sampler_array "tex0" "normalSamp" "lightBrightSamp"
118        tex_rcpsize_codevar_array "" "" "lightBrightRcpSize"
119    }
120}
121
122// D3D9 Highlevel Shaderlanguage
123d3d9
124{
125    hlsl_vertshader
126    {
127        // Code of the pixel program
128        code_variant_array
129       {
130            profile "1x1"
131            entry_point "main"
132            code "levelutil/shader/prog/d3d9_hlsl/"
133                    & "bump_d3d9_hlsl_vs1x1.s3d_shadercode_run"
134            debug_code_file "src/res/levelutil/shader/prog/d3d9_hlsl/"
135                    & "bump_d3d9_hlsl_vs1x1.s3d_shadercode"
136        }
137
138
139        // Copy matrices into vertex program constants.
140        // The field "chan" can be one
141        // of "identity", "proj", "view" or "projview" "bone"
142        // The field "trans" can be one
143        // of "identity", "inv", "transp" or "invtransp"
144        // One matrix needs 4 constants.
145        tracking
146        {
147            codevar "projMat"
148            slot 0
149            chan "proj"
150            trans "identity"
151        }
152        {
153            codevar "matBone"
154            slot 0
155            chan "bone"
156            trans "identity"
157        }
158
159        param_array
160        {
161            src_progvar "prog_light_cenrange"
162            dest_codevar "lightCenRange"
163            type "float4"
164        }
165        {
166            src_progvar "prog_light_brightmat"
167            dest_codevar "lightBrightMat"
168            type "float4x4"
169        }
170
171        predefine_array
172        {
173            name "S3D_USE_BONESUBSCR"
174        }
175        {
176            name "S3D_MATBONE_CNT"
177            val "32"
178        }
179        {
180            name "S3D_PARALLAX_MAPPING"
181        }
182        {
183            name "S3D_LIGHT_BRIGHT"
184        }
185        {
186            name "S3D_LIGHT_BRIGHT_CARE"
187        }
188    }
189
190    hlsl_pixshader
191    {
192        code_variant_array
193        {
194            profile "2x0"
195            entry_point "main"
196            code "levelutil/shader/prog/d3d9_hlsl/"
197                    & "bump_d3d9_hlsl_ps2x0.s3d_shadercode_run"
198        }
199       
200        param_array
201        {
202            src_progvar "prog_light_ambient"
203            dest_codevar "lightAmbient"
204            type "float4"
205        }
206        {
207            src_progvar "prog_light_diffuse"
208            dest_codevar "lightDiffuse"
209            type "float4"
210        }
211        {
212            src_progvar "prog_light_specular"
213            dest_codevar "lightSpecular"
214            type "float4"
215        }
216       
217        predefine_array
218        {
219            name "S3D_SPECULAR_EXP"
220            val "4.0"
221        }
222        {
223            name "S3D_GEOMETRIC_SHADOW"
224        }
225        {
226            name "S3D_PARALLAX_MAPPING"
227        }
228        {
229            name "S3D_PARALLAX_SCALE"
230            val "0.07"
231        }
232        {
233            name "S3D_PARALLAX_BIAS"
234            val "0.50196078431372549" // = 128/255
235        }
236        {
237            name "S3D_LIGHT_BRIGHT"
238        }
239        {
240            name "S3D_LIGHT_BRIGHT_CARE"
241        }
242
243        tex_rcpsize_codevar_array "" "" "lightBrightRcpSize"
244    }
245}
246
247// D3D9 Highlevel Shaderlanguage
248xe
249{
250    hlsl_vertshader
251    {
252        // Code of the pixel program
253        code_variant_array
254       {
255            profile "1x1"
256            entry_point "main"
257            code "levelutil/shader/prog/d3d9_hlsl/"
258                    & "bump_d3d9_hlsl_vs1x1.s3d_shadercode_run"
259            debug_code_file "src/res/levelutil/shader/prog/d3d9_hlsl/"
260                    & "bump_d3d9_hlsl_vs1x1.s3d_shadercode"
261        }
262
263
264        // Copy matrices into vertex program constants.
265        // The field "chan" can be one
266        // of "identity", "proj", "view" or "projview" "bone"
267        // The field "trans" can be one
268        // of "identity", "inv", "transp" or "invtransp"
269        // One matrix needs 4 constants.
270        tracking
271        {
272            codevar "projMat"
273            slot 0
274            chan "proj"
275            trans "identity"
276        }
277        {
278            codevar "matBone"
279            slot 0
280            chan "bone"
281            trans "identity"
282        }
283
284        param_array
285        {
286            src_progvar "prog_light_cenrange"
287            dest_codevar "lightCenRange"
288            type "float4"
289        }
290        {
291            src_progvar "prog_light_brightmat"
292            dest_codevar "lightBrightMat"
293            type "float4x4"
294        }
295
296        predefine_array
297        {
298            name "S3D_USE_BONESUBSCR"
299        }
300        {
301            name "S3D_MATBONE_CNT"
302            val "32"
303        }
304        {
305            name "S3D_PARALLAX_MAPPING"
306        }
307        {
308            name "S3D_LIGHT_BRIGHT"
309        }
310        {
311            name "S3D_LIGHT_BRIGHT_CARE"
312        }
313    }
314
315    hlsl_pixshader
316    {
317        code_variant_array
318        {
319            profile "2x0"
320            entry_point "main"
321            code "levelutil/shader/prog/d3d9_hlsl/"
322                    & "bump_d3d9_hlsl_ps2x0.s3d_shadercode_run"
323        }
324
325        param_array       
326        {
327            src_progvar "prog_light_ambient"
328            dest_codevar "lightAmbient"
329            type "float4"
330        }
331        {
332            src_progvar "prog_light_diffuse"
333            dest_codevar "lightDiffuse"
334            type "float4"
335        }
336        {
337            src_progvar "prog_light_specular"
338            dest_codevar "lightSpecular"
339            type "float4"
340        }
341
342        predefine_array
343        {
344            name "S3D_SPECULAR_EXP"
345            val "4.0"
346        }
347        {
348            name "S3D_GEOMETRIC_SHADOW"
349        }
350        {
351            name "S3D_PARALLAX_MAPPING"
352        }
353        {
354            name "S3D_PARALLAX_SCALE"
355            val "0.07"
356        }
357        {
358            name "S3D_PARALLAX_BIAS"
359            val "0.50196078431372549" // = 128/255
360        }
361        {
362            name "S3D_LIGHT_BRIGHT"
363        }
364        {
365            name "S3D_LIGHT_BRIGHT_CARE"
366        }
367
368        tex_rcpsize_codevar_array "" "" "lightBrightRcpSize"
369    }
370}
Note: See TracBrowser for help on using the repository browser.