Skip to content

Anisotropy: Bug in the derivation of the or wrong assumption about the resulting $a_t$ and $a_b$ #306

Description

@sherholz

There seems to be a bug in the mapping from roughness and anisotropy to the GGX parameters $a_t$ and $a_b$, or a misassumption about the characteristics of the resulting values.

The spec text says the following:

The NDF terms $a_t$ and $a_b$ are more conveniently parametrized as the total roughness $r$
and an anisotropy $a∈[0,1]$. We specify the following mapping from $r$ and $a$ to $α_t$, $α_b$:
$a_t=r^2\sqrt{\frac{2}{1+(1-a)^2}}$ and $a_b=(1-a)a_t$.
This formulation satisfies $α^2_t+α^2_b=2α^2$, to preserve the average roughness regardless of the anisotropy.

First, there seems to be a typo in the formula that should be satisfied. The text says that the average roughness should be preserved, but the formula uses $a$ instead of $r$: $2a^2$ -> $2r^2$.
Second, when solving the left side of the formula by inserting the definitions of $a_t$ and $a_b$ one gets $a_t^2+a_b^2 = 2r^4$.
The result does not seem to be related to an average roughness.

To get something that fulfills the goal of a mapping that matches the average roughness, the mapping needs to be:
$a_t=r^{1/2}\sqrt{\frac{2}{1+(1-a)^2}}$ and $a_b=(1-a)a_t$.
and then the following would hold:
$a_t^2+a_b^2 = 2r$.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions