7#include <QtQuick3DRuntimeRender/private/qssgrenderer_p.h>
8#include <QtQuick3DRuntimeRender/private/qssgrenderlight_p.h>
9#include <QtQuick3DRuntimeRender/private/qssgrhicustommaterialsystem_p.h>
10#include <QtQuick3DRuntimeRender/private/qssgrhiquadrenderer_p.h>
11#include <QtQuick3DRuntimeRender/private/qssgrhiparticles_p.h>
12#include <QtQuick3DRuntimeRender/private/qssgrenderlayer_p.h>
13#include <QtQuick3DRuntimeRender/private/qssgrendereffect_p.h>
14#include <QtQuick3DRuntimeRender/private/qssgrendercamera_p.h>
15#include <QtQuick3DRuntimeRender/private/qssgrenderskeleton_p.h>
16#include <QtQuick3DRuntimeRender/private/qssgrenderjoint_p.h>
17#include <QtQuick3DRuntimeRender/private/qssgrendermorphtarget_p.h>
18#include <QtQuick3DRuntimeRender/private/qssgrenderparticles_p.h>
19#include <QtQuick3DRuntimeRender/private/qssgrendercontextcore_p.h>
20#include <QtQuick3DRuntimeRender/private/qssgrenderbuffermanager_p.h>
21#include <QtQuick3DRuntimeRender/private/qssgrendershadercache_p.h>
22#include <QtQuick3DRuntimeRender/private/qssgperframeallocator_p.h>
23#include <QtQuick3DRuntimeRender/private/qssgruntimerenderlogging_p.h>
24#include <QtQuick3DRuntimeRender/private/qssglightmapper_p.h>
29#if defined(QT_QUICK3D_MESH_LOD_DEBUG) || defined(QT_QUICK3D_MESH_LOD_NORMALS_DEBUG)
30#include <QtQuick3DRuntimeRender/private/qssgdebugdrawsystem_p.h>
33#include <QtQuick3DUtils/private/qssgutils_p.h>
34#include <QtQuick3DUtils/private/qssgassert_p.h>
36#include <QtQuick/private/qsgtexture_p.h>
37#include <QtQuick/private/qsgrenderer_p.h>
39#include <QtCore/QCoreApplication>
40#include <QtCore/QBitArray>
49#define POS4BONETRANS(x) (sizeof(float) * 16 * (x) * 2)
50#define POS4BONENORM(x) (sizeof(float) * 16 * ((x) * 2 + 1))
51#define BONEDATASIZE4ID(x) POS4BONETRANS(x + 1)
60 if (!supportRgba32f && !supportRgba16f) {
61 static bool warningShown =
false;
63 qWarning () <<
"Particles not supported due to missing RGBA32F and RGBA16F texture format support";
91 const auto &
b =
handle.obj->globalBounds;
96 return visibleRenderables.
size();
105 while (front <= back) {
106 const auto &
b = renderables.
at(front).obj->globalBounds;
118 return lhs.cameraDistanceSq < rhs.cameraDistanceSq;
123 return lhs.cameraDistanceSq > rhs.cameraDistanceSq;
128 if (node->
type == QSSGRenderGraphObject::Type::Joint) {
134 globalTrans *= poses[jointNode->
index];
136 reinterpret_cast<const void *
>(globalTrans.
constData()),
155 bool dirtyNonJoint = ((node->
type != QSSGRenderGraphObject::Type::Joint)
159 if (node->
type == QSSGRenderGraphObject::Type::Joint)
160 hasChildJoints =
true;
161 bool nodeHasChildJoints =
false;
165 hasChildJoints |= nodeHasChildJoints;
166 if (
ret && nodeHasChildJoints)
170 hasChildJoints |= nodeHasChildJoints;
171 return dirtyNonJoint && nodeHasChildJoints;
174template<
typename T,
typename V>
177 if (dstPos <
dst.size())
184template <
typename T,
typename V>
187 if (dstPos <
dst.size())
188 dst[
dst.size() - dstPos - 1] = node;
190 dst.push_front(node);
195#define MAX_MORPH_TARGET 8
196#define MAX_MORPH_TARGET_INDEX_SUPPORTS_NORMALS 3
197#define MAX_MORPH_TARGET_INDEX_SUPPORTS_TANGENTS 1
201 int &ioRenderableModelsCount,
203 int &ioRenderableParticlesCount,
205 int &ioRenderableItem2DsCount,
211 int &ioReflectionProbeCount,
219 if (inNode.
type == QSSGRenderNode::Type::Model)
221 else if (inNode.
type == QSSGRenderNode::Type::Particles)
223 else if (inNode.
type == QSSGRenderNode::Type::Item2D)
230 }
else if (inNode.
type == QSSGRenderGraphObject::Type::ReflectionProbe) {
234 for (
auto &theChild : inNode.
children)
237 ioRenderableModelsCount,
238 outRenderableParticles,
239 ioRenderableParticlesCount,
240 outRenderableItem2Ds,
241 ioRenderableItem2DsCount,
247 ioReflectionProbeCount,
254 : firstImage(
nullptr), opacity(1.0f), materialKey(inKey), dirty(
false)
264 camera->calculateViewProjectionMatrix(viewProjection);
265 std::optional<QSSGClippingFrustum> clippingFrustum;
266 if (
camera->enableFrustumClipping) {
278 ret = { viewProjection, clippingFrustum,
camera->getScalingCorrectDirection(),
camera->getGlobalPos() };
367 const auto cameraDirectionAndPosition = getCachedCameraData();
368 const QVector3D &cameraDirection = cameraDirectionAndPosition.direction;
369 const QVector3D &cameraPosition = cameraDirectionAndPosition.position;
371 const auto isItemNodeDistanceGreatThan = [cameraDirection, cameraPosition]
373 if (!lhs->parent || !rhs->parent)
375 const QVector3D lhsDifference = lhs->parent->getGlobalPos() - cameraPosition;
377 const QVector3D rhsDifference = rhs->parent->getGlobalPos() - cameraPosition;
379 return lhsCameraDistanceSq > rhsCameraDistanceSq;
382 const auto isItemZOrderLessThan = []
384 if (lhs->parent && rhs->parent && lhs->parent == rhs->parent) {
386 return lhs->zOrder < rhs->zOrder;
402void QSSGLayerRenderData::updateSortedDepthObjectsListImp()
411 for (
const auto &opaqueObject : sortedOpaqueObjects) {
412 const auto depthMode = opaqueObject.obj->depthWriteMode;
418 for (
const auto &transparentObject : sortedTransparentObjects) {
419 const auto depthMode = transparentObject.obj->depthWriteMode;
425 for (
const auto &screenTextureObject : sortedScreenTextureObjects) {
426 const auto depthMode = screenTextureObject.obj->depthWriteMode;
437 updateSortedDepthObjectsListImp();
443 updateSortedDepthObjectsListImp();
451template <
typename T,
typename... Args>
454 static_assert(std::is_trivially_destructible_v<T>,
"Objects allocated using the per-frame allocator needs to be trivially destructible!");
455 return new (
ctx.perFrameAllocator().allocate(
sizeof(T)))T(std::forward<Args>(
args)...);
461 static_assert(std::is_trivially_destructible_v<T>,
"Objects allocated using the per-frame allocator needs to be trivially destructible!");
462 const size_t asize =
sizeof(T) *
count;
463 return {
reinterpret_cast<T *
>(
ctx.perFrameAllocator().allocate(asize)),
qsizetype(
count) };
479 int shadowMapCount = 0;
480 for (
int lightIdx = 0, lightEnd =
lights.size(); lightIdx < lightEnd; ++lightIdx) {
482 const bool isDirectional = theLight->
type == QSSGRenderLight::Type::DirectionalLight;
483 const bool isSpot = theLight->
type == QSSGRenderLight::Type::SpotLight;
496 return theGeneratedKey;
526 if (
texture.m_flags.hasTransparency()
527 && (inMapType == QSSGRenderableImage::Type::Diffuse
528 || inMapType == QSSGRenderableImage::Type::Opacity
529 || inMapType == QSSGRenderableImage::Type::Translucency))
555 switch (
texture.m_texture->format()) {
575 if (ioFirstImage ==
nullptr)
576 ioFirstImage = theImage;
580 ioNextImage = theImage;
587 switch (inImageIndex) {
621 bool useDefault =
false;
677 retval.renderableFlags = inExistingFlags;
680 retval.opacity = inOpacity;
681 float &subsetOpacity(retval.opacity);
686 subsetOpacity *= theMaterial->
opacity;
757 if (specularEnabled || metalnessEnabled)
773#define CHECK_IMAGE_AND_PREPARE(img, imgtype, shadercomponent) \
775 prepareImageForRender(*(img), imgtype, firstImage, nextImage, renderableFlags, \
776 theGeneratedKey, shadercomponent, &inMaterial)
778 if (theMaterial->
type == QSSGRenderGraphObject::Type::PrincipledMaterial ||
779 theMaterial->
type == QSSGRenderGraphObject::Type::SpecularGlossyMaterial) {
781 QSSGRenderableImage::Type::BaseColor,
784 QSSGRenderableImage::Type::Occlusion,
787 QSSGRenderableImage::Type::Height,
790 QSSGRenderableImage::Type::Clearcoat,
793 QSSGRenderableImage::Type::ClearcoatRoughness,
796 QSSGRenderableImage::Type::ClearcoatNormal,
799 QSSGRenderableImage::Type::Transmission,
802 QSSGRenderableImage::Type::Thickness,
804 if (theMaterial->
type == QSSGRenderGraphObject::Type::PrincipledMaterial) {
806 QSSGRenderableImage::Type::Metalness,
811 QSSGRenderableImage::Type::Diffuse,
816 QSSGRenderableImage::Type::Specular,
819 QSSGRenderableImage::Type::Roughness,
824 QSSGRenderableImage::Type::SpecularAmountMap,
828 QSSGRenderableImage::Type::Translucency,
831#undef CHECK_IMAGE_AND_PREPARE
834 subsetOpacity = 0.0f;
853 retval.firstImage = firstImage;
854 if (retval.renderableFlags.isDirty())
869 retval.renderableFlags = inExistingFlags;
872 retval.opacity = inOpacity;
873 float &subsetOpacity(retval.opacity);
876 subsetOpacity = 0.0f;
948 retval.firstImage =
nullptr;
950 if (retval.dirty || alreadyDirty)
962 RenderableNodeEntries &renderableModels,
963 bool globalPickingEnabled)
968 auto end = originalModelCount;
970 for (
int idx = 0; idx <
end; ++idx) {
981 if (
auto theMesh = bufferManager->loadMesh(&
model); theMesh &&
model.materials.size() > 0) {
982 renderable.mesh = theMesh;
988 && (globalPickingEnabled
990 if (canModelBePickable) {
993 if (!
model.meshPath.isNull())
994 theMesh->bvh = bufferManager->loadMeshBVH(
model.meshPath);
995 else if (
model.geometry)
996 theMesh->bvh = bufferManager->loadMeshBVH(
model.geometry);
999 for (
int i = 0;
i < theMesh->bvh->roots.size(); ++
i)
1000 theMesh->subsets[
i].bvhRoot = theMesh->bvh->roots.at(
i);
1013 if (
end != originalModelCount)
1020 bufferManager->commitBufferResourceUpdates();
1025 lightmapTextures[&modelContext] = lightmapTexture;
1032 const auto it = lightmapTextures.
constFind(&modelContext);
1033 ret = (
it != lightmapTextures.
cend()) ? *
it :
nullptr;
1041 bonemapTextures[&modelContext] = bonemapTexture;
1048 const auto it = bonemapTextures.
constFind(&modelContext);
1049 ret = (
it != bonemapTextures.
cend()) ? *
it :
nullptr;
1069 bool wasDirty =
false;
1073 const auto &
lights = renderable.lights;
1076 QSSG_ASSERT_X(theMesh !=
nullptr,
"Only renderables with a mesh will be processed!",
continue);
1082 const auto &meshSubsets = theMesh->
subsets;
1083 const auto meshSubsetCount = meshSubsets.size();
1088 auto boneTexture = bufferManager->loadSkinmap(
model.skin);
1090 }
else if (
model.skeleton) {
1091 auto boneTexture = bufferManager->loadSkinmap(&(
model.skeleton->boneTexData));
1100 if (meshSubsetCount > 0) {
1109 if (
model.hasLightmap()) {
1122 bool hasJoint =
false;
1123 bool hasWeight =
false;
1155 bool usesBlendParticles = particlesEnabled && theModelContext.
model.
particleBuffer !=
nullptr
1156 &&
model.particleBuffer->particleCount();
1159 auto &renderableSubsets = theModelContext.
subsets;
1160 const auto &materials = renderable.materials;
1161 const auto materialCount = materials.
size();
1163 int idx = 0, subsetIdx = 0;
1164 for (; idx < meshSubsetCount; ++idx) {
1167 QSSG_ASSERT_X(theMaterialObject !=
nullptr,
"No material found for model!",
continue);
1171 float subsetOpacity =
model.globalOpacity;
1184 quint32 subsetLevelOfDetail = 0;
1185 if (!theSubset.
lods.isEmpty() && lodThreshold > 0.0f) {
1188 float distanceThreshold = 0.0f;
1192 if (
camera->
type != QSSGRenderGraphObject::Type::OrthographicCamera) {
1194#ifdef QT_QUICK3D_MESH_LOD_DEBUG
1202#ifdef QT_QUICK3D_MESH_LOD_DEBUG
1206 const float distanceMin = cameraPlane.
distance(lodSupportMin);
1207 const float distanceMax = cameraPlane.
distance(lodSupportMax);
1209 if (distanceMin * distanceMax < 0.0)
1210 distanceThreshold = 0.0;
1211 else if (distanceMin >= 0.0)
1212 distanceThreshold = distanceMin;
1213 else if (distanceMax <= 0.0)
1214 distanceThreshold = -distanceMax;
1218 distanceThreshold = 1.0;
1221 int currentLod = -1;
1222 if (
model.levelOfDetailBias > 0.0f) {
1223 const float threshold = distanceThreshold * lodDistanceMultiplier;
1224 const float modelBias = 1 /
model.levelOfDetailBias;
1226 float subsetDistance = theSubset.
lods[
i].distance * modelScale * modelBias;
1227 float screenSize = subsetDistance / threshold;
1228 if (screenSize > lodThreshold)
1233 if (currentLod == -1)
1234 subsetLevelOfDetail = 0;
1236 subsetLevelOfDetail = currentLod + 1;
1237#ifdef QT_QUICK3D_MESH_LOD_DEBUG
1238 auto levelOfDetailColor = [](
int lod) ->
QColor {
1265#ifdef QT_QUICK3D_MESH_LOD_NORMALS_DEBUG
1269 mesh = bufferManager->loadMeshData(
model.geometry);
1271 mesh = bufferManager->loadMeshData(
model.meshPath);
1286 quint32 positionOffset = UINT_MAX;
1287 quint32 normalOffset = UINT_MAX;
1291 positionOffset = vbe.offset;
1292 if (vbe.componentType != QSSGMesh::Mesh::ComponentType::Float32 &&
1293 vbe.componentCount != 3)
1296 normalOffset = vbe.offset;
1297 if (vbe.componentType != QSSGMesh::Mesh::ComponentType::Float32 &&
1298 vbe.componentCount != 3)
1303 const auto globalTransform =
model.globalTransform;
1308 const char *vp = vertexData.
constData();
1312 const char * posPtr = vp + (
index * vertexStride) + positionOffset;
1313 const float *fPosPtr =
reinterpret_cast<const float *
>(posPtr);
1315 const char * normalPtr = vp + (
index * vertexStride) + normalOffset;
1316 const float *fNormalPtr =
reinterpret_cast<const float *
>(normalPtr);
1317 QVector3D normal(fNormalPtr[0], fNormalPtr[1], fNormalPtr[2]);
1326 if (subsetLevelOfDetail != 0) {
1329 const char *vp = vertexData.
constData();
1330 p += theSubset.
lodOffset(subsetLevelOfDetail);
1332 for (
uint i = 0;
i < indexCount; ++
i) {
1334 const char * posPtr = vp + (
index * vertexStride) + positionOffset;
1335 const float *fPosPtr =
reinterpret_cast<const float *
>(posPtr);
1337 const char * normalPtr = vp + (
index * vertexStride) + normalOffset;
1338 const float *fNormalPtr =
reinterpret_cast<const float *
>(normalPtr);
1339 QVector3D normal(fNormalPtr[0], fNormalPtr[1], fNormalPtr[2]);
1351#ifdef QT_QUICK3D_MESH_LOD_NORMALS_DEBUG
1352 debugNormals(
model, theSubset, subsetLevelOfDetail, (theModelCenter -
camera->
getGlobalPos()).length() * 0.01);
1355 if (theMaterialObject->
type == QSSGRenderGraphObject::Type::DefaultMaterial ||
1356 theMaterialObject->
type == QSSGRenderGraphObject::Type::PrincipledMaterial ||
1357 theMaterialObject->
type == QSSGRenderGraphObject::Type::SpecularGlossyMaterial) {
1361 subsetOpacity = theMaterialPrepResult.
opacity;
1363 wasDirty |= theMaterialPrepResult.
dirty;
1370 const auto boneCount =
model.skin ?
model.skin->boneCount :
1371 model.skeleton ?
model.skeleton->boneCount : 0;
1395 new (theRenderableObject)
QSSGSubsetRenderable(QSSGSubsetRenderable::Type::DefaultMaterialMeshSubset,
1402 subsetLevelOfDetail,
1407 wasDirty = wasDirty || renderableFlags.
isDirty();
1408 }
else if (theMaterialObject->
type == QSSGRenderGraphObject::Type::CustomMaterial) {
1412 wasDirty |= theMaterialSystem->prepareForRender(theModelContext.
model, theSubset, theMaterial);
1415 prepareCustomMaterialForRender(theMaterial, renderableFlags, subsetOpacity, wasDirty,
1418 subsetOpacity = theMaterialPrepResult.
opacity;
1422 if (
model.particleBuffer &&
model.particleBuffer->particleCount())
1428 const auto boneCount =
model.skin ?
model.skin->boneCount :
1429 model.skeleton ?
model.skeleton->boneCount : 0;
1459 new (theRenderableObject)
QSSGSubsetRenderable(QSSGSubsetRenderable::Type::CustomMaterialMeshSubset,
1466 subsetLevelOfDetail,
1472 if (theRenderableObject)
1478 renderableSubsets.mSize = subsetIdx + 1;
1480 bool handled =
false;
1482 handled =
filter(&theModelContext);
1485 for (
auto &ro : renderableSubsets) {
1486 if (ro.renderableFlags.requiresScreenTexture())
1488 else if (ro.renderableFlags.hasTransparency())
1493 if (ro.renderableFlags.usedInBakedLighting())
1494 bakedLightingObjects.
push_back({&ro, ro.camdistSq});
1498 if (!bakedLightingObjects.isEmpty())
1515 const auto &
lights = renderable.lights;
1540 firstImage = theImage;
1553 colorTable = theImage;
1557 auto *theRenderableObject = RENDER_FRAME_NEW<QSSGParticlesRenderable>(
contextInterface,
1566 if (theRenderableObject) {
1567 if (theRenderableObject->renderableFlags.requiresScreenTexture())
1569 else if (theRenderableObject->renderableFlags.hasTransparency())
1585 const auto &clipSpaceCorrMatrix = ctxIfc.
rhiContext()->rhi()->clipSpaceCorrMatrix();
1588 theItem2D->MVP =
cameraData.viewProjection * theItem2D->globalTransform;
1589 static const QMatrix4x4 flipMatrix(1.0f, 0.0f, 0.0f, 0.0f,
1590 0.0f, -1.0f, 0.0f, 0.0f,
1591 0.0f, 0.0f, 1.0f, 0.0f,
1592 0.0f, 0.0f, 0.0f, 1.0f);
1593 theItem2D->MVP = clipSpaceCorrMatrix * theItem2D->MVP * flipMatrix;
1605 for (
const auto resourceLoader : std::as_const(
layer.resourceLoaders))
1614 for (
int i = 0;
i < probeCount;
i++) {
1617 int reflectionObjectCount = 0;
1623 && !(
handle.obj->type == QSSGRenderableObject::Type::Particles)) {
1631 nodeBound.
maximum = vmax.toVector3D();
1636 if (renderableObj->
reflectionProbeIndex == -1 || distance < renderableObj->distanceFromReflectionProbe) {
1644 reflectionObjectCount++;
1657 reflectionMapManager->addTexturedReflectionMapEntry(
i, *probe);
1658 else if (reflectionObjectCount > 0)
1659 reflectionMapManager->addReflectionMapEntry(
i, *probe);
1667 if (node == lightScope)
1689 for (
const auto &node : std::as_const(renderableNodes)) {
1690 if (node.node->type == QSSGRenderGraphObject::Type::Model) {
1692 auto skeletonNode = modelNode->
skeleton;
1695 const bool dirtySkeleton = dirtySkeletons.
contains(skeletonNode);
1696 const bool hasDirtyNonJoints = (skeletonNode->containsNonJointNodes
1699 if (skeletonNode->skinningDirty || hasDirtyNonJoints || dirtyTransform) {
1700 skeletonNode->boneTransformsDirty =
false;
1701 if (hasDirtyNonJoints && !dirtySkeleton)
1702 dirtySkeletons.
insert(skeletonNode);
1703 skeletonNode->skinningDirty =
false;
1705 if (skeletonNode->boneData.size() <
dataSize)
1706 skeletonNode->boneData.resize(
dataSize);
1707 skeletonNode->calculateGlobalVariables();
1708 skeletonNode->containsNonJointNodes =
false;
1709 for (
auto &
child : skeletonNode->children)
1712 skeletonNode->boneCount = skeletonNode->boneData.size() / 2 / 4 / 16;
1713 const int boneTexWidth =
qCeil(
qSqrt(skeletonNode->boneCount * 4 * 2));
1714 skeletonNode->boneTexData.setSize(
QSize(boneTexWidth, boneTexWidth));
1715 skeletonNode->boneData.resize(boneTexWidth * boneTexWidth * 16);
1716 skeletonNode->boneTexData.setTextureData(skeletonNode->boneData);
1718 const int numMorphTarget = modelNode->morphTargets.size();
1719 for (
int i = 0;
i < numMorphTarget; ++
i) {
1721 modelNode->morphWeights[
i] = morphTarget->
weight;
1722 modelNode->morphAttributes[
i] = morphTarget->attributes;
1724 modelNode->morphAttributes[
i] &= 0x1;
1726 modelNode->morphAttributes[
i] &= 0x3;
1731 dirtySkeletons.
clear();
1752 ps.
viewport = { float(theViewport.
x()), float(theViewport.
y()), float(theViewport.
width()), float(theViewport.
height()), 0.0f, 1.0f };
1753 if (
layer.scissorRect.isValid()) {
1756 theViewport.
height() - (
layer.scissorRect.y() +
layer.scissorRect.height()),
1757 layer.scissorRect.width(),
1758 layer.scissorRect.height() };
1761 bool wasDirty =
false;
1762 bool wasDataDirty =
false;
1763 wasDirty =
layer.isDirty();
1768 const bool SSAOEnabled =
layer.ssaoEnabled();
1773 bool requiresDepthTexture = SSAOEnabled;
1774 for (
QSSGRenderEffect *theEffect =
layer.firstEffect; theEffect; theEffect = theEffect->m_nextEffect) {
1775 if (theEffect->isDirty()) {
1777 theEffect->clearDirty();
1779 if (theEffect->requiresDepthTexture)
1780 requiresDepthTexture =
true;
1786 if (!
layer.firstEffect)
1797 static bool notified =
false;
1800 qCDebug(lcQuick3DRender,
"Qt Quick 3D maximum number of lights has been reduced from %d to %d due to the graphics driver's limitations",
1807 if (
layer.lightProbe) {
1817 if (
layer.lightProbe->clearDirty())
1818 wasDataDirty =
true;
1832 layer.lightProbe =
nullptr;
1841 int renderableModelsCount = 0;
1842 int renderableParticlesCount = 0;
1843 int renderableItem2DsCount = 0;
1844 int cameraNodeCount = 0;
1845 int lightNodeCount = 0;
1846 int reflectionProbeCount = 0;
1848 for (
auto &theChild :
layer.children)
1851 renderableModelsCount,
1853 renderableParticlesCount,
1855 renderableItem2DsCount,
1861 reflectionProbeCount,
1871 if (
cameras.size() != cameraNodeCount)
1872 cameras.resize(cameraNodeCount);
1873 if (
lights.size() != lightNodeCount)
1874 lights.resize(lightNodeCount);
1887 wasDataDirty = wasDataDirty || theResult.
m_wasDirty;
1889 qCCritical(INTERNAL_ERROR,
"Failed to calculate camera frustum");
1899 wasDataDirty = wasDataDirty
1902 wasDataDirty = wasDataDirty || theResult.
m_wasDirty;
1904 qCCritical(INTERNAL_ERROR,
"Failed to calculate camera frustum");
1910 float meshLodThreshold = 1.0f;
1925 int shadowMapCount = 0;
1926 bool hasScopedLights =
false;
1932 if (showLightCountWarning) {
1933 qWarning(
"Too many lights in scene, maximum is %d", maxLightCount);
1946 hasScopedLights |= (renderLight->
m_scope !=
nullptr);
1949 shadowMapCount += int(shadows);
1960 if (shadowMapCount > 0) {
1963 for (
int i = 0,
end = renderableLights.
size();
i !=
end; ++
i) {
1964 const auto &shaderLight = renderableLights.
at(
i);
1965 if (shaderLight.shadows) {
1967 ShadowMapModes mapMode = (shaderLight.light->type != QSSGRenderLight::Type::DirectionalLight)
1970 shadowMapManager->addShadowMapEntry(
i,
1974 shaderLight.light->debugObjectName);
1989 if (hasScopedLights) {
1990 for (
const auto &shaderLight : std::as_const(renderableLights)) {
1991 if (!shaderLight.light->m_scope)
1996 for (
qint32 idx = 0,
end = renderableNodes.size(); idx <
end; ++idx) {
1999 for (
const auto &light : std::as_const(renderableLights)) {
2000 if (light.light->m_scope && !
scopeLight(theNodeEntry.
node, light.light->m_scope))
2005 if (filteredLights.
isEmpty()) {
2012 std::copy(filteredLights.
cbegin(), filteredLights.
cend(), customLightList.begin());
2013 theNodeEntry.
lights = customLightList;
2024 for (
qint32 idx = 0,
end = renderableNodes.size(); idx <
end; ++idx) {
2039 const auto &renderExtensions =
layer.renderExtensions[
i];
2041 for (
auto rit = renderExtensions.crbegin(), rend = renderExtensions.crend(); rit != rend; ++rit) {
2042 wasDirty |= (*rit)->prepareData(frameData);
2052 const auto &
cameraData = getCachedCameraData();
2054 if (particlesEnabled)
2061 wasDirty = wasDirty || wasDataDirty;
2068 const bool animating = wasDirty;
2070 layer.progAAPassIndex = 0;
2073 layer.progressiveAAIsActive = progressiveAA;
2076 layer.temporalAAIsActive = temporalAA;
2080 if (progressiveAA &&
layer.progAAPassIndex > 0 &&
layer.progAAPassIndex <
quint32(
layer.antialiasingQuality)) {
2081 int idx =
layer.progAAPassIndex - 1;
2086 const int t = 1 - 2 * (
layer.tempAAPassIndex % 2);
2087 const float f =
t *
layer.temporalAAStrength;
2088 vertexOffsetsAA = {
f / float(theViewport.
width()/2.0),
f / float(theViewport.
height()/2.0) };
2092 if (temporalAA || progressiveAA ) {
2095 if (
camera->
type == QSSGRenderCamera::Type::OrthographicCamera) {
2096 offsetProjection(0, 3) -= vertexOffsetsAA.
x();
2097 offsetProjection(1, 3) -= vertexOffsetsAA.
y();
2098 }
else if (
camera->
type == QSSGRenderCamera::Type::PerspectiveCamera) {
2099 offsetProjection(0, 2) += vertexOffsetsAA.
x();
2100 offsetProjection(1, 2) += vertexOffsetsAA.
y();
2103 modelContext->modelViewProjection = offsetProjection * invProjection * modelContext->modelViewProjection;
2131 if (underlayPass.hasData())
2137 if (overlayPass.hasData())
2164 lightmapTextures.
clear();
2165 bonemapTextures.
clear();
2244 for (
auto &
s : sortData)
2245 *dest++ = instance[
s.indexOrOffset];
2250 const QVector3D &cameraPosition,
float minThreshold,
float maxThreshold)
2255 const float x = cameraPosition.
x() - instance->
row0.
w();
2256 const float y = cameraPosition.
y() - instance->
row1.
w();
2257 const float z = cameraPosition.
z() - instance->
row2.
w();
2258 const float distanceSq =
x *
x +
y *
y +
z *
z;
2259 if (distanceSq >= minThreshold * minThreshold && (maxThreshold < 0 || distanceSq < maxThreshold * maxThreshold))
2273 bool usesLod = minThreshold >= 0 || maxThreshold >= 0;
2277 bool sortingChanged =
table->isDepthSortingEnabled() != instanceData.
sorting;
2278 bool cameraDirectionChanged = !
qFuzzyCompare(instanceData.sortedCameraDirection, cameraDirection);
2279 bool cameraPositionChanged = !
qFuzzyCompare(instanceData.cameraPosition, cameraPosition);
2280 bool updateInstanceBuffer =
table->serial() != instanceData.serial || sortingChanged || (cameraDirectionChanged &&
table->isDepthSortingEnabled());
2281 bool updateForLod = cameraPositionChanged && usesLod;
2282 if (sortingChanged && !
table->isDepthSortingEnabled()) {
2283 instanceData.sortedData.clear();
2284 instanceData.sortData.clear();
2285 instanceData.sortedCameraDirection = {};
2287 instanceData.sorting =
table->isDepthSortingEnabled();
2288 if (instanceData.buffer && instanceData.buffer->size() < instanceBufferSize) {
2289 updateInstanceBuffer =
true;
2291 instanceData.buffer->setSize(instanceBufferSize);
2292 instanceData.buffer->create();
2294 if (!instanceData.buffer) {
2296 updateInstanceBuffer =
true;
2298 instanceData.buffer->
create();
2300 if (updateInstanceBuffer || updateForLod) {
2301 const void *
data =
nullptr;
2302 if (
table->isDepthSortingEnabled()) {
2303 if (updateInstanceBuffer) {
2305 instanceData.sortedData.resize(
table->dataSize());
2307 instanceData.sortData,
2311 invGlobalTransform.
map(cameraDirection).normalized());
2313 data = instanceData.sortedData.constData();
2314 instanceData.sortedCameraDirection = cameraDirection;
2320 if (
table->isDepthSortingEnabled()) {
2321 instanceData.lodData.resize(
table->dataSize());
2322 cullLodInstances(instanceData.lodData, instanceData.sortedData.constData(), instanceData.sortedData.size(), cameraPosition, minThreshold, maxThreshold);
2323 data = instanceData.lodData.constData();
2325 instanceData.lodData.resize(
table->dataSize());
2327 data = instanceData.lodData.constData();
2335 qWarning() <<
"NO DATA IN INSTANCE TABLE";
2337 instanceData.serial =
table->serial();
2338 instanceData.cameraPosition = cameraPosition;
2347 static bool bakeRequested =
false;
2348 static bool bakeFlagChecked =
false;
2349 if (!bakeFlagChecked) {
2350 bakeFlagChecked =
true;
2353 bakeRequested = cmdLineReq || envReq;
2376 for (
int i = 0, ie = sortedBakedLightingModels.size();
i != ie; ++
i)
2380 cb->debugMarkBegin(
"Quick3D lightmap baking");
2385 qDebug(
"Lightmap baking done, exiting application");
2402 if (node->type == QSSGRenderNode::Type::Model) {
2406 if (foundIt != cend)
2419 if (node->type == QSSGRenderNode::Type::Model) {
2423 if (foundIt != cend) {
2445 if (!camera_ || camera_ ==
camera)
2446 data = getCachedCameraData();
2473 return shadowMapManager;
2480 return reflectionMapManager;
char * data()
\macro QT_NO_CAST_FROM_BYTEARRAY
const char * constData() const noexcept
Returns a pointer to the const data stored in the byte array.
bool isEmpty() const noexcept
Returns true if the byte array has size 0; otherwise returns false.
The QColor class provides colors based on RGB, HSV or CMYK values.
static QStringList arguments()
const_iterator constFind(const Key &key) const noexcept
const_iterator cend() const noexcept
void clear() noexcept(std::is_nothrow_destructible< Node >::value)
Removes all items from the hash and frees up all memory used by it.
qsizetype size() const noexcept
bool isEmpty() const noexcept
iterator erase(const_iterator begin, const_iterator end)
bool empty() const noexcept
void swapItemsAt(qsizetype i, qsizetype j)
void push_back(parameter_type t)
const_reference at(qsizetype i) const noexcept
void reserve(qsizetype size)
void resize(qsizetype size)
const_iterator cend() const noexcept
void append(parameter_type t)
const_iterator cbegin() const noexcept
The QMatrix4x4 class represents a 4x4 transformation matrix in 3D space.
QMatrix3x3 normalMatrix() const
Returns the normal matrix corresponding to this 4x4 transformation.
QMatrix4x4 inverted(bool *invertible=nullptr) const
Returns the inverse of this matrix.
QPoint map(const QPoint &point) const
Maps point by multiplying this matrix by point.
const float * constData() const
Returns a constant pointer to the raw data of this matrix.
\inmodule QtCore\reentrant
constexpr qreal height() const noexcept
Returns the height of the rectangle.
constexpr qreal width() const noexcept
Returns the width of the rectangle.
constexpr QSizeF size() const noexcept
Returns the size of the rectangle.
\inmodule QtCore\reentrant
constexpr int height() const noexcept
Returns the height of the rectangle.
constexpr int x() const noexcept
Returns the x-coordinate of the rectangle's left edge.
constexpr int width() const noexcept
Returns the width of the rectangle.
constexpr int y() const noexcept
Returns the y-coordinate of the rectangle's top edge.
virtual bool create()=0
Creates the corresponding native graphics resources.
void resourceUpdate(QRhiResourceUpdateBatch *resourceUpdates)
Sometimes committing resource updates is necessary or just more convenient without starting a render ...
void updateDynamicBuffer(QRhiBuffer *buf, quint32 offset, quint32 size, const void *data)
Enqueues updating a region of a QRhiBuffer buf created with the type QRhiBuffer::Dynamic.
QRhiBuffer * newBuffer(QRhiBuffer::Type type, QRhiBuffer::UsageFlags usage, quint32 size)
bool isTextureFormatSupported(QRhiTexture::Format format, QRhiTexture::Flags flags={}) const
QRhiResourceUpdateBatch * nextResourceUpdateBatch()
Class representing 3D range or axis aligned bounding box.
static Q_ALWAYS_INLINE QSSGBounds3 centerExtents(const QVector3D ¢er, const QVector3D &extent)
returns the AABB from center and extents vectors.
Q_ALWAYS_INLINE QVector3D center() const
returns the center of this axis aligned box.
QVector3D getSupport(const QVector3D &direction) const
Q_ALWAYS_INLINE bool intersects(const QSSGBounds3 &b) const
indicates whether the intersection of this and b is empty or not.
static QSSGBounds3 transform(const QMatrix3x3 &matrix, const QSSGBounds3 &bounds)
gets the transformed bounds of the passed AABB (resulting in a bigger AABB).
\inmodule QtQuick3DRuntimeRender
QVector< QSSGBakedLightingModel > renderedBakedLightingModels
QRhiTexture * getLightmapTexture(const QSSGModelContext &modelContext) const
static qsizetype frustumCullingInline(const QSSGClippingFrustum &clipFrustum, QSSGRenderableObjectList &renderables)
bool prepareModelsForRender(const RenderableNodeEntries &renderableModels, QSSGLayerRenderPreparationResultFlags &ioFlags, const QSSGCameraRenderData &cameraData, RenderableFilter filter, float lodThreshold=0.0f)
bool prepareItem2DsForRender(const QSSGRenderContextInterface &ctxIfc, const RenderableItem2DEntries &renderableItem2Ds)
QSSGLightmapper::Callback lightmapBakingOutputCallback
void prepareResourceLoaders()
QSSGRenderableObjectList renderedOpaqueObjects
QSSGRenderableObjectList renderedTransparentObjects
QVector< QSSGBakedLightingModel > bakedLightingModels
QSSGFrameData & getFrameData()
void prepareReflectionProbesForRender()
void setLightmapTexture(const QSSGModelContext &modelContext, QRhiTexture *lightmapTexture)
std::optional< QSSGClippingFrustum > clippingFrustum
void setVertexInputPresence(const QSSGRenderableObjectFlags &renderableFlags, QSSGShaderDefaultMaterialKey &key, QSSGRenderer *renderer)
QSSGRenderableObjectList renderedDepthWriteObjects
bool tooManyLightsWarningShown
const QSSGRenderableObjectList & getSortedRenderedDepthWriteObjects()
QSSGRenderableNodeEntry takeNode(QSSGNodeId id)
QSSGRenderCamera * camera
QSSGLayerRenderData(QSSGRenderLayer &inLayer, QSSGRenderer &inRenderer)
void prepareImageForRender(QSSGRenderImage &inImage, QSSGRenderableImage::Type inMapType, QSSGRenderableImage *&ioFirstImage, QSSGRenderableImage *&ioNextImage, QSSGRenderableObjectFlags &ioFlags, QSSGShaderDefaultMaterialKey &ioGeneratedShaderKey, quint32 inImageIndex, QSSGRenderDefaultMaterial *inMaterial=nullptr)
QVarLengthArray< QSSGRenderPass *, 12 > activePasses
QSSGRenderableObjectList opaqueObjects
static void prepareModelMeshes(const QSSGRenderContextInterface &contextInterface, RenderableNodeEntries &renderableModels)
const QSSGRenderableObjectList & getSortedOpaqueRenderableObjects()
const QSSGRenderReflectionMapPtr & requestReflectionMapManager()
QSSGLightmapper * m_lightmapper
const QSSGRenderableObjectList & getSortedTransparentRenderableObjects()
QSSGShaderDefaultMaterialKey generateLightingKey(QSSGRenderDefaultMaterial::MaterialLighting inLightingType, const QSSGShaderLightListView &lights, bool receivesShadows=true)
ReflectionMapPass reflectionMapPass
const QSSGRenderableObjectList & getSortedrenderedOpaqueDepthPrepassObjects()
RenderableNodeEntries renderableModels
const QSSGRenderableObjectList & getSortedScreenTextureRenderableObjects()
const QVector< QSSGBakedLightingModel > & getSortedBakedLightingModels()
bool interactiveLightmapBakingRequested
bool tooManyShadowLightsWarningShown
const RenderableItem2DEntries & getRenderableItem2Ds()
QRhiTexture * getBonemapTexture(const QSSGModelContext &modelContext) const
static qsizetype frustumCulling(const QSSGClippingFrustum &clipFrustum, const QSSGRenderableObjectList &renderables, QSSGRenderableObjectList &visibleRenderables)
ZPrePassPass zPrePassPass
QSSGRenderableObjectList renderedOpaqueDepthPrepassObjects
QSSGRenderableObjectList transparentObjects
RenderableItem2DEntries renderedItem2Ds
QSSGCameraRenderData getCameraRenderData(const QSSGRenderCamera *camera)
ShadowMapPass shadowMapPass
std::optional< QSSGLayerRenderPreparationResult > layerPrepResult
QSSGRenderContextInterface * contextInterface() const
ScreenMapPass screenMapPass
void setBonemapTexture(const QSSGModelContext &modelContext, QRhiTexture *bonemapTexture)
QSSGRenderGraphObject * getResource(QSSGResourceId id) const
QSSGRenderableObjectList renderedScreenTextureObjects
QSSGRenderableNodeEntry getNode(QSSGNodeId id) const
DepthMapPass depthMapPass
const QSSGRenderShadowMapPtr & requestShadowMapManager()
QVector< QSSGRenderLight * > lights
QSSGRenderableObjectList screenTextureObjects
UserPass userPasses[USERPASSES]
QVector< QSSGRenderItem2D * > renderableItem2Ds
bool prepareParticlesForRender(const RenderableNodeEntries &renderableParticles, const QSSGCameraRenderData &cameraData)
QVector< QSSGRenderReflectionProbe * > reflectionProbes
QVector< QSSGRenderCamera * > cameras
std::function< bool(QSSGModelContext *)> RenderableFilter
QSSGShaderLightList globalLights
TModelContextPtrList modelContexts
static constexpr size_t USERPASSES
RenderableNodeEntries renderableParticles
std::optional< QSSGCameraRenderData > cameraData
qsizetype add(const QSSGBakedLightingModel &model)
void setOptions(const QSSGLightmapperOptions &options)
void setOutputCallback(Callback callback)
VertexBuffer vertexBuffer() const
IndexBuffer indexBuffer() const
Representation of a plane.
Q_ALWAYS_INLINE float distance(const QVector3D &p) const
const std::unique_ptr< QSSGRhiContext > & rhiContext() const
const std::unique_ptr< QSSGDebugDrawSystem > & debugDrawSystem() const
const std::unique_ptr< QSSGCustomMaterialSystem > & customMaterialSystem() const
const std::unique_ptr< QSSGBufferManager > & bufferManager() const
static void setTonemapFeatures(QSSGShaderFeatures &features, QSSGRenderLayer::TonemapMode tonemapMode)
bool isGlobalPickingEnabled() const
QSSGShaderDefaultMaterialKeyProperties & defaultMaterialShaderKeyProperties()
void addMaterialDirtyClear(QSSGRenderGraphObject *material)
QSSGRenderContextInterface * contextInterface() const
QSSGRhiInstanceBufferData & instanceBufferData(QSSGRenderInstanceTable *instanceTable)
QRhiCommandBuffer * commandBuffer() const
bool contains(const T &value) const
iterator insert(const T &value)
constexpr QSize toSize() const noexcept
Returns an integer based copy of this size.
constexpr size_type size() const noexcept
const T & at(qsizetype idx) const
const_iterator cbegin() const noexcept
const_iterator cend() const noexcept
void push_back(const T &t)
The QVector2D class represents a vector or vertex in 2D space.
constexpr float y() const noexcept
Returns the y coordinate of this point.
constexpr float x() const noexcept
Returns the x coordinate of this point.
The QVector3D class represents a vector or vertex in 3D space.
QVector3D normalized() const noexcept
Returns the normalized unit vector form of this vector.
QT_WARNING_POP float distanceToPoint(QVector3D point) const noexcept
constexpr float y() const noexcept
Returns the y coordinate of this point.
constexpr float x() const noexcept
Returns the x coordinate of this point.
static constexpr float dotProduct(QVector3D v1, QVector3D v2) noexcept
Returns the dot product of v1 and v2.
constexpr float z() const noexcept
Returns the z coordinate of this point.
The QVector4D class represents a vector or vertex in 4D space.
constexpr float w() const noexcept
Returns the w coordinate of this point.
constexpr QVector3D toVector3D() const noexcept
Returns the 3D vector form of this 4D vector, dropping the w coordinate.
QList< QSSGRenderExtension * > extensions
QSet< QString >::iterator it
constexpr quint32 nextMultipleOf4(quint32 value)
Combined button and popup list for selecting options.
constexpr Initialization Uninitialized
QVector3D Q_QUICK3DUTILS_EXPORT transform(const QMatrix3x3 &m, const QVector3D &v)
QVector3D Q_QUICK3DUTILS_EXPORT transform(const QMatrix4x4 &m, const QVector3D &v)
QVector3D Q_QUICK3DUTILS_EXPORT getScale(const QMatrix4x4 &m)
#define Q_STATIC_ASSERT(Condition)
#define Q_REQUIRED_RESULT
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction void DBusFreeFunction return DBusConnection return DBusConnection return const char DBusError return DBusConnection DBusMessage dbus_uint32_t return DBusConnection dbus_bool_t DBusConnection DBusAddWatchFunction DBusRemoveWatchFunction DBusWatchToggledFunction void DBusFreeFunction return DBusConnection DBusDispatchStatusFunction void DBusFreeFunction DBusTimeout return DBusTimeout return DBusWatch return DBusWatch unsigned int return DBusError const DBusError return const DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessageIter * iter
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
size_t qHash(const QFileSystemWatcherPathKey &key, size_t seed=0)
bool qFuzzyCompare(qfloat16 p1, qfloat16 p2) noexcept
qfloat16 qSqrt(qfloat16 f)
#define Q_LOGGING_CATEGORY(name,...)
#define qCCritical(category,...)
#define qCDebug(category,...)
constexpr const T & qMin(const T &a, const T &b)
constexpr const T & qMax(const T &a, const T &b)
GLboolean GLboolean GLboolean b
GLuint GLfloat GLfloat GLfloat GLfloat GLfloat z
GLuint64 GLenum void * handle
GLint GLint GLint GLint GLint x
[0]
GLboolean GLboolean GLboolean GLboolean a
[7]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLenum GLenum GLsizei count
const void GLsizei GLsizei stride
GLsizei GLsizei GLfloat distance
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum GLenum GLenum GLenum GLenum scale
GLenum GLenum GLsizei void * table
static qreal position(const QQuickItem *item, QQuickAnchors::Anchor anchorLine)
static QT_BEGIN_NAMESPACE const QRgb colors[][14]
#define QSSG_ASSERT_X(cond, msg, action)
#define QSSG_ASSERT(cond, action)
void updateDirtySkeletons(const QVector< QSSGRenderableNodeEntry > &renderableNodes)
static bool scopeLight(QSSGRenderNode *node, QSSGRenderNode *lightScope)
static void collectNodeFront(V node, QVector< T > &dst, int &dstPos)
static constexpr bool furthestToNearestCompare(const QSSGRenderableObjectHandle &lhs, const QSSGRenderableObjectHandle &rhs) noexcept
Q_REQUIRED_RESULT QSSGDataRef< T > RENDER_FRAME_NEW_BUFFER(QSSGRenderContextInterface &ctx, size_t count)
#define MAX_MORPH_TARGET_INDEX_SUPPORTS_NORMALS
static QSSGCameraRenderData getCameraDataImpl(const QSSGRenderCamera *camera)
#define MAX_MORPH_TARGET_INDEX_SUPPORTS_TANGENTS
static const QVector2D s_ProgressiveAAVertexOffsets[QSSGLayerRenderData::MAX_AA_LEVELS]
static const int REDUCED_MAX_LIGHT_COUNT_THRESHOLD_BYTES
static bool checkParticleSupport(QRhi *rhi)
#define BONEDATASIZE4ID(x)
static void sortInstances(QByteArray &sortedData, QList< QSSGRhiSortData > &sortData, const void *instances, int stride, int count, const QVector3D &cameraDirection)
#define CHECK_IMAGE_AND_PREPARE(img, imgtype, shadercomponent)
static constexpr bool nearestToFurthestCompare(const QSSGRenderableObjectHandle &lhs, const QSSGRenderableObjectHandle &rhs) noexcept
static void cullLodInstances(QByteArray &lodData, const void *instances, int count, const QVector3D &cameraPosition, float minThreshold, float maxThreshold)
Q_REQUIRED_RESULT T * RENDER_FRAME_NEW(QSSGRenderContextInterface &ctx, Args &&... args)
static void collectBoneTransforms(QSSGRenderNode *node, QSSGRenderSkeleton *skeletonNode, const QVector< QMatrix4x4 > &poses)
static bool hasDirtyNonJointNodes(QSSGRenderNode *node, bool &hasChildJoints)
static int effectiveMaxLightCount(const QSSGShaderFeatures &features)
static bool maybeQueueNodeForRender(QSSGRenderNode &inNode, QVector< QSSGRenderableNodeEntry > &outRenderableModels, int &ioRenderableModelsCount, QVector< QSSGRenderableNodeEntry > &outRenderableParticles, int &ioRenderableParticlesCount, QVector< QSSGRenderItem2D * > &outRenderableItem2Ds, int &ioRenderableItem2DsCount, QVector< QSSGRenderCamera * > &outCameras, int &ioCameraCount, QVector< QSSGRenderLight * > &outLights, int &ioLightCount, QVector< QSSGRenderReflectionProbe * > &outReflectionProbes, int &ioReflectionProbeCount, quint32 &ioDFSIndex)
void collectNode(V node, QVector< T > &dst, int &dstPos)
static float getCameraDistanceSq(const QSSGRenderableObject &obj, const QSSGCameraRenderData &camera) noexcept
#define QSSG_RENDER_MINIMUM_RENDER_OPACITY
QSSGDataView< QSSGRenderGraphObject * > QSSGMaterialListView
std::shared_ptr< QSSGRenderReflectionMap > QSSGRenderReflectionMapPtr
std::shared_ptr< QSSGRenderShadowMap > QSSGRenderShadowMapPtr
@ VSM
variance shadow mapping
@ CUBE
cubemap omnidirectional shadows
#define QSSG_REDUCED_MAX_NUM_LIGHTS
#define QSSG_MAX_NUM_LIGHTS
#define QSSG_MAX_NUM_SHADOW_MAPS
SSL_CTX int(* cb)(SSL *ssl, unsigned char **out, unsigned char *outlen, const unsigned char *in, unsigned int inlen, void *arg)
#define QStringLiteral(str)
Q_CORE_EXPORT int qEnvironmentVariableIntValue(const char *varName, bool *ok=nullptr) noexcept
QSqlQueryModel * model
[16]
QSvgRenderer * renderer
[0]
bool m_computeFrustumSucceeded
bool intersectsWith(const QSSGBounds3 &bounds) const
QSSGDefaultMaterialPreparationResult(QSSGShaderDefaultMaterialKey inMaterialKey)
QSSGRenderableImage * firstImage
QSSGRenderableObjectFlags renderableFlags
QSSGShaderDefaultMaterialKey materialKey
void setRequiresSsaoPass(bool inValue)
void setRequiresScreenTexture(bool inValue)
bool requiresDepthTexture() const
void setLayerDataDirty(bool inValue)
void setWasDirty(bool inValue)
bool requiresScreenTexture() const
bool requiresShadowMapPass() const
void setRequiresMipmapsForScreenTexture(bool inValue)
void setRequiresDepthTexture(bool inValue)
bool requiresSsaoPass() const
void setRequiresShadowMapPass(bool inValue)
bool isLayerVisible() const
QSSGLayerRenderPreparationResultFlags flags
QSize textureDimensions() const
QSSGCameraGlobalCalculationResult setupCameraForRender(QSSGRenderCamera &inCamera)
QSSGLayerRenderPreparationResult()=default
static const char * getNormalAttrName()
static const char * getPositionAttrName()
ComponentType componentType
QVector< VertexBufferEntry > entries
const QSSGRenderModel & model
QSSGDataRef< QSSGSubsetRenderable > subsets
int particleCount() const
QSSGBounds3 bounds() const
float horizontalMagnification
float getLevelOfDetailMultiplier() const
QSSGCameraGlobalCalculationResult calculateGlobalVariables(const QRectF &inViewport)
bool isDirty(DirtyFlag dirtyFlag=DirtyMask) const
float levelOfDetailPixelThreshold
float verticalMagnification
RenderFlags m_renderFlags
QSSGRenderImage * m_iblProbe
@ InverseProjectionMatrix
QSSGCullFaceMode m_cullMode
QSSGRenderImage * opacityMap
bool isClearcoatEnabled() const
QSSGRenderImage * roughnessMap
QSSGRenderImage * clearcoatMap
bool isFresnelEnabled() const
QSSGRenderImage * transmissionMap
bool isMetalnessEnabled() const
TextureChannelMapping translucencyChannel
QSSGRenderImage * thicknessMap
QSSGCullFaceMode cullMode
QSSGRenderImage * clearcoatNormalMap
QSSGRenderDefaultMaterial::MaterialSpecularModel specularModel
bool isVertexColorsEnabled() const
TextureChannelMapping transmissionChannel
QSSGRenderImage * metalnessMap
TextureChannelMapping clearcoatChannel
QSSGRenderImage * clearcoatRoughnessMap
QSSGRenderImage * iblProbe
bool isSpecularEnabled() const
QSSGRenderImage * specularReflection
QSSGRenderImage * colorMap
TextureChannelMapping heightChannel
QSSGRenderImage * bumpMap
QSSGRenderImage * heightMap
QSSGRenderDefaultMaterial::MaterialBlendMode blendMode
QSSGRenderImage * translucencyMap
TextureChannelMapping opacityChannel
MaterialLighting lighting
bool isTransmissionEnabled() const
QSSGRenderImage * occlusionMap
TextureChannelMapping occlusionChannel
TextureChannelMapping thicknessChannel
TextureChannelMapping roughnessChannel
QSSGRenderImage * normalMap
TextureChannelMapping metalnessChannel
QSSGRenderImage * specularMap
QSSGRenderDefaultMaterial::MaterialAlphaMode alphaMode
TextureChannelMapping clearcoatRoughnessChannel
QSSGRenderImage * emissiveMap
static Q_REQUIRED_RESULT constexpr bool isLight(Type type) Q_DECL_NOTHROW
static Q_REQUIRED_RESULT constexpr bool isCamera(Type type) Q_DECL_NOTHROW
static Q_REQUIRED_RESULT constexpr bool isRenderable(Type type) Q_DECL_NOTHROW
QSSGRenderImageTextureFlags m_flags
bool isImageTransformIdentity() const
MappingModes m_mappingMode
QVector< QSSGRenderSubset > subsets
QSSGParticleBuffer * particleBuffer
QSSGRenderSkeleton * skeleton
bool usesBoneTexture() const
QSSGRenderInstanceTable * instanceTable
QVector< QSSGRenderGraphObject * > materials
bool calculateGlobalVariables()
QMatrix4x4 globalTransform
QVector3D getScalingCorrectDirection() const
QVector3D getGlobalPos() const
constexpr bool getGlobalState(GlobalState stateFlag) const
constexpr bool isDirty(DirtyFlag dirtyFlag=DirtyFlag::DirtyMask) const
QSSGRenderImage * m_colorTable
QSSGRenderImage * m_sprite
QSSGParticleBuffer m_particleBuffer
QSSGRenderImage * texture
bool containsNonJointNodes
QSSGRhiInputAssemblerState ia
quint32 lodOffset(int lodLevel) const
quint32 lodCount(int lodLevel) const
QRhiTexture * targetsTexture
struct QSSGRenderSubset::@751 rhi
QSSGRenderableImage * m_nextImage
QSSGShaderLightListView lights
void setPointsTopology(bool v)
bool hasAttributeTexCoordLightmap() const
void setRendersWithLightmap(bool inRendersWithLightmap)
void setHasAttributeTexCoord1(bool b)
void setHasAttributePosition(bool b)
void setHasAttributeJointAndWeight(bool b)
bool hasAttributePosition() const
void setHasAttributeNormal(bool b)
void setHasAttributeColor(bool b)
bool hasAttributeNormal() const
void setHasAttributeTangent(bool b)
bool receivesShadows() const
void setHasAttributeMorphTarget(bool b)
void setHasAttributeTexCoordLightmap(bool b)
void setHasAttributeTexCoord0(bool b)
bool hasAttributeBinormal() const
void setCastsReflections(bool inCastsReflections)
void setCastsShadows(bool inCastsShadows)
bool hasAttributeJointAndWeight() const
bool hasAttributeColor() const
void setReceivesReflections(bool inReceivesReflections)
void setUsedInBakedLighting(bool inUsedInBakedLighting)
bool hasAttributeTangent() const
bool hasAttributeTexCoord1() const
bool hasAttributeTexCoord0() const
void setHasTransparency(bool inHasTransparency)
void setHasAttributeBinormal(bool b)
void setReceivesShadows(bool inReceivesShadows)
const QSSGBounds3 & bounds
const QMatrix4x4 & globalTransform
QSSGShaderKeyBoolean m_usesInverseProjectionMatrix
QSSGShaderKeyUnsigned< 4 > m_debugMode
QSSGShaderKeyBoolean m_usesProjectionMatrix
QSSGShaderKeyUnsigned< 8 > m_targetTexCoord1Offset
QSSGShaderKeyBoolean m_lightSpotFlags[LightCount]
QSSGShaderKeyUnsigned< 4 > m_lightCount
QSSGShaderKeyBoolean m_fogEnabled
QSSGShaderKeyBoolean m_usesInstancing
QSSGShaderKeyBoolean m_blendParticles
QSSGShaderKeyBoolean m_hasLighting
@ SingleChannelImagesFirst
QSSGShaderKeyTextureChannel m_textureChannels[SingleChannelImageCount]
QSSGShaderKeyBoolean m_clearcoatEnabled
QSSGShaderKeyBoolean m_transmissionEnabled
QSSGShaderKeyBoolean m_lightmapEnabled
QSSGShaderKeyBoolean m_usesVarColor
QSSGShaderKeyBoolean m_overridesPosition
QSSGShaderKeyBoolean m_isDoubleSided
QSSGShaderKeyImageMap m_imageMaps[ImageMapCount]
QSSGShaderKeySpecularModel m_specularModel
QSSGShaderKeyBoolean m_usesFloatJointIndices
QSSGShaderKeyBoolean m_specularEnabled
QSSGShaderKeyUnsigned< 8 > m_targetPositionOffset
QSSGShaderKeyUnsigned< 16 > m_boneCount
QSSGShaderKeyBoolean m_hasIbl
QSSGShaderKeyUnsigned< 8 > m_targetTangentOffset
QSSGShaderKeyUnsigned< 8 > m_targetTexCoord0Offset
QSSGShaderKeyUnsigned< 8 > m_targetColorOffset
QSSGShaderKeyBoolean m_vertexColorsEnabled
QSSGShaderKeyVertexAttribute m_vertexAttributes
QSSGShaderKeyUnsigned< 8 > m_targetNormalOffset
QSSGShaderKeyBoolean m_fresnelEnabled
QSSGShaderKeyBoolean m_lightFlags[LightCount]
QSSGShaderKeyUnsigned< 8 > m_targetBinormalOffset
QSSGShaderKeyAlphaMode m_alphaMode
QSSGShaderKeyUnsigned< 8 > m_targetCount
QSSGShaderKeyBoolean m_specularGlossyEnabled
QSSGShaderKeyBoolean m_lightShadowFlags[LightCount]
QSSGShaderKeyBoolean m_usesPointsTopology
QSSGShaderKeyBoolean m_specularAAEnabled
constexpr bool isSet(Feature feature) const
void set(Feature feature, bool val)
void setValue(QSSGDataRef< quint32 > inDataStore, bool inValue) const
bool getValue(QSSGDataView< quint32 > inDataStore) const
void setIdentityTransform(QSSGDataRef< quint32 > inKeySet, bool val)
void setEnabled(QSSGDataRef< quint32 > inKeySet, bool val)
void setUsesUV1(QSSGDataRef< quint32 > inKeySet, bool val)
void setLightProbe(QSSGDataRef< quint32 > inKeySet, bool val)
void setEnvMap(QSSGDataRef< quint32 > inKeySet, bool val)
void setSpecularModel(QSSGDataRef< quint32 > inKeySet, QSSGRenderDefaultMaterial::MaterialSpecularModel inModel)
void setTextureChannel(TexturChannelBits channel, QSSGDataRef< quint32 > inKeySet)
void setValue(QSSGDataRef< quint32 > inDataStore, quint32 inValue) const
QVector3D probeCubeMapCenter
bool prepareInstancing(QSSGRhiContext *rhiCtx, const QVector3D &cameraDirection, const QVector3D &cameraPosition, float minThreshold, float maxThreshold)
QSSGShaderReflectionProbe reflectionProbe
float distanceFromReflectionProbe
QRhiBuffer * instanceBuffer
const QSSGModelContext & modelContext