Details
Description
Currently the engine renders into linear color space, but this doesn't get corrected before getting rendered by Qt Quick. It is even somewhat broken now because while the Skybox rendering is tonemapped and gamma corrected, the scene rendered is not. We have several different potential paths so Tonemapping in a generic way is difficult.
Direct Rendering:
Overlay
Underlay
RenderNode
In the direct rendering case we would need to perform Tonemapping and gamma correction as part of the shading for each draw call. So before gl_fragColor = ... we would need to call a tonemap function.
Offscreen Rendering:
In the offscreen rendering case, we have an opportunity to perform color correction only once before it is rendered by Qt Quick. Right now we just use a simple texture node which would just perform a blit, but here we could have a custom tonemapped texture node which performes the tone mapping function once per view.
Post Processing:
When using post processing effects with any of the View3D render modes, the 3D scene is always rendered off-screen internally, so we would need to turn off both of the above methods conditionally, and then the expectation is that the Post processing stack would be responsible for tone-mapping, as this is normally where this step is done in 3d engines.
This creates somewhat convoluted logic, so whatever solution is created should provide test cases to validate each case working, and regression tests so we can keep this logic sound.
Attachments
Gerrit Reviews
For Gerrit Dashboard: QTBUG-82335 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
311633,13 | Add support for tonemapping | dev | qt/qtquick3d | Status: MERGED | +2 | 0 |