Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
RenderHelpers Namespace Reference

Functions

std::pair< QSSGBoxPoints, QSSGBoxPointscalculateSortedObjectBounds (const QVector< QSSGRenderableObjectHandle > &sortedOpaqueObjects, const QVector< QSSGRenderableObjectHandle > &sortedTransparentObjects)
 
void rhiRenderShadowMap (QSSGRhiContext *rhiCtx, QSSGPassKey passKey, QSSGRhiGraphicsPipelineState &ps, QSSGRenderShadowMap &shadowMapManager, const QSSGRenderCamera &camera, const QSSGShaderLightList &globalLights, const QVector< QSSGRenderableObjectHandle > &sortedOpaqueObjects, QSSGRenderer &renderer, const QSSGBoxPoints &castingObjectsBox, const QSSGBoxPoints &receivingObjectsBox)
 
void rhiRenderReflectionMap (QSSGRhiContext *rhiCtx, QSSGPassKey passKey, const QSSGLayerRenderData &inData, QSSGRhiGraphicsPipelineState *ps, QSSGRenderReflectionMap &reflectionMapManager, const QVector< QSSGRenderReflectionProbe * > &reflectionProbes, const QVector< QSSGRenderableObjectHandle > &reflectionPassObjects, QSSGRenderer &renderer)
 
bool rhiPrepareDepthPass (QSSGRhiContext *rhiCtx, QSSGPassKey passKey, const QSSGRhiGraphicsPipelineState &basePipelineState, QRhiRenderPassDescriptor *rpDesc, QSSGLayerRenderData &inData, const QVector< QSSGRenderableObjectHandle > &sortedOpaqueObjects, const QVector< QSSGRenderableObjectHandle > &sortedTransparentObjects, QSSGRhiDrawCallDataKey::Selector ubufSel, int samples)
 
void rhiRenderDepthPass (QSSGRhiContext *rhiCtx, const QSSGRhiGraphicsPipelineState &ps, const QVector< QSSGRenderableObjectHandle > &sortedOpaqueObjects, const QVector< QSSGRenderableObjectHandle > &sortedTransparentObjects, bool *needsSetViewport)
 
bool rhiPrepareAoTexture (QSSGRhiContext *rhiCtx, const QSize &size, QSSGRhiRenderableTexture *renderableTex)
 
void rhiRenderAoTexture (QSSGRhiContext *rhiCtx, QSSGPassKey passKey, QSSGRenderer &renderer, QSSGRhiShaderPipeline &shaderPipeline, QSSGRhiGraphicsPipelineState &ps, const SSAOMapPass::AmbientOcclusion &ao, const QSSGRhiRenderableTexture &rhiAoTexture, const QSSGRhiRenderableTexture &rhiDepthTexture, const QSSGRenderCamera &camera)
 
bool rhiPrepareScreenTexture (QSSGRhiContext *rhiCtx, const QSize &size, bool wantsMips, QSSGRhiRenderableTexture *renderableTex)
 
void rhiPrepareGrid (QSSGRhiContext *rhiCtx, QSSGRenderLayer &layer, QSSGRenderCamera &inCamera, QSSGRenderer &renderer)
 
void rhiPrepareSkyBox (QSSGRhiContext *rhiCtx, QSSGPassKey passKey, QSSGRenderLayer &layer, QSSGRenderCamera &inCamera, QSSGRenderer &renderer)
 
void rhiPrepareSkyBoxForReflectionMap (QSSGRhiContext *rhiCtx, QSSGPassKey passKey, QSSGRenderLayer &layer, QSSGRenderCamera &inCamera, QSSGRenderer &renderer, QSSGReflectionMapEntry *entry, int cubeFace)
 
Q_QUICK3DRUNTIMERENDER_EXPORT void rhiPrepareRenderable (QSSGRhiContext *rhiCtx, QSSGPassKey passKey, const QSSGLayerRenderData &inData, QSSGRenderableObject &inObject, QRhiRenderPassDescriptor *renderPassDescriptor, QSSGRhiGraphicsPipelineState *ps, QSSGShaderFeatures featureSet, int samples, QSSGRenderCamera *inCamera=nullptr, QMatrix4x4 *alteredModelViewProjection=nullptr, int cubeFace=-1, QSSGReflectionMapEntry *entry=nullptr)
 
Q_QUICK3DRUNTIMERENDER_EXPORT void rhiRenderRenderable (QSSGRhiContext *rhiCtx, const QSSGRhiGraphicsPipelineState &state, QSSGRenderableObject &object, bool *needsSetViewport, int cubeFace=-1)
 
bool rhiPrepareDepthTexture (QSSGRhiContext *rhiCtx, const QSize &size, QSSGRhiRenderableTexture *renderableTex)
 
QRect correctViewportCoordinates (const QRectF &layerViewport, const QRect &deviceRect)
 

Function Documentation

◆ calculateSortedObjectBounds()

std::pair< QSSGBoxPoints, QSSGBoxPoints > RenderHelpers::calculateSortedObjectBounds ( const QVector< QSSGRenderableObjectHandle > &  sortedOpaqueObjects,
const QVector< QSSGRenderableObjectHandle > &  sortedTransparentObjects 
)

Definition at line 682 of file qssgrenderer.cpp.

References QSSGBounds3::include(), and QSSGBounds3::toQSSGBoxPointsNoEmptyCheck().

+ Here is the call graph for this function:

◆ correctViewportCoordinates()

QRect RenderHelpers::correctViewportCoordinates ( const QRectF layerViewport,
const QRect deviceRect 
)
inline

Definition at line 304 of file qssgrenderer_p.h.

References QRect::bottom(), QRectF::bottom(), deviceRect, QRectF::height(), QRectF::width(), and QRectF::x().

+ Here is the call graph for this function:

◆ rhiPrepareAoTexture()

◆ rhiPrepareDepthPass()

bool RenderHelpers::rhiPrepareDepthPass ( QSSGRhiContext rhiCtx,
QSSGPassKey  passKey,
const QSSGRhiGraphicsPipelineState basePipelineState,
QRhiRenderPassDescriptor rpDesc,
QSSGLayerRenderData inData,
const QVector< QSSGRenderableObjectHandle > &  sortedOpaqueObjects,
const QVector< QSSGRenderableObjectHandle > &  sortedTransparentObjects,
QSSGRhiDrawCallDataKey::Selector  ubufSel,
int  samples 
)

Definition at line 2350 of file qssgrenderer.cpp.

References addDepthTextureBindings(), addOpaqueDepthPrePassBindings(), QSSGRhiShaderResourceBindingList::addUniformBuffer(), QRhiBuffer::beginFullDynamicBufferUpdateForCurrentFrame(), QSSGLayerRenderData::camera, QSSGLayerRenderData::cameraData, QSSGRenderer::contextInterface(), QSSGGraphicsPipelineStateKey::create(), QSSGRenderDefaultMaterial::cullMode, QSSGSubsetRenderable::customMaterial(), QSSGRenderContextInterface::customMaterialSystem(), QSSGSubsetRenderable::defaultMaterial(), QSSGShaderFeatures::DepthPass, QSSGSubsetRenderable::depthPrePass, QSSGRhiContext::drawCallData(), QRhiBuffer::endFullDynamicBufferUpdateForCurrentFrame(), QSSGSubsetRenderable::firstImage, QSSGRenderSubset::ia, QSSGRenderCustomMaterial::m_cullMode, QSSGSubsetRenderable::material, QSSGModelContext::model, QSSGSubsetRenderable::modelContext, QSSGShaderFeatures::OpaqueDepthPrePass, OpaquePrePass, QSSGRhiContext::pipeline(), QSSGSubsetRenderable::pipeline, QSSGSubsetRenderable::renderer, RENDERER_VISIBILITY_ALL, QSSGRenderSubset::rhi, QSSGSubsetRenderable::rhiRenderData, QSSGRhiGraphicsPipelineState::samples, QSSGShaderFeatures::set(), setupInstancing(), QSSGCustomMaterialSystem::shadersForCustomMaterial(), shadersForDefaultMaterial(), QSSGRhiContext::srb(), QSSGSubsetRenderable::srb, QSSGSubsetRenderable::subset, QSSGRhiGraphicsPipelineState::toCullMode(), QSSGRhiDrawCallData::ubuf, QSSGCustomMaterialSystem::updateUniformsForCustomMaterial(), and updateUniformsForDefaultMaterial().

+ Here is the call graph for this function:

◆ rhiPrepareDepthTexture()

◆ rhiPrepareGrid()

◆ rhiPrepareRenderable()

void RenderHelpers::rhiPrepareRenderable ( QSSGRhiContext rhiCtx,
QSSGPassKey  passKey,
const QSSGLayerRenderData inData,
QSSGRenderableObject inObject,
QRhiRenderPassDescriptor renderPassDescriptor,
QSSGRhiGraphicsPipelineState ps,
QSSGShaderFeatures  featureSet,
int  samples,
QSSGRenderCamera inCamera = nullptr,
QMatrix4x4 alteredModelViewProjection = nullptr,
int  cubeFace = -1,
QSSGReflectionMapEntry entry = nullptr 
)

Definition at line 1246 of file qssgrenderer.cpp.

References addDepthTextureBindings(), QSSGRhiShaderResourceBindingList::addTexture(), QSSGRhiShaderResourceBindingList::addUniformBuffer(), QSSGRhiInputAssemblerState::bakeVertexInputLocations(), QRhiBuffer::beginFullDynamicBufferUpdateForCurrentFrame(), QSSGRhiDrawCallData::bindings, QSSGRenderDefaultMaterial::blendMode, QSSGRhiShadowMapProperties::cachedBinding, camera, QSSGLayerRenderData::camera, QSSGLayerRenderData::cameraData, QSSGRhiContext::checkAndAdjustForNPoT(), QRhiSampler::ClampToEdge, QSSGRenderer::contextInterface(), QSSGGraphicsPipelineStateKey::create(), QSSGRenderDefaultMaterial::cullMode, QSSGRhiGraphicsPipelineState::cullMode, QSSGSubsetRenderable::customMaterial(), QSSGRenderContextInterface::customMaterialSystem(), QSSGSubsetRenderable::defaultMaterial(), QSSGRenderer::defaultMaterialShaderKeyProperties(), QSSGShaderFeatures::disableTonemapping(), QSSGRhiContext::drawCallData(), QRhiBuffer::endFullDynamicBufferUpdateForCurrentFrame(), QSSGGraphicsPipelineStateKey::extra, fillTargetBlend(), QSSGSubsetRenderable::firstImage, QRhiTexture::flags(), QRhiShaderResourceBinding::FragmentStage, QSSGLayerRenderData::getBonemapTexture(), QSSGRenderNode::getGlobalPos(), QSSGLayerRenderData::getReflectionMapManager(), QSSGMaterialShaderGenerator::getSamplerName(), QSSGRenderNode::getScalingCorrectDirection(), QSSGShaderKeyBoolean::getValue(), i, QSSGRenderSubset::ia, QSSGRhiGraphicsPipelineState::ia, QSSGShaderFeatures::isSet(), QSSGLayerRenderData::layer, QSSGShaderFeatures::Lightmap, LightmapTexture, QSSGRenderLayer::lightProbe, QSSGShaderFeatures::LightProbe, LightProbe, QRhiSampler::Linear, QSSGShaderDefaultMaterialKeyProperties::m_blendParticles, QSSGRenderImage::m_horizontalTilingMode, QSSGRenderableImage::m_imageNode, QSSGRenderImage::m_magFilterType, QSSGRenderableImage::m_mapType, QSSGRenderImage::m_minFilterType, QSSGRenderImage::m_mipFilterType, QSSGRenderableImage::m_nextImage, QSSGRenderableImage::m_texture, QSSGRenderImageTexture::m_texture, QSSGRenderImage::m_verticalTilingMode, QSSGRhiDrawCallDataKey::Main, QSSGSubsetRenderable::mainPass, QSSGSubsetRenderable::material, QRhiTexture::MipMapped, QSSGModelContext::model, QSSGSubsetRenderable::modelContext, QRhiSampler::Nearest, QRhiSampler::None, QSSGRenderSubset::offset, QSSGRhiDrawCallData::pipeline, QSSGRhiContext::pipeline(), QSSGSubsetRenderable::pipeline, QSSGParticleRenderer::prepareParticlesForModel(), QSSGRhiDrawCallData::ps, Q_ASSERT, qWarning, ReceivesReflections, QSSGSubsetRenderable::reflectionPass, QSSGShaderFeatures::ReflectionProbe, QSSGSubsetRenderable::reflectionProbeIndex, QSSGRenderableObject::renderableFlags, QSSGSubsetRenderable::renderer, RENDERER_VISIBILITY_ALL, QSSGRenderableObjectFlags::rendersWithLightmap(), QSSGGraphicsPipelineStateKey::renderTargetDescription, QSSGRhiDrawCallData::renderTargetDescription, QSSGGraphicsPipelineStateKey::renderTargetDescriptionHash, QSSGRhiDrawCallData::renderTargetDescriptionHash, QRhiSampler::Repeat, QSSGRenderSubset::rhi, QSSGCustomMaterialSystem::rhiPrepareRenderable(), QSSGParticleRenderer::rhiPrepareRenderable(), QSSGSubsetRenderable::rhiRenderData, QSSGRhiContext::sampler(), QSSGRhiGraphicsPipelineState::samples, ScreenTexture, QSSGShaderFeatures::set(), setupInstancing(), QSSGSubsetRenderable::shaderDescription, shadersForDefaultMaterial(), shadersForParticleMaterial(), QSSGRhiShadowMapProperties::shadowMapTexture, QSSGRhiShadowMapProperties::shadowMapTextureUniformName, QSSGRhiDrawCallData::srb, QSSGRhiContext::srb(), QSSGSubsetRenderable::srb, QSSGSubsetRenderable::subset, QSSGRhiGraphicsPipelineState::targetBlend, QSSGRenderSubset::targetsTexture, QFlags< Enum >::testFlag(), QSSGRhiGraphicsPipelineState::toCullMode(), toRhi(), QSSGRenderableObject::type, QSSGRhiDrawCallData::ubuf, updateUniformsForDefaultMaterial(), QSSGParticleRenderer::updateUniformsForParticleModel(), and QRhiShaderResourceBinding::VertexStage.

Referenced by QSSGRenderHelpers::rhiPrepareRenderable().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ rhiPrepareScreenTexture()

◆ rhiPrepareSkyBox()

void RenderHelpers::rhiPrepareSkyBox ( QSSGRhiContext rhiCtx,
QSSGPassKey  passKey,
QSSGRenderLayer layer,
QSSGRenderCamera inCamera,
QSSGRenderer renderer 
)

Definition at line 2320 of file qssgrenderer.cpp.

References cb, QSSGRhiContext::commandBuffer(), QByteArrayLiteral, and renderer.

+ Here is the call graph for this function:

◆ rhiPrepareSkyBoxForReflectionMap()

void RenderHelpers::rhiPrepareSkyBoxForReflectionMap ( QSSGRhiContext rhiCtx,
QSSGPassKey  passKey,
QSSGRenderLayer layer,
QSSGRenderCamera inCamera,
QSSGRenderer renderer,
QSSGReflectionMapEntry entry,
int  cubeFace 
)

Definition at line 2334 of file qssgrenderer.cpp.

References cb, QSSGRhiContext::commandBuffer(), QByteArrayLiteral, and renderer.

+ Here is the call graph for this function:

◆ rhiRenderAoTexture()

void RenderHelpers::rhiRenderAoTexture ( QSSGRhiContext rhiCtx,
QSSGPassKey  passKey,
QSSGRenderer renderer,
QSSGRhiShaderPipeline shaderPipeline,
QSSGRhiGraphicsPipelineState ps,
const SSAOMapPass::AmbientOcclusion ao,
const QSSGRhiRenderableTexture rhiAoTexture,
const QSSGRhiRenderableTexture rhiDepthTexture,
const QSSGRenderCamera camera 
)

