Skip to content

Restore default sky roughness levels to 8.#116154

Merged
Repiteo merged 1 commit into
godotengine:masterfrom
clayjohn:sky-roughness
Feb 11, 2026
Merged

Restore default sky roughness levels to 8.#116154
Repiteo merged 1 commit into
godotengine:masterfrom
clayjohn:sky-roughness

Conversation

@clayjohn
Copy link
Copy Markdown
Member

Fixes: #116146

In 4.6 (#107902) we switched to using only 7 roughness levels by default so that we could have the same number of roughness levels when using the "update once" mode and the "update always mode". We also found it helped alleviate some artifacts along seams using our old seam blending approach. However, by the time we merged the work, we used a different approach for seam blending that didn't suffer from the same issue.

In hindsight, we should have switched back to 8 layers. But in testing we didn't notice any issues.

In the MRP from #116146, we have a very poorly formed HDR with 2 pixels that are 100x brighter than the next brightest handful of pixel and 10,000 times brighter than the average pixel. This causes really bad undersampling artifacts. Godot does the best it can to handle such HDRIs, but the results are not good (see #116146 (comment) for example).

In 4.5.1, this specific case looked okay because it uses full roughness and the environment map is downsampled so far (2x2 pixels per face) that the undersampling isn't visible. When using a lower roughness however, the problems are obvious.

In 4.6, we see an issue since the lowest mip level is 10x10 (8x8 + 1 pixel padding) and thus is slightly higher frequency and is able to show off the undersampling artifacts more.

By increasing the roughness levels by one, we decrease the final mip level to 6x6 (4x4 + 1 pixel padding) which much more closely matches the final frequency in 4.5.1. This gives the appearance of removing the artifacts in 4.6-stable. However, I want to strongly note that the generated environment map is bad in both cases. The particular case of a fully rough, non-metallic object looks better, but the actual result is still bad overall.

That being said, I think we should go ahead with this for 4.7 and 4.6.2 as matching the behaviour in 4.5.1 is important and worth doing on its own since we don't want to regress. Even though it is only going from bad behaviour to worse behaviour.

This PR
Screenshot from 2026-02-10 15-12-18

4.5.1
Screenshot from 2026-02-10 15-10-16

4.6
Screenshot from 2026-02-10 15-10-04

In the future #108127 will help tremendously. And should pave the way for further optimizations

…h non-metallic objects that have a very noisy HDRI
@clayjohn clayjohn added this to the 4.7 milestone Feb 10, 2026
@clayjohn clayjohn requested review from a team as code owners February 10, 2026 23:30
@clayjohn clayjohn added bug topic:rendering regression cherrypick:4.6 Considered for cherry-picking into a future 4.6.x release labels Feb 10, 2026
Copy link
Copy Markdown
Contributor

@passivestar passivestar left a comment

Choose a reason for hiding this comment

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

I didn't compile this but I can confirm that setting roughness layers to 8 in 4.6 fixes the issues

Copy link
Copy Markdown
Contributor

@BlueCube3310 BlueCube3310 left a comment

Choose a reason for hiding this comment

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

This makes me wonder if the roughness layer editor setting should just be ignored for mip-based roughness, and instead have it be automatically determined based on the envmap resolution.
It makes sense to keep it manually adjustable for layer-based roughness where the memory and computational costs are higher, and you can get away with ~4 layers and still have fairly decent-looking ambient/specular light.

@Repiteo Repiteo merged commit 724ab21 into godotengine:master Feb 11, 2026
20 checks passed
@Repiteo
Copy link
Copy Markdown
Contributor

Repiteo commented Feb 11, 2026

Thanks!

@Repiteo
Copy link
Copy Markdown
Contributor

Repiteo commented Feb 20, 2026

Cherry-picked for 4.6.2.

@Repiteo Repiteo removed the cherrypick:4.6 Considered for cherry-picking into a future 4.6.x release label Feb 20, 2026
@clayjohn clayjohn deleted the sky-roughness branch April 7, 2026 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Broken ambient light from reflection probes (regression)

5 participants