-
Notifications
You must be signed in to change notification settings - Fork 20
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
Distance fog changes colour based on height relative to ground plane #54
Comments
A naive solution, passing the elevation into the shader and just picking a color before proceeding as usual, would be simple but incorrect and a bit ugly, as it doesn't account for the appearance of a view ray that passes through multiple layers of fog. I suspect a reasonably cheap analytic model for the color of a ray passing through elevation-sensitive fog could be derived (@MagmaMcFry how's your calculus? I think we can pose this as a fairly straightforward integral), and even if not, a precomputed 2D LUT could still be used, parameterized by altitude and angle. We'd have to fudge it a bit to keep visibility similar to the nonphysical exponential-squared fog we have now, of course. |
Relevant discussion of elevation fog in euclidean space: https://www.iquilezles.org/www/articles/fog/fog.htm |
While this is very true for the time being, I think it will be mitigated once we have collision detection, gravity, and gravity-based camera orientation. That said, nonuniform fog is still pretty. |
The naive solution was what I had in mind when I raised the issue---global fog colour as a function of elevation instead of a constant. It seems there are multiple motivations, pulling in different directions, when it comes to designing and implementing how fog works. On one hand there's fog as merely something to solve problems such as chunks popping into existence too suddenly, or not knowing how far you are from the plane. On the other, there's fog treated as a physical feature of the world, where simulating it correctly is important for its own sake. And then there are aesthetic considerations. What's your overall vision for the place of fog in hypermine? |
I see thick fog as an unfortunate compromise we have to make due to a poor view distance, but so long as we're going to have it I'd like it to be pretty. In an ideal world where our view distance is much larger, we still want slight fog because it's a key element of depth perception, but it would be far more subtle, and more physically plausible. Elevation-based color variation is desirable regardless. The naive solution is definitely an improvement, but an approach that models the effect of a ray passing through a range of elevations will be a large improvement. |
It would be helpful when navigating to have some visual feedback about how deep or how high you are on a large scale. Equidistant surfaces tend to look equally curved beyond a certain size and it is difficult to find your way back to planar ground when you're on an equidistant.
The text was updated successfully, but these errors were encountered: