| 1 | // Copyright (C) 2016 Klaralvdalens Datakonsult AB (KDAB). |
|---|---|
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
| 3 | |
| 4 | #include "scene3dsgmaterial_p.h" |
| 5 | |
| 6 | QT_BEGIN_NAMESPACE |
| 7 | |
| 8 | namespace Qt3DRender { |
| 9 | |
| 10 | /*! |
| 11 | \class Qt3DRender::Scene3DSGMaterial |
| 12 | \internal |
| 13 | \inherits QSGMaterial |
| 14 | |
| 15 | \brief The Scene3DSGMaterial class is a custom QSGMaterial subclass used to |
| 16 | render a Scene3DSGNode |
| 17 | |
| 18 | The Scene3DSGMaterial class renders a texture using premultiplied |
| 19 | alpha unlike the QSGSimpleTextureMaterial. |
| 20 | |
| 21 | This is needed to properly integrate alpha blending from a Qt3D scene |
| 22 | within a QtQuick 2 scene. |
| 23 | */ |
| 24 | Scene3DSGMaterial::Scene3DSGMaterial() |
| 25 | : QSGMaterial() |
| 26 | , m_texture(nullptr) |
| 27 | , m_visible(false) |
| 28 | { |
| 29 | } |
| 30 | |
| 31 | QSGMaterialShader *Scene3DSGMaterial::createShader(QSGRendererInterface::RenderMode renderMode) const |
| 32 | { |
| 33 | Q_UNUSED(renderMode); |
| 34 | return new Scene3DSGMaterialShader(); |
| 35 | } |
| 36 | |
| 37 | } // namespace Qt3DRender |
| 38 | |
| 39 | QT_END_NAMESPACE |
| 40 |
