Real Time Rendering 2
【Real Time Rendering 2】
1、The light vector l is usually defined pointing in a direction opposite to the direction the light is traveling.

2、The surface irradiance(辐照度) is equal to the irradiance measured perpendicularly to l, times the cosine of the angle θi between l and n.
Irradiance, is equivalent to the sum of energies of the photons passing through the surface in one second.
Light can be colored, so we will represent irradiance as an RGB vector containing three numbers: one for each of red, green and blue.
E is used in equations for irradiance, most commonly for irradiance perpendicular to n. We will use EL for irradiance perpendicular to l.

3、Scattering does not change the amount of light—it just causes it to change direction.

Shading equations typically incorporate a smoothness parameter that controls the distribution of the specular term.
4、irradiance is equivalent to the sum of energies of the photons passing through the surface in one second.

Incoming illumination is measured as surface irradiance. We measure outgoing light as exitance, which similarly to irradiance is energy per second
per unit area. The symbol for exitance is M.
5、Radiance is the density of light flow per area and per incoming direction. Radiance (symbolized as L in equations) can be thought of as the measure of the brightness and color of a single ray of light.
The directional distribution of the specular term depends on the surface smoothness. We can see this dependence in Figure 5.8, which shows diagrams and photographs for two surfaces of different smoothness. The beam of reflected light is tighter for the smoother surface, and more spread out for the rougher surface.

6、Physical sensors measure an average value of radiance over their area, over incoming directions focused by the lens, and over a time interval; the evaluation of a shader equation computes radiance in a single ray at a single instant.


7、Shading equation for the diffuse term:



8、Specular。


θh is the angle between h and n。Lspec increases when the angle θh between h and n decreases。 m, which represents the surface smoothness. Increasing m causes the specular highlights to be smaller and brighter。


9、Diffuse + Specular:

而经典的Blinn-Phong方程如下:

10、Equation 5.10 is for a single light source. However, scenes often contain multiple light sources. Lighting is additive in nature, so we can sum the contributions of the individual light sources to get the overall shading equation:

11、When designing a shading implementation, the computations need to be divided according to their frequency of evaluation. The lowest frequency of evaluation is per-model: Expressions that are constant over the entire model can be evaluated by the application once.

where Kd = cdiff/π and Ks = ((m + 8)/8π)cspec are computed by the application. Since we only use directional light sources, lk and ELk are constant and can be set once. The remaining variables θhk and θik vary over the mesh. As we have seen, cos θik is computed by performing a clamped dot product between lk and n. Similarly, cos θhk is computed with a dot product between hk and n.
12、法线。

13、The saturate intrinsic function returns its argument clamped between 0 and 1. In this case we just need it clamped to 0, but the argument is known not to exceed 1, and saturate is faster than the more general max function on most hardware.
14、the surface normal is scaled to length 1 in the vertex shader, interpolation can change its length, so it may be necessary to do so again in the pixel shader.


15、The goal of this sampling process is to represent information digitally. In doing so, the amount of information is reduced. However, the sampled signal needs to be reconstructed in order to recover the original signal. This is done by filtering the sampled signal.

16、The effect occurs because the images of the wheel are taken in a series of time steps, and is called temporal aliasing.

17、For a signal to be sampled properly (i.e., so that it is possible to reconstruct the original signal from the samples), the sampling frequency has to be more than twice the maximum frequency of the signal to be sampled.
This is often called the sampling theorem, and the sampling frequency is called the Nyquist rate or Nyquist limit.
采样频率必须大于 Nyquist Limit 才能不走样。上图中第三行,采样频率等于 Nyquist Limit,发现还是走样了。
it is impossible to entirely avoid aliasing problems when using point samples to render a scene.
18、三种 Filter:

lowpass filter:


19、The general strategy of screen-based antialiasing schemes is to use a sampling pattern for the screen and then weight and sum the samples to produce a pixel color, p:

20、Antialiasing algorithms that compute more than one full sample per pixel are called supersampling (or oversampling) methods. Conceptually simplest, full-scene antialiasing (FSAA) renders the scene at a higher resolution and then averages neighboring samples to create an image.
A related method is the accumulation buffer [474, 815]. Instead of one large offscreen buffer, this method uses a buffer that has the same resolution as, and usually more bits of color than, the desired image. To obtain a 2×2 sampling of a scene, four images are generated, with the view moved half a pixel in the screen x- or y- direction as needed. Essentially, each image generated is for a different sample position within the grid cell. These images are summed up in the accumulation buffer. Accumulation buffers are a part of the OpenGL API [9, 1362]. They can also be used for such effects as motion blur, where a moving object appears blurry, and depth of field.


