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 ...
随机推荐
- js中script的上下放置区别 , Dom的增删改创建
回顾 javascript分为三部分: 1.ECMAScript5.0 es6(阮一峰) es7 es8 es6中有类的概念 声明变量 var let(es6中语法) 内置函数 Date Math.r ...
- css:蓝环章鱼
许多海洋生物色彩艳丽,这次用css仿制一下蓝环章鱼的蓝环 <script type="text/javascript" src="http://cdn.bootcs ...
- JVM虚拟机宕机_java.lang.OutOfMemoryError: unable to create new native thread
原因:当前用户的系统最最大程序数数已达到最大值,使用ulimit -u可以看到是1024 解决办法:在当前用户下使用ulimit -u 65535 然后再执行jsp,一切ok 功能说明:控 ...
- leetcode1023
class Solution(object): def getGroup(self,que): group = list() temp = '' for i in range(len(que)): c ...
- leetcode701
class Solution: def insertIntoBST(self, root, val): """ Time: O(log(n)) [average case ...
- element el-upload组件获取文件名
组件的连接:http://element-cn.eleme.io/#/zh-CN/component/upload 需求:点x按钮,获取文件名传到后端服务,把文件从服务器删除 分析: 仔细看文档,会发 ...
- 机器学习进阶-图像金字塔与轮廓检测-图像金字塔-(**高斯金字塔) 1.cv2.pyrDown(对图片做向下采样) 2.cv2.pyrUp(对图片做向上采样)
1.cv2.pyrDown(src) 对图片做向下采样操作,通常也可以做模糊化处理 参数说明:src表示输入的图片 2.cv2.pyrUp(src) 对图片做向上采样操作 参数说明:src表示输入的 ...
- 塔式Server 服务器ESXI6.5安装
参考文献: https://www.cnblogs.com/yufusec/p/9181422.html 第一步: esxi6.5.ios文件的下载 第二步: 通过UltraISO软件 制作启动盘或光 ...
- Spring BeanUtils简单使用
引入包 <dependency> <groupId>commons-beanutils</groupId> <artifactId>commons-be ...
- ABAP-多线程处理
*&---------------------------------------------------------------------* *& Report ZRICO_TES ...