diff options
| author | Andy Nichols <[email protected]> | 2020-09-21 07:23:57 +0200 |
|---|---|---|
| committer | Andy Nichols <[email protected]> | 2020-09-24 20:17:23 +0200 |
| commit | c31fd387bd0e97ff5636383b4bf28bd735c2aac0 (patch) | |
| tree | 7d846c77c176c04cb2ab1590a9755f0f4c6d3d47 /src/quick3d/qquick3dsceneenvironment_p.h | |
| parent | efc03dece47281dbad6c28daf768e39edb96e71c (diff) | |
Use cubeMaps for IBL texture sources
This changes how IBL sources are pre-processed and used at runtime.
Previously we would directly use the equirectangular texture data. This
led to several issues:
- A Compute shader was required at runtime to pre-filter each mip level
(which depended on the previous level). Compute shaders are not
available everywhere, and doing the software version at runtime was very
expensive.
- Even when we had support for compute shaders the minimium number of
compute units available was not enough for decent processing.
- The method we were using for pre-filtering was not what we needed for
doing proper BRDF.
- Using equirectangular textures at runtime is expensive because each
time we want to sample the texture we have to convert the coordinate
space.
- Using equirectangular projections leads to artifacts at the poles
which lead to obvious artifacts in the skybox, as well as specular
reflections which depend on values samples against those poles.
- The lack of irradiance data let to very dark diffuse contributions.
So instead of using a prefiltered equirectangular texture directly, now
we create a cubeMap from the provided texture using a series of standard
shading passes which contains pre-filtered environment mip levels for
BRDF as well as a pre-convolved irradiance map. This eliminates all of
the above issues.
Fixes: QTBUG-78849
Fixes: QTBUG-86682
Fixes: QTBUG-86684
Fixes: QTBUG-86685
Fixes: QTBUG-86795
Change-Id: I7dcd059c8b669142fc5c368f4dbfeed199a57f16
Reviewed-by: Laszlo Agocs <[email protected]>
Diffstat (limited to 'src/quick3d/qquick3dsceneenvironment_p.h')
| -rw-r--r-- | src/quick3d/qquick3dsceneenvironment_p.h | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/src/quick3d/qquick3dsceneenvironment_p.h b/src/quick3d/qquick3dsceneenvironment_p.h index d2689b4e..01d2c007 100644 --- a/src/quick3d/qquick3dsceneenvironment_p.h +++ b/src/quick3d/qquick3dsceneenvironment_p.h @@ -78,7 +78,6 @@ class Q_QUICK3D_EXPORT QQuick3DSceneEnvironment : public QQuick3DObject Q_PROPERTY(QQuick3DTexture *lightProbe READ lightProbe WRITE setLightProbe NOTIFY lightProbeChanged) Q_PROPERTY(float probeExposure READ probeExposure WRITE setProbeExposure NOTIFY probeExposureChanged) Q_PROPERTY(float probeHorizon READ probeHorizon WRITE setProbeHorizon NOTIFY probeHorizonChanged) - Q_PROPERTY(float probeFieldOfView READ probeFieldOfView WRITE setProbeFieldOfView NOTIFY probeFieldOfViewChanged) Q_PROPERTY(QVector3D probeOrientation READ probeOrientation WRITE setProbeOrientation NOTIFY probeOrientationChanged) Q_PROPERTY(QQuick3DEnvironmentTonemapModes tonemapMode READ tonemapMode WRITE setTonemapMode NOTIFY tonemapModeChanged) @@ -143,7 +142,6 @@ public: QQuick3DTexture *lightProbe() const; float probeExposure() const; float probeHorizon() const; - float probeFieldOfView() const; QVector3D probeOrientation() const; bool depthTestEnabled() const; @@ -173,7 +171,6 @@ public Q_SLOTS: void setLightProbe(QQuick3DTexture *lightProbe); void setProbeExposure(float probeExposure); void setProbeHorizon(float probeHorizon); - void setProbeFieldOfView(float probeFieldOfView); void setProbeOrientation(const QVector3D &orientation); void setDepthTestEnabled(bool depthTestEnabled); @@ -200,7 +197,6 @@ Q_SIGNALS: void lightProbeChanged(); void probeExposureChanged(); void probeHorizonChanged(); - void probeFieldOfViewChanged(); void probeOrientationChanged(); void depthTestEnabledChanged(); @@ -241,7 +237,6 @@ private: QQuick3DTexture *m_lightProbe = nullptr; float m_probeExposure = 1.0f; float m_probeHorizon = -1.0f; - float m_probeFieldOfView = 180.0f; QVector3D m_probeOrientation; ConnectionMap m_connections; |
