# Trying to understand how to construct lookup table from expression

There is a short and relatively simple paper here describing a method for antialiasing normal maps.

Whether you are very familiar with normal maps or not may not be important.

The part that I am having trouble with, is constructing the lookup table that they have described.

They provide a formula:

$\newcommand{\abs}[1]{\lvert#1\rvert}$ $$f_t = \frac{1}{1 + s \sigma^2} = \frac{\abs{N_a}}{\abs{N_a} + s(1 - \abs{N_a})}$$

And the following expression from which the table is to be constructed:

$$\frac{1 + f_t s}{1 + s}\left( \frac{N_a \cdot H}{\abs{N_a}} \right)^{f_t s}$$

The table is then to be expressed in terms of $N_a \cdot H$ and $N_a \cdot N_a$.

Does anyone understand what values the table should contain, so that it may be accessed with coordinates of the form $(N_a \cdot H, N_a \cdot N_a)$?

-

It seems to me that the answer is in the paper itself, in equation (9) at the top of page 5. There everything except for the shininess exponent $s$ is expressed in terms of $N_a\cdot H$ and $N_a\cdot N_a$. Does that answer your question? (The only difference to how you'd written it is that $|N_a|$ is replaced by $\sqrt{N_a\cdot N_a}$. Using $N_a\cdot N_a$ and not $|N_a|$ for the index is to avoid having to take a square root to compute the index.)