Naiman [919] shows that humans are most disturbed by aliasing on near-horizontal and near-vertical edges.
21、A multisampling algorithm takes more than one sample per pixel in a single pass, and (unlike the methods just presented) shares some computations among the samples.
MSAA is faster than a pure supersampling scheme because the fragment is shaded only once. It focuses effort on sampling the fragment’s pixel coverage at a higher rate and sharing the computed shade. However, actually storing a separate color and z-depth for each sample is usually unnecessary. CSAA takes advantage of this observation by storing just the coverage for the fragment at a higher sampling rate. Each subpixel stores an index to the fragment with which it is associated. A table with a limited number of entries (four or eight) holds the color and z-depth associated with each fragment.
MSAA每个fragment只计算一次,然后将计算结果赋值给覆盖的 sub-sample,所以sub-sample保存了fragment shader的计算结果。当绘制到屏幕时,每个pixel中的sub-sample,将被求各平均,从而达到抗锯齿。
CSAA is similar to Carpenter’s A-buffer [157], another form of multisampling. This algorithm is commonly used in software for generating high-quality renderings, but at noninteractive speeds.each polygon rendered creates a coverage mask for each screen grid cell it fully or partially covers.

22、随机采样。
A scene can be made of objects that are arbitrarily small on the screen, meaning that no sampling rate can ever perfectly capture them. So, a regular sampling pattern will always exhibit some form of aliasing. One approach to avoiding aliasing is to distribute the samples randomly over the pixel, with a different sampling pattern at each pixel. This is called stochastic sampling, and the reason it works better is that the randomization tends to replace repetitive aliasing effects with noise.
The most common kind of stochastic sampling is jittering, a form of stratified sampling.

N-rooks sampling is another form of stratified sampling, in which n samples are placed in an n ×n grid, with one sample per row and column
23、interleaved sampling. In ATI’s version, the antialiasing hardware allows up to 16 samples per pixel, and up to 16 different user-defined sampling patterns that can be intermingled in a repeating pattern.

24、边缘重叠采样。
One real-time antialiasing scheme that lets samples affect more than one pixel is NVIDIA’s older Quincunx method [269], also called high resolution antialiasing (HRAA). “Quincunx” means an arrangement of five objects, four in a square and the fifth in the center. Each corner sample value is distributed to its four neighboring pixels. So instead of weighting each sample equally (as most other real-time schemes do), the center sample is given a weight of 12, and each corner sample has a weight of 18. Because of this sharing, an average of only two samples are needed per pixel for the Quincunx scheme, and the results are considerably better than two-sample FSAA methods.
Quincunx method itself appears to have died out.
It should be noted that sample sharing is also used for antialiasing in the mobile graphics context [13]. The idea is to combine the clever idea of sample sharing in Quinqunx with RGSS. This results
in a pattern, called FLIPQUAD.
下图左边的左边是RGSS,左边的右边是FLIPQUAD。

25、透明。
Checkerboard fill pattern. That is, every other pixel of the polygon is rendered, thereby leaving the object behind it partially visible. The problems with this technique include:
• A transparent object looks best when 50% transparent. Fill patterns other than a checkerboard can be used, but in practice these are usually discernable as shapes themselves, detracting from the transparency effect.
• Only one transparent object can be convincingly rendered on one area of the screen. For example, if a transparent red object and transparent green object are rendered atop a blue object, only two of the three colors can appear on the checkerboard pattern.
26、标准透明算法是 back-to-front。front-to-back也是可以的,需要按如下这样做。
Blending front-to-back when rendering the transparent surfaces to a separate buffer, i.e., without any opaque objects rendered first. This blending mode is called the under operator and is used in volume rendering techniques.
additive blending:

This blending mode has the advantage of not requiring sorting between triangles, since addition can be done in any order. It can work well for glowing effects that do not attenuate the pixels behind them but only brighten them. Smoke or fire, additive blending has the effect of saturating the colors of the phenomenon.
27、预乘 alpha.
The most common way to store synthetic RGBα images is with premultiplied alphas (also known as associated alphas). That is, the RGB values are multiplied by the alpha value before being stored.

28、Gamma Correction
The transfer functions that define the relationship between radiance and encoded pixel values are slightly modified power curves.

The encoding gamma describes the encoding transfer function, The display gamma characterizes the display transfer function. The product of the two gamma values is the overall or end-to-end gamma of the imaging system, which describes the end-to-end transfer function.

Personal computers use a standard called sRGB [1223], which has an encoding gamma of about 0.45. This gamma is intended for bright office environments. These encoding gamma values are designed to work with a display gamma of 2.5 to produce the appropriate end-to-end gamma.
未Gamma-Correction的处理,易产生过曝。

未Gamma-Correction的处理易产生扭曲(Roping)

