DockDropOverlay.bsl 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. Parameters =
  2. {
  3. float invViewportWidth;
  4. float invViewportHeight;
  5. float4 tintColor;
  6. float4 highlightColor;
  7. float4 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 = "HLSL9";
  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. float invViewportWidth;
  66. float invViewportHeight;
  67. float4 tintColor;
  68. float4 highlightColor;
  69. float4 highlightActive;
  70. void main(
  71. in float2 inPos : POSITION,
  72. in float4 inColor : COLOR0,
  73. out float4 oPosition : POSITION,
  74. out float4 oColor : COLOR0)
  75. {
  76. float tfrmdX = -1.0f + ((inPos.x - 0.5f) * invViewportWidth);
  77. float tfrmdY = 1.0f - ((inPos.y - 0.5f) * invViewportHeight);
  78. oPosition = float4(tfrmdX, tfrmdY, 0, 1);
  79. float4 highlight = highlightActive * inColor;
  80. float highlightSum = highlight.x + highlight.y + highlight.z + highlight.a;
  81. oColor = (1.0f - highlightSum) * tintColor + highlightSum * highlightColor;
  82. }
  83. };
  84. Fragment =
  85. {
  86. float4 main(float4 color : COLOR0) : COLOR0
  87. {
  88. return color;
  89. }
  90. };
  91. };
  92. };
  93. Technique =
  94. {
  95. Language = "GLSL";
  96. Pass =
  97. {
  98. Target =
  99. {
  100. Blend = true;
  101. Color = { SRCA, SRCIA, ADD };
  102. };
  103. DepthRead = false;
  104. DepthWrite = false;
  105. Vertex =
  106. {
  107. uniform float invViewportWidth;
  108. uniform float invViewportHeight;
  109. uniform vec4 tintColor;
  110. uniform vec4 highlightColor;
  111. uniform vec4 highlightActive;
  112. in vec2 bs_position;
  113. in vec4 bs_color0;
  114. out vec4 color0;
  115. out gl_PerVertex
  116. {
  117. vec4 gl_Position;
  118. };
  119. void main()
  120. {
  121. float tfrmdX = -1.0f + (bs_position.x * invViewportWidth);
  122. float tfrmdY = 1.0f - (bs_position.y * invViewportHeight);
  123. gl_Position = vec4(tfrmdX, tfrmdY, 0, 1);
  124. vec4 highlight = highlightActive * bs_color0;
  125. float highlightSum = highlight.x + highlight.y + highlight.z + highlight.w;
  126. color0 = (1.0f - highlightSum) * tintColor + highlightSum * highlightColor;
  127. }
  128. };
  129. Fragment =
  130. {
  131. in vec4 color0;
  132. out vec4 fragColor;
  133. void main()
  134. {
  135. fragColor = color0;
  136. }
  137. };
  138. };
  139. };