铁匠smith

Early in the planning phase of The Blacksmith, we knew we wanted an atmospheric scattering solution that would give us a little bit more detail and control than the built-in fog options. In particular, we wanted to emphasize the aerial perspective effect in some of the more expansive shots in the movie.

在铁匠铺的规划阶段初期,我们知道我们需要一种大气散射解决方案,该解决方案比内置雾气选项能够给我们带来更多的细节和控制。 特别是,我们想在电影中一些更宽广的镜头中强调空中透视效果。

As we started working towards a scattering solution for the project, we initially implemented and played around with the simulation models presented in several papers from Tomoyuki Nishita[1]. After some experimentation and prototyping of different shots, we eventually decided that we would be better off aiming for a model that allowed extensive artistic control for each of the shots in the short film. We wanted a solution that would allow us to get close to the primary elements of the physical models, but that also allowed us to break any and all rules when required. We also needed the solution to not have a huge impact on the runtime performance of the short film, and set aim to be able to do most of the calculations per-vertex as opposed to per-pixel.

当我们开始为该项目寻求散射解决方案时,我们最初实施并尝试了西田友之[1]的几篇论文中介绍的仿真模型。 经过对不同镜头的实验和原型制作之后,我们最终决定,最好针对一种模型,该模型允许对短片中的每个镜头进行广泛的艺术控制。 我们希望有一个解决方案,使我们能够接近物理模型的主要元素,但是也可以让我们在需要时打破所有规则。 我们还需要该解决方案对短片的运行时性能没有太大影响,并设定目标是能够按顶点而不是按像素进行大多数计算。

We set a goal of trying to emulate the combined effects of Rayleigh and Mie scattering from the physical models. We also added a third element representing various types of low-altitude scattering effects; collectively named height scattering. Another key divergence from the physics based models was that we decided to keep using HDR sky textures, as opposed to procedurally generating the sky and clouds. The obvious downside to this is that setting up something like dynamic time of day (which we didn’t need for The Blacksmith) becomes a bit more complicated, whereas the primary advantage is retaining full artistic control over the sky.

我们设定了一个目标,试图从物理模型模拟瑞利散射和米氏散射的综合影响。 我们还添加了代表各种类型的低空散射效果的第三个元素; 统称为高度散射。 与基于物理的模型的另一个关键区别是,我们决定继续使用HDR天空纹理,而不是程序生成天空和云。 明显的缺点是设置动态时间(我们不需要铁匠铺)会变得更加复杂,而主要优点是保留了对天空的完全艺术控制。

瑞利散射 (Rayleigh Scattering)

Rayleigh scattering of sunlight in the atmosphere is the reason for the bright blue hue of the daytime sky, and the reddening of the sun and horizon at sunrise and sunset.

大气中阳光的瑞利散射是白天天空呈蓝色调,日出和日落时太阳和地平线变红的原因。

In our emulation, we omit the sun itself, and focus just on modelling the colors and extinction produced by the sunlight’s in- and out-scattering. A visual representation of the sun can be added either in the sky texture, as part of Mie scattering, as a sun flare sprite, or any combination of these. At its simplest core, the density of our rayleigh scattering boils down to a glorified exponential function modulated by the Rayleigh phase function. However, we have some additional control over the data that gets put into it, and the data we extract out from it. Since we don’t model light of different wavelengths travelling through the atmosphere, the densities we calculate are scalar values. We use an HDR color ramp to allow for different hues of in-scattered light at horizon and towards zenith, and use a distance aware function for composing the final hue.

在我们的仿真中,我们忽略了太阳本身,而只专注于模拟由太阳光的内外散射产生的颜色和消光。 可以在天空纹理中添加太阳的视觉表示,作为Mie散射的一部分,也可以将太阳耀斑精灵添加到其中,或将它们组合使用。 在其最简单的核心上,我们的瑞利散射的密度可归结为瑞利相位函数调制的光荣指数函数。 但是,我们对放入其中的数据以及从中提取的数据有一些其他控制。 由于我们不对穿过大气的不同波长的光进行建模,因此我们计算出的密度是标量值。 我们使用HDR色带,以允许水平和朝向天顶的散射光具有不同的色调,并使用距离感知功能来构成最终的色调。

