DockDropOverlay.bsl 967 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. technique DockDropOverlay
  2. {
  3. blend
  4. {
  5. target
  6. {
  7. enabled = true;
  8. color = { srcA, srcIA, add };
  9. };
  10. };
  11. depth
  12. {
  13. read = false;
  14. write = false;
  15. };
  16. code
  17. {
  18. cbuffer Uniforms
  19. {
  20. float invViewportWidth;
  21. float invViewportHeight;
  22. float4 tintColor;
  23. float4 highlightColor;
  24. float4 highlightActive;
  25. };
  26. void vsmain(
  27. in float2 inPos : POSITION,
  28. in float4 color : COLOR0,
  29. out float4 oPosition : SV_Position,
  30. out float4 oColor : COLOR0)
  31. {
  32. float tfrmdX = -1.0f + (inPos.x * invViewportWidth);
  33. float tfrmdY = 1.0f - (inPos.y * invViewportHeight);
  34. oPosition = float4(tfrmdX, tfrmdY, 0, 1);
  35. float4 highlight = highlightActive * color;
  36. float highlightSum = highlight.x + highlight.y + highlight.z + highlight.a;
  37. oColor = (1.0f - highlightSum) * tintColor + highlightSum * highlightColor;
  38. }
  39. float4 fsmain(in float4 inPos : SV_Position, in float4 color : COLOR0) : SV_Target
  40. {
  41. return color;
  42. }
  43. };
  44. };