◆ rhiRenderDepthPass()

◆ rhiRenderReflectionMap()

void RenderHelpers::rhiRenderReflectionMap ( QSSGRhiContext rhiCtx,
QSSGPassKey  passKey,
const QSSGLayerRenderData inData,
QSSGRhiGraphicsPipelineState ps,
QSSGRenderReflectionMap reflectionMapManager,
const QVector< QSSGRenderReflectionProbe * > &  reflectionProbes,
const QVector< QSSGRenderableObjectHandle > &  reflectionPassObjects,
QSSGRenderer renderer 
)

Definition at line 1917 of file qssgrenderer.cpp.

References QSSGRenderLayer::background, cb, QSSGRhiContext::commandBuffer(), QSSGRhiContext::commonPassFlags(), QRhiResource::deleteLater(), QSSGRenderReflectionProbe::FirstFrame, i, QSSGRenderReflectionProbe::IndividualFaces, QRhi::isFeatureSupported(), QRhi::isYUpInFramebuffer(), QSSGLayerRenderData::layer, QSSGReflectionMapEntry::m_needsRender, QSSGReflectionMapEntry::m_rendered, QSSGReflectionMapEntry::m_rhiCube, QSSGReflectionMapEntry::m_rhiDepthStencil, QSSGReflectionMapEntry::m_rhiRenderTargets, QSSGReflectionMapEntry::m_skyBoxSrbs, QSSGReflectionMapEntry::m_timeSliceFace, QSSGReflectionMapEntry::m_timeSlicing, QSSGReflectionMapEntry::m_viewProjection, NegY, QRhiTextureRenderTarget::newCompatibleRenderPassDescriptor(), QSSGBaseTypeHelpers::next(), QSSGRenderLayer::None, QRhiTexture::pixelSize(), PosY, Q_ASSERT, Q_QUICK3D_PROFILE_END_WITH_STRING, Q_QUICK3D_PROFILE_START, QSSG_RENDERPASS_NAME, QSSGRenderTextureCubeFaces, QSSGRHICTX_STAT, QSSGRenderReflectionMap::reflectionMapEntry(), renderer, QSSGReflectionMapEntry::renderMips(), QSSGRhiContext::rhi(), rhiPrepareResourcesForReflectionMap(), rhiRenderRenderable(), QRhiRenderTarget::setRenderPassDescriptor(), setupCubeReflectionCameras(), QSSGRhiGraphicsPipelineState::shaderPipeline, QList< T >::size(), QSSGRenderLayer::SkyBox, QSSGRenderLayer::SkyBoxCubeMap, QSSGRenderLayer::skyBoxIsRgbe8, QSSGSubsetRenderable::srb, QRhi::TexelFetch, and QSSGRhiGraphicsPipelineState::viewport.

+ Here is the call graph for this function:

◆ rhiRenderRenderable()

void RenderHelpers::rhiRenderRenderable ( QSSGRhiContext rhiCtx,
const QSSGRhiGraphicsPipelineState state,
QSSGRenderableObject object,
bool *  needsSetViewport,
int  cubeFace = -1 
)

◆ rhiRenderShadowMap()

void RenderHelpers::rhiRenderShadowMap ( QSSGRhiContext rhiCtx,
QSSGPassKey  passKey,
QSSGRhiGraphicsPipelineState ps,
QSSGRenderShadowMap shadowMapManager,
const QSSGRenderCamera camera,
const QSSGShaderLightList globalLights,
const QVector< QSSGRenderableObjectHandle > &  sortedOpaqueObjects,
QSSGRenderer renderer,
const QSSGBoxPoints castingObjectsBox,
const QSSGBoxPoints receivingObjectsBox 
)

