// Copyright Contributors to the Open Shading Language project.
// SPDX-License-Identifier: BSD-3-Clause
// https://github.com/AcademySoftwareFoundation/OpenShadingLanguage

shader
test (float Kd = 0.5, float Ks = 0.5, float exponent = 20, color opacity = 0.5,
      // test closure params
      closure color closureparam = 0.0)
{
    Ci = Kd * diffuse (N, "label", "first", "label", "second");
    printf ("  Ci = %s\n", Ci);

    printf ("adding specular term:");
    closure color spec = Ks * phong(N, exponent, "label", "one");  // also test assignment
    Ci += spec;
    printf ("  Ci = %s\n", Ci);

    // mix in transparency
    printf ("adding transparency:");
    Ci = opacity * Ci + (1 - opacity) * transparent();
    printf ("  Ci = %s\n", Ci);

    // add emission term
    printf ("adding emission:");
    Ci += emission();
    printf ("  Ci = %s\n", Ci);

    // add debug
    printf ("adding debug:");
    Ci += 0.25 * debug("MyAOV");
    printf ("  Ci = %s\n", Ci);

    // add holdout
    printf ("adding holdout:");
    Ci += 0.5 * holdout();
    printf ("  Ci = %s\n", Ci);

    // add varying keyword parameter
    printf ("adding varying keyword parameter:");
    Ci += diffuse( N, "label", format( "%f", u ) );
    printf ("  Ci = %s\n", Ci);

    closure color xclosure = 0;
    xclosure = 0;
}
