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

KHR_materials_volume: clarify that the calculation of the attenuation coefficient uses a natural logarithm #2341

Open
expenses opened this issue Oct 23, 2023 · 0 comments

Comments

@expenses
Copy link

From https://github.com/KhronosGroup/glTF/tree/main/extensions/2.0/Khronos/KHR_materials_volume#attenuation:

The infinite range of the coefficient makes it rather unintuitive to control by users. To provide a convenient parameterization, this extension exposes two derived parameters: attenuation color c and attenuation distance d (see Properties). The relation between the two parameters and the attenuation coefficient σt is defined as

σt = -log(c) / d

I was just reading over these docs and had to double-check with the glTF Sample Viewer code and my own previous implementation that this coefficient uses a natural (base-e) log and not a base-10 log. It'd be great to clarify this as https://en.wikipedia.org/wiki/Attenuation_coefficient is not helpful in this regard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant