2
0

DockDropOverlay.bsl 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. Parameters =
  2. {
  3. float invViewportWidth;
  4. float invViewportHeight;
  5. color tintColor;
  6. color highlightColor;
  7. color highlightActive;
  8. };
  9. Technique =
  10. {
  11. Language = "HLSL11";
  12. Pass =
  13. {
  14. Target =
  15. {
  16. Blend = true;
  17. Color = { SRCA, SRCIA, ADD };
  18. };
  19. DepthRead = false;
  20. DepthWrite = false;
  21. Vertex =
  22. {
  23. float invViewportWidth;
  24. float invViewportHeight;
  25. float4 tintColor;
  26. float4 highlightColor;
  27. float4 highlightActive;
  28. void main(
  29. in float2 inPos : POSITION,
  30. in float4 color : COLOR0,
  31. out float4 oPosition : SV_Position,
  32. out float4 oColor : COLOR0)
  33. {
  34. float tfrmdX = -1.0f + (inPos.x * invViewportWidth);
  35. float tfrmdY = 1.0f - (inPos.y * invViewportHeight);
  36. oPosition = float4(tfrmdX, tfrmdY, 0, 1);
  37. float4 highlight = highlightActive * color;
  38. float highlightSum = highlight.x + highlight.y + highlight.z + highlight.a;
  39. oColor = (1.0f - highlightSum) * tintColor + highlightSum * highlightColor;
  40. }
  41. };
  42. Fragment =
  43. {
  44. float4 main(in float4 inPos : SV_Position, in float4 color : COLOR0) : SV_Target
  45. {
  46. return color;
  47. }
  48. };
  49. };
  50. };
  51. Technique =
  52. {
  53. Language = "GLSL";
  54. Pass =
  55. {
  56. Target =
  57. {
  58. Blend = true;
  59. Color = { SRCA, SRCIA, ADD };
  60. };
  61. DepthRead = false;
  62. DepthWrite = false;
  63. Vertex =
  64. {
  65. layout(location = 0) in vec2 bs_position;
  66. layout(location = 1) in vec4 bs_color0;
  67. layout(location = 0) out vec4 color0;
  68. out gl_PerVertex
  69. {
  70. vec4 gl_Position;
  71. };
  72. layout(binding = 0) uniform VertUBO
  73. {
  74. float invViewportWidth;
  75. float invViewportHeight;
  76. vec4 tintColor;
  77. vec4 highlightColor;
  78. vec4 highlightActive;
  79. };
  80. void main()
  81. {
  82. float tfrmdX = -1.0f + (bs_position.x * invViewportWidth);
  83. float tfrmdY = 1.0f - (bs_position.y * invViewportHeight);
  84. gl_Position = vec4(tfrmdX, tfrmdY, 0, 1);
  85. vec4 highlight = highlightActive * bs_color0;
  86. float highlightSum = highlight.x + highlight.y + highlight.z + highlight.w;
  87. color0 = (1.0f - highlightSum) * tintColor + highlightSum * highlightColor;
  88. }
  89. };
  90. Fragment =
  91. {
  92. layout(location = 0) in vec4 color0;
  93. layout(location = 0) out vec4 fragColor;
  94. void main()
  95. {
  96. fragColor = color0;
  97. }
  98. };
  99. };
  100. };