实时动态阴影来补充延迟着色?
我目前有一个延迟渲染系统设置,可以渲染点光源和定向光源。 我的问题是,对于不同形式的阴影,我有什么选择,这些阴影可以基于点光源和定向光制作阴影,这些阴影可以利用延迟着色设置?
I currently have a deferred rendering system setup and can render point lights and directional lights. My question is what are my options for different forms of shadowing which can make shadows based on point lights and directional lights which can maybe make use of a deferred shading setup?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
延迟渲染实际上并没有什么特别之处,需要独特的阴影技术。 大多数产生阴影的标准方法都可以很好地与延迟渲染方案配合使用。
阴影贴图是当今游戏等实时应用程序中最常用的阴影算法。 模板阴影几年前很流行,但由于各种限制而逐渐失宠。 阴影贴图与延迟着色配合得很好。 阴影贴图的基本算法相当简单:
与渲染一样,问题在于细节。 为了获得高质量的阴影,您需要仔细设置阴影贴图投影,以充分利用阴影贴图中可用的像素(搜索透视阴影贴图、级联阴影贴图)。 由于精度问题,您将得到各种具有自阴影表面的伪影(“阴影痤疮”是最常见的一种),并且有多种策略可以减少这些伪影的发生率(深度偏差、投影矩阵调整)。 为了减少分辨率不足的阴影贴图的块状、像素化外观,您可能需要执行一些阴影贴图过滤。 百分比更接近过滤是标准方法,有多种方法可以执行 PCF。
您还面临着阴影的标准质量/性能权衡,而动态阴影往往是场景渲染中最昂贵的方面之一。 有许多技巧和技术可以尝试最大限度地提高阴影贴图的性能。
最近,基本阴影贴图算法出现了许多变体,试图通过以不同的方式处理过滤问题,为给定的阴影贴图分辨率提供更好的结果。 方差阴影贴图和指数阴影贴图是两种最新的技术,它们具有一些不错的优点,但也有一些独特的问题。
Nvidia 的 开发者网站 是一般图形编程的良好资源,并且有很多有关阴影的文章。 也可以查看该网站上提供的 GPU Gems 书籍的 HTML 版本,其中有各种有关阴影的文章,包括有关 GPU Gems 3 中的方差阴影贴图的权威文章。
There's not really anything special about deferred rendering that requires unique shadowing techniques. Most of the standard approaches to producing shadows work just fine with deferred rendering schemes.
Shadow mapping is the most common shadowing algorithm in use today in real time applications like games. Stencil shadows were popular a few years ago but have fallen out of favour a bit due to various limitations. Shadow mapping works fine with deferred shading. The basic algorithm for shadow mapping is reasonably straightforward:
As usual with rendering, the devil is in the details. In order to get good quality shadows you need to set up your shadow map projection carefully to make best use of the pixels available in the shadow map (search for perspective shadow maps, cascaded shadow maps). Due to precision issues you will get various artifacts with self shadowing surfaces ('shadow acne' is the most common one) and there are various strategies to reduce the incidence of these artifacts (depth bias, projection matrix tweaks). In order to reduce the blocky, pixelated look of shadow maps with insufficient resolution you will probably want to perform some shadow map filtering. Percentage Closer Filtering is the standard approach and there are various ways to go about performing PCF.
You also face the standard quality/performance tradeoff with shadows and dynamic shadowing tends to be one of the most expensive aspects of scene rendering. There are numerous tricks and techniques to attempt to maximize the performance of shadow mapping.
Recently there have been a number of variations on the basic shadow mapping algorithm that attempt to give better looking results for a given shadow map resolution by approaching the filtering problem differently. Variance Shadow Maps and Exponential Shadow Maps are two recent techniques that have some nice benefits but some unique problems of their own.
Nvidia's developer site is a good resource for graphics programming in general and has lots of articles on shadowing. Take a look at the HTML versions of the GPU Gems books available on the site as well, they have various articles on shadowing, including the definitive article on Variance Shadow Maps in GPU Gems 3.