PointLight QML Type

씬에서 포인트 조명을 정의합니다. 더 보기...

Import Statement: import QtQuick3D
Inherits:

Light

속성

자세한 설명

점광은 빛의 중심에서 모든 방향으로 동일한 세기의 빛을 방출하는 구형으로 설명할 수 있습니다. 이는 전구가 빛을 발산하는 방식과 유사합니다.

포인트 조명을 회전하거나 크기를 조정해도 효과가 없습니다. 포인트 조명을 이동하면 빛이 방출되는 위치가 변경됩니다.

기본적으로 포인트 라이트의 강도는 역제곱 법칙에 따라 감소합니다. 그러나 constantFade, linearFade, quadraticFade 프로퍼티를 사용하여 페이드오프(및 범위)를 제어할 수 있습니다. 빛 감쇠는 다음 공식을 사용하여 계산합니다: constantFade + distance * (linearFade * 0.01) + distance^2 * (quadraticFade * 0.0001)

간단한 예: 세 가지 방법으로 구체 음영 처리하기

배경에 확대된 직사각형 앞에 구가 포함된 장면을 가져옵니다. 직사각형의 PrincipledMaterial 기본 기본 색상은 흰색입니다.

조명을 사용하지 않고 두 메시의 조명 관련 셰이딩을 비활성화하면 다음과 같은 결과가 나타납니다:

import QtQuick
import QtQuick3D
View3D {
    anchors.fill: parent

    PerspectiveCamera { z: 600 }

    Model {
        source: "#Rectangle"
        scale: Qt.vector3d(10, 10, 10)
        z: -100
        materials: PrincipledMaterial {
            lighting: PrincipledMaterial.NoLighting
        }
    }

    Model {
        source: "#Sphere"
        scale: Qt.vector3d(2, 2, 2)
        materials: PrincipledMaterial {
            lighting: PrincipledMaterial.NoLighting
            baseColor: "#40c060"
            roughness: 0.1
        }
    }
}

기본적으로 Z축을 따라 방출되는 방향성 조명을 추가하면 다음과 같이 됩니다:

import QtQuick
import QtQuick3D
View3D {
    anchors.fill: parent

    PerspectiveCamera { z: 600 }

    DirectionalLight { }

    Model {
        source: "#Rectangle"
        scale: Qt.vector3d(10, 10, 10)
        z: -100
        materials: PrincipledMaterial { }
    }

    Model {
        source: "#Sphere"
        scale: Qt.vector3d(2, 2, 2)
        materials: PrincipledMaterial {
            baseColor: "#40c060"
            roughness: 0.1
        }
    }
}

이제 DirectionalLight 을 다음과 같이 바꾸면 어떨까요?

PointLight {
    z: 300
}

여기서 흰색 포인트 라이트는 카메라와 씬 중앙의 중간에 위치하도록 Z축에서 이동합니다. DirectionalLight 와는 달리 포인트 라이트의 회전은 중요하지 않지만 위치는 중요합니다. 특히 배경의 직사각형 메시에서 강도가 감소하는 것을 볼 수 있습니다.

더 많은 사용 예제는 Qt Quick 3D - 조명 예제를 참조하세요.

DirectionalLight, SpotLight, 섀도 매핑도참조하세요 .

프로퍼티 문서

constantFade : real

이 프로퍼티는 빛의 감쇠 항의 상수 계수입니다. 기본값은 1.0입니다.


linearFade : real

이 프로퍼티는 조명까지의 거리에 비례하여 조명 효과가 조명을 어둡게 하는 속도를 증가시킵니다. 기본값은 0.0 이며, 이는 조명에 선형 페이드가 없음을 의미합니다. 여기서 사용되는 값은 0.01 을 곱한 후 빛 감쇠를 계산하는 데 사용됩니다.


quadraticFade : real

이 프로퍼티는 역제곱 법칙에 비례하여 조명 효과가 빛을 어둡게 하는 속도를 증가시킵니다. 기본값은 1.0으로, 포인트 조명 페이드가 역제곱 법칙을 정확히 따르는 즉, 물체와의 거리가 두 배가 되면 빛의 강도가 1/4로 감소합니다. 여기서 사용되는 값은 0.0001 을 곱한 후 빛 감쇠를 계산하는 데 사용됩니다.


© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.