- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 4.2k
          Tweak exponential falloff in ScatteringTerm
          #21644
        
          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
base: main
Are you sure you want to change the base?
Conversation
| /// Returns a scattering medium representing an earthlike atmosphere. | ||
| /// | ||
| /// Uses physically-based scale heights from Earth's atmosphere, assuming | ||
| /// a 60 km atmosphere height: | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I took this directly from your pr @mate-h, but isn't this meant to be 100km?
| Falloff::Exponential { scale } => { | ||
| // fill discontinuity at scale == 0, | ||
| // arbitrarily choose linear falloff | ||
| if *scale == 0.0 { | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This discontinuity is kind of unfortunate, since it's there because of the division by scale below. I'm fine with it though since it lets us stay close to the "scale height" parametrization.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very clear and a sensible parameterization. Does this need a migration guide if we get it in during 0.18?
| 
 Maybe? Up to you but I'd lean towards improving module docs instead, the main friction is going to be the whole new asset type anyways. This is also much closer to what's in 0.17 than what was merged in the general scattering PR. | 
| 
 Let's prioritize that then. Better docs are much more durable. I won't block on it in this PR. | 
Objective
current exponential falloff parametrization isn't intuitive, strays from previous "scale height" parametrization common in atmospheric scattering literature
Solution
This is basically equivalent to the "scale height" parametrization
e^-(1-p)/sfor small values ofscale, but also has the nice propertiesf(0, s) = 0, f(1, s) = 1and has a broader domain for values ofscale.Testing