QDiffuseMapMaterial Class

class Qt3DExtras::QDiffuseMapMaterial

QDiffuseMapMaterial は、拡散光成分がテクスチャマップから読み取られるフォン照明効果のデフォルト実装を提供します。詳細はこちら

ヘッダー #include <QDiffuseMapMaterial>
CMake: find_package(Qt6 REQUIRED COMPONENTS 3dextras)
target_link_libraries(mytarget PRIVATE Qt6::3dextras)
qmake: QT += 3dextras
を継承する: Qt3DRender::QMaterial
ステータス非推奨

このクラスは非推奨です。新しいコードで使用しないことを強くお勧めします。

プロパティ

パブリック機能

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

パブリックスロット

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

シグナル

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

詳細説明

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

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

  • アンビエントは、他の光源がない場合に物体から発せられる色です。
  • ディフューズ(Diffuse)とは、ライトによる急激な表面反射に対して発せられる色です。
  • スペキュラ(Specular)とは、ライトによる表面の光沢のある反射に対して発せられる色です。
  • 表面の輝きは float プロパティで制御します。

このマテリアルは、シングル レンダー パス アプローチのエフェクトを使用し、フラグメントごとにライティングを実行します。テクニックはOpenGL 2、OpenGL 3以上、OpenGL ES 2用に提供されています。

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

ambient : QColor

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

アクセス機能

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

通知信号

void ambientChanged(const QColor &ambient)

diffuse : Qt3DRender::QAbstractTexture*

ディフューズマップとして使用される現在のテクスチャを保持します。

デフォルトでは、ディフューズテクスチャは以下のプロパティを持っています:

  • 線形最小化フィルタと拡大フィルタ
  • ミップマップを有効にしたリニアミップマップ
  • リピートラップモード
  • 最大異方性16.0

アクセス関数:

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

通知シグナル

void diffuseChanged(Qt3DRender::QAbstractTexture *diffuse)

shininess : float

現在の輝度を 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は、サーフェス全体にテクスチャをタイル化する簡単な方法を提供します。例えば、4.0 のテクスチャスケールは、16 (4x4) のタイルになります。

アクセス関数

float textureScale() const
void setTextureScale(float textureScale)

通知シグナル

void textureScaleChanged(float textureScale)

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

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

親オブジェクトparent を持つ新しい QDiffuseMapMaterial インスタンスを構築する。

[virtual noexcept] QDiffuseMapMaterial::~QDiffuseMapMaterial()

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

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