[2453] | 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 |
|
---|
| 246 | //#ifdef S3D_GENERAL_PLATFORM_XE
|
---|
| 247 | xe
|
---|
| 248 | {
|
---|
| 249 | hlsl_vertshader
|
---|
| 250 | {
|
---|
| 251 | // Code of the pixel program
|
---|
| 252 | code_variant_array
|
---|
| 253 | {
|
---|
| 254 | profile "1x1"
|
---|
| 255 | entry_point "main"
|
---|
| 256 | code "levelutil/shader/prog/d3d9_hlsl/"
|
---|
| 257 | & "bump_d3d9_hlsl_vs1x1.s3d_shadercode_run"
|
---|
| 258 | debug_code_file "src/res/levelutil/shader/prog/d3d9_hlsl/"
|
---|
| 259 | & "bump_d3d9_hlsl_vs1x1.s3d_shadercode"
|
---|
| 260 | }
|
---|
| 261 |
|
---|
| 262 |
|
---|
| 263 | // Copy matrices into vertex program constants.
|
---|
| 264 | // The field "chan" can be one
|
---|
| 265 | // of "identity", "proj", "view" or "projview" "bone"
|
---|
| 266 | // The field "trans" can be one
|
---|
| 267 | // of "identity", "inv", "transp" or "invtransp"
|
---|
| 268 | // One matrix needs 4 constants.
|
---|
| 269 | tracking
|
---|
| 270 | {
|
---|
| 271 | codevar "projMat"
|
---|
| 272 | slot 0
|
---|
| 273 | chan "proj"
|
---|
| 274 | trans "identity"
|
---|
| 275 | }
|
---|
| 276 | {
|
---|
| 277 | codevar "matBone"
|
---|
| 278 | slot 0
|
---|
| 279 | chan "bone"
|
---|
| 280 | trans "identity"
|
---|
| 281 | }
|
---|
| 282 |
|
---|
| 283 | param_array
|
---|
| 284 | {
|
---|
| 285 | src_progvar "prog_light_cenrange"
|
---|
| 286 | dest_codevar "lightCenRange"
|
---|
| 287 | type "float4"
|
---|
| 288 | }
|
---|
| 289 | {
|
---|
| 290 | src_progvar "prog_light_brightmat"
|
---|
| 291 | dest_codevar "lightBrightMat"
|
---|
| 292 | type "float4x4"
|
---|
| 293 | }
|
---|
| 294 |
|
---|
| 295 | predefine_array
|
---|
| 296 | {
|
---|
| 297 | name "S3D_USE_BONESUBSCR"
|
---|
| 298 | }
|
---|
| 299 | {
|
---|
| 300 | name "S3D_MATBONE_CNT"
|
---|
| 301 | val "32"
|
---|
| 302 | }
|
---|
| 303 | {
|
---|
| 304 | name "S3D_PARALLAX_MAPPING"
|
---|
| 305 | }
|
---|
| 306 | {
|
---|
| 307 | name "S3D_LIGHT_BRIGHT"
|
---|
| 308 | }
|
---|
| 309 | {
|
---|
| 310 | name "S3D_LIGHT_BRIGHT_CARE"
|
---|
| 311 | }
|
---|
| 312 | }
|
---|
| 313 |
|
---|
| 314 | hlsl_pixshader
|
---|
| 315 | {
|
---|
| 316 | code_variant_array
|
---|
| 317 | {
|
---|
| 318 | profile "2x0"
|
---|
| 319 | entry_point "main"
|
---|
| 320 | code "levelutil/shader/prog/d3d9_hlsl/"
|
---|
| 321 | & "bump_d3d9_hlsl_ps2x0.s3d_shadercode_run"
|
---|
| 322 | }
|
---|
| 323 |
|
---|
| 324 | param_array
|
---|
| 325 | {
|
---|
| 326 | src_progvar "prog_light_ambient"
|
---|
| 327 | dest_codevar "lightAmbient"
|
---|
| 328 | type "float4"
|
---|
| 329 | }
|
---|
| 330 | {
|
---|
| 331 | src_progvar "prog_light_diffuse"
|
---|
| 332 | dest_codevar "lightDiffuse"
|
---|
| 333 | type "float4"
|
---|
| 334 | }
|
---|
| 335 | {
|
---|
| 336 | src_progvar "prog_light_specular"
|
---|
| 337 | dest_codevar "lightSpecular"
|
---|
| 338 | type "float4"
|
---|
| 339 | }
|
---|
| 340 |
|
---|
| 341 | predefine_array
|
---|
| 342 | {
|
---|
| 343 | name "S3D_SPECULAR_EXP"
|
---|
| 344 | val "4.0"
|
---|
| 345 | }
|
---|
| 346 | {
|
---|
| 347 | name "S3D_GEOMETRIC_SHADOW"
|
---|
| 348 | }
|
---|
| 349 | {
|
---|
| 350 | name "S3D_PARALLAX_MAPPING"
|
---|
| 351 | }
|
---|
| 352 | {
|
---|
| 353 | name "S3D_PARALLAX_SCALE"
|
---|
| 354 | val "0.07"
|
---|
| 355 | }
|
---|
| 356 | {
|
---|
| 357 | name "S3D_PARALLAX_BIAS"
|
---|
| 358 | val "0.50196078431372549" // = 128/255
|
---|
| 359 | }
|
---|
| 360 | {
|
---|
| 361 | name "S3D_LIGHT_BRIGHT"
|
---|
| 362 | }
|
---|
| 363 | {
|
---|
| 364 | name "S3D_LIGHT_BRIGHT_CARE"
|
---|
| 365 | }
|
---|
| 366 |
|
---|
| 367 | tex_rcpsize_codevar_array "" "" "lightBrightRcpSize"
|
---|
| 368 | }
|
---|
| 369 | }
|
---|
| 370 | //#endif
|
---|