当前位置:网站首页>Games101 Lesson 7 shading 1 Notes

Games101 Lesson 7 shading 1 Notes

2022-07-06 07:23:00 Fenghou Qimen L

One 、 The depth of the cache (Z-buffering)

(1) Painter algorithm : Like an oil painter painting , Draw the farthest first , Paint and cover from far to near .
 Painter algorithm
① Painter's algorithm works in most cases , You need to arrange the distance first .
② But if there is partial coverage of each other , There will be problems with the painter's Algorithm , Here's the picture .
 Painter algorithm problem
(2) The depth of the cache
 Definition of deep cache
① The depth of the cache Z-buffer The algorithm records the depth of each pixel , In addition to recording the color of each pixel , The depth of each pixel is also recorded .
② The pseudo code of deep cache is as follows .
 Pseudo code of deep Cache Algorithm
③ An example of deep caching is as follows .
 An example of deep caching
④ The complexity of the deep cache algorithm is O(n).
 The complexity of deep Cache Algorithm

Two 、 To color (Shading)

(1) Coloring in this course refers to applying different materials to objects .
 The concept of coloring
(2) A simple coloring model :Blinn-Phong Reflectance Model
 shading model
① Highlights are shown from top to bottom 、 Diffuse reflection 、 Three parts of ambient light .
(3) Shading point
① These inputs are required : Observation direction 、 normal 、 The direction of the light 、 Surface parameters ( Such as color 、 Brightness, etc ).
② Observation direction 、 normal 、 The illumination directions are unit vectors .
③ Shading discussed in this section does not consider shadows .
 shading model

3、 ... and 、 Diffuse reflection (Diffuse Reflection)

(1) Definition of diffuse reflection
 Definition of diffuse reflection
① Light will be reflected evenly to all angles .
② The color is the same in all observation directions .
(2) The energy that light at different angles can accept
 The energy that light at different angles can accept
(3) Light attenuation
 Light attenuation
① The farther away the point is, the energy of light will be attenuated .
② For example, light radiates a circle , The length of the circumference near , The circumference in the distance is long , According to the conservation of energy , Distant points should get less energy .
(4)Lambertian Shading
 Light attenuation
① Combined with the energy received by light at different angles and the light attenuation formula, the coloring of a point can be obtained .
(5) Different diffuse reflection coefficients kd Examples of different coloring situations obtained .
 Different diffuse reflection coefficients kd

reference

Course video link : GAMES101 Lecture07 Shading 1

原网站

版权声明
本文为[Fenghou Qimen L]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202131926220294.html