III.3.3 Clipping of beams against room geometry
Even more accurate beams can be obtained if the beams are clipped against the geometry, in addition to the originating beam, as illustrated below.

- Alternate between 'Basic beam-tracing' and 'Full beam-clipping' to see how the shape of the lowest beam changes due to clipping.
- You can animate through the clipping process step-by-step with 'Animate clipping'. It is best seen in the 'Plain image source method' mode.
- Move the sound source up and down to see how the width of the lowest beam changes.

Zoom: Visualization: Wavefronts Full ray paths Raylets
Plain image source method Basic beam-tracing Full beam-clipping

However, performing this is computationally heavy in real cases. Below is an algorithm for that and a call for that should be added into the beam-tracing algorithm shown earlier.

Algorithm: Full beam clipping against all surfaces in the geometry

The most difficult part in the algorithm above is the function differenceBeam that would clip out tmpBeam out of newBeam . This algorithm is straightforward to implement for the 2D case demonstrated here, but making it work in 3D would be much more challenging. It could end up in cases in which the beam cross-sections could have holes or will be split into several disjoint parts. Handling all those would be much more tedious when compared to the option of retaining the original cross-sectional shapes that are typically low-order polygons. For this reason, it is typically more efficient not to perform full 3D clipping in real applications, but instead, use more approximate beams. However, if those are done properly, there is no need to perform any ray validation, but it is sufficient to know if the listener is inside a beam or not, and there are no obstructions in the last section of the reflection path. To see and verify this, please, move the listener around and notice that valid paths are possible only inside the beams.