VolumeRenderBase.bslinc 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. Technique : base("VolumeRenderBase") =
  2. {
  3. Language = "HLSL11";
  4. Pass =
  5. {
  6. DepthWrite = false;
  7. DepthRead = false;
  8. Common =
  9. {
  10. struct VStoGS
  11. {
  12. float4 position : SV_POSITION;
  13. float2 uv0 : TEXCOORD0;
  14. uint layerIdx : TEXCOORD1;
  15. };
  16. struct GStoFS
  17. {
  18. float4 position : SV_POSITION;
  19. float2 uv0 : TEXCOORD0;
  20. uint layerIdx : SV_RenderTargetArrayIndex;
  21. };
  22. };
  23. Vertex =
  24. {
  25. struct VertexInput
  26. {
  27. float2 screenPos : POSITION;
  28. float2 uv0 : TEXCOORD0;
  29. uint layerIdx : SV_InstanceID;
  30. };
  31. VStoGS main(VertexInput input)
  32. {
  33. VStoGS output;
  34. output.position = float4(input.screenPos, 0, 1);
  35. output.uv0 = input.uv0;
  36. output.layerIdx = input.layerIdx;
  37. return output;
  38. }
  39. };
  40. Geometry =
  41. {
  42. [maxvertexcount(3)]
  43. void main(triangle VStoGS input[3], inout TriangleStream<GStoFS> outStream)
  44. {
  45. GStoFS vert0;
  46. vert0.position = input[0].position;
  47. vert0.uv0 = input[0].uv0;
  48. vert0.layerIdx = input[0].layerIdx;
  49. GStoFS vert1;
  50. vert1.position = input[1].position;
  51. vert1.uv0 = input[1].uv0;
  52. vert1.layerIdx = input[1].layerIdx;
  53. GStoFS vert2;
  54. vert2.position = input[2].position;
  55. vert2.uv0 = input[2].uv0;
  56. vert2.layerIdx = input[2].layerIdx;
  57. outStream.Append(vert0);
  58. outStream.Append(vert1);
  59. outStream.Append(vert2);
  60. }
  61. };
  62. };
  63. };
  64. Technique : base("VolumeRenderBase") =
  65. {
  66. Language = "GLSL";
  67. Pass =
  68. {
  69. Vertex =
  70. {
  71. // TODO
  72. };
  73. };
  74. };