Helgard opened this issue on Jun 26, 2010 · 195 posts
bagginsbill posted Fri, 09 July 2010 at 12:53 AM
The first is the DepthCue_StartDist(ance). Until the distance is bigger than this value, the attenuation is 1.
The second is the DepthCue_EndDist(ance). This is the distance at which the attenuation is 0.
For any distance between those two, the attenuation is a linear decrease from 1 to 0.
If we denote the start distance with the letter a, and the end distance with the letter b, then the function that is implemented inside the Atmosphere node for DC is shown in the attached graph.
The linear decreasing region is implemented by 1 - (x - a) / (b - a). Of course that is a straight line forever, so the effective value is Clamped. Clamped just means the value is constrained to be at least 0 and no more than 1.
So the full equation is Clamp(1 - (x - a) / (b - a)), but I'm not going to keep writing the Clamp part. Just keep in mind that attenuation is always in the range 0 to 1.
Renderosity forum reply notifications are wonky. If I read a follow-up in a thread, but I don't myself reply, then notifications no longer happen AT ALL on that thread. So if I seem to be ignoring a question, that's why. (Updated September 23, 2019)