Changeset 1094 for GTP/trunk/App/Demos/Illum
- Timestamp:
- 07/07/06 08:53:01 (18 years ago)
- Location:
- GTP/trunk/App/Demos/Illum/Ogre/Media/materials
- Files:
-
- 5 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/App/Demos/Illum/Ogre/Media/materials/programs/GameTools_Cau.hlsl
r916 r1094 10 10 float2 center : TEXCOORD2; 11 11 float4 position : TEXCOORD3; 12 float pSize : PSIZE; 13 float dist : TEXCOORD4; 12 14 }; 13 15 … … 24 26 25 27 float radius = CauSpriteSize; 26 float2 offset = 2.0 * texCoord.zw * radius; 27 28 OUT.pSize = radius; 28 29 float4 cPosition; 29 30 30 float4 pos = tex2Dlod(PhotonHitMap, float4(position.x, 1.0 - position.y,0,0)).rgba; 31 float4 pos = tex2Dlod(PhotonHitMap, float4(position.x, 1.0 - position.y,0,0)).rgba; 32 // float4 pos = float4(0,0,-0.5,1); 31 33 if(pos.a == 0)//no photon hit 32 34 { … … 40 42 cPosition = mul(worldView, wPosition); 41 43 OUT.center = cPosition.xy; 42 cPosition.xy += offset;43 44 OUT.position = cPosition; 44 OUT.hPosition = mul(Proj, cPosition); 45 46 /* 47 //rotate to camera 48 cPosition = mul(worldView, wPosition); 49 50 float3 C = cPosition.xyz; 51 float3 right = cross(C, float3(0,1,0)); 52 float3 up = cross(right, C); 53 54 float3 cOffset = offset.x * right + offset.y * up; 55 cPosition.xy += float2(-0.5/resolution, -0.5/resolution); 56 OUT.center = cPosition.xy; 57 cPosition.xyz += cOffset; 58 OUT.position = cPosition; 59 OUT.hPosition = mul(Proj, cPosition); 60 */ 45 OUT.hPosition = mul(Proj, cPosition); 61 46 } 62 47 63 OUT.r.x = abs(offset.x);48 OUT.r.x = radius; 64 49 OUT.r.y = radius; 65 50 OUT.texCoord = texCoord; 66 OUT.color = 1; 51 OUT.color = 1; 52 OUT.color = float4(pos); 53 OUT.dist = length(pos.xyz); 67 54 68 55 return OUT; … … 71 58 72 59 float4 CauPS(VS_OUT IN, 60 uniform float3 color, 73 61 uniform sampler2D intensityTex : register(s1) 74 62 ):COLOR 75 63 { 76 64 77 float2 texcoord = (IN.center - IN.position.xy) / IN.r.x; 78 texcoord = (texcoord + 1.0) * 0.5; 79 float intens = tex2D(intensityTex, texcoord).r; 80 IN.color = intens * CauSpriteIntens; 81 82 return IN.color; 83 65 // float2 texcoord = (IN.center - IN.position.xy) / IN.r.x; 66 // texcoord = (texcoord + 1.0) * 0.5; 67 IN.color.rgb = color; 68 float intens = tex2D(intensityTex, IN.texCoord).r; 69 IN.color.a = intens * CauSpriteIntens; 70 return IN.color; 84 71 } 85 72 -
GTP/trunk/App/Demos/Illum/Ogre/Media/materials/programs/GameTools_Caustic.hlsl
r1085 r1094 40 40 float dist = readDistanceCubeMap(distanceCube, dir); 41 41 42 float EPSILON = 0.1;42 float EPSILON = 1.0; 43 43 44 //if(mydist > dist + EPSILON) caustic = 0;45 caustic *= max(attenuation - mydist,0) / attenuation;46 44 if(mydist > dist + EPSILON) caustic = 0; 45 //caustic.rgb *= max(attenuation - mydist, 0.0) / attenuation; 46 47 47 Color = caustic; 48 48 Color += attenuation; 49 Color.a = 1; 49 50 return Color; 50 51 } -
GTP/trunk/App/Demos/Illum/Ogre/Media/materials/programs/GameTools_Localized_EnvMap.hlsl
r1060 r1094 24 24 { 25 25 float4 color = texCUBE( cm, float3(coord.xy, - coord.z) ); 26 color.a = 1; 26 27 return color; 27 28 } -
GTP/trunk/App/Demos/Illum/Ogre/Media/materials/scripts/GameTools.material
r1081 r1094 1 2 3 material GameTools/HPS4 {5 6 technique7 {8 pass9 {10 IllumTechniques11 {12 RenderTechnique HPS13 {14 particle_script GameTools/Little15 }16 }17 18 scene_blend add19 20 lighting off21 depth_check off22 23 texture_unit24 {25 texture26 }27 28 29 }30 }31 }32 33 34 1 material Flare 35 2 { … … 103 70 } 104 71 105 material GameTools/PostProcBlack106 {107 technique108 {109 pass110 {111 vertex_program_ref GameTools/PostProc1_VS112 {113 }114 fragment_program_ref GameTools/PostProc_Black115 {116 117 }118 }119 }120 }121 material GameTools/PostProc1122 {123 technique124 {125 pass126 {127 vertex_program_ref GameTools/PostProc1_VS128 {129 }130 fragment_program_ref GameTools/PostProc1_PS131 {132 133 }134 texture_unit135 {136 // filtering none137 texture rockwall.tga138 }139 }140 }141 }142 72 143 material GameTools/GlowCut144 {145 technique146 {147 pass148 {149 vertex_program_ref GameTools/PostProc1_VS150 {151 }152 fragment_program_ref GameTools/GlowCut_PS153 {154 param_named_auto width viewport_width155 param_named_auto height viewport_height156 157 }158 texture_unit159 {160 //filtering none161 texture rockwall.tga162 }163 texture_unit164 {165 //filtering none166 texture rockwall.tga167 }168 }169 }170 }171 172 material GameTools/Luminance173 {174 technique175 {176 pass177 {178 vertex_program_ref GameTools/PostProc1_VS179 {180 }181 fragment_program_ref GameTools/Luminance_PS182 {183 param_named_auto width viewport_width184 param_named_auto height viewport_height185 186 }187 texture_unit188 {189 //filtering none190 texture rockwall.tga191 }192 193 }194 }195 }196 197 198 199 material GameTools/GlowBlurH200 {201 technique202 {203 pass204 {205 vertex_program_ref GameTools/PostProc1_VS206 {207 }208 fragment_program_ref GameTools/GlowBlurH_PS209 {210 param_named_auto width viewport_width211 param_named_auto height viewport_height212 param_named Stretch float 3.2213 }214 texture_unit215 {216 tex_address_mode mirror217 texture rockwall.tga218 }219 220 }221 }222 }223 224 material GameTools/GlowBlurV225 {226 technique227 {228 pass229 {230 vertex_program_ref GameTools/PostProc1_VS231 {232 }233 fragment_program_ref GameTools/GlowBlurV_PS234 {235 param_named_auto width viewport_width236 param_named_auto height viewport_height237 param_named Stretch float 3.2238 }239 texture_unit240 {241 tex_address_mode mirror242 texture rockwall.tga243 }244 }245 }246 }247 248 material GameTools/TextureCopy249 {250 technique251 {252 pass253 {254 vertex_program_ref GameTools/PostProc1_VS255 {256 }257 fragment_program_ref GameTools/TextureCopy_PS258 {259 param_named_auto width viewport_width260 param_named_auto height viewport_height261 262 }263 texture_unit264 {265 // filtering none266 texture rockwall.tga267 }268 }269 }270 }271 272 material GameTools/GlowAdd273 {274 technique275 {276 pass277 {278 vertex_program_ref GameTools/PostProc1_VS279 {280 }281 fragment_program_ref GameTools/GlowAdd_PS282 {283 param_named_auto width viewport_width284 param_named_auto height viewport_height285 286 }287 texture_unit288 {289 // filtering none290 texture rockwall.tga291 }292 texture_unit293 {294 // filtering none295 texture rockwall.tga296 }297 }298 }299 }300 301 material GameTools/ToneMap302 {303 technique304 {305 pass306 {307 vertex_program_ref GameTools/PostProc1_VS308 {309 }310 fragment_program_ref GameTools/ToneMap_PS311 {312 param_named_auto width viewport_width313 param_named_auto height viewport_height314 param_named Gain float 0.5315 }316 texture_unit317 {318 // filtering none319 texture rockwall.tga320 }321 texture_unit322 {323 // filtering none324 texture rockwall.tga325 }326 texture_unit327 {328 // filtering none329 texture rockwall.tga330 }331 }332 }333 }334 73 335 74 material GameTools/UVShader … … 353 92 } 354 93 355 356 material GameTools/Caustic/Default357 {358 359 technique360 {361 pass362 {363 lighting off364 365 vertex_program_ref GameTools/Caustic/DefaultVS366 {367 param_named_auto worldViewProj worldviewproj_matrix368 param_named_auto world world_matrix369 }370 fragment_program_ref GameTools/Caustic/DefaultPS371 {372 param_named cubeMapCameraPosition float3 0 0 0373 }374 375 texture_unit376 {377 filtering none378 }379 380 texture_unit381 {382 //filtering linear linear linear383 }384 }385 }386 }387 388 material GameTools/SoftShadowReciever/Default389 {390 391 technique392 {393 pass394 {395 lighting off396 397 vertex_program_ref GameTools/SoftShadow/VertexPrograms/DefaultVS398 {399 param_named_auto worldViewProj worldviewproj_matrix400 param_named_auto world world_matrix401 }402 fragment_program_ref GameTools/SoftShadow/FragmentPrograms/DefaultPS403 {404 param_named cubeMapCameraPosition float3 0 0 0405 }406 407 texture_unit408 {409 texture rockwall.tga410 //texture cubbe.jpg411 412 }413 414 texture_unit415 {416 //filtering linear linear linear417 cubic_texture cubemap.jpg combinedUVW418 env_map cubic_reflection419 }420 }421 }422 }423 424 material GameTools/SoftShadowReciever/Default2425 {426 427 technique428 {429 pass430 {431 lighting off432 433 vertex_program_ref GameTools/SoftShadow/VertexPrograms/DefaultVS434 {435 param_named_auto world_IT inverse_transpose_world_matrix436 param_named_auto worldViewProj worldviewproj_matrix437 param_named_auto world world_matrix438 }439 fragment_program_ref GameTools/SoftShadow/FragmentPrograms/Default2PS440 {441 param_named cubeMapCameraPosition float3 0 0 0442 param_named_auto cameraPos camera_position443 param_named_auto lightPosition light_position 0444 }445 446 texture_unit447 {448 //filtering linear linear linear449 cubic_texture cubemap.jpg combinedUVW450 env_map cubic_reflection451 }452 }453 }454 }455 456 material GameTools/CausticSoftShadowReciever457 {458 459 technique460 {461 pass462 {463 lighting off464 465 vertex_program_ref GameTools/CausticSoftShadowVS466 {467 param_named_auto world_IT worldviewproj_matrix468 param_named_auto worldViewProj worldviewproj_matrix469 param_named_auto world world_matrix470 }471 fragment_program_ref GameTools/CausticSoftShadowPS472 {473 //param_named_auto world_IT inverse_worldview_matrix474 param_named cubeMapCameraPosition float3 0 0 0475 }476 477 texture_unit478 {479 //texture rockwall.tga480 texture cubbe.jpg481 }482 483 //texture_unit //caustic cubemap484 //{485 // //filtering linear linear linear486 // cubic_texture cubemap.jpg combinedUVW487 //}488 489 //texture_unit //softshadow cubemap490 //{491 // //filtering linear linear linear492 // cubic_texture cubemap.jpg combinedUVW493 //}494 495 texture_unit/bump496 {497 texture falnormal.dds498 }499 }500 }501 }502 503 504 material GameTools/CubeMap/Default505 {506 507 technique508 {509 pass510 {511 lighting off512 513 514 515 vertex_program_ref GameTools/CubeMap/VertexPrograms/DefaultVS516 {517 param_named_auto worldViewProj worldviewproj_matrix518 param_named_auto world world_matrix519 }520 fragment_program_ref GameTools/CubeMap/FragmentPrograms/DefaultPS521 {522 param_named_auto cameraPos camera_position523 }524 525 //Cube map for reflections and refractions526 texture_unit527 {528 cubic_texture cubemap.jpg combinedUVW529 //env_map cubic_reflection530 }531 532 533 }534 }535 }536 537 538 539 material GameTools/CubeMap/Reduce540 {541 542 technique543 {544 pass545 {546 //depth_check off547 lighting off548 549 vertex_program_ref GameTools/CubeMap/VertexPrograms/ReduceVS550 {551 // param_named_auto worldViewProj worldviewproj_matrix552 // param_named_auto world world_matrix553 }554 fragment_program_ref GameTools/CubeMap/FragmentPrograms/ReducePS555 {556 //param_named_auto cameraPos camera_position557 param_named nFace int 0558 param_named CUBEMAP_SIZE int 256559 //param_named RATE int 2560 561 }562 563 //Cube map for reflections and refractions564 texture_unit565 {566 filtering point point point567 cubic_texture cubemap.jpg combinedUVW568 tex_address_mode clamp569 // env_map cubic_reflection570 colour_op modulate571 }572 573 574 }575 }576 }577 578 579 580 material GameTools/CubeMap/Localized581 {582 583 technique584 {585 586 pass587 {588 IllumTechniques589 {590 RenderTechnique ColorCubeMap591 {592 update_interval 0593 distance_calc true 3.5594 }595 RenderTechnique DistanceCubeMap596 {597 update_interval 0598 distance_calc true 3.5599 }600 RenderTechnique CausticCaster601 {602 603 }604 605 }606 607 608 vertex_program_ref GameTools/CubeMap/VertexPrograms/LocalizedVS609 {610 param_named_auto worldViewProj worldviewproj_matrix611 param_named_auto world world_matrix612 }613 fragment_program_ref GameTools/CubeMap/FragmentPrograms/LocalizedPS614 {615 param_named_auto cameraPos camera_position616 param_named_auto lightPosition light_position 0617 }618 619 //Cube map for reflections and refractions620 texture_unit621 {622 cubic_texture cubemap.jpg combinedUVW623 tex_address_mode clamp624 colour_op replace625 }626 627 //Cube map of distances628 texture_unit629 {630 cubic_texture cubemap.jpg combinedUVW631 tex_address_mode clamp632 colour_op replace633 }634 635 636 }637 }638 }639 640 641 material GameTools/Localized_NOCAUSTIC642 {643 644 technique645 {646 647 pass648 {649 IllumTechniques650 {651 RenderTechnique ColorCubeMap652 {653 update_interval 0654 distance_calc true 3.5655 }656 RenderTechnique DistanceCubeMap657 {658 update_interval 0659 distance_calc true 3.5660 }661 662 }663 664 665 vertex_program_ref GameTools/CubeMap/VertexPrograms/LocalizedVS666 {667 param_named_auto worldViewProj worldviewproj_matrix668 param_named_auto world world_matrix669 }670 fragment_program_ref GameTools/CubeMap/FragmentPrograms/LocalizedPS671 {672 param_named_auto cameraPos camera_position673 param_named_auto lightPosition light_position 0674 }675 676 //Cube map for reflections and refractions677 texture_unit678 {679 cubic_texture cubemap.jpg combinedUVW680 tex_address_mode clamp681 colour_op replace682 }683 684 //Cube map of distances685 texture_unit686 {687 cubic_texture cubemap.jpg combinedUVW688 tex_address_mode clamp689 colour_op replace690 }691 692 693 }694 }695 }696 697 material GameTools/CubeMap/LocalizedBump698 {699 700 technique701 {702 703 pass704 {705 vertex_program_ref GameTools/CubeMap/VertexPrograms/LocalizedBumpVS706 {707 param_named_auto worldViewProj worldviewproj_matrix708 param_named_auto world world_matrix709 }710 fragment_program_ref GameTools/CubeMap/FragmentPrograms/LocalizedBumpPS711 {712 param_named_auto cameraPos camera_position713 param_named_auto lightPosition light_position 0714 }715 716 //Cube map for reflections and refractions717 texture_unit718 {719 cubic_texture cubemap.jpg combinedUVW720 tex_address_mode clamp721 colour_op replace722 }723 724 //Cube map of distances725 texture_unit726 {727 cubic_texture cubemap.jpg combinedUVW728 tex_address_mode clamp729 colour_op replace730 }731 732 //normal map733 texture_unit734 {735 texture atheneNormalMapNew.dds736 //texture atheneNormalMap.png737 }738 texture_unit739 {740 texture atheneDisplacementMap.bmp741 }742 743 744 }745 }746 }747 748 material GameTools/CubeMap/Diffuse749 {750 technique751 {752 pass753 {754 755 IllumTechniques756 {757 RenderTechnique ReducedColorCubeMap758 {759 update_interval 3760 distance_calc false761 face_angle_calc false762 update_all_face false763 }764 }765 766 767 vertex_program_ref GameTools/DiffuseVS768 {769 param_named_auto worldViewProj worldviewproj_matrix770 param_named_auto world world_matrix771 772 }773 fragment_program_ref GameTools/DiffusePS774 {775 param_named_auto cameraPos camera_position776 param_named REDUCED_CUBEMAP_SIZE int 8777 param_named lastCenter float3 0 0 0778 }779 780 //Cube map for reflections and refractions781 texture_unit782 {783 cubic_texture cubemap.jpg combinedUVW784 tex_address_mode clamp785 colour_op replace786 }787 788 //Cube map of distances789 texture_unit790 {791 cubic_texture cubemap.jpg combinedUVW792 tex_address_mode clamp793 colour_op replace794 }795 }796 }797 }798 799 800 801 material GameTools/CubeMap/LocalizedMetal802 {803 804 technique805 {806 pass807 {808 vertex_program_ref GameTools/CubeMap/VertexPrograms/LocalizedVS809 {810 param_named_auto worldViewProj worldviewproj_matrix811 param_named_auto world world_matrix812 813 }814 fragment_program_ref GameTools/CubeMap/FragmentPrograms/LocalizedMetalPS815 {816 param_named_auto cameraPos camera_position817 param_named n float3 0.21 0.96 1.17818 param_named k float3 4.16 2.57 2.32819 }820 821 //Cube map for reflections and refractions822 texture_unit823 {824 cubic_texture cubemap.jpg combinedUVW825 tex_address_mode clamp826 colour_op replace827 }828 829 //Cube map of distances830 texture_unit831 {832 cubic_texture cubemap.jpg combinedUVW833 tex_address_mode clamp834 colour_op replace835 }836 837 838 }839 }840 }841 842 843 94 material GameTools/DistanceShader 844 95 { … … 861 112 } 862 113 } 863 864 865 material GameTools/PhotonMapCaustic866 {867 technique868 {869 870 pass871 {872 vertex_program_ref GameTools/CubeMap/VertexPrograms/LocalizedVS873 {874 param_named_auto worldViewProj worldviewproj_matrix875 param_named_auto world world_matrix876 param_named_auto worldIT inverse_transpose_world_matrix877 }878 fragment_program_ref GameTools/PhotonMapCausticPS879 {880 param_named_auto cameraPos camera_position881 param_named lastCenter float3 0 0 0882 }883 884 //Cube map for reflections and refractions885 texture_unit886 {887 cubic_texture888 filtering none889 //tex_address_mode clamp890 }891 892 }893 }894 }895 896 897 material GameTools/PhotonMapSoftShadow898 {899 technique900 {901 pass902 {903 vertex_program_ref GameTools/CubeMap/VertexPrograms/LocalizedVS904 {905 param_named_auto worldViewProj worldviewproj_matrix906 param_named_auto world world_matrix907 }908 fragment_program_ref GameTools/PhotonMapSoftShadowPS909 {910 param_named_auto cameraPos camera_position911 param_named lastCenter float3 0 0 0912 }913 914 //Cube map for reflections and refractions915 texture_unit916 {917 cubic_texture cubemap.jpg combinedUVW918 tex_address_mode clamp919 colour_op replace920 env_map cubic_reflection921 }922 923 //Cube map of distances924 texture_unit925 {926 cubic_texture cubemap.jpg combinedUVW927 tex_address_mode clamp928 colour_op replace929 }930 }931 }932 }933 934 935 936 114 937 115 material GameTools/SceneCameraDepthShader … … 984 162 } 985 163 } 986 987 material GameTools/Cau988 {989 technique990 {991 pass992 993 cull_hardware none994 cull_software none995 lighting off996 scene_blend add997 scene_blend src_alpha one998 depth_write off999 1000 vertex_program_ref GameTools/CauVS1001 {1002 param_named_auto worldViewProj worldviewproj_matrix1003 param_named_auto worldView worldview_matrix1004 param_named_auto Proj projection_matrix1005 param_named_auto resolution viewport_width1006 param_named CauSpriteSize float 1.01007 }1008 fragment_program_ref GameTools/CauPS1009 {1010 param_named CauSpriteIntens float 1.01011 }1012 1013 texture_unit1014 {1015 vertex_texture true1016 texture flare.png1017 }1018 texture_unit1019 {1020 texture PowerOfPhotonHitTexel.dds1021 }1022 1023 }1024 }1025 }1026 1027 material GameTools/SpriteShader1028 {1029 1030 technique1031 {1032 pass1033 {1034 1035 cull_hardware none1036 cull_software none1037 lighting off1038 scene_blend add1039 depth_write off1040 1041 vertex_program_ref GameTools/SpriteVS1042 {1043 param_named_auto worldViewProj worldviewproj_matrix1044 param_named_auto worldView worldview_matrix1045 param_named_auto Proj projection_matrix1046 }1047 fragment_program_ref GameTools/SpritePS1048 {1049 1050 }1051 1052 texture_unit1053 {1054 texture flare.png1055 }1056 1057 }1058 }1059 }1060 1061 1062 material GameTools/SBB1063 {1064 1065 technique1066 {1067 pass1068 {1069 lighting off1070 1071 scene_blend src_alpha one1072 //scene_blend src_alpha one_minus_src_alpha1073 depth_write off1074 depth_check off1075 1076 vertex_program_ref GameTools/SBBVS1077 {1078 param_named_auto worldViewProj worldviewproj_matrix1079 param_named_auto worldView worldview_matrix1080 param_named_auto Proj projection_matrix1081 param_named_auto width viewport_width1082 param_named_auto height viewport_height1083 1084 1085 }1086 fragment_program_ref GameTools/SBBPS1087 {1088 param_named_auto farplane far_clip_distance1089 param_named_auto nearplane near_clip_distance1090 1091 }1092 1093 texture_unit1094 {1095 anim_texture smokealpha.tga 32 2.01096 //texture flare.png1097 }1098 1099 texture_unit1100 {1101 filtering none1102 }1103 1104 texture_unit1105 {1106 texture planck.tga1107 }1108 1109 }1110 }1111 } -
GTP/trunk/App/Demos/Illum/Ogre/Media/materials/scripts/kupola.material
r1085 r1094 13 13 RenderTechnique CausticReciever 14 14 { 15 max_caster_count 10 16 } 17 //RenderTechnique DepthShadowReciever 18 //{ 15 19 16 } 17 RenderTechnique DepthShadowReciever 18 { 19 20 } 20 //} 21 21 } 22 22 … … 66 66 RenderTechnique CausticReciever 67 67 { 68 max_caster_count 10 69 } 70 //RenderTechnique DepthShadowReciever 71 //{ 68 72 69 } 70 RenderTechnique DepthShadowReciever 71 { 72 73 } 73 //} 74 74 } 75 75
Note: See TracChangeset
for help on using the changeset viewer.