AcademySoftwareFoundation / AcademySoftwareFoundation/OpenPBR

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

Open
#306 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
CSS
Stars
793
Forks
44
PR merge metrics
No merged PRs in 30d

Description

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$.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by checking the cited specification passage and independently derive the stated mapping and roughness-preservation condition. Compare the derivation with the proposed alternative, then document or update the specification once the intended parameterization and formula are confirmed.

Written by the indexing model from the issue text.

Assessment

Domain
computer-graphics
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.