paper 72 :高动态范围(HDR)图像 HDR (High Dynamic Range)

摘要:
允许内部图像,0…1值之外的范围是高动态范围渲染。使用HDR时,使用相机组件上的设置为每个相机单独启用HDHDR:-HDR为每个相机组件单独启用设置:当HDR处于活动状态时,场景渲染到HDR图像缓冲区,该缓冲区分析0…1范围之外的修改像素值。此缓冲区是使用图像效果的输入过程,例如HDBloom。色调映射图像效果是将HDR图像转换为标准的低动态图像以供显示。如果只在后面应用LDR图像效果,则必须在图像效果管道中的某个点应用到LDR的转换,而不需要定义。惯例,某些图像效果自动转换为LDRaf以应用HDRefect。当HDR被激活时,场景被配置为HDR图像缓冲区,该缓冲区可以保存0.1范围之外的像素值。色调映射图像效果是将HDR图像转换为标准的低动态范围图像传输显示。色调映射色调映射是将HDR值映射回LDR范围的过程。有很多不同的技术,对一个项目有利的可能对另一个项目不利。Unity TousettheselectAssets-˃ImportPackage-˃ImageEffects中包含一个映射图像效果共享的可用性,选择组件-˃ImageEffects-˃ToneMapping中的相机,可以在图像效果文档中找到映射类型的详细说明。色调映射是反映返回到LDR范围的HDR值的过程。Unity中包含了各种色调映射图像效果。HDR中显示了一个异常的亮度。一个映射用于将右侧内容返回到可显示范围。在HDR下渲染以查看额外亮度。色调映射用于将亮度强度降低到可显示范围。

In standard rendering, the red, green and blue values for a pixel are each represented by a fraction in the range 0..1, where 0 represents zero intensity and 1 represents the maximum intensity for the display device. While this is straightforward to use, it doesn't accurately reflect the way that lighting works in a real life scene. The human eye tends to adjust to local lighting conditions, so an object that looks white in a dimly lit room may in fact be less bright than an object that looks grey in full daylight. Additionally, the eye is more sensitive to brightness differences at the low end of the range than at the high end.

在标准渲染,每像素的红、绿、蓝值表示0~1的范围比例,其中0表示零强度和1表示显示设备的最大强度。虽然这是直观使用,它并不能准确反映在真实的生活场景的照明。人眼倾向于以适应本地的照明条件,所以,一个物体在昏暗的房间里看起来是白色的,并不比在日光下灰色的物体亮。此外,眼睛在该范围看低处的亮度差异比在高处更敏感。

