Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qssgrenderreflectionmap_p.h
Go to the documentation of this file.
1// Copyright (C) 2021 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#ifndef QSSG_RENDER_REFLECTION_MAP_H
5#define QSSG_RENDER_REFLECTION_MAP_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtQuick3DRuntimeRender/private/qtquick3druntimerenderglobal_p.h>
19#include <QtQuick3DRuntimeRender/private/qssgrenderreflectionprobe_p.h>
20
22
23class QRhi;
25class QSSGRhiContext;
27
31class QRhiTexture;
34class QRhiBuffer;
35
37{
39
41 QRhiTexture *preFiltered);
44 QRhiTexture *prefiltered,
45 QRhiRenderBuffer *depthStencil);
46
47 void renderMips(QSSGRhiContext *rhiCtx);
49
51
52 // RHI resources
56 QVarLengthArray<QRhiTextureRenderTarget *, 6> m_rhiRenderTargets;
58
66 QMap<int, QVarLengthArray<QRhiTextureRenderTarget *, 6>> m_rhiPrefilterRenderTargetsMap;
68 QMap<int, QSize> m_prefilterMipLevelSizes;
69
70 QVarLengthArray<QRhiShaderResourceBindings *, 6> m_skyBoxSrbs;
71
73
74 bool m_needsRender = false;
75 bool m_rendered = false;
76
81};
82
83class Q_QUICK3DRUNTIMERENDER_EXPORT QSSGRenderReflectionMap
84{
85 typedef QVector<QSSGReflectionMapEntry> TReflectionMapEntryList;
86 Q_DISABLE_COPY(QSSGRenderReflectionMap)
87
88public:
90
91 explicit QSSGRenderReflectionMap(const QSSGRenderContextInterface &inContext);
93 void releaseCachedResources();
94
95 void addReflectionMapEntry(qint32 probeIdx, const QSSGRenderReflectionProbe &probe);
96 void addTexturedReflectionMapEntry(qint32 probeIdx, const QSSGRenderReflectionProbe &probe);
97
98 QSSGReflectionMapEntry *reflectionMapEntry(int probeIdx);
99
100 qint32 reflectionMapEntryCount() { return m_reflectionMapList.size(); }
101
102private:
103 TReflectionMapEntryList m_reflectionMapList;
104};
105
106using QSSGRenderReflectionMapPtr = std::shared_ptr<QSSGRenderReflectionMap>;
107
109
110#endif
The QMatrix4x4 class represents a 4x4 transformation matrix in 3D space.
Definition qmatrix4x4.h:25
\inmodule QtGui
Definition qrhi.h:846
\inmodule QtGui
Definition qrhi.h:1651
\inmodule QtGui
Definition qrhi.h:1270
\inmodule QtGui
Definition qrhi.h:1094
\inmodule QtGui
Definition qrhi.h:1142
\inmodule QtGui
Definition qrhi.h:1214
\inmodule QtGui
Definition qrhi.h:1184
\inmodule QtGui
Definition qrhi.h:895
\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h
Definition qrhi.h:1804
const QSSGRenderContextInterface & m_context
\inmodule QtQuick3D
Combined button and popup list for selecting options.
#define Q_QUICK3D_PROFILE_ID
static constexpr QSSGRenderTextureCubeFace QSSGRenderTextureCubeFaces[]
QSSGRenderTextureCubeFace
std::shared_ptr< QSSGRenderReflectionMap > QSSGRenderReflectionMapPtr
unsigned int quint32
Definition qtypes.h:50
int qint32
Definition qtypes.h:49
QJSValue cube
QVarLengthArray< QRhiTextureRenderTarget *, 6 > m_rhiRenderTargets
QSSGRenderReflectionProbe::ReflectionTimeSlicing m_timeSlicing
QVarLengthArray< QRhiShaderResourceBindings *, 6 > m_skyBoxSrbs
static QSSGReflectionMapEntry withRhiTexturedCubeMap(quint32 probeIdx, QRhiTexture *preFiltered)
QRhiRenderPassDescriptor * m_rhiRenderPassDesc
static QSSGReflectionMapEntry withRhiCubeMap(quint32 probeIdx, QRhiTexture *cube, QRhiTexture *prefiltered, QRhiRenderBuffer *depthStencil)
QRhiShaderResourceBindings * m_irradianceSrb
QRhiShaderResourceBindings * m_prefilterSrb
QMap< int, QSize > m_prefilterMipLevelSizes
QRhiRenderPassDescriptor * m_rhiPrefilterRenderPassDesc
QRhiGraphicsPipeline * m_irradiancePipeline
QRhiGraphicsPipeline * m_prefilterPipeline
QMap< int, QVarLengthArray< QRhiTextureRenderTarget *, 6 > > m_rhiPrefilterRenderTargetsMap
void renderMips(QSSGRhiContext *rhiCtx)
QSSGRenderTextureCubeFace m_timeSliceFace