<p>I want to learn is it good or bad idea.</p>
<p>Let's assume video RAM is not a problem.</p>
<p>For source texture create a texture of texels: spherical functions. Spherical functions defined by small arrays of spherical harmonics coefficients up to some reasonable degree (say 3). To gather single sample for particular texel and particular coordinates on sphere (theta, phi) it is needed to integrate over the footprint (here I mean <em>footprint assembly</em> method) started from the textel and use this value later when spherical harmonic coefficients are calculated. Phi is exactly polar angle of the footprint on <code>uv</code> plane. Theta is length of the footprint up to (and from, as optimization) some reasonable length. I almost sure, that continuity is almost preserved, except bottom of the sphere (and to, where theta begins, if we starts from some threshold minimal length of a footprint).</p>
<p>There are possible some optimizations when performed backing of a footprints: save value of integrated color in both pixels footprint begins and ends. Calculate values for fixed number of directions and radii (and on power of two proximities). And, maybe others.</p>
<p>The advantage of the method is possibility to get color of whole screen pixel footprint in single sampling act. The disadvantage is requirement to prepare (<span class="math-container">$O(N^4) \approx x_{resolution} \cdot y_{resolution} \cdot n_\phi \cdot n_\theta$</span>?) such a texture for every LOD (separately? or bilinear scaling applicable?) and huge amount of memory even for coefficients of spherical harmonics to represent a spherical function of even 3 degree (<span class="math-container">$3^2 = 9$</span> RGB values) for better angular and <em>footprint length</em> resolution.</p>
<h3>ADDITIONAL</h3>
<p>Now I think there is no need to have mips. All other LODs can be modeled <strong>continuously</strong> by using different cone angle to make convolution with saved spherical function. It is very smooth.</p>
<p>It seems also better to save value of color itself, not integral over footprint, because spherical harmonics allow to easily calculate integrals (just a scalar product). Especially with zonal sperical functions like integral into a solid angle inside of arbitrary oriented cone.</p>
<p>I think this format of textures is best for cartoon industry.</p>

CC BY-SA 3.0
2018-02-09T13:38:09.740Z
What's the actual question? If your aim is to have a discussion, SE sites don't really work for that. (See [help/dont-ask] for more.)
Dan Hulme
CC BY-SA 3.0
2018-02-09T13:43:41.223Z
But http://codereview.stackexchange.com is a part of SE.
Tomilov Anatoliy
CC BY-SA 3.0
2018-02-09T13:45:56.237Z
It is sad, that there is no ideareview SE.
Tomilov Anatoliy
<antialiasing><filtering><spherical-harmonics>
Baked anisotropic filtering using spherical harmonics
Tomilov Anatoliy
# Baked anisotropic filtering using spherical harmonics

(Asked by: username_0 on 2018-02-09)

I want to learn is it good or bad idea.

Let's assume video RAM is not a problem.

For source texture create a texture of texels: spherical functions. Spherical functions defined by small arrays of spherical harmonics coefficients up to some reasonable degree (say 3). To gather single sample for particular texel and particular coordinates on sphere (theta, phi) it is needed to integrate over the footprint (here I mean *footprint assembly* method) started from the textel and use this value later when spherical harmonic coefficients are calculated. Phi is exactly polar angle of the footprint on `uv` plane. Theta is length of the footprint up to (and from, as optimization) some reasonable length. I almost sure, that continuity is almost preserved, except bottom of the sphere (and to, where theta begins, if we starts from some threshold minimal length of a footprint).

There are possible some optimizations when performed backing of a footprints: save value of integrated color in both pixels footprint begins and ends. Calculate values for fixed number of directions and radii (and on power of two proximities). And, maybe others.

The advantage of the method is possibility to get color of whole screen pixel footprint in single sampling act. The disadvantage is requirement to prepare ($O(N^4) \approx x\_{resolution} \cdot y\_{resolution} \cdot n\_\phi \cdot n\_\theta$?) such a texture for every LOD (separately? or bilinear scaling applicable?) and huge amount of memory even for coefficients of spherical harmonics to represent a spherical function of even 3 degree ($3^2 = 9$ RGB values) for better angular and *footprint length* resolution.

### ADDITIONAL

Now I think there is no need to have mips. All other LODs can be modeled **continuously** by using different cone angle to make convolution with saved spherical function. It is very smooth.

It seems also better to save value of color itself, not integral over footprint, because spherical harmonics allow to easily calculate integrals (just a scalar product). Especially with zonal sperical functions like integral into a solid angle inside of arbitrary oriented cone.

I think this format of textures is best for cartoon industry.

**Tags:** antialiasing, filtering, spherical-harmonics

> **Comments:**
> **username_1**: What's the actual question? If your aim is to have a discussion, SE sites don't really work for that. (See [help/dont-ask] for more.)  
> **username_0**: But http://codereview.stackexchange.com is a part of SE.  
> **username_0**: It is sad, that there is no ideareview SE.  

---

## 0 answers

