The [[Spot Light]] effect is a lighting effect / [[Light]] source where there is a cone of light being emitter, with a brighter iner cone and dimmer outer code. Light intensity smoothly diminishes from the inner to outer cone. The inner cone is control by a constant $\theta$ and the outer cone by $\phi$, and the rate of diminishing of the light is called the 'falloff' value $P$. $\huge S_{E} = \min\left( 1, \pa{ \frac{\cos \alpha - \cos \phi}{\cos \theta - \cos \phi} }^{P} \right) $ Where $\alpha$ is the angle between the light [[../Math/Vector|Vector]] $\vec L$ and $\vec D$ (the vector from the light's position to the fragment's position). However $S_E=0$ if $\alpha > \phi$, as this prevents $S_E$ being [[../Math/Complex Numbers|imaginary]]. $\huge S_{E} = \begin{cases} \min\left( 1, \pa{ \frac{\cos \alpha - \cos \phi}{\cos \theta - \cos \phi} }^{P} \right) & \alpha \leq \phi \\ 0 & \alpha > \phi \end{cases} $ $\huge S_{E} \in [0,1] $ The full [[../Digipen/Phong Lighting Model|Phong Illumination Equation]] for a fragment lit by a spotlight: $\huge I_{\text{total}} = I_{\text{emissive}} + I_{\text{ambient}} + S_{E}\pa{I_{\text{diffuse}}+I_{\text{specular}}} $