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