However, I managed a bit of a small step in the right direction with depth values. By taking the depth value and forming it to a linear set of values between 0.0f and 1.0f (transform to NDC coordinates, then work backwards according to the (1/z - 1/near / 1/far - 1/near) for depth calculation, I finally got the values I was looking for (with a bit of clamping). By multiplying said fog by a set constant value, the objects would fade into grey based on their depth values in the scene. This worked well, even with the vertices that weren't well spread out on the plane. I'm thinking with a floor or terrain with more vertices, such a problem won't be present. The skybox is still there, but is also interpolated with the foggy color to seem more natural compared to the rest of the objects.
Before I start working on something snow related, I may want to replace the gigantic wall with something more realistic like a building. That will be the next step.
No comments:
Post a Comment