当前位置:网站首页>Games101 Lesson 8 shading 2 Notes
Games101 Lesson 8 shading 2 Notes
2022-07-04 11:25:00 【Fenghou Qimen L】
To color 2
One 、 highlights (Specular Term)
(1) The highlight vector and the light source vector are symmetrical with the normal line as the symmetry axis .
(2)Blinn-Phong The model calculates the energy of the highlight
①Blinn-Phong The light source vector is introduced into the model l And observation vector v The half range vector of h To facilitate the calculation of .
②Blinn-Phong The model is a simplified model , There is no consideration that objects will absorb energy .
③ Because the highlight can only be seen in a small range , Therefore, the penalty index is introduced p. The following function image shows the value of cosine function with exponent .
(3) The following figure shows the highlight coefficient ks and p The observation of the sphere when the value changes .
① This image gives the observation results that both highlights and diffuse reflections exist .
Two 、 The ambient light (Ambient Term)
(1) Definition of ambient light
① Ambient light is independent of light source and observation vector .
② Ambient light is a constant ( It's a certain color ).
③ The ambient light calculation in this section is a simplified calculation .
3、 ... and 、Blinn-Phong Reflection model
(1)Blinn-Phong Single point coloring of reflection model = Ambient shading + Diffuse shading + Highlight shading
Four 、 Coloring frequency (Shading Frequencies)
(1) Coloring frequency refers to coloring a certain area of size , It's about face . Here are the observations corresponding to three different coloring frequencies .
(2) Three coloring models with different coloring frequencies
①Flat Shading It is coloring triangle by triangle , Each triangle has the same color .
②Gouraud Shading Is shading per vertex , Each triangle is colored according to three vertices , It looks smooth .
③Phong Shading It is shading per pixel .
(3) Comparison of three coloring models
① If the vertices of the model / More faces , The gap between the three coloring models will become smaller until they are the same .
② The more complex the model , The effect of the first two shading models will be enhanced , But at the same time, the cost will be greater .
(4) How to calculate the normals of vertices ?
① Usually, a vertex belongs to multiple planes , The normals of vertices can be obtained by averaging the sum of normals of these planes .
② If the weighted average is carried out according to the area of each face , It works better .
(5) How to calculate the normal of pixels ?
① The vertex normals on both sides are known , Using the barycentric coordinates, you can calculate the normals of each point inside .
② Find various vectors, and finally remember the normalization operation .
5、 ... and 、 pipeline (Pipeline)
(1) Pipeline refers to the whole rendering process from model to pixel , It can be seen as a pipeline from model to drawing . The pipeline is divided into the following steps :
① Vertex Processing
② Triangle processing
③ Rasterize
④ Pixel processing
⑤ Mix all pixels into one image
(2) Be careful
① If the shading model is Phong Shading, Then the coloring step is carried out in the pixel processing link ; If the shading model is Gouraud Shading, Then the shading operation can be carried out in vertex processing .
6、 ... and 、 Texture mapping (Texture Mapping)
(1) Texture mapping defines different attributes in different positions of objects .
(2) Some definitions
① The surface of any three-dimensional object is two-dimensional .
② We can think of texture as a picture .
③ Applying texture to the surface of an object can be understood as mapping it .
(3) Texture coordinate system
① Defines a texture coordinate system (u, v). Each triangle corresponds to a position in the texture coordinate system .
② Different positions can also be mapped to the same texture , That is, textures can be reused .
reference
Course video link : GAMES101 Lecture08 Shading 2
边栏推荐
- Local MySQL forgot the password modification method (Windows)
- No response after heartbeat startup
- Capl: timer event
- Jemeter script recording
- The most ideal automated testing model, how to achieve layering of automated testing
- R built in data set
- thread
- iptables导致Heartbeat脑裂
- Some tips on learning database
- How do std:: function and function pointer assign values to each other
猜你喜欢
Function introduction of canbedded component
2021-08-09
Usage of case when then else end statement
Climb Phoenix Mountain on December 19, 2021
Analysis function in SQL
Performance test method
os. Path built-in module
Automatic translation between Chinese and English
Introduction to Lichuang EDA
JMeter correlation technology
随机推荐
Lvs+kept realizes four layers of load and high availability
2021-10-20
Discussion | has large AI become autonomous? Lecun, chief scientist of openai
Canoe: the fourth simulation project -- bug debugging experience
Video analysis
OSI seven layer reference model
Open the neural network "black box"! Unveil the mystery of machine learning system with natural language
Postman interface test
software test
OSI model notes
Climb Phoenix Mountain on December 19, 2021
iptables导致Heartbeat脑裂
2022 AAAI fellow release! Yan Shuicheng, chief scientist of sail, and Feng Yan, Professor of Hong Kong University of science and technology, were selected
Canoe: what is vtsystem
2021-08-09
Sys module
Dos and path
QQ group collection
Aike AI frontier promotion (2.14)
Using terminal connection in different modes of virtual machine