当前位置:网站首页>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
边栏推荐
- Ternsort model integration summary
- Canoe - the second simulation engineering - xvehicle - 2 panel design (operation)
- Appscan installation steps
- Configure SSH key to realize login free
- Common built-in modules
- (2021-08-20) web crawler learning 2
- QQ group collection
- Usage of with as
- os. Path built-in module
- 本地Mysql忘记密码的修改方法(windows)
猜你喜欢
Canoe test: two ways to create CAPL test module
(August 10, 2021) web crawler learning - Chinese University ranking directed crawler
Detailed array expansion analysis --- take you step by step analysis
2020 Summary - Magic year, magic me
QQ group collection
Introduction to canoe automatic test system
OSI seven layer reference model
Postman interface test
Installation of ES plug-in in Google browser
Application of slice
随机推荐
If function in SQL
Elevator dispatching (pairing project) ①
Ten key performance indicators of software applications
Process communication and thread explanation
Lvs+kept realizes four layers of load and high availability
Appscan installation error: unable to install from Net runtime security policy logout appscan solution
QQ group collection
Open the neural network "black box"! Unveil the mystery of machine learning system with natural language
Digital simulation beauty match preparation -matlab basic operation No. 6
Send a request using paste raw text
Function parameters (positional parameters, default value parameters, variable parameters, named keyword parameters, keyword parameters)
JMeter Foundation
Foreach (system.out:: println) usage
F12 clear the cookies of the corresponding web address
How do std:: function and function pointer assign values to each other
Function introduction of canbedded component
regular expression
VPS installation virtualmin panel
Test question bank management system - database design [easy to understand]
C language memory layout