SlopeMask - 图1

    1. // Slope Mask Shader by Saul Espinosa for Redshift
    2. // This file is licensed under Apache 2.0 license
    3. shader SlopeMask
    4. [[ string help = "Generates a mask based on Slope and direction",
    5. string label = "Slope Mask" ]]
    6. (
    7. float Power = 4.0
    8. [[
    9. float min =0.03,
    10. float max = 100
    11. ]],
    12. float Slope = 0.5
    13. [[
    14. float min = 0.0,
    15. float max = 0.9999999
    16. ]],
    17. int Direction = 1
    18. [[
    19. string widget = "mapper",
    20. string options = "X:0|Y:1|Z:2",
    21. int min = 0,
    22. int max = 2
    23. ]],
    24. output color Out = 1.0
    25. )
    26. {
    27. Out = pow((N[Direction] - Slope) / .5, 1.0 / Power);
    28. }