当前位置:网站首页>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
边栏推荐
- Aike AI frontier promotion (2.14)
- Cacti主机模板之定制版
- QQ get group information
- Elevator dispatching (pairing project) ②
- Appscan installation error: unable to install from Net runtime security policy logout appscan solution
- Usage of with as
- Local MySQL forgot the password modification method (Windows)
- Getting started with window functions
- 2021-11-02
- Solaris 10网络服务
猜你喜欢

Canoe - description of common database attributes

2021 annual summary - it seems that I have done everything except studying hard

netstat

Summary of Shanghai Jiaotong University postgraduate entrance examination module firewall technology

(2021-08-20) web crawler learning 2

JMeter common configuration components and parameterization

Analysis function in SQL

Canoe - the third simulation project - bus simulation-1 overview

Login operation (for user name and password)

Open the neural network "black box"! Unveil the mystery of machine learning system with natural language
随机推荐
Open the neural network "black box"! Unveil the mystery of machine learning system with natural language
Summary of Shanghai Jiaotong University postgraduate entrance examination module firewall technology
Swagger and OpenAPI
F12 clear the cookies of the corresponding web address
Summary of Shanghai Jiaotong University postgraduate entrance examination module -- cryptography
How do std:: function and function pointer assign values to each other
QQ set group information
iptables导致Heartbeat脑裂
(2021-08-20) web crawler learning 2
Reptile learning 4 winter vacation series (3)
C language memory layout
VPS安装Virtualmin面板
Introduction of network security research direction of Shanghai Jiaotong University
Analysis function in SQL
Elevator dispatching (pairing project) ②
Take advantage of the world's sleeping gap to improve and surpass yourself -- get up early
Introduction to canoe automatic test system
netstat
Oracle11g | getting started with database. It's enough to read this 10000 word analysis
Postman advanced