6#ifndef QSSG_RHI_PARTICLES_H
7#define QSSG_RHI_PARTICLES_H
20#include <QtQuick3DRuntimeRender/qtquick3druntimerenderglobal.h>
21#include <QtQuick3DRuntimeRender/private/qssgrenderableobjects_p.h>
22#include <QtQuick3DRuntimeRender/private/qssgrenderparticles_p.h>
23#include <QtGui/QMatrix4x4>
24#include <QtGui/QMatrix3x3>
29struct QSSGRenderableImage;
30struct QSSGRenderLayer;
31struct QSSGRenderLight;
32class QSSGRenderCamera;
39 static void updateUniformsForParticles(
const QSSGLayerRenderData &inData, QSSGRhiShaderPipeline &shaderPipeline,
40 QSSGRhiContext *rhiCtx,
42 QSSGParticlesRenderable &renderable,
43 const QSSGRenderCameraList &cameras);
44 static void updateUniformsForParticleModel(QSSGRhiShaderPipeline &shaderPipeline,
46 const QSSGRenderModel *model, quint32 offset);
48 static QSSGRhiShaderPipelinePtr getShaderPipelineParticles(QSSGRenderer &renderer,
49 QSSGParticlesRenderable &inRenderable,
50 const QSSGShaderFeatures &inFeatureSet);
52 static QSSGRhiShaderPipelinePtr generateRhiShaderPipeline(QSSGRenderer &renderer,
53 QSSGParticlesRenderable &inRenderable,
54 const QSSGShaderFeatures &inFeatureSet,
55 QByteArray &shaderString,
56 const QSSGShaderParticleMaterialKeyProperties &shaderKeyProperties);
58 static void rhiPrepareRenderable(QSSGRhiShaderPipeline &shaderPipeline, QSSGPassKey passKey,
59 QSSGRhiContext *rhiCtx,
60 QSSGRhiGraphicsPipelineState *ps,
61 QSSGParticlesRenderable &renderable,
62 const QSSGLayerRenderData &inData,
63 QRhiRenderPassDescriptor *renderPassDescriptor,
66 QSSGRenderCamera *alteredCamera =
nullptr,
67 QSSGRenderTextureCubeFace cubeFace = QSSGRenderTextureCubeFaceNone,
68 QSSGReflectionMapEntry *entry =
nullptr,
70 static void rhiRenderRenderable(QSSGRhiContext *rhiCtx,
71 QSSGParticlesRenderable &renderable,
72 bool *needsSetViewport,
73 QSSGRenderTextureCubeFace cubeFace,
74 const QSSGRhiGraphicsPipelineState &state);
75 static void prepareParticlesForModel(QSSGRhiShaderPipeline &shaderPipeline,
76 QSSGRhiContext *rhiCtx,
77 QSSGRhiShaderResourceBindingList &bindings,
78 const QSSGRenderModel *model);
79 static QSSGShaderFeatures particleShaderFeatures(
const QSSGShaderFeatures& features);
80 static void setShaderCacheEnabled(
bool enabled);
QSSGRhiShaderPipelinePtr debugObjectShader
QSSGRhiGraphicsPipelineState ps
void renderPass(QSSGRenderer &renderer) final
Type passType() const final
void renderPrep(QSSGRenderer &renderer, QSSGLayerRenderData &data) final
void resetForFrame() final
void renderPass(QSSGRenderer &renderer) final
QSSGRhiGraphicsPipelineState ps
void renderPrep(QSSGRenderer &renderer, QSSGLayerRenderData &data) final
QSSGRhiShaderPipelinePtr gridShader
void resetForFrame() final
Type passType() const final
Type passType() const final
std::vector< QSGRenderer * > prepdItem2DRenderers
void renderPrep(QSSGRenderer &renderer, QSSGLayerRenderData &data) final
void renderPass(QSSGRenderer &renderer) final
void resetForFrame() final
static constexpr int MaxBuckets
QSSGRhiGraphicsPipelineState ps
QSSGRenderMotionVectorMapPtr motionVectorMapManager
QSSGRenderableObjectList motionVectorPassObjects[MaxBuckets]
Type passType() const final
QSSGRhiRenderableTexture * rhiMotionVectorTexture
QSSGRenderCamera * camera
void renderPrep(QSSGRenderer &renderer, QSSGLayerRenderData &data) final
void renderPass(QSSGRenderer &renderer) final
void resetForFrame() final
QSSGShaderFeatures shaderFeatures
void renderPrep(QSSGRenderer &renderer, QSSGLayerRenderData &data) final
QRhiShaderResourceBindings * compositeSrb
QSSGRhiShaderPipelinePtr compositeShaderPipeline
QSSGRenderLayer::OITMethod method
void resetForFrame() final
Type passType() const final
void renderPass(QSSGRenderer &renderer) final
QSSGRhiGraphicsPipelineState ps
void setMethod(QSSGRenderLayer::OITMethod m)
void setMethod(QSSGRenderLayer::OITMethod m)
quint32 reportedNodeCount
QSSGShaderFeatures shaderFeatures
QSSGRenderLayer::OITMethod method
QRhiShaderResourceBindings * clearSrb
QSSGRenderableObjectList sortedTransparentObjects
QSSGRhiRenderableTexture * rhiCounterImage
QRhiTextureRenderTarget * renderTarget
void resetForFrame() final
QSSGRhiShaderPipelinePtr clearPipeline
void renderPrep(QSSGRenderer &renderer, QSSGLayerRenderData &data) final
QSSGRhiRenderableTexture * rhiDepthTexture
QSSGRhiGraphicsPipelineState ps
QRhiTexture * readbackImage
bool linkedListRequiresResize(QSize dim)
Type passType() const final
void renderPass(QSSGRenderer &renderer) final
QSSGOITRenderContext * oitRenderContext
QRhiBuffer * rhiCounterBuffer
void renderPrep(QSSGRenderer &renderer, QSSGLayerRenderData &data) final
void resetForFrame() final
Type passType() const final
void renderPass(QSSGRenderer &renderer) final
QSSGShaderFeatures shaderFeatures
QSSGRhiGraphicsPipelineState ps
static void render(const QSSGRenderContextInterface &ctx, const QSSGRhiGraphicsPipelineState &ps, const QSSGRenderableObjectList &sortedOpaqueObjects)
QSSGRenderableObjectList sortedOpaqueObjects
QRect viewport() const
Returns the viewport rectangle.
void drawLine(const QVector3D &startPoint, const QVector3D &endPoint, const QColor &color, bool isPersistent=false)
void recordRenderDebugObjects(QSSGRhiContext *rhiCtx, QSSGRhiGraphicsPipelineState *ps, QRhiShaderResourceBindings *srb, QRhiRenderPassDescriptor *rpDesc)
void drawPoint(const QVector3D &vertex, const QColor &color, bool isPersistent=false)
void prepareGeometry(QSSGRhiContext *rhiCtx, QRhiResourceUpdateBatch *rub)
void drawBounds(const QSSGBounds3 &bounds, const QColor &color, bool isPersistent=false)
InstanceTransforms getInstanceTransforms(QSSGRenderNodeHandle h) const
float getGlobalOpacity(const QSSGRenderNode &node) const
LayerNodeView getLayerNodeView(const QSSGRenderLayer &layer) const
float getGlobalOpacity(QSSGRenderNodeHandle h, float defaultValue=1.0f) const
void bumpStateGeneration()
InstanceTransformStore instanceTransforms
size_t storageSize() const
GlobalOpacityStore globalOpacities
QMatrix4x4 getGlobalTransform(QSSGRenderNodeHandle h) const
QMatrix4x4 getGlobalTransform(const QSSGRenderNode &node) const
LayerNodeView getLayerNodeView(QSSGRenderLayerHandle h) const
QMatrix4x4 getGlobalTransform(QSSGRenderNodeHandle h, const QMatrix4x4 &defaultValue) const
VersionType stateGeneration() const
InstanceTransforms getInstanceTransforms(const QSSGRenderNode &node) const
VersionType version() const
GlobalTransformStore globalTransforms
NormalMatrixStore normalMatrices
LayerNodeViewStore layerNodes
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
QSSGRenderMvpArray modelViewProjections
const QMatrix4x4 globalTransform
const QMatrix3x3 normalMatrix
QSSGDataRef< QSSGSubsetRenderable > subsets
friend class QSSGLayerRenderData
friend class QSSGRenderer
friend class QQuick3DWindowAttachment
static GlobalStateResult updateGlobalNodeState(QSSGRenderNode *node, const VersionType version)
updateGlobalNodeState
static bool calcInstanceTransforms(QSSGRenderNode *node, const VersionType version, QSSGGlobalRenderNodeData::GlobalTransformStore &globalTransforms, QSSGGlobalRenderNodeData::InstanceTransformStore &instanceTransforms)
calcInstanceTransforms
void releaseRenderData(const QSSGRenderItem2D &item)
void updateItem2DData(QSSGItem2DsView &items, QSSGRenderer *renderer, const QSSGRenderCameraDataList &renderCameraData)
Item2DRenderer getItem2DRenderer(const QSSGRenderItem2D &item) const
const QSSGGlobalRenderNodeDataPtr & globalNodeData() const
ModelViewProjections getModelViewProjection(const QSSGRenderItem2D &item) const
ModelViewProjections getModelViewProjection(QSSGRenderNodeHandle h) const
ModelViewProjections getModelViewProjection(QSSGRenderNodeHandle h) const
void updateModelData(QSSGModelsView &models, QSSGRenderer *renderer, const QSSGRenderCameraDataList &renderCameraData)
QMatrix3x3 getNormalMatrix(const QSSGRenderModel &model) const
const QSSGGlobalRenderNodeDataPtr & globalNodeData() const
QSSGRenderMesh * getMesh(const QSSGRenderModel &model) const
ModelViewProjections getModelViewProjection(const QSSGRenderModel &model) const
MaterialList getMaterials(const QSSGRenderModel &model) const
QMatrix3x3 getNormalMatrix(QSSGRenderNodeHandle h, QMatrix3x3 defaultValue) const
virtual ~QSSGRenderPass()
virtual void resetForFrame()=0
virtual Type passType() const =0
virtual void renderPrep(QSSGRenderer &renderer, QSSGLayerRenderData &data)=0
virtual void renderPass(QSSGRenderer &renderer)=0
const QSSGBounds3 & bounds
QSSGRenderableObjectFlags renderableFlags
QSSGBounds3 globalBoundsInstancing
QSSGDepthDrawMode depthWriteMode
QSSGRenderableObject(Type ty, QSSGRenderableObjectFlags inFlags, const QVector3D &inWorldCenterPt, const QSSGBounds3 &inBounds, float inDepthBias, float inMinThreshold=-1, float inMaxThreshold=-1)
QVector3D worldCenterPoint
friend class QSSGParticleRenderer
void releaseItem2DData(const QSSGRenderItem2D &item2D)
const std::unique_ptr< QSSGRhiQuadRenderer > & rhiQuadRenderer() const
quint32 frameDepth() const
friend class QSSGRenderContextInterface
QRect scissorRect() const
void cleanupResources(QSet< QSSGRenderGraphObject * > &resources)
void setViewport(QRect inViewport)
void beginSubLayerRender(QSSGLayerRenderData &inLayer)
const std::unique_ptr< QSSGRhiCubeRenderer > & rhiCubeRenderer() const
void setScissorRect(QRect inScissorRect)
void endSubLayerRender(QSSGLayerRenderData &inLayer)
QSSGRenderContextInterface * contextInterface() const
void renderPrep(QSSGRenderer &renderer, QSSGLayerRenderData &data) final
void renderPass(QSSGRenderer &renderer) final
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 renderPrep(QSSGRenderer &renderer, QSSGLayerRenderData &data) final
void resetForFrame() final
QSSGRhiShaderPipelinePtr ssaoShaderPipeline
QSSGAmbientOcclusionSettings aoSettings
void renderPass(QSSGRenderer &renderer) final
const QSSGRenderCamera * camera
QSSGRhiGraphicsPipelineState ps
void renderPrep(QSSGRenderer &renderer, QSSGLayerRenderData &data) final
void renderPass(QSSGRenderer &renderer) final
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
void renderPass(QSSGRenderer &renderer) final
QSSGRhiGraphicsPipelineState ps
void renderPrep(QSSGRenderer &renderer, QSSGLayerRenderData &data) final
void resetForFrame() final
Type passType() const final
QSSGRenderCamera * camera
void renderPrep(QSSGRenderer &renderer, QSSGLayerRenderData &data) final
QSSGBounds3 castingObjectsBox
QSSGShaderLightList globalLights
QSSGRenderableObjectList shadowPassObjects
QSSGRhiGraphicsPipelineState ps
QSSGBounds3 receivingObjectsBox
void resetForFrame() final
std::unique_ptr< QSSGRenderCamera > debugCamera
Type passType() const final
void renderPass(QSSGRenderer &renderer) final
std::shared_ptr< QSSGRenderShadowMap > shadowMapManager
QSSGRhiRenderableTexture * offscreenTexture
QRhiShaderResourceBindings * backgroundSrb
void renderPrep(QSSGRenderer &renderer, QSSGLayerRenderData &data) final
void resetForFrame() final
Type passType() const final
QSSGRhiShaderPipelinePtr pipeline
QSSGRhiGraphicsPipelineState ps
void renderPass(QSSGRenderer &renderer) final
QRhiRenderPassDescriptor * rpDesc
void renderPass(QSSGRenderer &renderer) final
void renderPrep(QSSGRenderer &renderer, QSSGLayerRenderData &data) final
void resetForFrame() final
Type passType() const final
QRhiRenderPassDescriptor * rpDesc
void renderPass(QSSGRenderer &renderer) final
void renderPrep(QSSGRenderer &renderer, QSSGLayerRenderData &data) final
QSSGRhiShaderPipelinePtr skyBoxCubeShader
QSSGRhiGraphicsPipelineState ps
void resetForFrame() final
Type passType() const final
void renderPass(QSSGRenderer &renderer) final
void resetForFrame() final
QRhiRenderPassDescriptor * rpDesc
void renderPrep(QSSGRenderer &renderer, QSSGLayerRenderData &data) final
Type passType() const final
QSSGRhiGraphicsPipelineState ps
QSSGRenderableObjectList sortedTransparentObjects
static void render(const QSSGRenderContextInterface &ctx, const QSSGRhiGraphicsPipelineState &ps, const QSSGRenderableObjectList &sortedTransparentObjects)
void renderPass(QSSGRenderer &renderer) final
QSSGShaderFeatures shaderFeatures
QSSGRhiGraphicsPipelineState ps
void renderPrep(QSSGRenderer &renderer, QSSGLayerRenderData &data) final
void resetForFrame() final
Type passType() const final
void renderPrep(QSSGRenderer &renderer, QSSGLayerRenderData &data) final
void renderPass(QSSGRenderer &renderer) final
Type passType() const final
QList< QSSGRenderExtension * > extensions
void resetForFrame() final
void renderPrep(QSSGRenderer &renderer, QSSGLayerRenderData &data) final
void resetForFrame() final
void renderPass(QSSGRenderer &renderer) final
static constexpr size_t MAX_SUBPASS_DEPTH
QList< QSSGRenderUserPass * > userPasses
std::vector< UserPassData > userPassData
void preparePassImpl(QSSGRenderer &renderer, QSSGLayerRenderData &data, QSSGRenderUserPass *passNode, std::vector< UserPassData > &outData, QSSGRhiRenderableTextureV2Ptr renderableTexture)
Type passType() const final
void prepareSubPass(QSSGRenderer &renderer, QSSGLayerRenderData &data, QSSGRenderUserPass *subPassNode, std::vector< UserPassData > &subPassData, const QSSGRhiRenderableTextureV2Ptr &renderableTexture)
void prepareTopLevelPass(QSSGRenderer &renderer, QSSGLayerRenderData &data, QSSGRenderUserPass *passNode)
std::set< QSSGResourceId > visitedPasses
void resetForFrame() final
void renderPass(QSSGRenderer &renderer) final
QSSGRenderableObjectList renderedOpaqueDepthPrepassObjects
Type passType() const final
QSSGRhiGraphicsPipelineState ps
void renderPrep(QSSGRenderer &renderer, QSSGLayerRenderData &data) final
QSSGRenderableObjectList renderedDepthWriteObjects
QSSGRenderResult::Key toInternalRenderResultKey(QSSGFrameData::RenderResult id)
@ SkyMaterialBackgroundTexture
Combined button and popup list for selecting options.
qsizetype rhiPrepareOverrideMaterialUserPass(QSSGRhiContext *rhiCtx, QSSGPassKey passKey, const QSSGRhiGraphicsPipelineState &basePipelineState, QRhiRenderPassDescriptor *rpDesc, QSSGRenderGraphObject *overrideMaterial, QSSGLayerRenderData &inData, QSSGRenderableObjectList &inObjects, QSSGShaderFeatures featureSet)
void rhiRenderUserAugmentedPass(QSSGRhiContext *rhiCtx, QSSGRenderableObjectList &inObjects)
quint32 rhiCalculateABufferSize(int nodeCount)
void rhiRenderAoTexture(QSSGRhiContext *rhiCtx, QSSGPassKey passKey, QSSGRenderer &renderer, QSSGRhiShaderPipeline &shaderPipeline, QSSGRhiGraphicsPipelineState &ps, const QSSGAmbientOcclusionSettings &ao, const QSSGRhiRenderableTexture &rhiAoTexture, const QSSGRhiRenderableTexture &rhiDepthTexture, const QSSGRenderCamera &camera)
bool rhiPrepareNormalPass(QSSGRhiContext *rhiCtx, QSSGPassKey passKey, const QSSGRhiGraphicsPipelineState &basePipelineState, QRhiRenderPassDescriptor *rpDesc, QSSGLayerRenderData &inData, const QSSGRenderableObjectList &sortedOpaqueObjects)
bool rhiPrepareMotionVectorTexture(QSSGRhiContext *rhiCtx, const QSize &size, QSSGRhiRenderableTexture *renderableTex)
void rhiRenderReflectionMap(const QSSGRenderContextInterface &context, QSSGPassKey passKey, const QSSGLayerRenderData &inData, QSSGRhiGraphicsPipelineState *ps, QSSGRenderReflectionMap &reflectionMapManager, const std::vector< QSSGRenderReflectionProbe * > &reflectionProbes, const QSSGRenderableObjectList &reflectionPassObjects, QSSGRenderer &renderer)
void rhiRenderNormalPass(QSSGRhiContext *rhiCtx, const QSSGRhiGraphicsPipelineState &ps, const QSSGRenderableObjectList &sortedOpaqueObjects, bool *needsSetViewport)
Q_QUICK3DRUNTIMERENDER_EXPORT void rhiRenderRenderable(QSSGRhiContext *rhiCtx, const QSSGRhiGraphicsPipelineState &state, QSSGRenderableObject &object, bool *needsSetViewport, QSSGRenderTextureCubeFace cubeFace=QSSGRenderTextureCubeFaceNone, qsizetype userPassIndex=-1)
qsizetype rhiPrepareAugmentedUserPass(QSSGRhiContext *rhiCtx, QSSGPassKey passKey, const QSSGRhiGraphicsPipelineState &basePipelineState, QRhiRenderPassDescriptor *rpDesc, const QSSGUserShaderAugmentation &shaderAugmentation, const QSSGLayerRenderData &inData, QSSGRenderableObjectList &inObjects, QSSGShaderFeatures featureSet)
bool rhiPrepareDepthPass(QSSGRhiContext *rhiCtx, QSSGPassKey passKey, const QSSGRhiGraphicsPipelineState &basePipelineState, QRhiRenderPassDescriptor *rpDesc, QSSGLayerRenderData &inData, const QSSGRenderableObjectList &sortedOpaqueObjects, const QSSGRenderableObjectList &sortedTransparentObjects, int samples, int viewCount)
qsizetype rhiPrepareOriginalMaterialUserPass(QSSGRhiContext *rhiCtx, QSSGPassKey passKey, const QSSGRhiGraphicsPipelineState &basePipelineState, QRhiRenderPassDescriptor *rpDesc, const QSSGLayerRenderData &inData, QSSGRenderableObjectList &inObjects, QSSGShaderFeatures featureSet)
bool rhiPrepareScreenTexture(QSSGRhiContext *rhiCtx, const QSize &size, bool wantsMips, QSSGRhiRenderableTexture *renderableTex, quint8 viewCount)
QRect correctViewportCoordinates(const QRectF &layerViewport, const QRect &deviceRect)
void addAccumulatorImageBindings(QSSGRhiShaderPipeline *shaderPipeline, QSSGRhiShaderResourceBindingList &bindings)
bool rhiPrepareDepthTexture(QSSGRhiContext *rhiCtx, const QSize &size, QSSGRhiRenderableTexture *renderableTex, quint8 viewCount, int samples=1)
void rhiRenderMotionVector(QSSGRhiContext *rhiCtx, const QSSGRhiGraphicsPipelineState &state, const QSSGRenderableObjectList *motionVectorPassObjects, int bucketsCount)
bool rhiPrepareAoTexture(QSSGRhiContext *rhiCtx, const QSize &size, QSSGRhiRenderableTexture *renderableTex, quint8 viewCount)
quint32 rhiCalculateABufferSize(const QSize &size, int levels)
void rhiRenderDepthPass(QSSGRhiContext *rhiCtx, const QSSGRhiGraphicsPipelineState &ps, const QSSGRenderableObjectList &sortedOpaqueObjects, const QSSGRenderableObjectList &sortedTransparentObjects, bool *needsSetViewport)
void addDebugFrustum(const QSSGBoxPoints &frustumPoints, const QColor &color, QSSGDebugDrawSystem *debugDrawSystem)
void addDebugBox(const QSSGBoxPoints &boxUnsorted, const QColor &color, QSSGDebugDrawSystem *debugDrawSystem)
void addDirectionalLightDebugBox(const QSSGBoxPoints &box, QSSGDebugDrawSystem *debugDrawSystem)
QSSGLayerRenderPreparationResultFlag
@ RequiresSkyMaterialPass
@ RequiresMotionVectorPass
@ MaterialHasCustomBlendMode
@ RequiresMipmapsForScreenTexture
Q_DECLARE_TYPEINFO(QSSGRenderableObjectHandle, Q_PRIMITIVE_TYPE)
@ HasAttributeTexCoordLightmap
@ HasAttributeMorphTarget
@ HasAttributeJointAndWeight
@ IsMotionVectorParticipant
QVarLengthArray< QSSGShaderLight, 16 > QSSGShaderLightList
static void setupCubeShadowCameras(const QSSGLayerRenderData &inData, const QSSGRenderLight *inLight, float shadowMapFar, QSSGRenderCamera inCameras[6])
static void updateUniformsForDefaultMaterial(QSSGRhiShaderPipeline &shaderPipeline, QSSGRhiContext *rhiCtx, const QSSGLayerRenderData &inData, char *ubufData, QSSGRhiGraphicsPipelineState *ps, QSSGSubsetRenderable &subsetRenderable, const QSSGRenderCameraList &cameras, const QVector2D *depthAdjust, const QMatrix4x4 *alteredModelViewProjection, const QSSGRenderGraphObject *materialOverride=nullptr)
static QSSGRhiShaderPipelinePtr shadersForParticleMaterial(QSSGRhiGraphicsPipelineState *ps, QSSGParticlesRenderable &particleRenderable, const QSSGShaderFeatures &featureSet)
static QSSGRhiShaderPipelinePtr shadersForDefaultMaterial(QSSGRhiGraphicsPipelineState *ps, QSSGSubsetRenderable &subsetRenderable, const QSSGShaderFeatures &featureSet, const QSSGUserShaderAugmentation &shaderAugmentation={})
static std::unique_ptr< QSSGRenderCamera > computeShadowCameraFromFrustum(const QMatrix4x4 &lightMatrix, const QMatrix4x4 &lightMatrixInverted, const QVector3D &lightPivot, const QVector3D &lightForward, const QVector3D &lightUp, const float shadowMapResolution, const float pcfRadius, const QSSGBoxPoints &frustumPoints, float frustumStartT, float frustumEndT, float frustumRadius, bool lockShadowmapTexels, const QSSGBounds3 &castingBox, const QSSGBounds3 &receivingBox, QSSGDebugDrawSystem *debugDrawSystem, const bool drawCascades, const bool drawSceneCascadeIntersection)
static QRhiViewport calculateAtlasViewport(QSize atlasPixelSize, const QSSGShadowMapEntry::AtlasEntry &atlasEntry, bool yIsUp)
static QSSGBoxPoints sliceFrustum(const QSSGBoxPoints &frustumPoints, float t0, float t1)
static void rhiPrepareSkyBox_helper(const QSSGRenderContextInterface &context, QSSGPassKey passKey, QSSGRenderLayer &layer, QSSGRenderCameraList &cameras, QSSGRenderer &renderer, QSSGReflectionMapEntry *entry=nullptr, QSSGRenderTextureCubeFace cubeFace=QSSGRenderTextureCubeFaceNone, uint tonemapMode=0)
static QT_BEGIN_NAMESPACE constexpr float QSSG_PI
static void rhiPrepareResourcesForReflectionMap(const QSSGRenderContextInterface &context, QSSGPassKey passKey, const QSSGLayerRenderData &inData, QSSGReflectionMapEntry *pEntry, QSSGRhiGraphicsPipelineState *ps, const QSSGRenderableObjectList &sortedOpaqueObjects, QSSGRenderCamera &inCamera, QSSGRenderer &renderer, QSSGRenderTextureCubeFace cubeFace)
static void rhiPrepareResourcesForShadowMap(QSSGRhiContext *rhiCtx, const QSSGLayerRenderData &inData, QSSGPassKey passKey, QSSGShadowMapEntry *pEntry, QSSGRhiGraphicsPipelineState *ps, const QVector2D *depthAdjust, const QSSGRenderableObjectList &sortedOpaqueObjects, QSSGRenderCamera &inCamera, bool orthographic, QSSGRenderTextureCubeFace cubeFace, quint32 cascadeIndex)
static void addOpaqueDepthPrePassBindings(QSSGRhiContext *rhiCtx, QSSGRhiShaderPipeline *shaderPipeline, QSSGRenderableImage *renderableImage, QSSGRhiShaderResourceBindingList &bindings, bool isCustomMaterialMeshSubset=false)
static QSSGBoxPoints computeFrustumBounds(const QMatrix4x4 &projection)
static void addNormalTextureBindings(QSSGRhiContext *rhiCtx, QSSGRhiShaderPipeline *shaderPipeline, QSSGRhiShaderResourceBindingList &bindings)
static const QRhiShaderResourceBinding::StageFlags RENDERER_VISIBILITY_ALL
static QRhiShaderResourceBindings * drawCallDataSrb(QSSGRhiContextPrivate *rhiCtxD, QSSGRhiDrawCallData &dcd, const QSSGRhiShaderResourceBindingList &bindings)
static constexpr float QSSG_HALFPI
void rhiPrepareRenderableImp(QSSGRhiContext *rhiCtx, QSSGPassKey passKey, const QSSGLayerRenderData &inData, QSSGRenderableObject &inObject, QRhiRenderPassDescriptor *renderPassDescriptor, QSSGRhiGraphicsPipelineState *ps, QSSGShaderFeatures featureSet, int samples, int viewCount, bool screenMapPass, QSSGRenderCamera *alteredCamera, QMatrix4x4 *alteredModelViewProjection, QSSGRenderTextureCubeFace cubeFace, QSSGReflectionMapEntry *entry, bool oit)
static int setupInstancing(QSSGSubsetRenderable *renderable, QSSGRhiGraphicsPipelineState *ps, QSSGRhiContext *rhiCtx, const QVector3D &cameraDirection, const QVector3D &cameraPosition)
static void setupCubeReflectionCameras(const QSSGLayerRenderData &inData, const QSSGRenderReflectionProbe *inProbe, QSSGRenderCamera inCameras[6])
static void fillTargetBlend(QRhiGraphicsPipeline::TargetBlend *targetBlend, QSSGRenderDefaultMaterial::MaterialBlendMode materialBlend)
static void addDepthTextureBindings(QSSGRhiContext *rhiCtx, QSSGRhiShaderPipeline *shaderPipeline, QSSGRhiShaderResourceBindingList &bindings, QBitArray *specifiedBindings=nullptr)
static QVarLengthArray< std::unique_ptr< QSSGRenderCamera >, 4 > setupCascadingCamerasForShadowMap(const QSSGLayerRenderData &data, const QSSGRenderCamera &inCamera, const QSSGRenderLight *inLight, const int shadowMapResolution, const float pcfRadius, const float clipNear, const float clipFar, const QSSGBounds3 &castingObjectsBox, const QSSGBounds3 &receivingObjectsBox, bool lockShadowmapTexels, QSSGDebugDrawSystem *debugDrawSystem, bool drawCascades, bool drawSceneCascadeIntersection)
QSqlQueryModel * model
[16]
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
QRhiReadbackResult * pendingResult
QRhiBuffer * counterBuffer
QList< QRhiReadbackResult * > completedResults
QRhiTextureRenderTarget * oitRenderTarget
QRhiResourceUpdateBatch * rub
QRhiTexture * copyTexture
QRhiRenderPassDescriptor * renderPassDescriptor
QMatrix4x4 viewProjection
std::optional< QSSGClippingFrustum > clippingFrustum
QVector< QSSGRenderGraphObject * > materials
QMatrix4x4 globalTransform
QSSGShaderLightListView lights
QSSGRenderableNodeEntry()=default
void setPointsTopology(bool v)
bool hasAttributeTexCoordLightmap() const
void setRendersWithLightmap(bool inRendersWithLightmap)
void setHasAttributeTexCoord1(bool b)
void setHasAttributePosition(bool b)
void setCompletelyTransparent(bool inTransparent)
bool receivesReflections() const
void setHasAttributeJointAndWeight(bool b)
bool hasAttributePosition() const
bool hasTransparency() const
void setHasAttributeNormal(bool b)
void setHasAttributeColor(bool b)
bool hasAttributeNormal() const
void setHasAttributeTangent(bool b)
bool receivesShadows() const
void setHasAttributeMorphTarget(bool b)
bool isCompletelyTransparent() const
void setMotionVectorParticipant(bool v)
bool requiresNormalTexture() const
void setHasAttributeTexCoordLightmap(bool b)
void setHasAttributeTexCoord0(bool b)
bool hasAttributeBinormal() const
void setCastsReflections(bool inCastsReflections)
bool hasAttributeMorphTarget() const
void setCastsShadows(bool inCastsShadows)
bool hasAttributeJointAndWeight() const
bool requiresScreenTexture() const
bool castsReflections() const
bool usedInBakedLighting() const
bool hasAttributeColor() const
void setReceivesReflections(bool inReceivesReflections)
void setUsedInBakedLighting(bool inUsedInBakedLighting)
bool hasAttributeTangent() const
void setRequiresScreenTexture(bool v)
bool castsShadows() const
bool hasAttributeTexCoord1() const
bool hasAttributeTexCoord0() const
bool isPointsTopology() const
void setHasTransparency(bool inHasTransparency)
bool rendersWithLightmap() const
void setHasAttributeBinormal(bool b)
void setRequiresNormalTexture(bool v)
bool isMotionVectorParticipant() const
void setDirty(bool inDirty)
void setReceivesShadows(bool inReceivesShadows)
QSSGRenderableObjectHandle(QSSGRenderableObject *o, float camDistSq, QSSGRenderNodeTag tag)
QSSGRenderableObject * obj
QSSGRenderableObjectHandle()=default
bool operator<(const QSSGShaderLight &o) const
QVector3D probeCubeMapCenter
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