aboutsummaryrefslogtreecommitdiffstats
path: root/src/runtimerender/res/effectlib/funccalculatePointLightAttenuation.glsllib
blob: a52130dd19a32990e59cfcd52eb416d82cb838d3 (plain)
1
2
3
4
5
6
7
8
// Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only

float qt_calculatePointLightAttenuation(vec3 attenuationConstants, float lightDistance)
{
    return 1.0 / (attenuationConstants.x + attenuationConstants.y * lightDistance
                  + attenuationConstants.z * lightDistance * lightDistance);
}