DockDropOverlay.bsl 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. Parameters =
  2. {
  3. float invViewportWidth;
  4. float invViewportHeight;
  5. color tintColor;
  6. color highlightColor;
  7. color highlightActive;
  8. };
  9. Technique =
  10. {
  11. Pass =
  12. {
  13. Target =
  14. {
  15. Blend = true;
  16. Color = { SRCA, SRCIA, ADD };
  17. };
  18. DepthRead = false;
  19. DepthWrite = false;
  20. Vertex =
  21. {
  22. cbuffer Uniforms
  23. {
  24. float invViewportWidth;
  25. float invViewportHeight;
  26. float4 tintColor;
  27. float4 highlightColor;
  28. float4 highlightActive;
  29. };
  30. void main(
  31. in float2 inPos : POSITION,
  32. in float4 color : COLOR0,
  33. out float4 oPosition : SV_Position,
  34. out float4 oColor : COLOR0)
  35. {
  36. float tfrmdX = -1.0f + (inPos.x * invViewportWidth);
  37. float tfrmdY = 1.0f - (inPos.y * invViewportHeight);
  38. oPosition = float4(tfrmdX, tfrmdY, 0, 1);
  39. float4 highlight = highlightActive * color;
  40. float highlightSum = highlight.x + highlight.y + highlight.z + highlight.a;
  41. oColor = (1.0f - highlightSum) * tintColor + highlightSum * highlightColor;
  42. }
  43. };
  44. Fragment =
  45. {
  46. float4 main(in float4 inPos : SV_Position, in float4 color : COLOR0) : SV_Target
  47. {
  48. return color;
  49. }
  50. };
  51. };
  52. };