VarianceShadowmap.material
上传用户:xhbjoy
上传日期:2014-10-07
资源大小:38068k
文件大小:2k
源码类别:

游戏引擎

开发平台:

Visual C++

  1. // Shadow Caster __________________________________________________
  2. vertex_program VarianceShadowMapping/ShadowCasterVP cg
  3. {
  4.     source varianceshadowcastervp.cg
  5.     entry_point main
  6.     profiles arbvp1 vs_2_x
  7.     default_params
  8.     {
  9.         param_named_auto uModelViewProjection worldviewproj_matrix
  10.     }
  11. }
  12. fragment_program VarianceShadowMapping/ShadowCasterFP cg
  13. {
  14.     source varianceshadowcasterfp.cg
  15.     entry_point main
  16.     profiles arbfp1 ps_2_x
  17.     default_params
  18.     {
  19.         param_named      uDepthOffset float       1.0
  20.         param_named_auto uProjection              projection_matrix
  21.     }
  22. }
  23. material VarianceShadowMapping/ShadowCaster
  24. {
  25.     technique default
  26.     {
  27.         // Z-write only pass
  28.         pass Z-write
  29.         {
  30.             //Instead of using depth_bias, we'll be implementing it manually
  31.             vertex_program_ref VarianceShadowMapping/ShadowCasterVP
  32.             {
  33.             }
  34.             fragment_program_ref VarianceShadowMapping/ShadowCasterFP
  35.             {
  36.             }
  37.         }
  38.     }
  39. }
  40. // Shadow Receiver ________________________________________________
  41. vertex_program VarianceShadowMapping/ShadowReceiverVP cg
  42. {
  43.     source varianceshadowreceivervp.cg
  44.     entry_point main
  45.     profiles arbvp1 vs_2_x
  46.     default_params
  47.     {
  48.         param_named_auto uModelViewProjection   worldviewproj_matrix
  49.         param_named_auto uLightPosition         light_position_object_space 0
  50.         param_named_auto uModel                 world_matrix
  51.         param_named_auto uTextureViewProjection texture_viewproj_matrix
  52.     }
  53. }
  54. fragment_program VarianceShadowMapping/ShadowReceiverFP cg
  55. {
  56.     source varianceshadowreceiverfp.cg
  57.     entry_point main
  58.     profiles arbfp1 ps_2_x
  59.     default_params
  60.     {
  61.         param_named uSTexWidth  float 512.0
  62.         param_named uSTexHeight float 512.0
  63.     }
  64. }
  65. material VarianceShadowMapping/ShadowReceiver
  66. {
  67.     technique default
  68.     {
  69.         pass lighting
  70.         {
  71.             vertex_program_ref VarianceShadowMapping/ShadowReceiverVP
  72.             {
  73.             }
  74.             fragment_program_ref VarianceShadowMapping/ShadowReceiverFP
  75.             {
  76.             }
  77.             // we won't rely on hardware specific filtering of z-tests
  78.             texture_unit ShadowMap
  79.             {
  80.                 tex_address_mode clamp
  81.                 filtering none
  82.             }
  83.         }
  84.     }
  85. }