Guest User

Untitled

a guest
Jan 18th, 2019
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. // ---------------------- Pixel Shader for colored pixels -------------------------
  2.  
  3. // --- Input Constants ---
  4. // fc0 - 4d vector for ARGB color
  5. // fc1.x - Dashed line tollerance, should be 0.5
  6.  
  7. // --- Input Attributes ---
  8. // v0.x - Scalar representing distance along a line (for creating dashed lines)
  9.  
  10. // --- Usage ---
  11.  
  12. // ----------------------------------------------------------------------------------
  13. mov ft1 fc0 // Move color into a temporary register so we can modify it
  14. frc ft0.x v0.x // Get the fractional component of this pixel's distance on line
  15. //slt ft0.x ft0.x fc1.x // Set vt0.x to 0 or 1 based upon whether the fractional component is < 0.5
  16. mul ft1 ft1 ft0.x // If result is zero, don't render this pixel
  17.  
  18. mov oc, ft1 // Move color constant to output
Add Comment
Please, Sign In to add comment