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 void updateBackgroundUniforms(
const QSSGRenderContextInterface &sgContext,
66 const QVarLengthArray<QMatrix4x4, 2> &inverseProjections,
67 const QVarLengthArray<QMatrix4x4, 2> &viewRotations,
71 QByteArray fragmentShaderSource;
73 QByteArray shaderPathKey =
"sky material --";
76 bool isFragmentShaderDirty =
true;
77 bool isBackgroundShaderDirty =
true;
79 QSSGRhiShaderResourceBindingList bindings;
80 QSSGRhiShaderResourceBindingList backgroundBindings;
83 QSSGRhiShaderPipelinePtr buildPipeline(
const QSSGRenderContextInterface &sgContext,
84 QByteArray vertexShader,
85 const QSSGShaderCustomMaterialAdapter::StringPairList &vertexViewDependentUniforms,
86 const QSSGShaderCustomMaterialAdapter::StringPairList &vertexUniforms,
87 const QByteArray &fragmentMainSnippet,
88 const QSSGShaderCustomMaterialAdapter::StringPairList &fragmentUniforms,
89 const QSSGShaderFeatures &features,
91 const QByteArray &cacheKeyTag);
93 quint32 m_backgroundTonemapKey = quint32(-1);
94 int m_backgroundViewCount = 0;
~QSSGRhiRenderableTextureV2()
void setDescription(QRhi *rhi, QRhiTextureRenderTargetDescription rtDesc, QRhiTextureRenderTarget::Flags={})
static QString getUBMemberSizeWarning(QLatin1StringView name, qsizetype correctedSize, qsizetype requestedSize)