Definition at line 1638 of file qssgrenderer.cpp.

References QSSGRhiShaderResourceBindingList::addTexture(), QSSGRhiShaderResourceBindingList::addUniformBuffer(), QRhiBuffer::beginFullDynamicBufferUpdateForCurrentFrame(), QSSGRenderCamera::calculateViewProjectionMatrix(), camera, QSSGRenderableObjectFlags::castsShadows(), cb, QRhiSampler::ClampToEdge, QSSGRhiShaderResourceBindingList::clear(), QSSGRhiGraphicsPipelineState::colorAttachmentCount, QSSGRhiContext::commandBuffer(), QSSGRhiContext::commonPassFlags(), QMatrix4x4::constData(), QSSGRenderSubset::count, QRhiBuffer::create(), QMatrix4x4::data(), draw(), QSSGRhiContext::drawCallData(), QRhiBuffer::Dynamic, QRhiBuffer::endFullDynamicBufferUpdateForCurrentFrame(), QRhiShaderResourceBinding::FragmentStage, QSSGRenderNode::globalTransform, i, QSSGRenderSubset::indexBuffer, QSSGSubsetRenderable::instanceBuffer, QSSGRenderModel::instanceCount(), QSSGRenderModel::instancing(), QMatrix4x4::inverted(), QRhi::isClipDepthZeroToOne(), QRhi::isYUpInFramebuffer(), QRhi::isYUpInNDC(), QSSGLayerGlobalRenderProperties::layer, QRhiSampler::Linear, QSSGShadowMapEntry::m_lightCubeView, QSSGShadowMapEntry::m_lightView, QSSGShadowMapEntry::m_lightVP, QSSGShadowMapEntry::m_rhiCubeCopy, QSSGShadowMapEntry::m_rhiDepthCopy, QSSGShadowMapEntry::m_rhiDepthCube, QSSGShadowMapEntry::m_rhiDepthMap, QSSGShadowMapEntry::m_rhiDepthStencil, QSSGShadowMapEntry::m_rhiRenderTargets, map, QSSGSubsetRenderable::material, QSSGModelContext::model, QSSGSubsetRenderable::modelContext, NegY, QRhi::newBuffer(), QRhiSampler::None, QSSGRenderSubset::offset, QSSGSubsetRenderable::pipeline, QRhiTexture::pixelSize(), PosY, Q_ASSERT, Q_QUICK3D_PROFILE_END_WITH_IDS, Q_QUICK3D_PROFILE_END_WITH_STRING, Q_QUICK3D_PROFILE_START, QByteArrayLiteral, QSSG_ASSERT, QSSG_RENDERPASS_NAME, QSSGRenderTextureCubeFaces, QSSGRHICTX_STAT, QSSGRenderableObject::renderableFlags, QSSGRenderLayer::renderData, renderer, RENDERER_VISIBILITY_ALL, QRhiSampler::Repeat, QSSGRenderSubset::rhi, QSSGRhiContext::rhi(), rhiPrepareResourcesForShadowMap(), QSSGSubsetRenderable::rhiRenderData, QSSGRhiContext::sampler(), setupCameraForShadowMap(), setupCubeShadowCameras(), QSSGRhiGraphicsPipelineState::shaderPipeline, QSSGRhiDrawCallDataKey::ShadowBlur, QSSGRenderShadowMap::shadowMapEntry(), QSSGSubsetRenderable::shadowPass, QVLABaseBase::size(), QSSGRhiContext::srb(), QSSGSubsetRenderable::srb, QSSGSubsetRenderable::subset, QSSGRenderableObject::type, QSSGRhiDrawCallData::ubuf, QRhiBuffer::UniformBuffer, QSSGRhiQuadRenderer::UvCoords, QSSGRenderSubset::vertexBuffer, QSSGRhiGraphicsPipelineState::viewport, and Qt::white.

+ Here is the call graph for this function: