Skip to content

Conversation

@kaychang-unity
Copy link
Contributor

@kaychang-unity kaychang-unity commented Mar 4, 2021


Backport from master Purpose of #2880
This fixes ACES tonemapping not correctly working on Nintendo Switch.
The generated LUT had artefacts due to fp16 precision.
I tested Android Vulkan devices (Google Pixel 2, Glaxy S9 on ARM GPU), as well as iOS Metal (Iphone8), but the issue does not happens on these platforms.

…sion for Switch platform in order to fix ACES tonemapping artefact.

This issue does not affect other mobile platforms.
@github-actions github-actions bot added the SRP label Mar 4, 2021
@github-actions
Copy link

github-actions bot commented Mar 4, 2021

It appears that you made a non-draft PR!
Please convert your PR to draft (button on the right side of the page)
and cancel any jobs that started on Yamato.
See the PR template for more information.
Thank you!

@kaychang-unity kaychang-unity changed the title Promoted some color conversion functions to full floating point preci… Universal/fix aces filter Mar 4, 2021
@kaychang-unity kaychang-unity changed the title Universal/fix aces filter 2021.1 Universal/fix aces filter Mar 4, 2021
Comment on lines 257 to 261
#if defined(SHADER_API_SWITCH) // Must use full float precision on Switch to avoid artefact when using ACES tonemapping
float3 LinearToLMS(float3 x)
#else
real3 LinearToLMS(real3 x)
#endif
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Imo if this function needs full precision it should be changed for all platforms, otherwise we have the same issue on mobile. Checking the original PR, @eh-unity made the same comment.

Copy link
Contributor Author

@kaychang-unity kaychang-unity Mar 5, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested on iPhone8 metal and Galaxy S9 Mali-G72 Vulkan but could not reproduce the issue, hence why it is conservatively kept Switch only. But I can enable it for all platforms if you prefer. There is similar floating point fix in AcesTonemap() and NeutralCurve() for Switch but done from a different PR, do you want to change them for all platforms too?

Copy link
Contributor

@phi-lira phi-lira left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Are you going to also put a PR to master to change the behaviour to use float instead of half for all platforms?

@phi-lira phi-lira merged commit 07e1c74 into 2021.1/staging Mar 10, 2021
@phi-lira phi-lira deleted the 2021.1/universal/fix-aces-filter branch March 10, 2021 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants