Wavelength - 图1

    1. // Wavelength Color Shader
    2. // WaveLength.osl, by Zap Andersson
    3. // Modified: 2019-11-26
    4. // Copyright 2019 Autodesk Inc, All rights reserved. This file is licensed under Apache 2.0 license
    5. // https://github.com/ADN-DevTech/3dsMax-OSL-Shaders/blob/master/LICENSE.txt
    6. shader WaveLength
    7. [[ string help = "Modulates a color between two wavelengths of light",
    8. string label = "Wavelength Color",
    9. string category = "Utility"
    10. ]]
    11. (
    12. float Input = u,
    13. float Min = 400.0,
    14. float Max = 700.0,
    15. output color Col = 0.0,
    16. )
    17. {
    18. Col = wavelength_color(mix(Min, Max, Input));
    19. }