Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve roughness consistency between High Quality and Real Time environment sky filtering modes #56058

Closed
Calinou opened this issue Dec 18, 2021 · 1 comment · Fixed by #58418

Comments

@Calinou
Copy link
Member

Calinou commented Dec 18, 2021

Godot version

4.0.dev (8485d0c)

System information

Fedora 34, GeForce GTX 1080 (NVIDIA 470.74)

Issue description

Not critical for 4.0's release, but we should try to figure out if we can bring the roughness appearance closer to each other between the High Quality and Real Time sky filtering modes. (I am not referring to the presence of fireflies in the reflection here, which is an unrelated problem.)

Most importantly, materials with intermediate roughness values (0.3-0.8) tend to appear less rough on average when using the Real Time sky filtering mode. This caveat is shared both by the medium quality and high quality modes available in for the Real Time filtereing mode the project settings.

I think we should first try to determine which one is the most correct, perhaps by comparing the result with a reference raytracing renderer (Cycles, Mitsuba, …). Then we can try to better fit the sky filtering mode that's the furthest away from the reference renderer closer to the other mode (or perhaps find a middle ground if that happens to be the case).

It is unlikely that we will be able to find a perfect match for both modes, but it should be possible to bring them slightly closer to each other to make switching between both modes more convenient for users.

To see the difference in roughness rendering, focus on the top row where the difference between roughness generation is the most noticeable:

High Quality

X axis is roughness (left: 0.0, right: 1.0), Y axis is metallic (top: 1.0, bottom: 0.0).

The scene does not feature a visible DirectionalLight node, so only environment lighting is used here.

image

Real Time (medium quality, default)

image

Real Time (high quality)

image

Steps to reproduce

  • Add a WorldEnvironment with a highly detailed PanoramaSkyMaterial texture (https://polyhaven.com/hdris is a good source).
  • Add a MeshInstance with a SphereMesh and StandardMaterial3D that has Roughness = 0 and Metallic = 1.
  • Create 10 more MeshInstances. Do the same with various roughness values, in increments of 0.1 up to 1.0.

Minimal reproduction project

tests/3d/test_pbr_radiance_high_quality.tscn and tests/3d/test_pbr_radiance_real_time.tscn in https://github.com/Calinou/godot-rendering-tests

@clayjohn
Copy link
Member

clayjohn commented Dec 18, 2021

For future reference, the fast filtering is based on https://research.activision.com/publications/archives/fast-filtering-of-reflection-probes and it uses the precaclulated coefficients from the paper as well.

Activision uses a glossiness model which they convert to roughness for the purposes of calculating the coefficients. It is possible that their conversion of glossiness->roughness results in a slightly mapping of roughness. Our "high quality" filtering uses roughness based on a GGX model where roughness is squared in order to make it more perceptually linear. If Activision's Glossiness model doesn't do something similar, then that may explain the difference.

_edit: I have taken a closer look and indeed, simply mapping roughness to sqrt(roughness) when using real time mode makes realtime and high_quality match. This will be difficult to fix. The Realtime mode uses precomputed tables that days of precomputation time to create. _

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants