QDiffuseSpecularMaterial Class

class Qt3DExtras::QDiffuseSpecularMaterial

QDiffuseSpecularMaterial 클래스는 퐁 조명 효과의 기본 구현을 제공합니다. 더 보기...

Header: #include <QDiffuseSpecularMaterial>
CMake: find_package(Qt6 REQUIRED COMPONENTS 3dextras)
target_link_libraries(mytarget PRIVATE Qt6::3dextras)
qmake: QT += 3dextras
QML에서: DiffuseSpecularMaterial
상속합니다: Qt3DRender::QMaterial
상태: Deprecated

속성

공용 기능

QDiffuseSpecularMaterial(Qt3DCore::QNode *parent = nullptr)
virtual ~QDiffuseSpecularMaterial()
QColor ambient() const
QVariant diffuse() const
bool isAlphaBlendingEnabled() const
QVariant normal() const
float shininess() const
QVariant specular() const
float textureScale() const

공용 슬롯

void setAlphaBlendingEnabled(bool enabled)
void setAmbient(const QColor &ambient)
void setDiffuse(const QVariant &diffuse)
void setNormal(const QVariant &normal)
void setShininess(float shininess)
void setSpecular(const QVariant &specular)
void setTextureScale(float textureScale)

신호

void alphaBlendingEnabledChanged(bool enabled)
void ambientChanged(const QColor &ambient)
void diffuseChanged(const QVariant &diffuse)
void normalChanged(const QVariant &normal)
void shininessChanged(float shininess)
void specularChanged(const QVariant &specular)
void textureScaleChanged(float textureScale)

상세 설명

퐁 조명 효과는 앰비언트, 디퓨즈, 스페큘러의 세 가지 조명 구성 요소의 조합을 기반으로 합니다. 이러한 구성 요소의 상대적인 강도는 RGB 삼원색으로 모델링된 반사율 계수를 통해 제어됩니다:

  • 앰비언트는 다른 광원 없이 물체에서 방출되는 색입니다.
  • 확산은 조명에 의한 표면 반사를 위해 방출되는 색상입니다.
  • 스페큘러는 조명에 의해 반짝이는 표면 반사를 위해 방출되는 색상입니다.
  • 표면의 광택은 플로트 프로퍼티로 제어됩니다.

이 머티리얼은 단일 렌더 패스 접근 방식으로 효과를 사용하며 조각별 조명을 수행합니다. OpenGL 2, OpenGL 3 이상 및 OpenGL ES 2에 대한 기술이 제공됩니다.

프로퍼티 문서

alphaBlending : bool

렌더링 시 디퓨즈 프로퍼티에서 나오는 알파 정보를 고려할지 여부를 나타냅니다. 기본값은 false입니다.

함수에 액세스합니다:

bool isAlphaBlendingEnabled() const
void setAlphaBlendingEnabled(bool enabled)

노티파이 신호:

void alphaBlendingEnabledChanged(bool enabled)

ambient : QColor

다른 광원 없이 물체에서 방출되는 주변색을 유지합니다.

기능에 액세스합니다:

QColor ambient() const
void setAmbient(const QColor &ambient)

알림 신호:

void ambientChanged(const QColor &ambient)

diffuse : QVariant

라이트의 거친 표면 반사를 위해 방출되는 머티리얼의 디퓨즈 컬러를 보유합니다. 일반 색상 값이나 텍스처가 될 수 있습니다.

기능에 액세스합니다:

QVariant diffuse() const
void setDiffuse(const QVariant &diffuse)

알림 신호:

void diffuseChanged(const QVariant &diffuse)

normal : QVariant

머티리얼의 현재 노멀 맵 텍스처를 보유합니다. 텍스처만 가능하며, 그렇지 않으면 무시됩니다. 기본적으로 이 맵은 설정되지 않습니다.

함수 액세스:

QVariant normal() const
void setNormal(const QVariant &normal)

알림 신호:

void normalChanged(const QVariant &normal)

shininess : float

광택 지수 - 광택 지수를 보유합니다. 광택 값이 높을수록 하이라이트가 더 작고 밝아집니다.

기본값은 150.0입니다.

기능에 액세스합니다:

float shininess() const
void setShininess(float shininess)

알림 신호:

void shininessChanged(float shininess)

specular : QVariant

빛으로 반짝이는 표면 반사를 위해 방출되는 머티리얼의 스페큘러 색을 보유합니다. 일반 색상 값이나 텍스처가 될 수 있습니다.

기능에 액세스합니다:

QVariant specular() const
void setSpecular(const QVariant &specular)

알림 신호:

void specularChanged(const QVariant &specular)

textureScale : float

현재 텍스처 스케일을 유지합니다. 렌더링 시 텍스처 좌표에 배율로 적용됩니다. 기본값은 1.0입니다.

QTextureWrapMode::Repeat와 함께 사용하면 textureScale은 표면 전체에 텍스처를 타일링하는 간단한 방법을 제공합니다. 예를 들어, 텍스처 스케일이 4.0 인 경우 16(4x4) 타일이 생성됩니다.

함수에 액세스합니다:

float textureScale() const
void setTextureScale(float textureScale)

알림 신호:

void textureScaleChanged(float textureScale)

멤버 함수 문서

[explicit] QDiffuseSpecularMaterial::QDiffuseSpecularMaterial(Qt3DCore::QNode *parent = nullptr)

부모 오브젝트 parent 를 사용하여 새로운 QDiffuseSpecularMaterial 인스턴스를 생성합니다.

[virtual noexcept] QDiffuseSpecularMaterial::~QDiffuseSpecularMaterial()

QDiffuseSpecularMaterial 를 파괴합니다.

© 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.