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 | d3d9
|
---|
18 | {
|
---|
19 | hlsl_vertshader
|
---|
20 | {
|
---|
21 | // Code of the pixel program
|
---|
22 | code_variant_array
|
---|
23 | {
|
---|
24 | profile "1x1"
|
---|
25 | entry_point "main"
|
---|
26 | code "levelutil/shader/prog/d3d9_hlsl/"
|
---|
27 | & "direct_texturing_shmap_d3d9_hlsl_vs2x0.s3d_shadercode_run"
|
---|
28 | //debug_code_file "src/res/levelutil/shader/prog/d3d9_hlsl/"
|
---|
29 | // & "bump_d3d9_hlsl_vs1x1.s3d_shadercode"
|
---|
30 | }
|
---|
31 |
|
---|
32 |
|
---|
33 | // Copy matrices into vertex program constants.
|
---|
34 | // The field "chan" can be one
|
---|
35 | // of "identity", "proj", "view" or "projview" "bone"
|
---|
36 | // The field "trans" can be one
|
---|
37 | // of "identity", "inv", "transp" or "invtransp"
|
---|
38 | // One matrix needs 4 constants.
|
---|
39 | tracking
|
---|
40 | {
|
---|
41 | codevar "projMat"
|
---|
42 | slot 0
|
---|
43 | chan "proj"
|
---|
44 | trans "identity"
|
---|
45 | }
|
---|
46 | {
|
---|
47 | codevar "matView"
|
---|
48 | slot 0
|
---|
49 | chan "view"
|
---|
50 | trans "identity"
|
---|
51 | }
|
---|
52 |
|
---|
53 | param_array
|
---|
54 | {
|
---|
55 | src_progvar "prog_light_cenrange"
|
---|
56 | dest_codevar "lightCenRange"
|
---|
57 | type "float4"
|
---|
58 | }
|
---|
59 | {
|
---|
60 | src_progvar "prog_light_projmat"
|
---|
61 | dest_codevar "lightProjMat"
|
---|
62 | type "float4x4"
|
---|
63 | }
|
---|
64 | {
|
---|
65 | src_progvar "prog_light_shmapmat"
|
---|
66 | dest_codevar "lightShmapMat"
|
---|
67 | type "float4x4"
|
---|
68 | }
|
---|
69 |
|
---|
70 | predefine_array
|
---|
71 | {
|
---|
72 | name "S3D_SPECULAR_EXP"
|
---|
73 | val "4.0"
|
---|
74 | }
|
---|
75 | {
|
---|
76 | name "S3D_LIGHT_PROJ"
|
---|
77 | }
|
---|
78 | {
|
---|
79 | name "S3D_LIGHT_SHMAP"
|
---|
80 | }
|
---|
81 | }
|
---|
82 |
|
---|
83 | hlsl_pixshader
|
---|
84 | {
|
---|
85 | code_variant_array
|
---|
86 | {
|
---|
87 | profile "2x0"
|
---|
88 | entry_point "main"
|
---|
89 | code "levelutil/shader/prog/d3d9_hlsl/"
|
---|
90 | & "direct_texturing_shmap_d3d9_hlsl_ps2x0.s3d_shadercode_run"
|
---|
91 | }
|
---|
92 |
|
---|
93 | param_array
|
---|
94 | {
|
---|
95 | src_progvar "prog_light_ambient"
|
---|
96 | dest_codevar "lightAmbient"
|
---|
97 | type "float4"
|
---|
98 | }
|
---|
99 | {
|
---|
100 | src_progvar "prog_light_diffuse"
|
---|
101 | dest_codevar "lightDiffuse"
|
---|
102 | type "float4"
|
---|
103 | }
|
---|
104 | {
|
---|
105 | src_progvar "prog_light_specular"
|
---|
106 | dest_codevar "lightSpecular"
|
---|
107 | type "float4"
|
---|
108 | }
|
---|
109 |
|
---|
110 | tex_size_codevar_array "" "" "lightShmapSize"
|
---|
111 | tex_rcpsize_codevar_array "" "" "lightShmapRcpSize"
|
---|
112 |
|
---|
113 | predefine_array
|
---|
114 | {
|
---|
115 | name "S3D_SPECULAR_EXP"
|
---|
116 | val "4.0"
|
---|
117 | }
|
---|
118 | {
|
---|
119 | name "S3D_LIGHT_PROJ"
|
---|
120 | }
|
---|
121 | {
|
---|
122 | name "S3D_LIGHT_SHMAP"
|
---|
123 | }
|
---|
124 | /*
|
---|
125 | {
|
---|
126 | name "S3D_SHMAP_FILTER16"
|
---|
127 | val ""
|
---|
128 | }
|
---|
129 | */
|
---|
130 | {
|
---|
131 | name "S3D_SHMAP_ZBIAS"
|
---|
132 | //val "0.0003" // For no-filtering
|
---|
133 | val "0.0010" // For 4-filtering
|
---|
134 | //val "0.0010" // For 16-filtering
|
---|
135 | }
|
---|
136 | }
|
---|
137 | }
|
---|
138 |
|
---|