このページでは

Qt3DExtras::QNormalDiffuseMapMaterial Class

class Qt3DExtras::QNormalDiffuseMapMaterial

QNormalDiffuseMapMaterial は、フオン照明とバンプ効果のデフォルトの実装を提供します。この実装では、拡散光成分はテクスチャマップから読み込まれ、レンダリング対象のメッシュの法線は法線テクスチャマップから読み込まれます。詳細...

ヘッダー: #include <qnormaldiffusemapmaterial.h>
CMake: find_package(Qt6 REQUIRED COMPONENTS 3dextras)
target_link_libraries(mytarget PRIVATE Qt6::3dextras)
qmake: QT += 3dextras
継承元: Qt3DRender::QMaterial
継承元:

Qt3DExtras::QNormalDiffuseMapAlphaMaterial

ステータス: 非推奨

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

プロパティ

パブリック関数

QNormalDiffuseMapMaterial(Qt3DCore::QNode *parent = nullptr)
virtual ~QNormalDiffuseMapMaterial()
QColor ambient() const
Qt3DRender::QAbstractTexture *diffuse() const
Qt3DRender::QAbstractTexture *normal() const
float shininess() const
QColor specular() const
float textureScale() const

パブリックスロット

void setAmbient(const QColor &ambient)
void setDiffuse(Qt3DRender::QAbstractTexture *diffuse)
void setNormal(Qt3DRender::QAbstractTexture *normal)
void setShininess(float shininess)
void setSpecular(const QColor &specular)
void setTextureScale(float textureScale)

シグナル

void ambientChanged(const QColor &ambient)
void diffuseChanged(Qt3DRender::QAbstractTexture *diffuse)
void normalChanged(Qt3DRender::QAbstractTexture *normal)
void shininessChanged(float shininess)
void specularChanged(const QColor &specular)
void textureScaleChanged(float textureScale)

詳細な説明

このクラスは非推奨です。代わりにQDiffuseSpecularMaterial を使用してください。

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

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

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

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

ambient : QColor

現在の周囲の色を保持します。

アクセス関数:

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

通知シグナル:

void ambientChanged(const QColor &ambient)

diffuse : Qt3DRender::QAbstractTexture*

現在のディフューズマップテクスチャを保持します。

デフォルトでは、ディフューズテクスチャには以下のプロパティが設定されています:

  • 線形縮小および拡大フィルタ
  • ミップマッピングが有効な線形ミップマップ
  • リピート・ラップモード M
  • 最大異方性:16.0

アクセス関数:

Qt3DRender::QAbstractTexture *diffuse() const
void setDiffuse(Qt3DRender::QAbstractTexture *diffuse)

通知信号:

void diffuseChanged(Qt3DRender::QAbstractTexture *diffuse)

normal : Qt3DRender::QAbstractTexture*

現在の法線マップテクスチャを保持します。

デフォルトでは、法線テクスチャには以下のプロパティが設定されています:

  • 線形縮小および拡大フィルタ
  • リピート・ラップモード
  • 最大異方性:16.0

アクセス関数:

Qt3DRender::QAbstractTexture *normal() const
void setNormal(Qt3DRender::QAbstractTexture *normal)

通知シグナル:

void normalChanged(Qt3DRender::QAbstractTexture *normal)

shininess : float

現在の光沢度を浮動小数点数値として保持します。

アクセス関数:

float shininess() const
void setShininess(float shininess)

通知シグナル:

void shininessChanged(float shininess)

specular : QColor

現在のスペキュラーカラーを保持します。

アクセス関数:

QColor specular() const
void setSpecular(const QColor &specular)

通知シグナル:

void specularChanged(const QColor &specular)

textureScale : float

現在のテクスチャスケールを保持します。これは、レンダリング時にテクスチャ座標に対する乗数として適用されます。デフォルトは 1.0 です。

QTextureWrapMode::Repeat と組み合わせて使用すると、textureScale により、サーフェス全体にテクスチャをタイル状に並べる簡単な方法を提供します。たとえば、textureScale を4.0 に設定すると、16 個(4×4)のタイルが生成されます。

アクセス関数:

float textureScale() const
void setTextureScale(float textureScale)

通知シグナル:

void textureScaleChanged(float textureScale)

メンバ関数のドキュメント

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

親オブジェクトparent を持つ新しいQNormalDiffuseMapMaterialインスタンスを作成します。

[virtual noexcept] QNormalDiffuseMapMaterial::~QNormalDiffuseMapMaterial()

QNormalDiffuseMapMaterial インスタンスを破棄します。

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