# Approximate Image-Space Multidirectional Occlusion Shading Model for Direct Volume Rendering
## 3 Image Space Multidirectional Occlusion Shading Model
### Multiple Directional Light Sources and Spotlight  
We introduced our image-space shading model with a single light source in the previous sections. Since we just needed to compute the occlusion factor \(O_{cc}\) in Equations (2) and (5), it was straightforward to extend the idea to multiple directional light sources. We defined full occlusion in this work as:  
\[O_{cc}=\left(\sum_{j}N_{oj}\right)/\left(\sum_{j}N_{j}\right), \tag{13}\]  
where \(N_{oj}\) is the number of occluded samples from the \(j\)th light source and \(N_{j}\) the total number of light samples on the \(j\)th light source. Similarly, partial occlusion was defined as:  
\[O_{cc}=\left(\sum_{j}\left(\sum_{i}O_{cci}\right)_{j}\right)/\left(\sum_{j}N_ {j}\right). \tag{14}\]  
We then blended the colors of all light sources and applied the occlusion similarly to Equation (3). Figure 8a presents an example with two light sources for the full occlusion case. The figure shows an example with two light sources \(L0\) and \(L1\). From a pixel \(P\), there were four light samples on \(L0\) and five light samples on \(L1\). Three out of four samples were occluded for \(L0\), and two out of five were occluded for \(L1\). Then, we computed the occlusion from the two light sources as \(O_{cc}=(3+2)/(4+5)=0.555\). Let us assume that the colors for the two light sources are \(C_{0}\) and \(C_{1}\) and the intensities from the two lights are \(I_{L0}\) and \(I_{L1}\). The final color at the pixel \(P\) was computed as:  
\[C_{final}=\frac{1}{2}\cdot C_{p}\cdot(C_{0}\cdot I_{L0}+C_{1}\cdot I_{L1}) \cdot(1-O_{cc}), \tag{15}\]  
where \(C_{p}\) is the color at the pixel \(P\) from the color buffer, and we ignored the \(I_{amb}\) term for simplicity. Note that the number of light sources was not limited to two, although we used only two light sources for the demonstration. Figure 8 shows the effect of our multiple directional light sources using a teddy bear dataset. The ambient occlusion in (c) provides good depth cues compared to the local illumination in (b). However, it is still difficult to locate the arms in (c). The red and blue lights are applied separately in (d) and (e), and they provide more visual cues around the arms in each direction. (f) presents the effect of the two lights applied together, by which the visual cues are further enhanced. This multiple directional light effect could not be easily generated by previous image-space illumination models since the occlusion was computed at each pixel with light coming from all directions on the hemisphere. Note that the same lights used in (d) and (e) are applied in (f), and the two light colors are blended using Equation (15). Due to the light intensities, two different colors are blended gradually.  
A spotlight can be used to emphasize a certain area. Since we had multidirectional occlusion settings, it was easy to model a spotlight. Figure 11e illustrates our spotlight model. The model was a cone with parameters, a spotting point (C) and a covering angle (\(\omega\)) from a light sample (\(L_{p}\)). We tested whether a pixel (\(P\)) was within a cone by comparing the angle \(\gamma\) with \(\omega\) (see Figure 11e for \(\gamma\) and \(\omega\)). \(\gamma\) was calculated as \(\arccos\left(\frac{(P-L_{p})\cdot(C-L_{p})}{\|P-L_{p}\cdot\|\cdot(C-L_{p}\|}\right)\). If \(\gamma\) was smaller than \(\omega\), then we computed the occlusions described in the previous sections. Otherwise, the pixel was occluded without further computations, and the color at the pixel was computed as follows.  
\[C_{final}=C_{p}\cdot I_{L}\cdot I_{amb},\]  
where we assumed that the color of the light source was white.