// Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only

// Blinn-Phong
vec4 qt_specularBSDF(in vec3 N, in vec3 L, in vec3 V, in vec3 lightSpecular, in float shininess)
{
    vec4 rgba = vec4(0.0, 0.0, 0.0, 1.0);
    vec3 H = normalize(V + L);
    float cosAlpha = max(0.0, dot(H, N));
    float shine = pow(cosAlpha, shininess);
    rgba.rgb = shine * lightSpecular;
    return rgba;
}
