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;
36struct QSSGRenderSkyMaterial;
38class QSSGRenderExtension;
39class QSSGRenderUserPass;
152 const QSSGRenderCamera *
camera =
nullptr;
159class Q_QUICK3DRUNTIMERENDER_EXPORT
DepthMapPass :
public QSSGRenderPass
162 void renderPrep(QSSGRenderer &renderer, QSSGLayerRenderData &data) final;
163 void renderPass(QSSGRenderer &renderer) final;
164 Type passType()
const final {
return Type::Standalone; }
165 void resetForFrame() final;
166 void setMultisamplingEnabled(
bool enabled) { m_multisampling = enabled; }
167 bool isMultisamplingEnabled()
const {
return m_multisampling; }
169 QSSGRenderableObjectList sortedOpaqueObjects;
170 QSSGRenderableObjectList sortedTransparentObjects;
171 QSSGRhiGraphicsPipelineState ps;
172 QSSGRhiRenderableTexture *rhiDepthTexture =
nullptr;
173 bool m_multisampling =
false;
176class Q_QUICK3DRUNTIMERENDER_EXPORT
NormalPass :
public QSSGRenderPass
179 void renderPrep(QSSGRenderer &renderer, QSSGLayerRenderData &data) final;
180 void renderPass(QSSGRenderer &renderer) final;
181 Type passType()
const final {
return Type::Standalone; }
182 void resetForFrame() final;
184 QSSGRenderableObjectList sortedOpaqueObjects;
185 QSSGRhiGraphicsPipelineState ps;
186 QSSGRhiRenderableTexture *normalTexture =
nullptr;
187 QSSGRhiRenderableTexture *depthBuffer =
nullptr;
277 QSSGRhiGraphicsPipelineState &ps,
278 QSSGShaderFeatures shaderFeatures,
279 QRhiRenderPassDescriptor *rpDesc,
280 const QSSGRenderableObjectList &sortedOpaqueObjects);
283 const QSSGRhiGraphicsPipelineState &ps,
284 const QSSGRenderableObjectList &sortedOpaqueObjects);
296struct QSSGCameraRenderData;
304 QSSGRhiGraphicsPipelineState &ps,
305 QSSGShaderFeatures shaderFeatures,
306 QRhiRenderPassDescriptor *rpDesc,
307 const QSSGRenderableObjectList &sortedTransparentObjects,
311 const QSSGRhiGraphicsPipelineState &ps,
312 const QSSGRenderableObjectList &sortedTransparentObjects);
370 bool hasData()
const {
return extensions.size() != 0; }
383 bool hasData()
const {
return (userPasses.size() != 0); }
406 visitedPasses.clear();
407 preparePassImpl(renderer, data, passNode, userPassData, {});
412 QSSGRenderUserPass *subPassNode,
413 std::vector<UserPassData> &subPassData,
414 const QSSGRhiRenderableTextureV2Ptr &renderableTexture)
416 Q_ASSERT(renderableTexture !=
nullptr);
417 preparePassImpl(renderer, data, subPassNode, subPassData, renderableTexture);
422 QSSGRenderUserPass *passNode,
423 std::vector<UserPassData> &outData,
424 QSSGRhiRenderableTextureV2Ptr renderableTexture);
437 void setMethod(QSSGRenderLayer::OITMethod m) { method = m; }
476 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
bool linkedListRequiresResize(QSize dim)
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
std::vector< QSSGRenderReflectionProbe * > reflectionProbes
QSSGRhiGraphicsPipelineState ps
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
QSSGRhiRenderableTexture * offscreenTexture
QRhiShaderResourceBindings * backgroundSrb
void resetForFrame() final
Type passType() const final
QSSGRhiShaderPipelinePtr pipeline
QSSGRhiGraphicsPipelineState ps
QRhiRenderPassDescriptor * rpDesc
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)
@ SkyMaterialBackgroundTexture
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