- Timestamp:
- Nov 9, 2018, 1:06:05 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
data/branches/Shader_HS18/materials/Cube_Lava_Normal.material
r12088 r12091 1 //------------------------2 // Basic3 //------------------------4 5 //---------------------------------------------------6 // This file includes a number of basic GPU programs7 // for use in many materials.8 //---------------------------------------------------9 10 11 // A really basic ambient pass program, support for one texture coordinate set12 vertex_program AmbientOneTextureCg cg13 {14 source Example_Basic.cg15 entry_point ambientOneTexture_vp16 profiles vs_1_1 arbvp117 18 default_params19 {20 param_named_auto worldViewProj worldviewproj_matrix21 param_named_auto ambient ambient_light_colour22 }23 24 }25 26 vertex_program AmbientOneTextureCgSm4 cg27 {28 source Example_Basic_sm4.cg29 entry_point ambientOneTexture_vp30 profiles vs_4_031 32 default_params33 {34 param_named_auto worldViewProj worldviewproj_matrix35 param_named_auto ambient ambient_light_colour36 }37 38 }39 40 // A really basic ambient pass program, support for one texture coordinate set41 vertex_program AmbientOneTextureHLSL hlsl42 {43 source Example_Basic.hlsl44 entry_point ambientOneTexture_vp45 target vs_4_046 47 default_params48 {49 param_named_auto worldViewProj worldviewproj_matrix50 param_named_auto ambient ambient_light_colour51 }52 }53 // A really basic ambient pass program, support for one texture coordinate set54 vertex_program AmbientOneTextureGLSL glsl55 {56 source AmbientOneTexture.glsl57 }58 59 // A really basic ambient pass program, support for one texture coordinate set60 vertex_program AmbientOneTextureGLSL glsl61 {62 source AmbientOneTexture.glsl63 64 65 default_params66 {67 param_named_auto ambient ambient_light_colour68 param_named_auto worldViewProj worldviewproj_matrix69 }70 }71 72 // A really basic ambient pass program, support for one texture coordinate set73 vertex_program AmbientOneTextureGLSLES glsles74 {75 source AmbientOneTexture.glsles76 77 default_params78 {79 param_named_auto worldViewProj worldviewproj_matrix80 param_named_auto ambient ambient_light_colour81 }82 }83 84 vertex_program AmbientOneTextureWithUVGLSLES glsles85 {86 source AmbientOneTextureWithUV.glsles87 88 default_params89 {90 param_named_auto worldViewProj worldviewproj_matrix91 param_named_auto ambient ambient_light_colour92 }93 }94 95 vertex_program AmbientOneTextureWithUVGLSL glsl96 {97 source AmbientOneTextureWithUV.glsl98 99 100 default_params101 {102 param_named_auto worldViewProj worldviewproj_matrix103 param_named_auto ambient ambient_light_colour104 }105 }106 107 vertex_program AmbientOneTextureWithUV unified108 {109 delegate AmbientOneTextureWithUVGLSL110 delegate AmbientOneTextureWithUVGLSLES111 delegate AmbientOneTextureHLSL112 delegate AmbientOneTextureCg113 delegate AmbientOneTextureCgSm4114 }115 116 vertex_program AmbientOneTextureUnified unified117 {118 delegate AmbientOneTextureGLSL119 delegate AmbientOneTextureGLSLES120 delegate AmbientOneTextureHLSL121 delegate AmbientOneTextureCg122 delegate AmbientOneTextureCgSm4123 }124 125 fragment_program DiffuseOneTextureCg cg126 {127 source Example_Basic.cg128 entry_point diffuseOneTexture_fp129 profiles ps_2_0 arbfp1130 }131 132 fragment_program DiffuseOneTextureGLSLES glsles133 {134 source DiffuseOneTexture.glsles135 default_params136 {137 param_named texMap int 0138 }139 }140 141 fragment_program DiffuseOneTextureGLSL glsl142 {143 source DiffuseOneTexture.glsl144 default_params145 {146 param_named texMap int 0147 }148 }149 150 fragment_program DiffuseOneTexture unified151 {152 delegate DiffuseOneTextureGLSL153 delegate DiffuseOneTextureGLSLES154 delegate DiffuseOneTextureCg155 }156 157 // A really basic ambient pass program, support for one texture coordinate set158 fragment_program PassthroughFP unified159 {160 delegate PassthroughFpGLSL161 delegate PassthroughFpGLSLES162 delegate PassthroughFpCgSm4163 delegate PassthroughFpCg164 }165 166 // A really basic ambient pass program, support for one texture coordinate set167 fragment_program PassthroughFpCgSm4 cg168 {169 entry_point main170 source PassthroughFP_sm4.cg171 profiles ps_4_0172 }173 174 fragment_program PassthroughFpCg cg175 {176 entry_point mainCg177 source PassthroughFP.cg178 profiles ps_2_0 arbfp1179 }180 181 // A really basic ambient pass program, support for one texture coordinate set182 fragment_program PassthroughFpCgSm4ForAmbientOneTexture cg183 {184 entry_point mainForAmbientOneTexture185 source PassthroughFP_sm4.cg186 profiles ps_4_0187 }188 189 190 // A really basic ambient pass program, support for one texture coordinate set191 fragment_program PassthroughFpGLSLES glsles192 {193 source PassthroughFP.glsles194 }195 196 fragment_program PassthroughFpGLSL glsl197 {198 source PassthroughFP.glsl199 }200 201 //------------------------202 // Bump mapping section203 //------------------------204 205 // Bump map vertex program, support for this is required206 vertex_program Lava/BumpMapVPCg cg207 {208 source Example_BumpMapping.cg209 entry_point main_vp210 profiles vs_4_0 vs_1_1 arbvp1211 }212 213 vertex_program Lava/BumpMapVPGLSLES glsles214 {215 source Example_BumpMappingVp.glsles216 profiles glsles217 }218 219 vertex_program Lava/BumpMapVPGLSL glsl220 {221 source Example_BumpMappingVp.glsl222 }223 224 vertex_program Lava/BumpMapVP unified225 {226 delegate Lava/BumpMapVPGLSL227 delegate Lava/BumpMapVPGLSLES228 delegate Lava/BumpMapVPCg229 }230 231 // Bump map vertex program, with tangent parity support for this is required232 vertex_program Lava/BumpMapVPTangentParityCg cg233 {234 source Example_BumpMapping.cg235 entry_point main_vp236 profiles vs_1_1 arbvp1237 compile_arguments -DTANGENTS_HAVE_PARITY=1238 }239 240 // Bump map vertex program, with tangent parity support for this is required241 vertex_program Lava/BumpMapVPTangentParityGLSLES glsles242 {243 source BumpMapVPTangentParity.glsles244 }245 246 vertex_program Lava/BumpMapVPTangentParityGLSL glsl247 {248 source BumpMapVPTangentParity.glsl249 default_params250 {251 param_named_auto lightDiffuse light_diffuse_colour 0252 }253 }254 255 vertex_program Lava/BumpMapVPTangentParity unified256 {257 delegate Lava/BumpMapVPTangentParityGLSL258 delegate Lava/BumpMapVPTangentParityGLSLES259 delegate Lava/BumpMapVPTangentParityCg260 }261 262 // Bump map fragment program, support for this is optional263 fragment_program Lava/BumpMapFPCg cg264 {265 source Example_BumpMapping.cg266 entry_point main_fp267 profiles ps_4_0 ps_2_0 arbfp1 fp20268 }269 270 fragment_program Lava/BumpMapFPGLSLES glsles271 {272 source Example_BumpMappingFp.glsles273 profiles glsles274 default_params275 {276 // assign samplers as required by GLSL277 param_named normalMap int 0278 }279 }280 281 fragment_program Lava/BumpMapFPGLSL glsl282 {283 source Example_BumpMappingFp.glsl284 default_params285 {286 // assign samplers as required by GLSL287 param_named normalMap int 0288 }289 }290 291 fragment_program Lava/BumpMapFP unified292 {293 delegate Lava/BumpMapFPGLSL294 delegate Lava/BumpMapFPGLSLES295 delegate Lava/BumpMapFPCg296 }297 298 // Bump map vertex program shadow receiver299 vertex_program Lava/BumpMapVPShadowRcvCg cg300 {301 source Example_BumpMapping.cg302 entry_point main_shadowreceiver_vp303 profiles vs_1_1 arbvp1304 }305 306 // Bump map vertex program shadow receiver307 vertex_program Lava/BumpMapVPShadowRcvGLSLES glsles308 {309 source Example_BumpMappingShadowRcvVp.glsles310 profiles glsles311 }312 313 vertex_program Lava/BumpMapVPShadowRcvGLSL glsl314 {315 source Example_BumpMappingShadowRcvVp.glsl316 317 }318 319 vertex_program Lava/BumpMapVPShadowRcv unified320 {321 delegate Lava/BumpMapVPShadowRcvGLSL322 delegate Lava/BumpMapVPShadowRcvGLSLES323 delegate Lava/BumpMapVPShadowRcvCg324 }325 326 // Bump map fragment program shadow receiver, support for this is optional327 fragment_program Lava/BumpMapFPShadowRcvCg cg328 {329 source Example_BumpMapping.cg330 entry_point main_shadowreceiver_fp331 profiles ps_2_0 arbfp1 fp20332 }333 334 // Bump map fragment program shadow receiver, support for this is optional335 fragment_program Lava/BumpMapFPShadowRcvGLSLES glsles336 {337 source Example_BumpMappingShadowRcvFp.glsles338 profiles glsles339 default_params340 {341 // assign samplers as required by GLSL342 param_named shadowMap int 0343 param_named normalMap int 1344 }345 }346 347 fragment_program Lava/BumpMapFPShadowRcvGLSL glsl348 {349 source Example_BumpMappingShadowRcvFp.glsl350 default_params351 {352 // assign samplers as required by GLSL353 param_named shadowMap int 0354 param_named normalMap int 1355 }356 }357 358 fragment_program Lava/BumpMapFPShadowRcv unified359 {360 delegate Lava/BumpMapFPShadowRcvGLSL361 delegate Lava/BumpMapFPShadowRcvGLSLES362 delegate Lava/BumpMapFPShadowRcvCg363 }364 365 // Bump map with specular vertex program, support for this is required366 vertex_program Lava/BumpMapVPSpecularCg cg367 {368 source Example_BumpMapping.cg369 entry_point specular_vp370 profiles vs_4_0 vs_1_1 arbvp1371 }372 373 // Bump map with specular vertex program, support for this is required374 vertex_program Lava/BumpMapVPSpecularGLSLES glsles375 {376 source Example_BumpMappingSpecularVp.glsles377 profiles glsles378 }379 380 vertex_program Lava/BumpMapVPSpecularGLSL glsl381 {382 source Example_BumpMappingSpecularVp.glsl383 }384 385 vertex_program Lava/BumpMapVPSpecular unified386 {387 delegate Lava/BumpMapVPSpecularGLSL388 delegate Lava/BumpMapVPSpecularGLSLES389 delegate Lava/BumpMapVPSpecularCg390 }391 392 // Bump map fragment program, support for this is optional393 fragment_program Lava/BumpMapFPSpecularCg cg394 {395 source Example_BumpMapping.cg396 entry_point specular_fp397 profiles ps_4_0 ps_2_0 arbfp1 fp20398 }399 400 // Bump map fragment program, support for this is optional401 fragment_program Lava/BumpMapFPSpecularGLSLES glsles402 {403 source Example_BumpMappingSpecularFp.glsles404 profiles glsles405 default_params406 {407 // assign samplers as required by GLSL408 param_named normalMap int 0409 }410 }411 412 fragment_program Lava/BumpMapFPSpecularGLSL glsl413 {414 source Example_BumpMappingSpecularFp.glsl415 default_params416 {417 // assign samplers as required by GLSL418 param_named normalMap int 0419 }420 }421 422 fragment_program Lava/BumpMapFPSpecular unified423 {424 delegate Lava/BumpMapFPSpecularGLSL425 delegate Lava/BumpMapFPSpecularGLSLES426 delegate Lava/BumpMapFPSpecularCg427 }428 429 //------------------------430 // Material431 //------------------------432 433 1 // Any number of lights, diffuse 434 2 material Cube_Lava_Normal 435 3 { 436 437 // This is the preferred technique which uses both vertex and438 // fragment programs, supports coloured lights439 4 technique 440 5 { … … 444 9 // base colours, not needed for rendering, but as information 445 10 // to lighting pass categorisation routine 446 ambient 1 1 1 447 diffuse 0 0 0 448 specular 0 0 0 0 449 // Really basic vertex program 450 // NB we don't use fixed function here because GL does not like 451 // mixing fixed function and vertex programs, depth fighting can 452 // be an issue 453 vertex_program_ref AmbientOneTextureUnified 454 { 455 param_named_auto ambient ambient_light_colour 456 } 457 fragment_program_ref PassthroughFP 458 { 459 } 460 11 diffuse 0 0 0 461 12 } 462 13 // Now do the lighting pass … … 464 15 pass perlight 465 16 { 17 // do this for each light 18 iteration once_per_light 19 scene_blend add 20 466 21 // base colours, not needed for rendering, but as information 467 22 // to lighting pass categorisation routine 468 ambient 0 0 0 469 470 // do this for each light 471 iteration once_per_light 472 473 474 scene_blend add 23 ambient 0 0 0 475 24 476 25 // Vertex program reference 477 vertex_program_ref Lava/BumpMapVP26 vertex_program_ref Examples/BumpMapVP 478 27 { 479 28 param_named_auto lightPosition light_position_object_space 0 … … 482 31 483 32 // Fragment program 484 fragment_program_ref Lava/BumpMapFP33 fragment_program_ref Examples/BumpMapFP 485 34 { 486 35 param_named_auto lightDiffuse light_diffuse_colour 0 … … 488 37 489 38 // texture shadow receiver program 490 shadow_receiver_vertex_program_ref Lava/BumpMapVPShadowRcv39 shadow_receiver_vertex_program_ref Examples/BumpMapVPShadowRcv 491 40 { 492 41 param_named_auto lightPosition light_position_object_space 0 … … 496 45 } 497 46 // Additive texture shadow receiver program 498 shadow_receiver_fragment_program_ref Lava/BumpMapFPShadowRcv47 shadow_receiver_fragment_program_ref Examples/BumpMapFPShadowRcv 499 48 { 500 49 param_named_auto lightDiffuse light_diffuse_colour 0 … … 505 54 { 506 55 texture Cube_Lava_NORM.jpg 507 tex_address_mode wrap508 scale 1.0 1.0509 56 colour_op replace 510 57 } 511 512 58 } 513 59 … … 515 61 pass decal 516 62 { 517 // base colours, not needed for rendering, but as information 518 // to lighting pass categorisation routine 63 // hint to pass categorisation routine, that this is decal only 519 64 lighting off 520 // Really basic vertex program521 // NB we don't use fixed function here because GL does not like522 // mixing fixed function and vertex programs, depth fighting can523 // be an issue524 vertex_program_ref AmbientOneTextureUnified525 {526 param_named_auto worldViewProj worldviewproj_matrix527 param_named ambient float4 1 1 1 1528 }529 fragment_program_ref PassthroughFP530 {531 }532 533 65 scene_blend dest_colour zero 534 texture_unit 535 { 536 texture Cube_Lava_NORM.jpg 537 tex_address_mode wrap 538 scale 1.0 1.0 539 colour_op modulate 540 } 541 542 543 } 544 545 pass Cube_Lava 546 { 547 ambient 0.800000011920929 0.800000011920929 0.800000011920929 1.0 548 diffuse 0.6400000190734865 0.6400000190734865 0.6400000190734865 1.0 549 specular 0.5 0.5 0.5 1.0 12.5 550 emissive 0.0 0.0 0.0 1.0 551 552 alpha_to_coverage off 553 colour_write on 554 cull_hardware clockwise 555 depth_check on 556 depth_func less_equal 557 depth_write on 558 illumination_stage 559 light_clip_planes off 560 light_scissor off 561 lighting on 562 normalise_normals off 563 polygon_mode solid 564 scene_blend one zero 565 scene_blend_op add 566 shading gouraud 567 transparent_sorting on 568 569 texture_unit 570 { 571 texture Cube_Lava_COLOR.jpg 572 tex_address_mode wrap 573 scale 1.0 1.0 574 colour_op modulate 575 } 66 ambient 0.5 0.5 0.5 1 576 67 } 577 68 } 578 579 580 69 }
Note: See TracChangeset
for help on using the changeset viewer.