32 enum class SkyboxMode { Cubemap, ScreenSpaceFull, ScreenSpaceHalf, ScreenSpaceQuarter };
34 int radianceMapSize = 512;
35 int iblSampleCount = 16;
36 int iblSamplesPerFrame = 0;
37 int iblRenderFrames = 0;
38 SkyboxMode skyboxMode = SkyboxMode::Cubemap;
39 bool wantsMoreFrames =
false;
40 bool enableIBL =
false;
42 QSSGRenderSkyMaterial();
43 ~QSSGRenderSkyMaterial();
45 QList<QSSGBaseTypeProperty> propertyUniforms;
48 QSSGRhiShaderPipelinePtr iblPassPipeline;
51 QSSGRhiShaderPipelinePtr backgroundPipeline;
53 QSSGRhiShaderPipelinePtr ensurePipeline(
const QSSGRenderContextInterface &sgContext);
54 QSSGRhiShaderPipelinePtr ensureBackgroundPipeline(
const QSSGRenderContextInterface &sgContext,
55 const QSSGShaderFeatures &tonemapFeatures,
60 quint32 updateUniforms(
const QSSGRenderContextInterface &sgContext,
62 const QMatrix4x4 &mvp,
63 const QVarLengthArray<QMatrix4x4, 6> views,
64 QRhiResourceUpdateBatch *rub);
65 void updateBackgroundUniforms(
const QSSGRenderContextInterface &sgContext,
67 const QVarLengthArray<QMatrix4x4, 2> &inverseProjections,
68 const QVarLengthArray<QMatrix4x4, 2> &viewRotations,
71 QRhiResourceUpdateBatch *rub);
73 QByteArray fragmentShaderSource;
75 QByteArray shaderPathKey =
"sky material --";
78 bool isFragmentShaderDirty =
true;
79 bool isBackgroundShaderDirty =
true;
81 QSSGRhiShaderResourceBindingList bindings;
82 QSSGRhiShaderResourceBindingList backgroundBindings;
85 QSSGRhiShaderPipelinePtr buildPipeline(
const QSSGRenderContextInterface &sgContext,
86 QByteArray vertexShader,
87 const QSSGShaderCustomMaterialAdapter::StringPairList &vertexViewDependentUniforms,
88 const QSSGShaderCustomMaterialAdapter::StringPairList &vertexUniforms,
89 const QByteArray &fragmentMainSnippet,
90 const QSSGShaderCustomMaterialAdapter::StringPairList &fragmentUniforms,
91 const QSSGShaderFeatures &features,
93 const QByteArray &cacheKeyTag);
95 quint32 m_backgroundTonemapKey = quint32(-1);
96 int m_backgroundViewCount = 0;
void setDescription(QSSGRhiContext &rhiCtx, QRhiTextureRenderTargetDescription rtDesc, QRhiTextureRenderTarget::Flags={})
void reset(QSSGRhiResourceRegistry *registry)
static void releaseAutoLodDataIf(QHash< const QSSGRenderModel *, QSSGRhiInstanceBufferData > &instanceBuffersPerModel, Predicate release)
static QString getUBMemberSizeWarning(QLatin1StringView name, qsizetype correctedSize, qsizetype requestedSize)
static QByteArray asLookupKey(QByteArrayView name)