hlslStructs.hlsl 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. //-----------------------------------------------------------------------------
  2. // Copyright (c) 2012 GarageGames, LLC
  3. //
  4. // Permission is hereby granted, free of charge, to any person obtaining a copy
  5. // of this software and associated documentation files (the "Software"), to
  6. // deal in the Software without restriction, including without limitation the
  7. // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  8. // sell copies of the Software, and to permit persons to whom the Software is
  9. // furnished to do so, subject to the following conditions:
  10. //
  11. // The above copyright notice and this permission notice shall be included in
  12. // all copies or substantial portions of the Software.
  13. //
  14. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  19. // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  20. // IN THE SOFTWARE.
  21. //-----------------------------------------------------------------------------
  22. // The purpose of this file is to get all of our HLSL structures into one place.
  23. // Please use the structures here instead of redefining input and output structures
  24. // in each shader file. If structures are added, please adhere to the naming convention.
  25. //------------------------------------------------------------------------------
  26. // Vertex Input Structures
  27. //
  28. // These structures map to FVFs/Vertex Declarations in Torque. See gfxStructs.h
  29. //------------------------------------------------------------------------------
  30. // Notes
  31. //
  32. // Position should be specified as a float3 as our vertex structures in
  33. // the engine output float3s for position.
  34. struct VertexIn_P
  35. {
  36. float3 pos : POSITION;
  37. };
  38. struct VertexIn_PT
  39. {
  40. float3 pos : POSITION;
  41. float2 uv0 : TEXCOORD0;
  42. };
  43. struct VertexIn_PTTT
  44. {
  45. float3 pos : POSITION;
  46. float2 uv0 : TEXCOORD0;
  47. float2 uv1 : TEXCOORD1;
  48. float2 uv2 : TEXCOORD2;
  49. };
  50. struct VertexIn_PC
  51. {
  52. float3 pos : POSITION;
  53. float4 color : DIFFUSE;
  54. };
  55. struct VertexIn_PNC
  56. {
  57. float3 pos : POSITION;
  58. float3 normal : NORMAL;
  59. float4 color : DIFFUSE;
  60. };
  61. struct VertexIn_PCT
  62. {
  63. float3 pos : POSITION;
  64. float4 color : DIFFUSE;
  65. float2 uv0 : TEXCOORD0;
  66. };
  67. struct VertexIn_PN
  68. {
  69. float3 pos : POSITION;
  70. float3 normal : NORMAL;
  71. };
  72. struct VertexIn_PNT
  73. {
  74. float3 pos : POSITION;
  75. float3 normal : NORMAL;
  76. float2 uv0 : TEXCOORD0;
  77. };
  78. struct VertexIn_PNTT
  79. {
  80. float3 pos : POSITION;
  81. float3 normal : NORMAL;
  82. float3 tangent : TANGENT;
  83. float2 uv0 : TEXCOORD0;
  84. };
  85. struct VertexIn_PNCT
  86. {
  87. float3 pos : POSITION;
  88. float3 normal : NORMAL;
  89. float4 color : DIFFUSE;
  90. float2 uv0 : TEXCOORD0;
  91. };
  92. struct VertexIn_PNTTTB
  93. {
  94. float3 pos : POSITION;
  95. float3 normal : NORMAL;
  96. float2 uv0 : TEXCOORD0;
  97. float2 uv1 : TEXCOORD1;
  98. float3 T : TEXCOORD2;
  99. float3 B : TEXCOORD3;
  100. };