source: GTP/trunk/App/Demos/Illum/Shark3D/version164x12u/IllumDemo/bin/res/levelutil/shader/prog/bump_shmap.s3d_shaderprog_run @ 2196

Revision 2196, 10.6 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// Shader program configuration.
15// Different drivers access different parameters.
16
17// Opengl Highlevel Shaderlanguage
18ogl
19{
20    samp_depth_test_array "" "" ""
21
22    glsl
23    {
24        vertshader
25        {
26            code_variant_array
27            {
28                req_ver "1x0"
29                code_array "levelutil/shader/prog/ogl_glsl/"
30                        & "bump_ogl_glsl_vs1x0.s3d_shadercode_run"
31            }
32            tracking
33            {
34                // uniform mat4 matBone[4];
35                cnt 4
36                codevar "matBone[$]"
37                chan "bone"
38                trans "identity"
39            }
40
41            //  attribute vec4 bone_wgh;
42            bone_wgh "boneWgh"
43            //bone_subscr "boneSubscr"
44
45            predefine_array
46            {
47                name "S3D_USE_BONEWGH"
48            }
49            {
50                name "S3D_PARALLAX_MAPPING"
51            }
52            {
53                name "S3D_LIGHT_PROJ"
54            }
55            {
56                name "S3D_LIGHT_SHMAP"
57            }
58        }
59
60        fragshader
61        {
62            code_variant_array
63            {
64                req_ver "1x0"
65                code_array "levelutil/shader/prog/ogl_glsl/"
66                        & "bump_ogl_glsl_fs1x0.s3d_shadercode_run"
67            }
68            predefine_array
69            {
70                name "S3D_SPECULAR_EXP"
71                val "4.0"
72            }
73            {
74                name "S3D_GEOMETRIC_SHADOW"
75            }
76            {
77                name "S3D_PARALLAX_MAPPING"
78            }
79            {
80                name "S3D_PARALLAX_SCALE"
81                val "0.07"
82            }
83            {
84                name "S3D_PARALLAX_BIAS"
85                val "0.50196078431372549" // = 128/255
86            }
87            {
88                name "S3D_LIGHT_PROJ"
89            }
90            {
91                name "S3D_LIGHT_SHMAP"
92            }
93            {
94                name "S3D_SHMAP_FILTER16"
95            }
96            {
97                name "S3D_SHMAP_ZBIAS"
98                //val "0.0003" // For no-filtering
99                val "0.0010" // For 4-filtering
100                //val "0.0010" // For 16-filtering
101            }
102        }
103
104        param_array
105        {
106            src_progvar "prog_light_cenrange"
107            dest_codevar "lightCenRange"
108            type "float4"
109        }
110        {
111            src_progvar "prog_light_ambient"
112            dest_codevar "lightAmbient"
113            type "float4"
114        }
115        {
116            src_progvar "prog_light_diffuse"
117            dest_codevar "lightDiffuse"
118            type "float4"
119        }
120        {
121            src_progvar "prog_light_specular"
122            dest_codevar "lightSpecular"
123            type "float4"
124        }
125        {
126            src_progvar "prog_light_projmat"
127            dest_codevar "lightProjMat"
128            type "float4x4"
129        }
130        {
131            src_progvar "prog_light_shmapmat"
132            dest_codevar "lightShmapMat"
133            type "float4x4"
134        }
135
136        sampler_array "tex0" "normalSamp" "lightProjSamp" "lightShmapSamp"
137
138        tex_size_codevar_array "" "" "lightShmapSize"
139        tex_rcpsize_codevar_array "" "" "lightShmapRcpSize"
140    }
141}
142
143// D3D9 Highlevel Shaderlanguage
144d3d9
145{
146    hlsl_vertshader
147    {
148        // Code of the pixel program
149        code_variant_array
150        {
151            profile "1x1"
152            entry_point "main"
153            code "levelutil/shader/prog/d3d9_hlsl/"
154                    & "bump_d3d9_hlsl_vs1x1.s3d_shadercode_run"
155            //debug_code_file "src/res/levelutil/shader/prog/d3d9_hlsl/"
156            //      & "bump_d3d9_hlsl_vs1x1.s3d_shadercode"
157        }
158
159
160        // Copy matrices into vertex program constants.
161        // The field "chan" can be one
162        // of "identity", "proj", "view" or "projview" "bone"
163        // The field "trans" can be one
164        // of "identity", "inv", "transp" or "invtransp"
165        // One matrix needs 4 constants.
166        tracking
167        {
168            codevar "projMat"
169            slot 0
170            chan "proj"
171            trans "identity"
172        }
173        {
174            codevar "matBone"
175            slot 0
176            chan "bone"
177            trans "identity"
178        }
179
180        param_array
181        {
182            src_progvar "prog_light_cenrange"
183            dest_codevar "lightCenRange"
184            type "float4"
185        }
186        {
187            src_progvar "prog_light_projmat"
188            dest_codevar "lightProjMat"
189            type "float4x4"
190        }
191        {
192            src_progvar "prog_light_shmapmat"
193            dest_codevar "lightShmapMat"
194            type "float4x4"
195        }
196
197        predefine_array
198        {
199            name "S3D_USE_BONESUBSCR"
200        }
201        {
202            name "S3D_MATBONE_CNT"
203            val "32"
204        }
205        {
206            name "S3D_PARALLAX_MAPPING"
207        }
208        {
209            name "S3D_LIGHT_PROJ"
210        }
211        {
212            name "S3D_LIGHT_SHMAP"
213        }
214    }
215
216    hlsl_pixshader
217    {
218        code_variant_array
219        {
220            profile "2x0"
221            entry_point "main"
222            code "levelutil/shader/prog/d3d9_hlsl/"
223                    & "bump_d3d9_hlsl_ps2x0.s3d_shadercode_run"
224        }
225       
226        param_array
227        {
228            src_progvar "prog_light_ambient"
229            dest_codevar "lightAmbient"
230            type "float4"
231        }
232        {
233            src_progvar "prog_light_diffuse"
234            dest_codevar "lightDiffuse"
235            type "float4"
236        }
237        {
238            src_progvar "prog_light_specular"
239            dest_codevar "lightSpecular"
240            type "float4"
241        }
242
243        tex_size_codevar_array "" "" "lightShmapSize"
244        tex_rcpsize_codevar_array "" "" "lightShmapRcpSize"
245
246        predefine_array
247        {
248            name "S3D_SPECULAR_EXP"
249            val "4.0"
250        }
251        {
252            name "S3D_GEOMETRIC_SHADOW"
253        }
254        {
255            name "S3D_PARALLAX_MAPPING"
256        }
257        {
258            name "S3D_PARALLAX_SCALE"
259            val "0.07"
260        }
261        {
262            name "S3D_PARALLAX_BIAS"
263            val "0.50196078431372549" // = 128/255
264        }
265        {
266            name "S3D_LIGHT_PROJ"
267        }
268        {
269            name "S3D_LIGHT_SHMAP"
270        }
271        /*
272        {
273            name "S3D_SHMAP_FILTER16"
274            val ""
275        }
276        */
277        {
278            name "S3D_SHMAP_ZBIAS"
279            //val "0.0003" // For no-filtering
280            val "0.0010" // For 4-filtering
281            //val "0.0010" // For 16-filtering
282        }
283    }
284}
285
286// D3D9 Highlevel Shaderlanguage
287xe
288{
289    hlsl_vertshader
290    {
291        // Code of the pixel program
292        code_variant_array
293        {
294            profile "1x1"
295            entry_point "main"
296            code "levelutil/shader/prog/d3d9_hlsl/"
297                    & "bump_d3d9_hlsl_vs1x1.s3d_shadercode_run"
298            //debug_code_file "src/res/levelutil/shader/prog/d3d9_hlsl/"
299            //      & "bump_d3d9_hlsl_vs1x1.s3d_shadercode"
300        }
301
302
303        // Copy matrices into vertex program constants.
304        // The field "chan" can be one
305        // of "identity", "proj", "view" or "projview" "bone"
306        // The field "trans" can be one
307        // of "identity", "inv", "transp" or "invtransp"
308        // One matrix needs 4 constants.
309        tracking
310        {
311            codevar "projMat"
312            slot 0
313            chan "proj"
314            trans "identity"
315        }
316        {
317            codevar "matBone"
318            slot 0
319            chan "bone"
320            trans "identity"
321        }
322
323        param_array
324        {
325            src_progvar "prog_light_cenrange"
326            dest_codevar "lightCenRange"
327            type "float4"
328        }
329        {
330            src_progvar "prog_light_projmat"
331            dest_codevar "lightProjMat"
332            type "float4x4"
333        }
334        {
335            src_progvar "prog_light_shmapmat"
336            dest_codevar "lightShmapMat"
337            type "float4x4"
338        }
339
340        predefine_array
341        {
342            name "S3D_USE_BONESUBSCR"
343        }
344        {
345            name "S3D_MATBONE_CNT"
346            val "32"
347        }
348        {
349            name "S3D_PARALLAX_MAPPING"
350        }
351        {
352            name "S3D_LIGHT_PROJ"
353        }
354        {
355            name "S3D_LIGHT_SHMAP"
356        }
357    }
358
359    hlsl_pixshader
360    {
361        code_variant_array
362        {
363            profile "2x0"
364            entry_point "main"
365            code "levelutil/shader/prog/d3d9_hlsl/"
366                    & "bump_d3d9_hlsl_ps2x0.s3d_shadercode_run"
367        }
368
369        param_array
370        {
371            src_progvar "prog_light_ambient"
372            dest_codevar "lightAmbient"
373            type "float4"
374        }
375        {
376            src_progvar "prog_light_diffuse"
377            dest_codevar "lightDiffuse"
378            type "float4"
379        }
380        {
381            src_progvar "prog_light_specular"
382            dest_codevar "lightSpecular"
383            type "float4"
384        }
385
386        tex_size_codevar_array "" "" "" "lightShmapSize"
387        tex_rcpsize_codevar_array "" "" "" "lightShmapRcpSize"
388
389        predefine_array
390        {
391            name "S3D_SPECULAR_EXP"
392            val "4.0"
393        }
394        {
395            name "S3D_GEOMETRIC_SHADOW"
396        }
397        {
398            name "S3D_PARALLAX_MAPPING"
399        }
400        {
401            name "S3D_PARALLAX_SCALE"
402            val "0.07"
403        }
404        {
405            name "S3D_PARALLAX_BIAS"
406            val "0.50196078431372549" // = 128/255
407        }
408        {
409            name "S3D_LIGHT_PROJ"
410        }
411        {
412            name "S3D_LIGHT_SHMAP"
413        }
414        {
415            name "S3D_SHMAP_FILTER16"
416            val ""
417        }
418        {
419            name "S3D_SHMAP_ZBIAS"
420            //val "0.0003" // For no-filtering
421            //val "0.0010" // For 4-filtering
422            val "0.0010" // For 16-filtering
423        }
424    }
425}
Note: See TracBrowser for help on using the repository browser.