A [[Spherical Map]] is a type of [[Environment Mapping]] that is best used for objects that are near spherical. The actual [[Bitmap Image]] for the map will look like a square image where only the inscribed circle is used.
>[!example]
>>[!multi-column]
>>>![[Pasted image 20251201164702.png|400]]
>>
>>>![[Pasted image 20251201164718.png|400]]
### Use
For each [[Pixel]] on a spherical reflective object:
- Obtain the [[Normal Vector]] $\hat{n}$ and view vector $\hat{v}$
- Compute the [[Phong Lighting Model|reflection vector]] $\vec R$
- Compute [[Texture Coordinates]] $(u,v)$ based on $\vec R$
- Use the corresponding [[Texel]]
To get the correct texture coordinate, we define a spherical [[Coordinate System]] with radius $r=1$, such that the $z$-[[Axis]] is [[Parallel]] to $\hat v$.
This [[Linear Subspace|space]] has a [[Basis]] of $\set{ \hat{n} ,\vec R, \hat{v} }$.
$\huge \begin{align}
\hat{n} &= \frac{ \vec R + \hat{v} }{
\lvert \lvert \vec R + \hat v \rvert \rvert
}
\end{align}$
$\huge (u,v) = (n_{x}, n_{y}) $
>[!info] Pros and Cons
>*Pros*:
>- Can be generated with a photo or programmatically
>- Noe pole / boundry distortions
>- One image (view independent) or multiple images (view dependent)
>
>*Cons*:
>- Linear Interpolation is only an [[Approximation]]
>- Can be expensive if generating in real time
>- Only works for near spherical objects