6#ifndef QSSGRENDERPASS_H
7#define QSSGRENDERPASS_H
20#include <QtCore/qglobal.h>
22#include <ssg/qssgrenderhelpers.h>
23#include <QtQuick3DUtils/private/qssgaosettings_p.h>
24#include <QtQuick3DRuntimeRender/private/qssgrhicontext_p.h>
25#include <QtQuick3DRuntimeRender/private/qssgrendershadercache_p.h>
26#include <QtQuick3DRuntimeRender/private/qssgrenderableobjects_p.h>
27#include <QtQuick3DRuntimeRender/private/qssgrendermotionvectormap_p.h>
32class QSSGRenderShadowMap;
33class QSSGRenderReflectionMap;
35class QSSGRenderCamera;
37class QSSGRenderExtension;
38class QSSGRenderUserPass;
151 const QSSGRenderCamera *
camera =
nullptr;
158class Q_QUICK3DRUNTIMERENDER_EXPORT
DepthMapPass :
public QSSGRenderPass
161 void renderPrep(QSSGRenderer &renderer, QSSGLayerRenderData &data) final;
162 void renderPass(QSSGRenderer &renderer) final;
163 Type passType()
const final {
return Type::Standalone; }
164 void resetForFrame() final;
165 void setMultisamplingEnabled(
bool enabled) { m_multisampling = enabled; }
166 bool isMultisamplingEnabled()
const {
return m_multisampling; }
168 QSSGRenderableObjectList sortedOpaqueObjects;
169 QSSGRenderableObjectList sortedTransparentObjects;
170 QSSGRhiGraphicsPipelineState ps;
171 QSSGRhiRenderableTexture *rhiDepthTexture =
nullptr;
172 bool m_multisampling =
false;
175class Q_QUICK3DRUNTIMERENDER_EXPORT
NormalPass :
public QSSGRenderPass
178 void renderPrep(QSSGRenderer &renderer, QSSGLayerRenderData &data) final;
179 void renderPass(QSSGRenderer &renderer) final;
180 Type passType()
const final {
return Type::Standalone; }
181 void resetForFrame() final;
183 QSSGRenderableObjectList sortedOpaqueObjects;
184 QSSGRhiGraphicsPipelineState ps;
185 QSSGRhiRenderableTexture *normalTexture =
nullptr;
186 QSSGRhiRenderableTexture *depthBuffer =
nullptr;
256 QSSGRhiGraphicsPipelineState &ps,
257 QSSGShaderFeatures shaderFeatures,
258 QRhiRenderPassDescriptor *rpDesc,
259 const QSSGRenderableObjectList &sortedOpaqueObjects);
262 const QSSGRhiGraphicsPipelineState &ps,
263 const QSSGRenderableObjectList &sortedOpaqueObjects);
275struct QSSGCameraRenderData;
283 QSSGRhiGraphicsPipelineState &ps,
284 QSSGShaderFeatures shaderFeatures,
285 QRhiRenderPassDescriptor *rpDesc,
286 const QSSGRenderableObjectList &sortedTransparentObjects,
290 const QSSGRhiGraphicsPipelineState &ps,
291 const QSSGRenderableObjectList &sortedTransparentObjects);
349 bool hasData()
const {
return extensions.size() != 0; }
362 bool hasData()
const {
return (userPasses.size() != 0); }
385 visitedPasses.clear();
386 preparePassImpl(renderer, data, passNode, userPassData, {});
391 QSSGRenderUserPass *subPassNode,
392 std::vector<UserPassData> &subPassData,
393 const QSSGRhiRenderableTextureV2Ptr &renderableTexture)
395 Q_ASSERT(renderableTexture !=
nullptr);
396 preparePassImpl(renderer, data, subPassNode, subPassData, renderableTexture);
401 QSSGRenderUserPass *passNode,
402 std::vector<UserPassData> &outData,
403 QSSGRhiRenderableTextureV2Ptr renderableTexture);
416 void setMethod(QSSGRenderLayer::OITMethod m) { method = m; }
454 void setMethod(QSSGRenderLayer::OITMethod m) { method = m; }
QSSGRhiShaderPipelinePtr debugObjectShader
QSSGRhiGraphicsPipelineState ps
Type passType() const final
void resetForFrame() final
QSSGRhiGraphicsPipelineState ps
QSSGRhiShaderPipelinePtr gridShader
void resetForFrame() final
Type passType() const final
Type passType() const final
std::vector< QSGRenderer * > prepdItem2DRenderers
void resetForFrame() final
static constexpr int MaxBuckets
QSSGRhiGraphicsPipelineState ps
QSSGRenderMotionVectorMapPtr motionVectorMapManager
QSSGRenderableObjectList motionVectorPassObjects[MaxBuckets]
Type passType() const final
QSSGRhiRenderableTexture * rhiMotionVectorTexture
QSSGRenderCamera * camera
void resetForFrame() final
QSSGShaderFeatures shaderFeatures
QSSGRhiRenderableTexture * rhiABufferImage
QSSGRhiRenderableTexture * rhiAccumTexture
QRhiShaderResourceBindings * compositeSrb
QSSGRhiShaderPipelinePtr compositeShaderPipeline
QRhiBuffer * rhiAuxBuffer
QSSGRhiRenderableTexture * rhiAuxiliaryImage
QSSGRenderLayer::OITMethod method
void resetForFrame() final
Type passType() const final
QSSGRhiRenderableTexture * rhiRevealageTexture
QSSGRhiGraphicsPipelineState ps
void setMethod(QSSGRenderLayer::OITMethod m)
QSSGRhiRenderableTexture * rhiRevealageTexture
QRhiResourceUpdateBatch * rub
void setMethod(QSSGRenderLayer::OITMethod m)
QSSGRhiRenderableTexture * rhiABufferImage
QList< QRhiReadbackResult * > results
quint32 reportedNodeCount
QSSGShaderFeatures shaderFeatures
QSSGRenderLayer::OITMethod method
QRhiShaderResourceBindings * clearSrb
QSSGRenderableObjectList sortedTransparentObjects
QSSGRhiRenderableTexture * rhiAuxiliaryImage
QSSGRhiRenderableTexture * rhiCounterImage
QRhiTextureRenderTarget * renderTarget
QRhiBuffer * rhiAuxBuffer
void resetForFrame() final
QSSGRhiShaderPipelinePtr clearPipeline
QSSGRhiRenderableTexture * rhiDepthTexture
QSSGRhiGraphicsPipelineState ps
QRhiTexture * readbackImage
Type passType() const final
QRhiBuffer * rhiCounterBuffer
QSSGRhiRenderableTexture * rhiAccumTexture
static void prep(const QSSGRenderContextInterface &ctx, QSSGLayerRenderData &data, QSSGPassKey passKey, QSSGRhiGraphicsPipelineState &ps, QSSGShaderFeatures shaderFeatures, QRhiRenderPassDescriptor *rpDesc, const QSSGRenderableObjectList &sortedOpaqueObjects)
void resetForFrame() final
Type passType() const final
QSSGShaderFeatures shaderFeatures
QSSGRhiGraphicsPipelineState ps
static void render(const QSSGRenderContextInterface &ctx, const QSSGRhiGraphicsPipelineState &ps, const QSSGRenderableObjectList &sortedOpaqueObjects)
QSSGRenderableObjectList sortedOpaqueObjects
bool isLayerVisible() const
QSSGLayerRenderPreparationResult(const QRectF &inViewport, QSSGRenderLayer &inLayer)
QSize textureDimensions() const
void setState(State state)
QRectF getViewport() const
QSSGRenderLayer * getLayer() const
const QSSGLayerRenderPreparationResultFlags & getFlags() const
QSSGLayerRenderPreparationResult()=default
friend class QSSGLayerRenderData
friend class QSSGRenderer
virtual ~QSSGRenderPass()
virtual void resetForFrame()=0
virtual Type passType() const =0
friend class QSSGRenderContextInterface
void resetForFrame() final
std::shared_ptr< QSSGRenderReflectionMap > reflectionMapManager
QSSGRenderableObjectList reflectionPassObjects
QSSGRhiGraphicsPipelineState ps
QList< QSSGRenderReflectionProbe * > reflectionProbes
Type passType() const final
Type passType() const final
QSSGRhiRenderableTexture * rhiAoTexture
const QSSGRhiRenderableTexture * rhiDepthTexture
void resetForFrame() final
QSSGRhiShaderPipelinePtr ssaoShaderPipeline
QSSGAmbientOcclusionSettings aoSettings
const QSSGRenderCamera * camera
QSSGRhiGraphicsPipelineState ps
void resetForFrame() final
QSSGRhiGraphicsPipelineState ps
Type passType() const final
std::optional< SkyboxPass > skyboxPass
QSSGShaderFeatures shaderFeatures
QSSGRenderableObjectList sortedOpaqueObjects
std::optional< SkyboxCubeMapPass > skyboxCubeMapPass
QSSGRhiRenderableTexture * rhiScreenTexture
QSSGRenderableObjectList sortedScreenTextureObjects
const QSSGRhiRenderableTexture * rhiScreenTexture
QSSGRhiGraphicsPipelineState ps
void resetForFrame() final
Type passType() const final
QSSGRenderCamera * camera
QSSGBounds3 castingObjectsBox
QSSGShaderLightList globalLights
QSSGRenderableObjectList shadowPassObjects
QSSGRhiGraphicsPipelineState ps
QSSGBounds3 receivingObjectsBox
void resetForFrame() final
std::unique_ptr< QSSGRenderCamera > debugCamera
Type passType() const final
std::shared_ptr< QSSGRenderShadowMap > shadowMapManager
void resetForFrame() final
Type passType() const final
QRhiRenderPassDescriptor * rpDesc
QSSGRhiShaderPipelinePtr skyBoxCubeShader
QSSGRhiGraphicsPipelineState ps
void resetForFrame() final
Type passType() const final
void resetForFrame() final
QRhiRenderPassDescriptor * rpDesc
Type passType() const final
QSSGRhiGraphicsPipelineState ps
static void prep(const QSSGRenderContextInterface &ctx, QSSGLayerRenderData &data, QSSGPassKey passKey, QSSGRhiGraphicsPipelineState &ps, QSSGShaderFeatures shaderFeatures, QRhiRenderPassDescriptor *rpDesc, const QSSGRenderableObjectList &sortedTransparentObjects, bool oit=false)
QSSGRenderableObjectList sortedTransparentObjects
static void render(const QSSGRenderContextInterface &ctx, const QSSGRhiGraphicsPipelineState &ps, const QSSGRenderableObjectList &sortedTransparentObjects)
QSSGShaderFeatures shaderFeatures
QSSGRhiGraphicsPipelineState ps
void resetForFrame() final
Type passType() const final
Type passType() const final
QList< QSSGRenderExtension * > extensions
void resetForFrame() final
void resetForFrame() final
static constexpr size_t MAX_SUBPASS_DEPTH
QList< QSSGRenderUserPass * > userPasses
std::vector< UserPassData > userPassData
Type passType() const final
std::set< QSSGResourceId > visitedPasses
void resetForFrame() final
QSSGRenderableObjectList renderedOpaqueDepthPrepassObjects
Type passType() const final
QSSGRhiGraphicsPipelineState ps
QSSGRenderableObjectList renderedDepthWriteObjects
QSSGRenderResult::Key toInternalRenderResultKey(QSSGFrameData::RenderResult id)
Combined button and popup list for selecting options.
QSSGLayerRenderPreparationResultFlag
@ RequiresSkyMaterialPass
@ RequiresMotionVectorPass
@ MaterialHasCustomBlendMode
@ RequiresMipmapsForScreenTexture
static const char * effect_fragment_main_with_tonemapping
static const char * effect_vertex_main_post
static const char * effect_vertex_main_pre
static const char * effect_vertex_main_position
static const char * effect_fragment_main
QVector< QSSGRenderableObjectHandle > renderables
QSSGBakedLightingModel(const QSSGRenderModel *model, const QVector< QSSGRenderableObjectHandle > &renderables)
const QSSGRenderModel * model
QSSGDefaultMaterialPreparationResult(QSSGShaderDefaultMaterialKey inMaterialKey)
QSSGRenderableImage * firstImage
QSSGRenderableObjectFlags renderableFlags
QSSGShaderDefaultMaterialKey materialKey
bool requiresDepthTextureMS() const
void setRequiresSsaoPass(bool inValue)
void setRequiresMotionVectorPass(bool inValue)
void setRequiresScreenTexture(bool inValue)
bool wasLayerDataDirty() const
void setRequiresDepthTextureMS(bool inValue)
bool requiresDepthTexture() const
void setLayerDataDirty(bool inValue)
void setWasDirty(bool inValue)
bool requiresMipmapsForScreenTexture() const
void setRequiresSkyMaterialPass(bool inValue)
bool requiresScreenTexture() const
bool hasCustomBlendMode() const
void setRequiresNormalTexture(bool inValue)
bool requiresMotionVectorPass() const
bool requiresShadowMapPass() const
void setRequiresMipmapsForScreenTexture(bool inValue)
void setRequiresDepthTexture(bool inValue)
bool requiresSsaoPass() const
void setRequiresShadowMapPass(bool inValue)
bool requiresSkyMaterialPass() const
void setHasCustomBlendMode(bool inValue)
bool requiresNormalTexture() const
QRhiBuffer * counterBuffer
QRhiTextureRenderTarget * oitRenderTarget
QRhiTexture * copyTexture
QRhiRenderPassDescriptor * renderPassDescriptor
QSSGRhiRenderableTextureV2Ptr renderableTexture
std::optional< SkyboxCubeMapPass > skyboxCubeMapPass
std::vector< UserPassData > subPassData
QSSGRhiGraphicsPipelineState ps
QSSGShaderDefineList shaderDefines
QRhiDepthStencilClearValue depthStencilClearValue
QSSGRenderableObjectList renderables
std::optional< SkyboxPass > skyboxPass
std::optional< Item2DPass > item2DPass