このページでは

Qt3DExtras::QDiffuseSpecularMaterial Class

class Qt3DExtras::QDiffuseSpecularMaterial

QDiffuseSpecularMaterial クラスは、フォン照明効果のデフォルトの実装を提供します。詳細...

ヘッダー: #include <qdiffusespecularmaterial.h>
CMake: find_package(Qt6 REQUIRED COMPONENTS 3dextras)
target_link_libraries(mytarget PRIVATE Qt6::3dextras)
qmake: QT += 3dextras
QML内: DiffuseSpecularMaterial
継承元: Qt3DRender::QMaterial
ステータス: 非推奨

このクラスは非推奨です。新しいコードでの使用は強く推奨しません。

プロパティ

パブリック関数

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)

詳細な説明

フォン照明効果は、アンビエント、ディフューズ、スペキュラーという 3 つの照明成分の組み合わせに基づいています。これらの成分の相対的な強さは、RGB 3 値としてモデル化された反射率係数によって制御されます。

  • アンビエントとは、他の光源がない状態でオブジェクトから放出される色のことです。
  • ディフューズは、光が粗い表面で反射した際に発せられる色です。
  • スペキュラーは、光が光沢のある表面で反射した際に発せられる色です。
  • 表面の光沢度は、float型のプロパティによって制御されます。

このマテリアルは、シングルレンダーパス方式の効果を使用し、フラグメントごとのライティングを実行します。OpenGL 2、OpenGL 3 以降、および OpenGL ES 2 向けの技術が提供されています。

プロパティのドキュメント

alphaBlending : bool

「diffuse」プロパティから得られるアルファ情報が、レンダリング時に考慮されるかどうかを示します。デフォルトは 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 によって、サーフェス全体にテクスチャをタイル状に並べる簡単な方法を提供します。例えば、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 を削除します。

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