GI Engines GI引擎
Introduction
引言
In real life, light photons originate from light sources, they bounce off a number of surfaces, have their colors modified by these surfaces and eventually reach our eyes. In computer graphics, Global Illumination (GI) attempts to simulate those photon bouncing interactions. This simulation adds realism to lighting and helps achieve more life-like images.
在现实生活中,光的光子来自光源,它们被许多表面反弹,它们的颜色被这些表面改变,最终到达我们的眼睛。在计算机图形学,全局光源试图模拟这些光子弹跳的相互作用。这种模拟增加了照明的真实性,并有助于实现更多的逼真图像。
GI can have a profound effect even on extremely simple scenes, as shown below:
即使在极其简单的场景中,GI 也能产生深远的影响,如下图所示:
|
|
Without GI 没有胃肠道 | With GI. Notice the color bleeding. |
Light that reaches object surfaces without any bounces is referred to as direct lighting. Once light has bounced off one or more surfaces it is referred to as indirect lighting. So what GI essentially computes is indirect lighting.
光线到达物体表面时没有任何反射,称为直接照明。一旦光线从一个或多个表面反射回来,就称为间接照明。所以 GI 本质上计算的是间接照明。
When a photon hits a rough surface, it gets scattered around randomly. This is called Diffuse Global Illumination. When a photon hits a strongly reflective or refractive surface (like mirror or glass), it tends to have a more predictable bounce direction. Because of this, photons bouncing off reflective/refractive surfaces tend to get 'clumped' together and form interesting lighting patterns. These patterns are called Caustics. Global Illumination, in general, refers to both of these effects: Diffuse GI and Caustics
当光子撞击粗糙表面时,它会随机散射。 这就是所谓的漫反射全局光源。 当一个光子撞击一个强反射或折射的表面(如镜子或玻璃)时,它往往有一个更可预测的反射方向。 因此,反射 / 折射表面反弹的光子往往会“聚集”在一起,形成有趣的照明模式。 这些模式被称为焦散。 一般来说,全局光源指的是这两种效应: 漫射消化道和焦散
The image shown above is lit using Diffuse GI, while the image below uses Caustics.
上面显示的图像是点燃使用漫反射 GI,而下面的图像使用焦散。
Caustics
焦散
Redshift treats Diffuse GI and Caustics separately.
红移分别治疗弥漫性胃肠病和焦散。(3)
Diffuse Global Illumination can be achieved with a combination of the following techniques:
扩散全局光源可以通过以下技术的组合来实现:
- Photon mapping 光子映射
- Brute-Force 蛮力
- Irradiance caching 辐照度缓存
- Irradiance point cloud 辐照度点云
Caustics, on the other hand, can only be achieved with
另一方面,焦散,只能通过
- Photon mapping 光子映射
In Redshift, all of these techniques are called "GI Engines". Each GI Engine has its pros and cons. These are listed further down in this document.
在红移中,所有这些技术都被称为“ GI 引擎”。每个 GI 引擎都有它的优点和缺点。这些在本文件的下面有详细的列表。
Primary And Secondary GI Engines
一级和二级消化道引擎(2)
Among the techniques mentioned above, photon mapping is the only one that works similar to how lighting works in real-life, i.e. it shoots photons from the lights. All the other techniques work the reverse way: they shoot rays out of the camera, bounce them around and eventually hit a light.
在上面提到的技术中,光子映射是唯一一种与现实生活中的光线工作原理相似的技术,也就是说它从光线中发射光子。所有其他的技术都以相反的方式工作: 他们从相机中射出光线,反弹它们,最终击中一束光线。
When these camera rays hit an object, the primary GI Engine is used. If GI requires multiple bounces, the secondary GI Engine is used for these bounces. The figures below show how this happens when you enable "brute force" for both primary and secondary GI engines.
当这些照相机射线击中一个物体时,使用主 GI 引擎。如果 GI 需要多重反弹,第二 GI 引擎是用于这些反弹。下面的图表显示了当您为主要和次要 GI 引擎启用“蛮力”时,这是如何发生的。
Zero GI Bounces. Camera shoots a ray and hits wall (point "A"). The primary GI engine is used and shoots another ray of which is shown in red. This way, direct lighting on the floor (point "B") affects point "A".
零胃肠反弹。照相机拍摄一条射线并撞击墙壁(点“ a”)。主要的 GI 引擎被使用并且发射另一个射线,如红色所示。这样,直接照明在地板上(点“ b”)影响点“ a”。
One GI Bounce. The processing now goes a bit further. Point "B" uses the secondary GI engine to gather illumination from the sphere by shooting a single ray (shown in blue). This way, the direct lighting of the floor (point "B") and the sphere (point "C") affects point "A".
一个胃肠反弹。现在的处理过程更进一步。点“ b”使用二级 GI 引擎收集照明从球拍摄一个单一的射线(显示为蓝色)。这样,地板(点“ b”)和球体(点“ c”)的直接照明影响点“ a”。
Shooting photons from the lights or shooting rays from our eyes are, in some ways, equivalent. If you flip the direction of all the arrows above it's as if lighting came from the light source, bounced off the sphere, floor, wall and then reached the camera!
从光线中发射光子或者从我们的眼睛中发射射线,在某种程度上是等价的。如果你翻转上面所有箭头的方向,就好像灯光来自光源,反弹的球体,地板,墙壁,然后到达相机!
So why have separate primary and secondary GI engines? The results of primary GI lighting are directly visible to the camera so needs to be as high-quality as possible. Secondary GI lighting, on the other hand, often represents a smallest part of the final lighting so it can afford to be of somewhat lower quality (think "blurrier" or "noisier") without introducing significant visual artifacts. Approximating secondary GI like that has significant performance and, sometimes, quality advantages!
那么为什么有分开的主要和次要的胃肠道引擎?初级 GI 照明的结果是直接可见的相机,所以需要尽可能高的质量。另一方面,二级 GI 照明通常代表最终照明的最小部分,因此它可以承担一定程度的低质量(想想“模糊”或“嘈杂”) ,而不引入重要的视觉工件。类似这样的二级 GI 具有显著的性能,有时还具有质量优势!
Please note that the examples above only show what happens with "brute force". Other GI engines do different things for points A, B, C. These are described in more detail under each technique's documentation.
请注意,上面的例子只是展示了“蛮力”会发生什么。其他 GI 引擎对 a,b,c 点做不同的事情。这些在每个技术的文档中都有更详细的描述。
Main Global Illumination Settings
主要全局光源/设置
GI Engines and Number of Bounces
GI 引擎和反弹数量
The starting point for enabling GI is selecting the primary and secondary GI Engines and specifying the number of GI bounces.
启用 GI 的起点是选择主要和次要的 GI 引擎,并指定 GI 反弹的数量。
Introducing more GI bounces in your scene will often make your lighting brighter - and the rendering slower. It also tends to "wash out" the lighting a bit, too. For these reasons users sometimes choose to limit the number of bounces.
引入更多的 GI 反弹在你的场景往往会使你的照明明亮-和渲染缓慢。它也会有点“冲淡”光线。出于这些原因,用户有时会选择限制跳出的次数。
The scene shown below contains a few vertical tiles, one of which is lit with a strong spotlight. The biggest visual difference (for this particular scene) is between 0 and 1 GI bounces. Note that these images were rendered using Irradiance Caching for the primary GI engine and Irradiance Point Cloud for the secondary GI engine.
下面显示的场景包含一些垂直的瓷砖,其中一个用强烈的聚光灯照亮。最大的视觉差异(对于这个特殊的场景)是0和1之间的胃肠反弹。注意,这些图像是使用辐照度缓存渲染的主要 GI 引擎和辐照度点云渲染的次要 GI 引擎。
|
|
|
Zero GI Bounces. The right tiles are lit by the direct lighting on the center illuminated tile. 零 GI 反弹。正确的瓷砖是照明的直接照明对中心照明瓷砖。 |
One GI Bounce. The indirect lighting on the right tiles is now bouncing off once and illuminating the left tiles. The ground below the right tiles now also receives extra illumination. 一个胃肠反弹。右边瓷砖上的间接照明现在反弹一次,照亮了左边的瓷砖。右边瓷砖下面的地面现在也得到了额外的照明。 |
Two GI Bounces. The indirect lighting of the left tiles is now affecting the ground below them. The effect is definitely more subtle compared to the difference between zero and one GI bounce. 两个胃肠道反弹。左边瓷砖的间接照明现在影响到它们下面的地面。相对于零和一个消化道反弹的区别,这种效果显然更加微妙。 |
Conserve Reflections Energy
保存反射能量
Redshift does not currently support reflection ray sampling during Global Illumination calculation, which can lead to a loss of energy. Checking the 'Conserve Reflections Energy' option enables a cheap trick which adds the reflection energy that would be lost (i.e. the reflection color tint) to the diffuse color tint of materials during GI calculation. This gives the illusion of reflection ray bounces contributing to GI, which can be particularly noticeable with strong or colored material reflections.
红移目前不支持在全局光源计算期间进行反射射线采样,这会导致能量损失。检查“节约反射能量”选项启用了一个廉价的技巧,它增加了反射能量,将损失(即反射颜色色调)到漫反射颜色色调的材料在 GI 计算。这使得反射光线反弹的错觉有助于 GI,这可以特别明显的强烈或彩色材料反射。
After you've selected your primary and secondary GI engines and specified the number of GI bounces, you'll need to configure them. Please refer to the topics listed below for more information:
在你选择了你的主要和次要的 GI 引擎,并指定了 GI 反弹的数量,你需要配置他们。详情请参阅以下主题:
光子映射
蛮力
辐照度缓存
辐照度点云
Recommended Settings
推荐设置
Sometimes users are overwhelmed by the multitude of choices. and ask for the best settings.
有时候用户会被大量的选择淹没,并要求最佳的设置。
While different scenes will have different requirements, we've found that a good starting point is this:
虽然不同的场景有不同的要求,但我们发现一个好的起点是:
- Set the Primary GI Engine to "Brute-Force" 将主 GI 引擎设置为“蛮力”
- Set the Secondary GI Engine to "Irradiance Point Cloud" 将辅助 GI 引擎设置为“辐照点云”
- Set the "Number of GI Bounces" to 2 or 3 将“ GI 跳跃的数量”设置为2或3
- If your scene need caustics (for glass or mirrors), please refer to the 如果你的场景需要焦散线(玻璃或镜子) ,请参考caustics 焦散线 section of the photon mapping topic. 光子映射专题
As a rule of thumb, try to remember the following points regarding GI quality:
作为一个经验法则,试着记住以下关于胃肠道质量的要点:
- Scenes containing several (not too strong) lights can typically get away with fairly low GI settings (number of rays, number of samples, etc) 场景包含几个(不太强)光通常可以得到相当低的 GI 设置(射线数量,样本数量,等)
- Scenes that contain very few, very strong lights will need more aggressive GI settings. For example, the "single lit tile" scene above required many rays to get a clean result because it was almost entirely indirectly lit and using only a single very strong light. 场景包含非常少,非常强的灯光将需要更积极的 GI 设置。例如,上面的“单点亮的瓷砖”场景需要很多光线才能得到一个干净的结果,因为它几乎完全是间接照明,只使用一个非常强烈的光线
- Outdoor scenes that are lit with environment shaders (like "physical sky") can typically get away with fairly low GI settings 用环境着色器(比如“物理天空”)点亮的户外场景通常可以使用相当低的 GI 设置
- To summarize all of the above: lots of lighting contrast requires higher quality settings, lower contrast can get away with lower quality settings 综上所述: 大量的灯光对比度需要高质量的设置,低质量的设置可以避免低质量的设置
Pros and Cons of the Different Techniques
不同技巧的利与弊
For more information of how the individual techniques work, please look at their respective pages
要了解更多关于各种技术如何工作的信息,请查看它们各自的页面
Photon Mapping
光子映射
This technique works similarly to how light behaves in real life. In one stage, it shoots photons from light sources, bounces them around the scene and stores them on surfaces. Then, on a second stage, the renderer uses these photons to render the final image.
这项技术的工作原理与光在现实生活中的表现类似。在一个阶段,它从光源中发射光子,在场景中反弹,并将它们储存在表面上。然后,在第二阶段,渲染器使用这些光子来渲染最终的图像。
Pros
优点
- Provides a very good degree of control 提供了很好的控制程度
- For reasonable numbers of photons, it renders fast 对于合理数量的光子,它可以快速呈现
Cons
缺点
- Photon mapping is an outdated technique 光子映射是一种过时的技术
- Photons have to be stored in GPU memory so too many photons can be prohibitive in terms of memory usage 光子必须存储在 GPU 内存中,因此太多的光子就内存使用量而言是不允许的
- There are a few settings to tweak and some experimentation might be needed to get a clean result 有一些设置需要调整,可能需要一些实验才能得到一个干净的结果
- Processing time and storage may be wasted for photons that will not end up being visible to the camera 处理光子的时间和存储时间可能会被浪费掉,而这些光子最终会被摄像机看不见
Brute-Force
蛮力
Brute force works the opposite way to photon mapping. Instead of shooting photons from the light, it shoots a number of rays from each surface and bounces the rays around.
蛮力的工作方式与光子映射相反。它不是从光线中发射光子,而是从每个表面发射大量的射线,并使射线在周围反弹。
Pros
优点
- Very accurate 非常准确
- No flickering in animations 动画中没有闪烁
- It's easy as it only has one setting to tweak ("Num Rays") 这很容易,因为它只有一个设置去调整(“ Num ray”)
- Does not require any storage so the final image resolution and scene detail does not matter 不需要任何存储,所以最终的图像分辨率和场景细节并不重要
Cons
缺点
- It's the slowest technique. But due to Redshift's speed, it's more practical compared to other renderers. 这是最慢的技术,但由于红移的速度,它比其他渲染器更实用
- Unless many rays are shot per pixel, it can produce grainy images – especially in difficult lighting situations 除非每个像素拍摄多条光线,否则它会产生颗粒状的图像——特别是在光线不好的情况下
Irradiance Caching
辐照度缓存
Global Illumination often changes slowly over surfaces. This means that several pixels next to each other could 'share' the same value which, in turn, means that we don't need to compute a separate GI value for each pixel! Irradiance caching takes advantage of this fact and computes GI similar to Brute-Force but at sparse points around the image, which means that the computation takes much less time.
全局光源通常在表面上缓慢变化。这意味着相邻的几个像素可以共享相同的值,这反过来意味着我们不需要为每个像素计算一个独立的 GI 值!辐照度缓存利用了这一特点,在图像周围的稀疏点计算类似于 Brute-Force 的 GI,这意味着计算时间要少得多。
Pros
优点
- Can produce smooth images several times faster than Brute-Force 可以产生比 Brute-Force 快几倍的平滑图像
- The results can be saved to disk for each animation frame. So if you are tweaking things like antialiasing, glossy num rays, num area light samples and other quality parameters (not related to GI), you can simply load the GI results and iterate quickly. 结果可以保存到磁盘为每个动画帧。因此,如果您正在调整诸如反锯齿、光滑数字射线、数字区域光采样和其他质量参数(与 GI 无关) ,您可以简单地加载 GI 结果并快速迭代
- Lots of scenes have large parts that are mostly flat. For example: walls on an architectural interior. Or the surface of a car. The irradiance cache will have a significant performance benefit on these scenes. 很多场景的大部分都是平面的。例如: 建筑内部的墙壁。或者是汽车的表面。在这些场景中,辐照度缓存具有显著的性能优势
- Increasing the final image resolution often does not increase the irradiance cache time linearly –depending on scene complexity and irradiance cache settings. I.e. going from 1280x720 to 2560x1400 (i.e. 4 times more pixels), you might find the irradiance cache processing time taking less than 4 times longer 提高最终的图像分辨率往往不会线性增加辐照度缓存时间,这取决于场景复杂度和辐照度缓存设置。即从1280x720到2560x1400(即4倍像素) ,您可能会发现辐照度缓存处理时间不到4倍
Cons
缺点
- The Irradiance Cache Points are computed during a separate rendering pass so interactive feedback is not possible. 辐照度缓存点是在单独的渲染过程中计算出来的,所以交互式反馈是不可能的
- While shooting too few rays with brute-force shows up as grain, shooting too few rays for the irradiance cache shows up as "splotches" and flickering in animations. These can be even more visually distracting than grain. 虽然用蛮力拍摄的光线太少会显示为纹理,但是拍摄的光线太少会显示为“斑点”,并且在动画中闪烁。这些可能比谷物更容易分散视觉注意力
- There are several user parameters that control things like point spacing. Settings these correctly is important for splotch-free and flicker-free results. Learning how to use these settings often involves trial-and-error. 有几个用户参数控制诸如点间距之类的东西。这些正确的设置对于无斑点和无闪烁的结果非常重要。学习如何使用这些设置通常需要反复试验
- If the scene has a lot of detail (example: foliage covering a big part of the screen) then too many points might have to be created. This invalidates the benefits of the irradiance cache and also puts a big burden on memory resources because the points have to be stored. For these scenes, brute-force might be a better choice. 如果场景有很多细节(例如: 植物覆盖了屏幕的很大一部分) ,那么可能需要创建太多的点。这使得辐照度缓存的优点失效,同时也给内存资源带来了很大的负担,因为必须存储这些点。对于这些场景,蛮力可能是一个更好的选择
Irradiance Point Cloud
辐照度点云
The Irradiance Point Cloud can only be used as a secondary GI engine. Its purpose is to provide faster and cleaner secondary lighting to the primary GI engine. You might have seen similar techniques on other renderers called "Importons", "Irradiance Particles" or "Light Cache". While Redshift's Irradiance Point Cloud works differently to these techniques, it serves the same purpose which is to improve the quality and efficiency of multiple-bounce GI.
辐照点云只能作为辅助 GI 引擎使用。其目的是提供更快和更清洁的二次照明的主要胃肠道引擎。你可能在其他渲染器上看到过类似的技术,比如“ Importons”、“ Irradiance Particles”或者“ Light Cache”。虽然红移的辐射点云工程不同于这些技术,它服务于同一目的,即提高质量和效率的多反弹 GI。
Pros
优点
- Helps make Brute-Force and Irradiance Caching faster and cleaner 有助于使蛮力和辐照缓存更快和更干净
- Certain very difficult lighting scenarios can only be rendered with this technique! (i.e. they would take an extremely long time with purely brute force techniques) 某些非常困难的照明场景只能用这种技术渲染!(也就是说,使用纯粹的暴力破解技术需要极长的时间)
Cons
缺点
- Requires some storage (but, typically, not much) 需要一些存储空间(但通常不需要太多)
- There are a few settings to tweak so a bit of experimentation is required. 有一些设置需要调整,所以需要一些实验
- Only provides a benefit when multiple bounces are needed, if the scene contains lots of lights or when the lighting conditions are difficult 只有当需要多次反弹时,如果场景包含大量灯光或者照明条件困难时,才能提供好处
赶快留个言打破零评论!~