29、Applications used for authoring textures typically store the results in a nonlinear space(Gamma Space)
Real Time Rendering 2的更多相关文章
- 【原】实时渲染中常用的几种Rendering Path
[原]实时渲染中常用的几种Rendering Path 本文转载请注明出处 —— polobymulberry-博客园 本文为我的图形学大作业的论文部分,介绍了一些Rendering Path,比较简 ...
- Forward+ Rendering Framework
近几天啃各种新技术时又一个蛋疼的副产品...额,算是把AMD的Forward+ Sample抄了一遍吧. 其实个人感觉这个AMD大肆宣传的Forward+跟Intel很早之前提的Tiled-Based ...
- Thinking in Unity3D:渲染管线中的Rendering Path
关于<Thinking in Unity3D> 笔者在研究和使用Unity3D的过程中,获得了一些Unity3D方面的信息,同时也感叹Unity3D设计之精妙.不得不说,笔者最近几年的 ...
- CSharpGL(30)用条件渲染(Conditional Rendering)来提升OpenGL的渲染效率
CSharpGL(30)用条件渲染(Conditional Rendering)来提升OpenGL的渲染效率 当场景中有比较复杂的模型时,条件渲染能够加速对复杂模型的渲染. 条件渲染(Conditio ...
- CSharpGL(8)使用3D纹理渲染体数据 (Volume Rendering) 初探
CSharpGL(8)使用3D纹理渲染体数据 (Volume Rendering) 初探 2016-08-13 由于CSharpGL一直在更新,现在这个教程已经不适用最新的代码了.CSharpGL源码 ...
- Unity性能优化(4)-官方教程Optimizing graphics rendering in Unity games翻译
本文是Unity官方教程,性能优化系列的第四篇<Optimizing graphics rendering in Unity games>的翻译. 相关文章: Unity性能优化(1)-官 ...
- 几大主流浏览器内核(Rendering Engine)
"浏览器内核",英文为"Rendering Engine",也叫"渲染引擎",作用是帮助浏览器来渲染网页的内容,将页面内容和排版代码转换为用 ...
- 各大浏览器内核介绍(Rendering Engine)
在介绍各大浏览器的内核之前,我们先来了解一下什么是浏览器内核. 所谓浏览器内核就是指浏览器最重要或者说核心的部分"Rendering Engine",译为"渲染引擎&qu ...
- OpenCascade Chinese Text Rendering
OpenCascade Chinese Text Rendering eryar@163.com Abstract. OpenCascade uses advanced text rendering ...
- Tutorial - Deferred Rendering Shadow Mapping 转
http://www.codinglabs.net/tutorial_opengl_deferred_rendering_shadow_mapping.aspx Tutorial - Deferred ...
随机推荐
- 在linux环境下mongodb的安装和启动
安装 下载mongodb的版本,两点注意 根据业界规则,偶数为稳定版,如1.6.X,奇数为开发版,如1.7.X 32bit的mongodb最大只能存放2G的数据,64bit就没有限制 到官网,选择合适 ...
- 解决Cell重用问题
在显示的过程中,出现了内容重叠的问题,其实就是UITableViewCell重用机制的问题. 解决方法一:对在cell中添加的控件设置tag的方法 在cell的contentView上需要添加控件,那 ...
- elk收集windows日志
参考网站:https://www.secpulse.com/archives/55636.html https://blog.csdn.net/qq_38094271/article/details/ ...
- MFC 如何在一个窗体中嵌套在另一个窗体中
其中的一个方法是讲子窗体设置为非模式对话框,具体操作为 :设置子窗体的border属性为none,style为 child. 在父窗体中需要用create来实现,具体例子如下. 在父窗体的OnInit ...
- leetcode1011
class Solution: def shipWithinDays(self, weights: 'List[int]', D: int) -> int: left = max(weights ...
- <面试> PHP 常见算法
排序算法 1. 冒泡排序(数组排序) 基本思想:对需要排序的数组从后往前(逆序)进行多遍的扫描,当发现相邻的两个数值的次序与排序要求的规则不一致时,就将这两个数值进行交换.这样每遍历一次,最小的数值就 ...
- 机器学习进阶-图像基本处理-视频的读取与处理 1.cv2.VideoCapture(视频的载入) 2.vc.isOpened(载入的视频是否可以打开) 3.vc.read(视频中一张图片的读取) 4.cv2.cvtColor(将图片转换为灰度图)
1.vc = cv2.VideoCapture('test.mp4') #进行视频的载入 2.vc.isOpened() # 判断载入的视频是否可以打开 3.ret, frame = vc.read( ...
- Props文件属性读取
Properties props=new Properties(); try { props.load(new InputStreamReader(getClass().getResourceAsSt ...
- iOS响应链原理
ios找到被点击的view的过程是从根view开始递归地调用hitTest方法,直到有一个子view的hitTest方法返回自身:如果所有一级子view的hitTest方法都返回nil,那么根view ...
- python tuple排序
tuple排序,按照索引0,1,2,3...依次比较 a = [3,1,0,9,6,2,4,8,7,5] a.sort(key = lambda x: (x%2, x, x%3)) # 先按照x%2的 ...