This PR implements enhanced terrain fog and cloud rendering similar to newer vanilla versions. For terrain, we now blend against the rendered sky at the edge of render distance, rather than just using a provided fog color. This fixes ugly terrain-shaped silhouettes during sunsets etc. This change also applied to clouds, which use the same fog rendering logic, causing a new issue: clouds disappeared into the sky rather than their silhouette still being visible. To fix this properly, I decided to just take the opportunity to do a long-overdue overhaul of the cloud renderer. It now lives in common (so any renderer can use it) and uses vertex pulling, which enabled extending the cloud render distance. The fog calculations were also reworked to make sense with our new formulas.
The remaining limitation is that clouds aren't part of the sky texture, so distant fogged terrain in front of clouds shows as a sky-coloured silhouette.
This PR implements enhanced terrain fog and cloud rendering similar to newer vanilla versions. For terrain, we now blend against the rendered sky at the edge of render distance, rather than just using a provided fog color. This fixes ugly terrain-shaped silhouettes during sunsets etc. This change also applied to clouds, which use the same fog rendering logic, causing a new issue: clouds disappeared into the sky rather than their silhouette still being visible. To fix this properly, I decided to just take the opportunity to do a long-overdue overhaul of the cloud renderer. It now lives in common (so any renderer can use it) and uses vertex pulling, which enabled extending the cloud render distance. The fog calculations were also reworked to make sense with our new formulas.
The remaining limitation is that clouds aren't part of the sky texture, so distant fogged terrain in front of clouds shows as a sky-coloured silhouette.
This is based on an existing attempt by @rdh.
Bind the sky texture once per capture instead of on every program setup, free it when sky fog is off, and stop the LEGACY texelFetch remap from leaking into other includes.
Clouds are vertex-pulled like vanilla's since 1.21.6, keeping per-cell colors
from the clouds texture, and fade out over their own range instead of using
terrain fog. Shader packs generate the same vertices through CloudVertices.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
This PR implements enhanced terrain fog and cloud rendering similar to newer vanilla versions. For terrain, we now blend against the rendered sky at the edge of render distance, rather than just using a provided fog color. This fixes ugly terrain-shaped silhouettes during sunsets etc. This change also applied to clouds, which use the same fog rendering logic, causing a new issue: clouds disappeared into the sky rather than their silhouette still being visible. To fix this properly, I decided to just take the opportunity to do a long-overdue overhaul of the cloud renderer. It now lives in common (so any renderer can use it) and uses vertex pulling, which enabled extending the cloud render distance. The fog calculations were also reworked to make sense with our new formulas.
The remaining limitation is that clouds aren't part of the sky texture, so distant fogged terrain in front of clouds shows as a sky-coloured silhouette.
This is based on an existing attempt by @rdh.