More convincing visual effects can be achieved if the rendering is adapted to let the ranges of pixel values more accurately reflect the light levels that would be present in a real scene. Although these values will ultimately need to be mapped back to the range available on the display device, any intermediate calculations (such as Unity's image effects) will give more authentic results. Allowing the internal representation of the graphics to use values outside the 0..1 range is the essence of High Dynamic Range (HDR) rendering.

更有说服力的视觉效果可以实现,如果让渲染适应像素值的范围更准确的反射灯光的等级,这将是一个真实的场景。虽然这些值将最终需要被映射回显示设备的可用范围,任何中间计算(如Unity的图像效果)将提供更真实的结果。允许使用内部的图像,0...1值外范围是高动态范围(HDR)渲染。

Working with HDR 使用HDR

HDR is enabled separately for each camera using a setting on the Camera component:-

HDR为每个相机组件单独启用设置:

paper 72 :高动态范围(HDR)图像 HDR (High Dynamic Range)第1张

When HDR is active, the scene is rendered into an HDR image buffer which can accommodate pixel values outside the 0..1 range. This buffer is then postprocessed using image effects such as HDR bloom. The tonemapping image effect is what converts the HDR image into the standard low dynamic range (LDR) image to be sent for display. The conversion to LDR must be applied at some point in the image effect pipeline but it need not be the final step if LDR-only image effects are to be applied afterwards. For convenience, some image effects can automatically convert to LDR after applying an HDR effect (see Scripting below).

当HDR激活,该场景被渲染成一个HDR图像缓冲区可容纳0..1范围以外的像素值。这个缓冲区然后被后期处理使用图像效果,如HDR bloom。色调映射tonemapping图像效果是转换HDR图像到标准的低动态范围(LDR)图像发送显示。转换到LDR必须在一些点应用图像效果管线,如果仅LDR图像效果在后来应用,但它不需要最后一步。为方便起见,一些图像效果能自动转换为 LDR之后应用HDR效果(请参见下面的脚本)。

Tonemapping 色调映射

Tonemapping is the process of mapping HDR values back into the LDR range. There are many different techniques, and what is good for one project may not be the best for another. A variety of tonemapping image effects have been included in Unity. To use them select Assets -> Import Package -> Image Effects (Pro Only) select the camera in the scene then select Component -> Image Effects ->ToneMapping a detailed description of the tonemapping types can be found in the image effects documentation.

Tonemapping是HDR值反映射回到LDR范围的过程。有许多不同的技术,在这个项目是好的,未必在另外一个项目也是最好的。各种tonemapping图像特效已包含在Unity中。要使用他们,选择Assets -> Import Package -> Image Effects (Pro Only) ,选择在场景中的摄像机,然后选择Component -> Image Effects ->ToneMapping,关于tonemapping类型的详细描述,可以在图像特效文档找到image effects documentation.。

paper 72 :高动态范围(HDR)图像 HDR (High Dynamic Range)第2张

An exceptionally bright seen rendered in HDR. Tonemapping is used to bring the bright intensities back into the displayable range.

在HDR下渲染看到格外明亮。 tonemapping用于把明亮的强度降低到可显示的范围。

HDR Bloom

Using HDR allows for much more control in post processing. LDR bloom has an unfortunate side effect of blurring many areas of a scene even if their pixel intensity is less than 1.0. By using HDR it is possible to only bloom areas where the intensity is greater than one. This leads to a much more desiarable outcome with only super bright elements of a scene bleeding into neighboring pixels. The built in 'Bloom and Lens Flares' image effect now also supports HDR. To attach it to a camera select Assets -> Import Package -> Image Effects (Pro Only) select the camera in the scene then select Component -> Image Effects ->Bloom (Supports HDR and Lens Flare) a detailed description of the 'Bloom and Lens Flares' effect can be found in the image effects documentation.

使用HDR,允许更多的后处理控制。LDR bloom有些副作用,场景的许多区域变得模糊,即使他们的像素强度小于1.0。通过使用HDR,只bloom像素强度大于1的区域。这将导致一个场景中超高亮度元素渗色到邻近的像素得到更理想的结果。内置的"Bloom and Lens Flares'"的图像特效现在也支持HDR。选择Assets -> Import Package -> Image Effects (Pro Only) 把它关联到摄相机,选择在场景中的摄像机,然后选择Component -> Image Effects ->Bloom (Supports HDR and Lens Flare) (支持HDR和镜头光晕),详细描述 "Bloom and Lens Flares'"效应,可以查阅图像特效文档 image effects documentation。

paper 72 :高动态范围(HDR)图像 HDR (High Dynamic Range)第3张

An exceptionally bright scene where bloom has been applied to intensities greater than 1.0. The bloomed image has also been tonemapped back into the displayable range.

一个格外明亮的场景,像素强度>1.0的地方已经使用bloom。Bloom处理后的图像也进行tonemapped,变到可显示的范围。

Advantages of HDR ( HDR的优势)

  • Colors not being lost in high intensity areas 颜色在高强度区域不会丢失
  • Better bloom support 更好支持bloom
  • Reduction of banding in low frequency lighting areas 减少低频照明区域的波段

Disadvantages of HDR ( HDR的缺点)

  • Uses Floating Point buffers (rendering is slower and requires more VRAM) 
    使用浮点缓冲区(渲染很慢并且需要更多显存)
  • Not supported on all hardware 
    不是所有的硬件都支持

Usage notes 使用说明

Forward Rendering 正向渲染

In forward rendering mode HDR is only supported if you have an image effect present. This is due to performance considerations. If you have no image effect present then no tone mapping will exist and intensity truncation will occur. In this situation the scene will be rendered directly to the backbuffer where HDR is not supported.

正向渲染模式下,HDR仅支持在如果目前有一个图像特效的情况下。这是由于性能方面的考虑。如果你当前没有图像效果那么将不会发生色调映射和发生强度截断。在这种情况下,场景将直接渲染到不支持HDR的后备缓冲区。

Deferred Rendering 延迟渲染

In HDR mode the light prepass buffer is also allocated as a floating point buffer. This reduces banding in the lighting buffer. HDR is supported in deferred rendering even if no image effects are present.

在HDR模式下,灯光prepass缓冲区也被分配成浮点缓冲区。这将减少照明缓冲区的波段。即使当前没有图像特效,在延迟渲染下支持HDR。

Scripting 脚本

The ImageEffectTransformsToLDR attribute can be added to an image effect script to indicate that the target buffer should be in LDR instead of HDR. Essentially, this means that a script can automatically convert to LDR after applying its HDR image effect.

ImageEffectTransformsToLDR属性可以被添加到图像效果脚本来表示目标缓冲区应该是在LDR,而不是HDR的。基本上,这意味着一个脚本可以自动转换到LDR后应用HDR图像效果。

免责声明:文章转载自《paper 72 :高动态范围(HDR)图像 HDR (High Dynamic Range)》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇LoadRunner系列之—-01 接口压力测试脚本curator框架的使用以及实现分布式锁等应用与zkclient操作zookeeper,简化复杂原生API下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

高动态范围光照(High Dynamic Range Imaging,简称HDRI或HDR)

1 HDR基本概念 高动态范围光照(High Dynamic Range Imaging,简称HDRI或HDR),是一种表达超过了显示器所能表现的亮度范围的图像映射技术,已成为目前游戏应用不可或缺的一部分。通常,显示器能够显示R、G、B分量在[0, 255]之间的像素值。而256个不同的亮度级别显然不能表示自然界中光线的亮度情况。比如,太阳的亮度可能是一个...