Real-Time Rendering——7.8 Volumetric Shadow Techniques体积阴影技术

Transparent objects will attenuate and change the color of light. For some sets of transparent objects, techniques similar to those discussed in Section 5.5 can be used to simulate such effects. For example, in some situations a second type of shadow map can be generated. The transparent objects are rendered to it, and the closest depth and color or alpha coverage is stored. If the receiver is not blocked by the opaque shadow map, the transparency depth map is then tested and, if occluded, the color or coverage is retrieved as needed [471, 1678, 1679]. This idea is reminiscent of shadow and light projection in Section 7.2, with the stored depths avoiding projection onto receivers between the transparent objects and the light. Such techniques cannot be applied to the transparent objects themselves.

透明物体会减弱并改变光线的颜色。对于一些透明物体,类似于5.5节讨论的技术可以用来模拟这种效果。例如,在某些情况下,可以生成第二种类型的阴影贴图。透明对象被渲染到它,并且存储最接近的深度和颜色或alpha覆盖。如果接收器没有被不透明阴影图阻挡,则测试透明深度图,如果被遮挡,则根据需要检索颜色或覆盖范围[471,1678,1679]。这个想法让人想起第7.2节中的阴影和光投影,存储的深度避免投影到透明物体和光之间的接收器上。这种技术不能应用于透明物体本身。

Self-shadowing is critical for realistic rendering of objects such as hair and clouds,where objects are either small or semitransparent. Single-depth shadow maps will not work for these situations. Lokovic and Veach [1066] first presented the concept of deep shadow maps, in which each shadow-map texel stores a function of how light drops off with depth. This function is typically approximated by a series of samples at different depths, with each sample having an opacity value. The two samples in the map that bracket a given position’s depth are used to find the shadow’s effect.The challenge on the GPU is in generating and evaluating such functions efficiently.These algorithms use similar approaches and run into similar challenges found for some order-independent transparency algorithms (Section 5.5), such as compact storage of the data needed to faithfully represent each function.

自阴影对于头发和云等对象的真实渲染至关重要,这些对象要么很小,要么是半透明的。单一深度阴影贴图不适用于这些情况。Lokovic和Veach [1066]首先提出了深度阴影贴图的概念,其中每个阴影贴图纹理元素都存储了一个光线随深度衰减的函数。该函数通常由不同深度的一系列样本来近似,每个样本都有一个不透明度值。贴图中包含给定位置深度的两个样本用于查找阴影的效果。GPU面临的挑战是高效地生成和评估这样的函数。这些算法使用类似的方法,并遇到与一些顺序无关的透明算法(5.5节)类似的挑战,例如忠实地表示每个函数所需的数据的紧凑存储。

Kim and Neumann [894] were the first to present a GPU-based method, which they call opacity shadow maps. Maps storing just the opacities are generated at a fixed set of depths. Nguyen and Donnelly [1274] give an updated version of this approach,producing images such as Figure 17.2 on page 719. However, the depth slices are all parallel and uniform, so many slices are needed to hide in-between slice opacity artifacts due to linear interpolation. Yuksel and Keyser [1953] improve efficiency and quality by creating opacity maps that more closely follow the shape of the model.Doing so allows them to reduce the number of layers needed, as evaluation of each layer is more significant to the final image.

Kim和Neumann [894]首先提出了一种基于GPU的方法,他们称之为不透明阴影贴图。只存储不透明度的地图是在一组固定的深度上生成的。Nguyen和Donnelly [1274]给出了这种方法的更新版本,产生了如图17.2所示的图像。然而,深度切片都是平行和均匀的,因此需要许多切片来隐藏由于线性插值而导致的切片之间的不透明伪像。Yuksel和Keyser [1953]通过创建更接近模型形状的不透明度贴图来提高效率和质量。这样做可以减少所需的层数,因为每一层的评估对最终图像更重要。

Figure 17.2. Hair rendering using tessellated cubic curves [1274]. (Image from “Nalu” demo,courtesy of NVIDIA Corporation.) 

图17.2。使用镶嵌三次曲线的头发渲染[1274]。(图片来自《路娜》演示,由英伟达公司提供。)

To avoid having to rely on fixed slice setups, more adaptive techniques have been proposed. Salvi et al. [1531] introduce adaptive volumetric shadow maps, in which each shadow-map texel stores both the opacities and layer depths. Pixel shaders operations are used to lossily compress the stream of data (surface opacities) as it is rasterized. This avoids needing an unbounded amount of memory to gather all samples and process them in a set. The technique is similar to deep shadow maps [1066], but with the compression step done on the fly in the pixel shader. Limiting the function representation to a small, fixed number of stored opacity/depth pairs makes both compression and retrieval on the GPU more efficient [1531]. The cost is higher than simple blending because the curve needs to be read, updated, and written back, and it depends on the number of points used to represent a curve. In this case, this technique also requires recent hardware that supports UAV and ROV functionality(end of Section 3.8). See Figure 7.29 for an example.

为了避免不得不依赖于固定切片设置,已经提出了更具适应性的技术。萨尔维等人[1531]引入了自适应体积阴影贴图,其中每个阴影贴图纹理元素都存储了不透明度和层深度。像素着色器操作用于在数据流栅格化时对其进行有损压缩(表面不透明度)。这避免了需要无限量的存储器来收集所有样本并在集合中处理它们。该技术类似于深度阴影贴图[1066],但压缩步骤在像素着色器中动态完成。将函数表示限制为较小的固定数量的存储不透明度/深度对,使得GPU上的压缩和检索更加有效[1531]。成本高于简单的混合,因为曲线需要读取、更新和回写,并且它取决于用于表示曲线的点数。在这种情况下,这项技术还需要支持UAV和ROV功能的最新硬件(第3.8节结束)。例子见图7.29。

Figure 7.29. Hair and smoke rendering with adaptive volumetric shadow maps [1531]. (Reprinted by permission of Marco Salvi and Intel Corporation, copyright Intel Corporation, 2010.) 

图7.29。头发和烟雾渲染与自适应体积阴影图[1531]。(经马可·萨尔维和英特尔公司许可转载,版权归英特尔公司所有,2010年。)

The adaptive volumetric shadow mapping method was used for realistic smoke rendering in the game GRID2, with the average cost being below 2 ms/frame [886].F¨urst et al. [509] describe and provide code for their implementation of deep shadow maps for a video game. They use linked lists to store depths and alphas, and use exponential shadow mapping to provide a soft transition between lit and shadowed regions.

自适应体积阴影映射方法用于游戏GRID2中的真实烟雾渲染,平均成本低于2毫秒/帧[886]。F urst等人[509]描述并提供了用于视频游戏的深度阴影贴图实现的代码。他们使用链表来存储深度和alphas,并使用指数阴影映射来提供光照和阴影区域之间的柔和过渡。

Exploration of shadow algorithms continues, with a synthesis of a variety of algorithms and techniques becoming more common. For example, Selgrad et al. [1603]research storing multiple transparent samples with linked lists and using compute shaders with scattered writes to build the map. Their work uses deep shadow-map concepts, along with filtered maps and other elements, which give a more general solution for providing high-quality soft shadows.

对阴影算法的探索仍在继续,各种算法和技术的综合变得越来越普遍。例如,Selgrad等人[1603]研究了使用链表存储多个透明样本,并使用具有分散写入的计算着色器来构建贴图。他们的工作使用深度阴影贴图概念,以及过滤贴图和其他元素,为提供高质量的软阴影提供了一个更通用的解决方案。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

椰子糖莫莫

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值