summaryrefslogtreecommitdiffstats
path: root/src/quick3d/imports/scene3d/scene3dsgmaterial.cpp
blob: 0d1ea73846f7a99986ef8a225b1da5d118d3059a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// Copyright (C) 2016 Klaralvdalens Datakonsult AB (KDAB).
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only

#include "scene3dsgmaterial_p.h"

QT_BEGIN_NAMESPACE

namespace Qt3DRender {

/*!
    \class Qt3DRender::Scene3DSGMaterial
    \internal
    \inherits QSGMaterial

    \brief The Scene3DSGMaterial class is a custom QSGMaterial subclass used to
    render a Scene3DSGNode

    The Scene3DSGMaterial class renders a texture using premultiplied
    alpha unlike the QSGSimpleTextureMaterial.

    This is needed to properly integrate alpha blending from a Qt3D scene
    within a QtQuick 2 scene.
 */
Scene3DSGMaterial::Scene3DSGMaterial()
    : QSGMaterial()
    , m_texture(nullptr)
    , m_visible(false)
{
}

QSGMaterialShader *Scene3DSGMaterial::createShader(QSGRendererInterface::RenderMode renderMode) const
{
    Q_UNUSED(renderMode);
    return new Scene3DSGMaterialShader();
}

} // namespace Qt3DRender

QT_END_NAMESPACE