[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 | // Shader program configuration.
|
---|
| 15 | // Different drivers access different parameters.
|
---|
| 16 |
|
---|
| 17 | // Opengl Highlevel Shaderlanguage
|
---|
| 18 | ogl
|
---|
| 19 | {
|
---|
| 20 | glsl
|
---|
| 21 | {
|
---|
| 22 | vertshader
|
---|
| 23 | {
|
---|
| 24 | code_variant_array
|
---|
| 25 | {
|
---|
| 26 | req_ver "1x0"
|
---|
| 27 | code_array "levelutil/shader/prog/ogl_glsl/"
|
---|
| 28 | & "bump_ogl_glsl_vs1x0.s3d_shadercode_run"
|
---|
| 29 | }
|
---|
| 30 | tracking
|
---|
| 31 | {
|
---|
| 32 | cnt 4
|
---|
| 33 | codevar "matBone[$]"
|
---|
| 34 | chan "bone"
|
---|
| 35 | trans "identity"
|
---|
| 36 | }
|
---|
| 37 |
|
---|
| 38 | // attribute vec4 bone_wgh;
|
---|
| 39 | bone_wgh "boneWgh"
|
---|
| 40 | //bone_subscr "boneSubscr"
|
---|
| 41 |
|
---|
| 42 | predefine_array
|
---|
| 43 | {
|
---|
| 44 | name "S3D_USE_BONEWGH"
|
---|
| 45 | }
|
---|
| 46 | {
|
---|
| 47 | name "S3D_PARALLAX_MAPPING"
|
---|
| 48 | }
|
---|
| 49 | }
|
---|
| 50 |
|
---|
| 51 | fragshader
|
---|
| 52 | {
|
---|
| 53 | code_variant_array
|
---|
| 54 | {
|
---|
| 55 | req_ver "1x0"
|
---|
| 56 | code_array "levelutil/shader/prog/ogl_glsl/"
|
---|
| 57 | & "bump_ogl_glsl_fs1x0.s3d_shadercode_run"
|
---|
| 58 | }
|
---|
| 59 | predefine_array
|
---|
| 60 | {
|
---|
| 61 | name "S3D_SPECULAR_EXP"
|
---|
| 62 | val "4.0"
|
---|
| 63 | }
|
---|
| 64 | {
|
---|
| 65 | name "S3D_GEOMETRIC_SHADOW"
|
---|
| 66 | }
|
---|
| 67 | {
|
---|
| 68 | name "S3D_PARALLAX_MAPPING"
|
---|
| 69 | }
|
---|
| 70 | {
|
---|
| 71 | name "S3D_PARALLAX_SCALE"
|
---|
| 72 | val "0.07"
|
---|
| 73 | }
|
---|
| 74 | {
|
---|
| 75 | name "S3D_PARALLAX_BIAS"
|
---|
| 76 | val "0.50196078431372549" // = 128/255
|
---|
| 77 | }
|
---|
| 78 | }
|
---|
| 79 |
|
---|
| 80 | param_array
|
---|
| 81 | {
|
---|
| 82 | src_progvar "prog_light_cenrange"
|
---|
| 83 | dest_codevar "lightCenRange"
|
---|
| 84 | type "float4"
|
---|
| 85 | }
|
---|
| 86 | {
|
---|
| 87 | src_progvar "prog_light_ambient"
|
---|
| 88 | dest_codevar "lightAmbient"
|
---|
| 89 | type "float4"
|
---|
| 90 | }
|
---|
| 91 | {
|
---|
| 92 | src_progvar "prog_light_diffuse"
|
---|
| 93 | dest_codevar "lightDiffuse"
|
---|
| 94 | type "float4"
|
---|
| 95 | }
|
---|
| 96 | {
|
---|
| 97 | src_progvar "prog_light_specular"
|
---|
| 98 | dest_codevar "lightSpecular"
|
---|
| 99 | type "float4"
|
---|
| 100 | }
|
---|
| 101 |
|
---|
| 102 | sampler_array "tex0" "normalSamp"
|
---|
| 103 | }
|
---|
| 104 | }
|
---|
| 105 |
|
---|
| 106 | d3d9
|
---|
| 107 | {
|
---|
| 108 | hlsl_vertshader
|
---|
| 109 | {
|
---|
| 110 | // Code of the pixel program
|
---|
| 111 | code_variant_array
|
---|
| 112 | {
|
---|
| 113 | profile "1x1"
|
---|
| 114 | entry_point "main"
|
---|
| 115 | code "levelutil/shader/prog/d3d9_hlsl/"
|
---|
| 116 | & "bump_d3d9_hlsl_vs1x1.s3d_shadercode_run"
|
---|
| 117 | //debug_code_file "src/res/levelutil/shader/prog/d3d9_hlsl/"
|
---|
| 118 | // & "bump_d3d9_hlsl_vs1x1.s3d_shadercode"
|
---|
| 119 | }
|
---|
| 120 |
|
---|
| 121 |
|
---|
| 122 | // Copy matrices into vertex program constants.
|
---|
| 123 | // The field "chan" can be one
|
---|
| 124 | // of "identity", "proj", "view" or "projview" "bone"
|
---|
| 125 | // The field "trans" can be one
|
---|
| 126 | // of "identity", "inv", "transp" or "invtransp"
|
---|
| 127 | // One matrix needs 4 constants.
|
---|
| 128 | tracking
|
---|
| 129 | {
|
---|
| 130 | codevar "projMat"
|
---|
| 131 | slot 0
|
---|
| 132 | chan "proj"
|
---|
| 133 | trans "identity"
|
---|
| 134 | }
|
---|
| 135 | {
|
---|
| 136 | codevar "matView"
|
---|
| 137 | slot 0
|
---|
| 138 | chan "view"
|
---|
| 139 | trans "identity"
|
---|
| 140 | }
|
---|
| 141 | {
|
---|
| 142 | codevar "matBone"
|
---|
| 143 | slot 0
|
---|
| 144 | chan "bone"
|
---|
| 145 | trans "identity"
|
---|
| 146 | }
|
---|
| 147 |
|
---|
| 148 | param_array
|
---|
| 149 | {
|
---|
| 150 | src_progvar "prog_light_cenrange"
|
---|
| 151 | dest_codevar "lightCenRange"
|
---|
| 152 | type "float4"
|
---|
| 153 | }
|
---|
| 154 |
|
---|
| 155 | predefine_array
|
---|
| 156 | {
|
---|
| 157 | name "S3D_USE_BONESUBSCR"
|
---|
| 158 | }
|
---|
| 159 | {
|
---|
| 160 | name "S3D_MATBONE_CNT"
|
---|
| 161 | val "32"
|
---|
| 162 | }
|
---|
| 163 | {
|
---|
| 164 | name "S3D_PARALLAX_MAPPING"
|
---|
| 165 | }
|
---|
| 166 | }
|
---|
| 167 |
|
---|
| 168 | hlsl_pixshader
|
---|
| 169 | {
|
---|
| 170 | code_variant_array
|
---|
| 171 | {
|
---|
| 172 | profile "2x0"
|
---|
| 173 | entry_point "main"
|
---|
| 174 | code "levelutil/shader/prog/d3d9_hlsl/"
|
---|
| 175 | & "bump_d3d9_hlsl_ps2x0.s3d_shadercode_run"
|
---|
| 176 | }
|
---|
| 177 |
|
---|
| 178 | param_array
|
---|
| 179 | {
|
---|
| 180 | src_progvar "prog_light_ambient"
|
---|
| 181 | dest_codevar "lightAmbient"
|
---|
| 182 | type "float4"
|
---|
| 183 | }
|
---|
| 184 | {
|
---|
| 185 | src_progvar "prog_light_diffuse"
|
---|
| 186 | dest_codevar "lightDiffuse"
|
---|
| 187 | type "float4"
|
---|
| 188 | }
|
---|
| 189 | {
|
---|
| 190 | src_progvar "prog_light_specular"
|
---|
| 191 | dest_codevar "lightSpecular"
|
---|
| 192 | type "float4"
|
---|
| 193 | }
|
---|
| 194 |
|
---|
| 195 | predefine_array
|
---|
| 196 | {
|
---|
| 197 | name "S3D_SPECULAR_EXP"
|
---|
| 198 | val "4.0"
|
---|
| 199 | }
|
---|
| 200 | {
|
---|
| 201 | name "S3D_GEOMETRIC_SHADOW"
|
---|
| 202 | }
|
---|
| 203 | {
|
---|
| 204 | name "S3D_PARALLAX_MAPPING"
|
---|
| 205 | }
|
---|
| 206 | {
|
---|
| 207 | name "S3D_PARALLAX_SCALE"
|
---|
| 208 | val "0.07"
|
---|
| 209 | }
|
---|
| 210 | {
|
---|
| 211 | name "S3D_PARALLAX_BIAS"
|
---|
| 212 | val "0.50196078431372549" // = 128/255
|
---|
| 213 | }
|
---|
| 214 | }
|
---|
| 215 | }
|
---|
| 216 |
|
---|
| 217 | //#ifdef S3D_GENERAL_PLATFORM_XE
|
---|
| 218 | xe
|
---|
| 219 | {
|
---|
| 220 | hlsl_vertshader
|
---|
| 221 | {
|
---|
| 222 | // Code of the pixel program
|
---|
| 223 | code_variant_array
|
---|
| 224 | {
|
---|
| 225 | profile "1x1"
|
---|
| 226 | entry_point "main"
|
---|
| 227 | code "levelutil/shader/prog/d3d9_hlsl/"
|
---|
| 228 | & "bump_d3d9_hlsl_vs1x1.s3d_shadercode_run"
|
---|
| 229 | //debug_code_file "src/res/levelutil/shader/prog/d3d9_hlsl/"
|
---|
| 230 | // & "bump_d3d9_hlsl_vs1x1.s3d_shadercode"
|
---|
| 231 | }
|
---|
| 232 |
|
---|
| 233 |
|
---|
| 234 | // Copy matrices into vertex program constants.
|
---|
| 235 | // The field "chan" can be one
|
---|
| 236 | // of "identity", "proj", "view" or "projview" "bone"
|
---|
| 237 | // The field "trans" can be one
|
---|
| 238 | // of "identity", "inv", "transp" or "invtransp"
|
---|
| 239 | // One matrix needs 4 constants.
|
---|
| 240 | tracking
|
---|
| 241 | {
|
---|
| 242 | codevar "projMat"
|
---|
| 243 | slot 0
|
---|
| 244 | chan "proj"
|
---|
| 245 | trans "identity"
|
---|
| 246 | }
|
---|
| 247 | {
|
---|
| 248 | codevar "matView"
|
---|
| 249 | slot 0
|
---|
| 250 | chan "view"
|
---|
| 251 | trans "identity"
|
---|
| 252 | }
|
---|
| 253 | {
|
---|
| 254 | codevar "matBone"
|
---|
| 255 | slot 0
|
---|
| 256 | chan "bone"
|
---|
| 257 | trans "identity"
|
---|
| 258 | }
|
---|
| 259 |
|
---|
| 260 | param_array
|
---|
| 261 | {
|
---|
| 262 | src_progvar "prog_light_cenrange"
|
---|
| 263 | dest_codevar "lightCenRange"
|
---|
| 264 | type "float4"
|
---|
| 265 | }
|
---|
| 266 |
|
---|
| 267 | predefine_array
|
---|
| 268 | {
|
---|
| 269 | name "S3D_USE_BONESUBSCR"
|
---|
| 270 | }
|
---|
| 271 | {
|
---|
| 272 | name "S3D_MATBONE_CNT"
|
---|
| 273 | val "32"
|
---|
| 274 | }
|
---|
| 275 | {
|
---|
| 276 | name "S3D_PARALLAX_MAPPING"
|
---|
| 277 | }
|
---|
| 278 | }
|
---|
| 279 |
|
---|
| 280 | hlsl_pixshader
|
---|
| 281 | {
|
---|
| 282 | code_variant_array
|
---|
| 283 | {
|
---|
| 284 | profile "2x0"
|
---|
| 285 | entry_point "main"
|
---|
| 286 | code "levelutil/shader/prog/d3d9_hlsl/"
|
---|
| 287 | & "bump_d3d9_hlsl_ps2x0.s3d_shadercode_run"
|
---|
| 288 | }
|
---|
| 289 |
|
---|
| 290 | param_array
|
---|
| 291 | {
|
---|
| 292 | src_progvar "prog_light_ambient"
|
---|
| 293 | dest_codevar "lightAmbient"
|
---|
| 294 | type "float4"
|
---|
| 295 | }
|
---|
| 296 | {
|
---|
| 297 | src_progvar "prog_light_diffuse"
|
---|
| 298 | dest_codevar "lightDiffuse"
|
---|
| 299 | type "float4"
|
---|
| 300 | }
|
---|
| 301 | {
|
---|
| 302 | src_progvar "prog_light_specular"
|
---|
| 303 | dest_codevar "lightSpecular"
|
---|
| 304 | type "float4"
|
---|
| 305 | }
|
---|
| 306 |
|
---|
| 307 | predefine_array
|
---|
| 308 | {
|
---|
| 309 | name "S3D_SPECULAR_EXP"
|
---|
| 310 | val "4.0"
|
---|
| 311 | }
|
---|
| 312 | {
|
---|
| 313 | name "S3D_GEOMETRIC_SHADOW"
|
---|
| 314 | }
|
---|
| 315 | {
|
---|
| 316 | name "S3D_PARALLAX_MAPPING"
|
---|
| 317 | }
|
---|
| 318 | {
|
---|
| 319 | name "S3D_PARALLAX_SCALE"
|
---|
| 320 | val "0.07"
|
---|
| 321 | }
|
---|
| 322 | {
|
---|
| 323 | name "S3D_PARALLAX_BIAS"
|
---|
| 324 | val "0.50196078431372549" // = 128/255
|
---|
| 325 | }
|
---|
| 326 | }
|
---|
| 327 | }
|
---|
| 328 | //#endif
|
---|