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
|
---|
15 | ogl
|
---|
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
|
---|
123 | {
|
---|
124 | hlsl_vertshader
|
---|
125 | {
|
---|
126 | // Code of the pixel program
|
---|
127 | code_variant_array
|
---|
128 | {
|
---|
129 | profile "1x1"
|
---|
130 | entry_point "main"
|
---|
131 | code "levelutil/shader/prog/d3d9_hlsl/"
|
---|
132 | & "bump_d3d9_hlsl_vs1x1.s3d_shadercode_run"
|
---|
133 | debug_code_file "src/res/levelutil/shader/prog/d3d9_hlsl/"
|
---|
134 | & "bump_d3d9_hlsl_vs1x1.s3d_shadercode"
|
---|
135 | }
|
---|
136 |
|
---|
137 |
|
---|
138 | // Copy matrices into vertex program constants.
|
---|
139 | // The field "chan" can be one
|
---|
140 | // of "identity", "proj", "view" or "projview" "bone"
|
---|
141 | // The field "trans" can be one
|
---|
142 | // of "identity", "inv", "transp" or "invtransp"
|
---|
143 | // One matrix needs 4 constants.
|
---|
144 | tracking
|
---|
145 | {
|
---|
146 | codevar "projMat"
|
---|
147 | slot 0
|
---|
148 | chan "proj"
|
---|
149 | trans "identity"
|
---|
150 | }
|
---|
151 | {
|
---|
152 | codevar "matBone"
|
---|
153 | slot 0
|
---|
154 | chan "bone"
|
---|
155 | trans "identity"
|
---|
156 | }
|
---|
157 |
|
---|
158 | param_array
|
---|
159 | {
|
---|
160 | src_progvar "prog_light_cenrange"
|
---|
161 | dest_codevar "lightCenRange"
|
---|
162 | type "float4"
|
---|
163 | }
|
---|
164 | {
|
---|
165 | src_progvar "prog_light_brightmat"
|
---|
166 | dest_codevar "lightBrightMat"
|
---|
167 | type "float4x4"
|
---|
168 | }
|
---|
169 |
|
---|
170 | predefine_array
|
---|
171 | {
|
---|
172 | name "S3D_USE_BONESUBSCR"
|
---|
173 | }
|
---|
174 | {
|
---|
175 | name "S3D_MATBONE_CNT"
|
---|
176 | val "32"
|
---|
177 | }
|
---|
178 | {
|
---|
179 | name "S3D_PARALLAX_MAPPING"
|
---|
180 | }
|
---|
181 | {
|
---|
182 | name "S3D_LIGHT_BRIGHT"
|
---|
183 | }
|
---|
184 | {
|
---|
185 | name "S3D_LIGHT_BRIGHT_CARE"
|
---|
186 | }
|
---|
187 | }
|
---|
188 |
|
---|
189 | hlsl_pixshader
|
---|
190 | {
|
---|
191 | code_variant_array
|
---|
192 | {
|
---|
193 | profile "2x0"
|
---|
194 | entry_point "main"
|
---|
195 | code "levelutil/shader/prog/d3d9_hlsl/"
|
---|
196 | & "bump_d3d9_hlsl_ps2x0.s3d_shadercode_run"
|
---|
197 | }
|
---|
198 |
|
---|
199 | param_array
|
---|
200 | {
|
---|
201 | src_progvar "prog_light_ambient"
|
---|
202 | dest_codevar "lightAmbient"
|
---|
203 | type "float4"
|
---|
204 | }
|
---|
205 | {
|
---|
206 | src_progvar "prog_light_diffuse"
|
---|
207 | dest_codevar "lightDiffuse"
|
---|
208 | type "float4"
|
---|
209 | }
|
---|
210 | {
|
---|
211 | src_progvar "prog_light_specular"
|
---|
212 | dest_codevar "lightSpecular"
|
---|
213 | type "float4"
|
---|
214 | }
|
---|
215 |
|
---|
216 | predefine_array
|
---|
217 | {
|
---|
218 | name "S3D_SPECULAR_EXP"
|
---|
219 | val "4.0"
|
---|
220 | }
|
---|
221 | {
|
---|
222 | name "S3D_GEOMETRIC_SHADOW"
|
---|
223 | }
|
---|
224 | {
|
---|
225 | name "S3D_PARALLAX_MAPPING"
|
---|
226 | }
|
---|
227 | {
|
---|
228 | name "S3D_PARALLAX_SCALE"
|
---|
229 | val "0.07"
|
---|
230 | }
|
---|
231 | {
|
---|
232 | name "S3D_PARALLAX_BIAS"
|
---|
233 | val "0.50196078431372549" // = 128/255
|
---|
234 | }
|
---|
235 | {
|
---|
236 | name "S3D_LIGHT_BRIGHT"
|
---|
237 | }
|
---|
238 | {
|
---|
239 | name "S3D_LIGHT_BRIGHT_CARE"
|
---|
240 | }
|
---|
241 |
|
---|
242 | tex_rcpsize_codevar_array "" "" "lightBrightRcpSize"
|
---|
243 | }
|
---|
244 | }
|
---|
245 |
|
---|