• No se han encontrado resultados

ESTRUCTURA ORGANIZACIONAL Y MECANISMOS DE COORDINACIÓN

I. ANTECEDENTES DEL PROGRAMA

1.7. ESTRUCTURA ORGANIZACIONAL Y MECANISMOS DE COORDINACIÓN

Akenine-M¨oller and Assarsson [5] modify the definition of a shadow volume to produce soft shadows. Instead of a quadrilateral forming a shadow polygon, a wedge is formed from a silhouette edge that represents the penumbra region. Each wedge has a shape similar to a prism, and all the wedges surround the umbra (see Figure 4.27). To determine visibility, instead of incrementing and decrementing a

Figure 4.27. Penumbra wedges with penumbra intensity variations within a penumbra wedge. Image courtesy of Akenine-M¨oller and Assarsson [5], ©Eurographics Association 2002. Reproduced by permission of the Eurographics Association.

shadow count, a fractional counter (of changing lighting intensity) is used to in- crement and decrement when entering and exiting the wedges. A higher-precision stencil buffer is needed to deal with this lighting intensity counter. The intensity of the penumbra region has a linear decay between the wedge boundaries. As a con- sequence, the penumbra intensities are approximate, and when wedges of a single silhouette edge cross or are contained in one another, the shadow results can be wrong.

Assarsson and Akenine-M¨oller [24] improve on the original algorithm’s per- formance by separating the umbra and penumbra rasterizations. The umbra com- putations are virtually identical to the typical shadow volume approach, using the center of the light as the umbra point light source. The penumbra is only of inter- est if the point to be shaded resides within a wedge (i.e., in penumbra). If within a wedge but not in shadow from the umbra pass, then the shadow fraction is de- creased; if within a wedge but already in shadow from the umbra pass, the shadow fraction is increased to reduce the hardness of the umbra. Separating the two ras- terizations allows less intersection computations than in their original work [5], and since only visible surface points that reside within a wedge are of interest, the bounding box of minimum and maximum Z-depths can be used to cull a lot of penumbra rasterizations.

Despite the speed improvements [24], the above approaches can cause artifacts when the wedges of a single silhouette edge cross or are contained in one another; thus, another variant of the penumbra wedge solution has been proposed [23] where wedges act as conservative penumbra regions that are combined in a vis- ibility buffer bitmask to arrive at the shadow solution. In fact, the wedge created is independent of the light silhouette, and only the center point of an extended light is considered. The penumbra produced is fairly accurate unless the size of the light source is large in comparison to its shadow casters, which then results in overstated umbrae. Forest et al. [175] improve on the above problem by splitting the light into four regions, optimized by doing it in a single pass.

In terms of improving performance for the above, Assarsson et al. [25] include optimizations such as tighter shadow wedges and an optimized GPU pixel shader for rectangular and spherical lights. Viney [604] constructs penumbra wedge ge- ometry directly on the GPU using geometry shaders. Lengyel [346] suggests treat- ing a penumbra wedge as two halves, containing an inner and outer penumbra. An optimization would be to only process the outer penumbra wedge, resulting in less accurate results that still look good.

Forest et al. [176] use penumbra wedges and depth complexity sampling to ar- rive at a real-time soft shadow solution. See Section 4.7.3 for a ray tracing imple- mentation of the general approach. Forest et al. apply that general approach but use a sampling grid of only 16 samples, and instead of using ray tracing to compute the reference sample, they apply a shadow volume approach. SeeFigure 4.28and note the overstated umbrae from the penumbra-wedge approach, as compared to the more accurate result from Forest et al. [176]. Although penumbrae are generally

Figure 4.28.Comparing soft shadows from the following: penumbra wedges (left); the ap- proach of Forest et al. (center); reference image (right). Image courtesy of Forest et al. [176]. Computer Graphics Forum ©2008 The Eurographics Association and Blackwell Publishing Ltd. Published by Blackwell Publishing, 9600 Garsington Road, Oxford OX4 2DQ, UK and 350 Main Street, Malden, MA 02148, USA. Reproduced by permission of the Eurographics Associ- ation and Blackwell Publishing Ltd.

much improved, the approximate precision of the shadow fraction of the shadow volume approach may still result in penumbra errors.

Note that the implementations for the above penumbra wedge algorithms tend to be quite complex due to the many cases that need to be properly handled, and unfortunately, very little of the code from shadow volume hard shadows can be reused for soft shadows. The reward for the above algorithms remains the visually pleasing rendered results.

4.7

Ray Tracing

Ray tracing remains the most accurate, flexible, but also the slowest approach to achieving soft shadows unless the platform supports a high level of parallelism. Most of the research resides in distribution ray tracing (Section 4.7.1), although some work has been done in analytic solutions through back-projections (Sec- tion 4.7.2). Distribution ray tracing approaches tend to be easier to implement, but getting high-quality results with minimal noise and without resorting to many point light source samples tends to be challenging. Analytic solutions are more difficult to implement, but they often provide smoother-looking results. The main decision criteria to choose between the basic approaches is fundamentally how many point samples can match the analytic solution in terms of performance and quality. This is a difficult question to answer, although it is appropriate to conclude that the larger the size of the extended light, the more feasible analytic solutions become.

Faster alternatives to the above include the single-ray analytic solution (Sec- tion 4.7.3) and ray tracing depth images (Section 4.7.4), although care must be taken to avoid artifacts when using ray tracing depth images.