Rayleigh contribution in different scattering configurations.在不同散射配置中的瑞利贡献。

三重散射 (Mie Scattering)

Mie scattering of sunlight in the atmosphere contributes to the bright halo around the sun, the grey-white appearance of clouds, and the haze that can be seen over polluted cities. As opposed to Rayleigh, which scatters light in an almost uniform shape, Mie scattering is strongly forward directional.

三重太阳光在大气中的散射有助于形成太阳周围的明亮光晕,云层呈灰白色,以及在污染城市中可以看到的雾霾。 与将光以几乎均匀的形状散射的瑞利相反,米氏散射是强烈的前向方向。

In our emulation, we let Mie scattering primarily represent the haze and halo around the sun. As such, we almost always tint it to compensate for the fact that our Rayleigh emulation ignores the sun. Technically, our Rayleigh and Mie functions are very similar, with the significant difference being the phase function that is applied to the output. Like many other implementations, we use the Henyey-Greenstein scattering function for controlling the anisotropy – or forward directionality – of the Mie scattering.

在我们的仿真中,我们让Mie散射主要表示雾度和太阳周围的光晕。 因此,我们几乎总是对它进行着色,以补偿我们的Rayleigh仿真忽略太阳这一事实。 从技术上讲,我们的Rayleigh和Mie函数非常相似,其中最大的不同是应用于输出的相位函数。 像许多其他实现一样,我们使用Henyey-Greenstein散射函数来控制Mie散射的各向异性(或前向方向性)。

Mie contribution in different scattering configurations.三重贡献在不同的散射配置。

People who have read the research papers might scoff at our choice of names, given that we take certain ‘liberties’ in what we include in each of the emulations. We found early on that people generally used the name Rayleigh when describing ‘sky scattering’ and Mie when describing ‘sun haze’, so we decided to just keep rolling with those names even after the implementation models were simplified from the physical models.

阅读过研究论文的人可能会嘲笑我们对名称的选择,因为我们在每个模拟中都包含了某些“自由”。 我们很早就发现人们在描述“天空散射”时通常使用瑞利这个名字,而在描述“太阳霾”时通常使用三重这个名字,因此即使将实现模型从物理模型简化后,我们也决定继续使用这些名字。

高度散射 (Height Scattering)

The height scattering element represents a mish-mash of various low-altitude scattering effects, including radiation fog, ground haze, and low-lying clouds.

高度散射元素代表具有各种低空散射效果的泥浆,包括辐射雾,地雾和低空云。

Our implementation of height scattering is fairly straightforward; height density is calculated from a defined sea level and height falloff. This then scales the distance-based exponential density, and the whole thing is tinted to the desired color.

我们高度散射的实现非常简单; 根据定义的海平面和高度衰减计算高度密度。 然后按比例缩放基于距离的指数密度,然后将整个对象着色为所需的颜色。

Height contribution in different scattering configurations.不同散射配置下的高度贡献。

散射遮挡 (Scatter Occlusion)

Since our scattering contribution is primarily caused by sunlight scattering towards the observer, away from the observer, or being absorbed by particles on its way to the observer, it makes sense that something should be happening if objects are blocking the sun’s light.

由于我们的散射贡献主要是由于太阳光向观察者的散射,远离观察者的散射或在到达观察者的途中被粒子吸收而引起的,因此,如果物体挡住了太阳光,则应该发生某些事情。

To handle such cases, we ray-march through the directional light’s cascaded shadow map and accumulate the amount of occlusion along the ray in a downscaled, off-screen buffer. When applying the scattering to the output pixel, we upsample this occlusion map with an edge-aware filter, and use it in composing the final color for the pixel. This combining stage is where we get into a little bit of trouble; since our solution is single-scattering only, we can’t just go masking out all in-scattered light, as that would leave us with a very dark and unnatural image. We also didn’t want to expand the solution to handle the more complex and expensive multiple-scattering. In the end, the solution for us was to invent an ‘indirect factor’ where you could just explicitly designate a certain percentage of scattering to be treated as it were indirect instead of direct.

