Skip to content
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

Clarify and simplify formula for attenuation #2414

Merged
merged 1 commit into from
Jun 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions extensions/2.0/Khronos/KHR_materials_volume/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,15 @@ T(*x*) = e<sup>-σ<sub>t</sub>*x*</sup>

where T is commonly referred to as *transmittance*.

Substituting σ<sub>t</sub> in the previous equation by its definition via *attenuation color* and *attenuation distance*, as defined above, and setting *x* = *d* we get
Substituting σ<sub>t</sub> in the previous equation by its definition via *attenuation color* and *attenuation distance*, as defined above, we get

T(d<sub>a</sub>) = e<sup>(log(*c*) / *d*) * *d*</sup> = *c*
T(x) = e<sup>(log(*c*) / *d*) * *x*</sup>

So, after traveling distance *d* through the medium we get attenuation color *c*.
The above formula can be simplified as:

T(x) = *c*<sup> *x* / *d*</sup>

So, after traveling distance *x* through a medium with attenuation color *c* and attenuation distance *d*, we get we get transmittance T(x).

## Base Color and Absorption

Expand Down
Loading