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
|
---|
18 | ogl
|
---|
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
|
---|
144 | {
|
---|
145 | hlsl_vertshader
|
---|
146 | {
|
---|
147 | // Code of the pixel program
|
---|
148 | code_variant_array
|
---|
149 | {
|
---|
150 | profile "1x1"
|
---|
151 | entry_point "main"
|
---|
152 | code "levelutil/shader/prog/d3d9_hlsl/"
|
---|
153 | & "plain_shmap_d3d9_hlsl_vs1x1.s3d_shadercode_run"
|
---|
154 | //debug_code_file "src/res/levelutil/shader/prog/d3d9_hlsl/"
|
---|
155 | // & "plain_shmap_d3d9_hlsl_vs1x1.s3d_shadercode"
|
---|
156 | }
|
---|
157 |
|
---|
158 |
|
---|
159 | // Copy matrices into vertex program constants.
|
---|
160 | // The field "chan" can be one
|
---|
161 | // of "identity", "proj", "view" or "projview" "bone"
|
---|
162 | // The field "trans" can be one
|
---|
163 | // of "identity", "inv", "transp" or "invtransp"
|
---|
164 | // One matrix needs 4 constants.
|
---|
165 | tracking
|
---|
166 | {
|
---|
167 | codevar "projMat"
|
---|
168 | slot 0
|
---|
169 | chan "proj"
|
---|
170 | trans "identity"
|
---|
171 | }
|
---|
172 | {
|
---|
173 | codevar "matBone"
|
---|
174 | slot 0
|
---|
175 | chan "bone"
|
---|
176 | trans "identity"
|
---|
177 | }
|
---|
178 |
|
---|
179 | param_array
|
---|
180 | {
|
---|
181 | src_progvar "prog_light_cenrange"
|
---|
182 | dest_codevar "lightCenRange"
|
---|
183 | type "float4"
|
---|
184 | }
|
---|
185 | {
|
---|
186 | src_progvar "prog_light_projmat"
|
---|
187 | dest_codevar "lightProjMat"
|
---|
188 | type "float4x4"
|
---|
189 | }
|
---|
190 | {
|
---|
191 | src_progvar "prog_light_shmapmat"
|
---|
192 | dest_codevar "lightShmapMat"
|
---|
193 | type "float4x4"
|
---|
194 | }
|
---|
195 |
|
---|
196 | predefine_array
|
---|
197 | {
|
---|
198 | name "S3D_USE_BONESUBSCR"
|
---|
199 | }
|
---|
200 | {
|
---|
201 | name "S3D_MATBONE_CNT"
|
---|
202 | val "32"
|
---|
203 | }
|
---|
204 | {
|
---|
205 | name "S3D_PARALLAX_MAPPING"
|
---|
206 | }
|
---|
207 | {
|
---|
208 | name "S3D_LIGHT_PROJ"
|
---|
209 | }
|
---|
210 | {
|
---|
211 | name "S3D_LIGHT_SHMAP"
|
---|
212 | }
|
---|
213 | }
|
---|
214 |
|
---|
215 | hlsl_pixshader
|
---|
216 | {
|
---|
217 | code_variant_array
|
---|
218 | {
|
---|
219 | profile "2x0"
|
---|
220 | entry_point "main"
|
---|
221 | code "levelutil/shader/prog/d3d9_hlsl/"
|
---|
222 | & "plain_shmap_d3d9_hlsl_ps2x0.s3d_shadercode_run"
|
---|
223 | }
|
---|
224 |
|
---|
225 | param_array
|
---|
226 | {
|
---|
227 | src_progvar "prog_light_ambient"
|
---|
228 | dest_codevar "lightAmbient"
|
---|
229 | type "float4"
|
---|
230 | }
|
---|
231 | {
|
---|
232 | src_progvar "prog_light_diffuse"
|
---|
233 | dest_codevar "lightDiffuse"
|
---|
234 | type "float4"
|
---|
235 | }
|
---|
236 | {
|
---|
237 | src_progvar "prog_light_specular"
|
---|
238 | dest_codevar "lightSpecular"
|
---|
239 | type "float4"
|
---|
240 | }
|
---|
241 |
|
---|
242 | tex_size_codevar_array "" "" "lightShmapSize"
|
---|
243 | tex_rcpsize_codevar_array "" "" "lightShmapRcpSize"
|
---|
244 |
|
---|
245 | predefine_array
|
---|
246 | {
|
---|
247 | name "S3D_SPECULAR_EXP"
|
---|
248 | val "4.0"
|
---|
249 | }
|
---|
250 | {
|
---|
251 | name "S3D_GEOMETRIC_SHADOW"
|
---|
252 | }
|
---|
253 | {
|
---|
254 | name "S3D_PARALLAX_MAPPING"
|
---|
255 | }
|
---|
256 | {
|
---|
257 | name "S3D_PARALLAX_SCALE"
|
---|
258 | val "0.07"
|
---|
259 | }
|
---|
260 | {
|
---|
261 | name "S3D_PARALLAX_BIAS"
|
---|
262 | val "0.50196078431372549" // = 128/255
|
---|
263 | }
|
---|
264 | {
|
---|
265 | name "S3D_LIGHT_PROJ"
|
---|
266 | }
|
---|
267 | {
|
---|
268 | name "S3D_LIGHT_SHMAP"
|
---|
269 | }
|
---|
270 | /*
|
---|
271 | {
|
---|
272 | name "S3D_SHMAP_FILTER16"
|
---|
273 | val ""
|
---|
274 | }
|
---|
275 | */
|
---|
276 | {
|
---|
277 | name "S3D_SHMAP_ZBIAS"
|
---|
278 | //val "0.0003" // For no-filtering
|
---|
279 | val "0.0010" // For 4-filtering
|
---|
280 | //val "0.0010" // For 16-filtering
|
---|
281 | }
|
---|
282 | }
|
---|
283 | }
|
---|
284 |
|
---|