为了处理这种情况,我们对定向光的级联阴影贴图进行射线行进,并在缩小的屏幕外缓冲区中沿射线累积遮挡量。 当将散射应用于输出像素时,我们使用边缘感知滤镜对该遮挡图进行上采样,然后将其用于构成像素的最终颜色。 在合并阶段,我们会遇到一些麻烦。 由于我们的解决方案仅是单散射的,因此我们不能仅仅掩盖所有散射的光,因为那样会使我们留下非常黑暗和不自然的图像。 我们也不想扩展解决方案来处理更复杂和更昂贵的多重散射。 最后,我们的解决方案是发明一个“间接因素”,您可以在其中明确指定要处理的一定百分比的散射,因为它是间接的而不是直接的。

Unbiased occlusion in different scattering configurations.不同散射配置下的无偏光遮挡。

放在一起 (Putting it all together)

All that remains now, is to combine the different elements to compose the final image. Adding together the Rayleigh, Mie and Height elements gets us started with a nice composition of the different scattering colors.

现在剩下的就是将不同的元素组合在一起构成最终的图像。 将Rayleigh,Mie和Height元素加在一起可以使我们从不同散射颜色的良好组合开始。

Combined Rayleigh, Mie and Height scattering.结合了瑞利,米氏和高度散射。

Next, we need to make sure we put that occlusion buffer to good use. We use different strength parameters for tweaking the amount of occlusion applied to direct, indirect, cloud and sky scattering.

接下来,我们需要确保充分利用了该遮挡缓冲区。 我们使用不同的强度参数来调整应用于直接,间接,云和天空散射的遮挡量。

Combined and occluded scattering.合并和封闭散射。

Finally, the only thing that remains is to mix the scattering with the rendered image. We darken the transmitted image by the total accumulated extinction, and lighten it by the total accumulated in-scattering. This yields the final composition for our example scenes.

最后,剩下的唯一事情就是将散射与渲染的图像混合在一起。 我们通过总的累积消光使透射的图像变暗,并通过总的累积内散射使它变亮。 这样就产生了示例场景的最终构图。

Final composition.最终组成。

游戏时间! (Playtime!)

We’ve extracted the atmospheric scattering to a separate project which you can get from the Asset Store. In addition to all the code and shaders making up the solution, the project also contains all configuration presets used to generate the images in this post. Don’t forget to check the included readme for details about what the different configuration options mean.

我们已经将大气散射提取到一个单独的项目中,您可以从Asset Store中获得该项目。 除了构成该解决方案的所有代码和着色器之外,该项目还包含用于在本文中生成图像的所有配置预设。 不要忘记查看随附的自述文件,以详细了解不同配置选项的含义。

References: [1]: Display of The Earth Taking into account Atmospheric Scattering http://nishitalab.org/user/nis/cdrom/sig93_nis.pdf

参考文献:[1]:考虑大气散射的地球显示http://nishitalab.org/user/nis/cdrom/sig93_nis.pdf

[1]: Display Method of the Sky Color Taking into Account Multiple Scattering http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.75.5595&rep=rep1&type=pdf

[1]:考虑多重散射的天色显示方法http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.75.5595&rep=rep1&type=pdf

[1]: Display of Clouds Taking into Account Multiple Anisotropic Scattering and Sky Light http://www.researchgate.net/publication/220720838_Display_of_Clouds_Taking_into_Account_Multiple_Anisotropic_Scattering_and_Sky_Light

[1]:考虑到多个各向异性散射和天光,显示云http://www.researchgate.net/publication/220720838_Display_of_Clouds_Taking_into_Account_Multiple_Anisotropic_Scattering_and_Sky_Light

The HDR sky in the package is from NoEmotionHDRs (Peter Sanitra) / CC BY-ND 4.0. Used without modification.

软件包中的HDR天空来自NoEmotionHDRs( Peter Sanitra )/ CC BY-ND 4.0 。 无需修改即可使用。

翻译自: https://blogs.unity3d.com/2015/05/28/atmospheric-scattering-in-the-blacksmith/

铁匠smith

铁匠smith_铁匠的大气散射相关推荐

  1. 铁匠smith_铁匠的制作:场景设置,阴影,照明

    铁匠smith In the previous blog posts in this series we have looked at the team that created The Blacks ...

  2. 铁匠smith_铁匠的制作:动画,相机效果,音频/视频

    铁匠smith In this blog post we'll be sharing our animation pipeline, and our approach to the post effe ...

  3. 铁匠smith_铁匠的制作:概念和艺术创作

    铁匠smith For our second blog post in this series, the team reveals some sources of inspiration behind ...

  4. 铁匠smith_铁匠镇的皱纹地图

    铁匠smith When planning The Blacksmith short film, we never really prioritized a custom skin shader hi ...

  5. 铁匠smith_铁匠中的独特角色阴影

    铁匠smith It was bright and sunny morning. It must have been some time last fall, when we finally got ...

  6. 游戏开发者怎么做出以假乱真的画面效果?大气散射渲染了解一下

    参与介质(Participating media) 参与介质是另一种现实中常见的介质,这种介质中粒子分散在一定体积内,比如烟雾.云.牛奶.大气等. 相比于一般的固体材质,光在这类材质中会传播一段较长的 ...

  7. 天空的颜色和大气散射

    天空的颜色采用"A Practical Analytic Model for Daylight"建造的模型计算. 地形颜色的大气散射采用"Rendering Outdoo ...

  8. 次表面散射材质_游戏开发者怎么做出以假乱真的画面效果?大气散射渲染了解一下...

    编者按 游戏渲染做得好不好,看看天空就知道了.本文作者Bence将和大家分享游戏中基于物理的大气散射渲染,聊聊如何做出更好看的天空.雾气等等. 文 | Bence 腾讯互动娱乐 游戏客户端开发 参与介 ...

  9. 基于GPU预计算的大气散射

    本文转载自:https://blog.csdn.net/qq_31615919/article/details/85938076 基于GPU预计算的大气层光效渲染 前言 大气物理模型 渲染方程及其实现 ...

最新文章

  1. JButton类,简单应用
  2. 将ubuntu光盘作为安装源_[转载]Ubuntu 以光盘做为软件源
  3. 如何添加显示桌面图标置于快速启动栏
  4. 深度学习笔记——基于传统机器学习算法(LR、SVM、GBDT、RandomForest)的句子对匹配方法
  5. 【计算机系统设计】实践笔记(3)改进数据通路:移位R型指令分析
  6. 软件补丁问题(网络流24题)
  7. Linux学习笔记(四)之用户登录
  8. linux虚拟机ping不通外网问题
  9. 旅游业休克:“云旅游+直播买货”急救
  10. 777后无效 执行chmod_执行chmod -R 777 / 补救
  11. Android开发自定义View之仿米家APP双色灯控制UI:做一个智能家居产品的简单智能灯UI !(附带Demo)
  12. 微信支付(销客多)配置
  13. QUANT[6] 量化交易常见概念解析
  14. mysql查看备份文件_MySQL的备份与还原以及常用数据库查看命令
  15. Fusion 360安装教程
  16. 港科资讯 | 香港科技大学校歌正式发布!
  17. 12月第3周网络安全报告:发现放马站点域名131个
  18. Http请求、响应报文结构
  19. 程序员健康:编程之余保护眼睛
  20. Oracle NO_PUSH_PRED 不使用谓词推入

热门文章

  1. 初识3D Game——战地3,使命召唤8:现代战争3,Crysis 2:孤岛危机2
  2. 中国魔笛痛改前非做好准备 国足不能失去传奇大师
  3. dammit! (靠!)
  4. keil rt-thread link.sct 解析
  5. 《L-谷氨酰胺和L-精氨酸发酵生产》全书阅读笔记
  6. 11.拼数(c++)
  7. 字符串常见方法总结: 构造方法、静态方法、 其它方法
  8. python里的class定义类为什么括号有object
  9. P2P行业产品经理的分析
  10. 金属射流、门罗效应和密室杀人