| 1 | // Copyright (C) 2008-2012 NVIDIA Corporation. |
| 2 | // Copyright (C) 2019 The Qt Company Ltd. |
| 3 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only |
| 4 | |
| 5 | #ifndef QSSG_RENDER_MODEL_H |
| 6 | #define QSSG_RENDER_MODEL_H |
| 7 | |
| 8 | // |
| 9 | // W A R N I N G |
| 10 | // ------------- |
| 11 | // |
| 12 | // This file is not part of the Qt API. It exists purely as an |
| 13 | // implementation detail. This header file may change from version to |
| 14 | // version without notice, or even be removed. |
| 15 | // |
| 16 | // We mean it. |
| 17 | // |
| 18 | |
| 19 | #include <QtQuick3DRuntimeRender/private/qssgrendernode_p.h> |
| 20 | #include <QtQuick3DRuntimeRender/private/qssgrendermesh_p.h> |
| 21 | #include <QtQuick3DRuntimeRender/private/qssgrendergeometry_p.h> |
| 22 | #include <QtQuick3DRuntimeRender/private/qssgrenderskeleton_p.h> |
| 23 | #include <QtQuick3DRuntimeRender/private/qssgrenderskin_p.h> |
| 24 | #include <QtQuick3DRuntimeRender/private/qssgrenderinstancetable_p.h> |
| 25 | |
| 26 | #include <QtQuick3DUtils/private/qssgbounds3_p.h> |
| 27 | #include <QtCore/QVector> |
| 28 | |
| 29 | QT_BEGIN_NAMESPACE |
| 30 | |
| 31 | struct QSSGRenderDefaultMaterial; |
| 32 | struct QSSGParticleBuffer; |
| 33 | class QSSGBufferManager; |
| 34 | class QRhiTexture; |
| 35 | |
| 36 | struct Q_QUICK3DRUNTIMERENDER_EXPORT QSSGRenderModel : public QSSGRenderNode |
| 37 | { |
| 38 | QVector<QSSGRenderGraphObject *> materials; |
| 39 | QVector<QSSGRenderGraphObject *> morphTargets; |
| 40 | QSSGRenderGeometry *geometry = nullptr; |
| 41 | QSSGRenderPath meshPath; |
| 42 | QSSGRenderSkeleton *skeleton = nullptr; |
| 43 | QSSGRenderSkin *skin = nullptr; |
| 44 | QVector<QMatrix4x4> inverseBindPoses; |
| 45 | float m_depthBiasSq = 0.0f; // Depth bias is expected to be squared! |
| 46 | bool castsShadows = true; |
| 47 | bool receivesShadows = true; |
| 48 | float instancingLodMin = -1; |
| 49 | float instancingLodMax = -1; |
| 50 | |
| 51 | QSSGRenderInstanceTable *instanceTable = nullptr; |
| 52 | int instanceCount() const { return instanceTable ? instanceTable->count() : 0; } |
| 53 | bool instancing() const { return instanceTable;} |
| 54 | |
| 55 | QSSGParticleBuffer *particleBuffer = nullptr; |
| 56 | QMatrix4x4 particleMatrix; |
| 57 | bool hasTransparency = false; |
| 58 | |
| 59 | QVector<float> morphWeights; |
| 60 | QVector<quint32> morphAttributes; |
| 61 | |
| 62 | bool receivesReflections = false; |
| 63 | bool castsReflections = true; |
| 64 | bool usedInBakedLighting = false; |
| 65 | QString lightmapKey; |
| 66 | QString lightmapLoadPath; |
| 67 | uint lightmapBaseResolution = 0; |
| 68 | bool hasLightmap() const { return !lightmapKey.isEmpty(); } |
| 69 | bool usesBoneTexture() const { return ((skin != nullptr) || (skeleton != nullptr)); } |
| 70 | |
| 71 | float levelOfDetailBias = 1.0f; // values < 1.0 will decrease usage of LODs, values > 1.0 will increase usage of LODs |
| 72 | |
| 73 | QSSGRenderModel(); |
| 74 | }; |
| 75 | QT_END_NAMESPACE |
| 76 | |
| 77 | #endif |
| 78 | |