QDiffuseSpecularMapMaterial Class
class Qt3DExtras::QDiffuseSpecularMapMaterialQDiffuseSpecularMapMaterial は、拡散光と鏡面光の成分がテクスチャマップから読み取られる、フォン照明効果のデフォルト実装を提供します。詳細はこちら
ヘッダー | #include <QDiffuseSpecularMapMaterial> |
CMake: | find_package(Qt6 REQUIRED COMPONENTS 3dextras) target_link_libraries(mytarget PRIVATE Qt6::3dextras) |
qmake: | QT += 3dextras |
を継承する: | Qt3DRender::QMaterial |
ステータス | 非推奨 |
このクラスは非推奨です。新しいコードで使用しないことを強くお勧めします。
プロパティ
|
パブリック機能
QDiffuseSpecularMapMaterial(Qt3DCore::QNode *parent = nullptr) | |
virtual | ~QDiffuseSpecularMapMaterial() |
QColor | ambient() const |
Qt3DRender::QAbstractTexture * | diffuse() const |
float | shininess() const |
Qt3DRender::QAbstractTexture * | specular() const |
float | textureScale() const |
パブリックスロット
void | setAmbient(const QColor &ambient) |
void | setDiffuse(Qt3DRender::QAbstractTexture *diffuse) |
void | setShininess(float shininess) |
void | setSpecular(Qt3DRender::QAbstractTexture *specular) |
void | setTextureScale(float textureScale) |
シグナル
void | ambientChanged(const QColor &ambient) |
void | diffuseChanged(Qt3DRender::QAbstractTexture *diffuse) |
void | shininessChanged(float shininess) |
void | specularChanged(Qt3DRender::QAbstractTexture *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 &ambient) |
通知シグナル:
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 値で保持します。shininess の値が大きいほど、ハイライトは小さく明るくなります。
デフォルトは 150.0 です。
アクセス関数:
float | shininess() const |
void | setShininess(float shininess) |
通知シグナル:
void | shininessChanged(float shininess) |
specular : Qt3DRender::QAbstractTexture*
現在のスペキュラマップテクスチャを保持します。
デフォルトでは、鏡面テクスチャは以下のプロパティを持っています:
- 線形最小化フィルタと拡大フィルタ
- ミップマップを有効にしたリニアミップマップ
- リピートラップモード
- 最大異方性16.0
アクセス関数:
Qt3DRender::QAbstractTexture * | specular() const |
void | setSpecular(Qt3DRender::QAbstractTexture *specular) |
通知シグナル
void | specularChanged(Qt3DRender::QAbstractTexture *specular) |
textureScale : float
現在のテクスチャスケールを保持します。レンダリング時にテクスチャ座標に乗数として適用されます。デフォルトは 1.0 です。
QTextureWrapMode::Repeatと組み合わせて使用すると、textureScaleは、サーフェス全体にテクスチャをタイル化する簡単な方法を提供します。例えば、4.0
のテクスチャスケールは、16 (4x4) のタイルになります。
アクセス関数
float | textureScale() const |
void | setTextureScale(float textureScale) |
通知シグナル
void | textureScaleChanged(float textureScale) |
メンバー関数ドキュメント
[explicit]
QDiffuseSpecularMapMaterial::QDiffuseSpecularMapMaterial(Qt3DCore::QNode *parent = nullptr)
親オブジェクトparent を持つ新しい QDiffuseSpecularMapMaterial インスタンスを構築します。
[virtual noexcept]
QDiffuseSpecularMapMaterial::~QDiffuseSpecularMapMaterial()
QDiffuseSpecularMapMaterial インスタンスを破棄します。
© 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.