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

shader
test_normalize_v_dnormal (output color Cout = 0)
{
    float  val = u;
    float val2 = v;
    float val3 = u+v;

    normal v1 = normal(val, val2, val3);
    normal v2 = normal(val3, val, val2);
    
    normal nv = normalize(v1);
    
    if (int(P[0]*64)%2==0) {
        nv = normalize(v2);
    }
    
    Cout = Dx(nv) + Dy(nv);
}
