PassMesh.template 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. Pass
  2. {
  3. $splice(PassName)
  4. Tags
  5. {
  6. $splice(LightMode)
  7. }
  8. // Render State
  9. $splice(Blending)
  10. $splice(Culling)
  11. $splice(ZTest)
  12. $splice(ZWrite)
  13. $splice(ColorMask)
  14. $splice(Stencil)
  15. HLSLPROGRAM
  16. #pragma vertex vert
  17. #pragma fragment frag
  18. // Debug
  19. $splice(Debug)
  20. // --------------------------------------------------
  21. // Pass
  22. // Pragmas
  23. $splice(PassPragmas)
  24. // Keywords
  25. $splice(PassKeywords)
  26. $splice(GraphKeywords)
  27. // Defines
  28. $SurfaceType.Transparent: #define _SURFACE_TYPE_TRANSPARENT 1
  29. $AlphaClip: #define _AlphaClip 1
  30. $Normal: #define _NORMALMAP 1
  31. $SpecularSetup: #define _SPECULAR_SETUP
  32. $BlendMode.Add: #define _BLENDMODE_ADD 1
  33. $BlendMode.Premultiply: #define _ALPHAPREMULTIPLY_ON 1
  34. $features.NormalDropOffTS: #define _NORMAL_DROPOFF_TS 1
  35. $features.NormalDropOffOS: #define _NORMAL_DROPOFF_OS 1
  36. $features.NormalDropOffWS: #define _NORMAL_DROPOFF_WS 1
  37. $Attributes.normalOS: #define ATTRIBUTES_NEED_NORMAL
  38. $Attributes.tangentOS: #define ATTRIBUTES_NEED_TANGENT
  39. $Attributes.uv0: #define ATTRIBUTES_NEED_TEXCOORD0
  40. $Attributes.uv1: #define ATTRIBUTES_NEED_TEXCOORD1
  41. $Attributes.uv2: #define ATTRIBUTES_NEED_TEXCOORD2
  42. $Attributes.uv3: #define ATTRIBUTES_NEED_TEXCOORD3
  43. $Attributes.color: #define ATTRIBUTES_NEED_COLOR
  44. $Varyings.positionWS: #define VARYINGS_NEED_POSITION_WS
  45. $Varyings.normalWS: #define VARYINGS_NEED_NORMAL_WS
  46. $Varyings.tangentWS: #define VARYINGS_NEED_TANGENT_WS
  47. $Varyings.texCoord0: #define VARYINGS_NEED_TEXCOORD0
  48. $Varyings.texCoord1: #define VARYINGS_NEED_TEXCOORD1
  49. $Varyings.texCoord2: #define VARYINGS_NEED_TEXCOORD2
  50. $Varyings.texCoord3: #define VARYINGS_NEED_TEXCOORD3
  51. $Varyings.color: #define VARYINGS_NEED_COLOR
  52. $Varyings.viewDirectionWS: #define VARYINGS_NEED_VIEWDIRECTION_WS
  53. $Varyings.bitangentWS: #define VARYINGS_NEED_BITANGENT_WS
  54. $Varyings.screenPosition: #define VARYINGS_NEED_SCREENPOSITION
  55. $Varyings.fogFactorAndVertexLight: #define VARYINGS_NEED_FOG_AND_VERTEX_LIGHT
  56. $Varyings.cullFace: #define VARYINGS_NEED_CULLFACE
  57. $features.graphVertex: #define FEATURES_GRAPH_VERTEX
  58. $splice(GraphDefines)
  59. // Includes
  60. $splice(PassIncludes)
  61. // --------------------------------------------------
  62. // Graph
  63. // Graph Properties
  64. $splice(GraphProperties)
  65. // Graph Functions
  66. $splice(GraphFunctions)
  67. // Graph Vertex
  68. $splice(GraphVertex)
  69. // Graph Pixel
  70. $splice(GraphPixel)
  71. // --------------------------------------------------
  72. // Structs and Packing
  73. $buildType(Attributes)
  74. $buildType(Varyings)
  75. // --------------------------------------------------
  76. // Build Graph Inputs
  77. $features.graphVertex: $include("BuildVertexDescriptionInputs.template.hlsl")
  78. $features.graphPixel: $include("BuildSurfaceDescriptionInputs.template.hlsl")
  79. // --------------------------------------------------
  80. // Main
  81. $splice(MainInclude)
  82. ENDHLSL
  83. }