当前位置:网站首页>Games101 Lesson 9 shading 3 Notes
Games101 Lesson 9 shading 3 Notes
2022-07-03 04:31:00 【Fenghou Qimen L】
To color 3
One 、 The coordinates of the center of gravity (Barycentric Coordinates)
(1) Why do we want to do interpolation ?
① The properties of the three vertices of a triangle are known , Want to get the attribute of smooth change inside the triangle ( Such as texture coordinates , Color , Normals, etc ).
② Interpolation can be achieved by using barycentric coordinates .
(2) The barycentric coordinates are for a triangle (α,β,γ) In terms of the .
① Different triangles correspond to different barycentric coordinate systems .
②α,β,γ Both are nonnegative and the sum is 1 when , The point is in the triangle .
③ Any point in the triangle can be represented by barycentric coordinates . Just like A The coordinate of the center of gravity is (1,0,0), spot B The coordinate of the center of gravity is (0,1,0).
④ After projection , The triangle may become deformed , Then the center of gravity coordinates may change .
(3) From a geometric point of view 
① With α For example ,α And A relevant ,α The value is A The area of the triangle opposite the vertex AA With triangles ABC The area ratio of .
(4) The calculation formula of the center of gravity coordinate is as follows :
(5) Use of barycentric coordinates 
① We know the attributes of three vertices and the barycentric coordinates of a point , Then the attribute of the point can be calculated .
② Attributes in three-dimensional space should be obtained in three-dimensional space .
Two 、 Texture mapping
(1) Take diffuse reflection as an example to map texture
① For each pixel ( Usually the pixel center ) Coordinates of , Calculate the corresponding texture coordinates .
② Apply to the texture coordinates to calculate the corresponding color .
③ Set the color .
3、 ... and 、 Texture magnification (Texture Magnification)
(1) Texture magnification ( Case study 1)
① If the texture is small , Then the image may appear jagged .
② This is because pixels in a small area may be mapped to the same texture element .
③ Use bilinear interpolation to get more accurate attributes .
(2) Bilinear interpolation (Bilinear Interpolation)
① Find four pixels around the target location .
② to s Interpolation in direction , get u1 and u2 Properties of .
② Then on u1 and u2 Conduct t Interpolation in direction , You can get the attribute of the target location .
(3) Texture magnification ( Case study 2)
① If the texture is large , Then the image may appear moire and jagged .
② Pixels in different positions cover different texture elements , Pixels in the distance may cover a large area of texture .
(4) Texture magnification ( Case study 2) Solutions for
① Oversampling can be used , But this scheme costs a lot .
② Use average range query (Range Query) Methods .
Four 、Mipmap
(1)Mipmap: Reduce the picture to scale 
① Allow range queries .
② Fast query speed , But you can only do approximate and square queries .
③ Only more 1/3 Storage space .
(2) Find the corresponding mipmap The layer number 
① Map pixels to texture coordinates , It can be found that the original square pixel area will be mapped into an irregular texture .
② Find the mapping to the texture coordinate system , The current pixel and the surrounding two ( It can also be more ) The maximum distance between pixels L.
③ Use a side length of L To approximate this irregular region , To get the texture .
④ According to the side length L It can be calculated that the corresponding is mipmap Which floor in , To get the texture .
(3)mipmap The effect of 
① It has preliminary effect , But it can be seen that some places are discontinuous . This is because only number 0、1、2 Properties of equal layers , There is no calculation in the middle, such as 1.5 Layer properties .
② Trilinear interpolation can be used to solve , It's on the second floor mipmap Third interpolation between , To get more continuous properties .
③ The result of using trilinear interpolation is as follows .
(4)mipmap The problem is 
① Distant images will become blurred .
② Anisotropic filtering can be used to improve .
5、 ... and 、 Anisotropic filtering (Anisotropic Filtering)
(1)ripmap
① Zoom out in both directions .
② Allow range query of rectangular area .
③ There is not much improvement for oblique area range query .
④ Too much storage overhead 3 times .
(2)EWA filtering
① Query the range of circular areas .
② Multiple queries are required .
reference
Course video link : GAMES101 Lecture09 Shading 3
边栏推荐
- Mongodb slow query optimization analysis strategy
- How to retrieve the password for opening word files
- What are the Bluetooth headsets with good sound quality in 2022? Inventory of four high-quality Bluetooth headsets
- 跨境电商多商户系统怎么选
- 使用BENCHMARKSQL工具对KingbaseES执行测试时报错funcs sh file not found
- C language series - Section 3 - functions
- Busycal latest Chinese version
- MC Layer Target
- 重绘和回流
- 2022 P cylinder filling test content and P cylinder filling simulation test questions
猜你喜欢

2022 new examination questions for the main principals of hazardous chemical business units and examination skills for the main principals of hazardous chemical business units

Daily question - ugly number
![[fxcg] market analysis today](/img/ac/294368e3496a5b808b38833053ee81.jpg)
[fxcg] market analysis today

4 years of experience to interview test development, 10 minutes to end, ask too

拆一辆十万元的比亚迪“元”,快来看看里面的有哪些元器件。

Feature_selection

Preliminary cognition of C language pointer

When using the benchmarksql tool to test the concurrency of kingbasees, there are sub threads that are not closed in time after the main process is killed successfully

Youdao cloud notes

Which Bluetooth headset is cost-effective? Four Bluetooth headsets with high cost performance are recommended
随机推荐
sd卡数据损坏怎么回事,sd卡数据损坏怎么恢复
2022-02-13 (347. Top k high frequency elements)
Daily question - ugly number
[literature reading] sparse in deep learning: practicing and growth for effective information and training in NN
[文献阅读] Sparsity in Deep Learning: Pruning and growth for efficient inference and training in NN
[fxcg] inflation differences will still lead to the differentiation of monetary policies in various countries
金仓数据库KingbaseES 插件kdb_database_link
Writing skills of multi plate rotation strategy -- strategy writing learning materials
AWS VPC
Data Lake three swordsmen -- comparative analysis of delta, Hudi and iceberg
金仓数据库KingbaseES 插件kdb_exists_expand
[set theory] set concept and relationship (true subset | empty set | complete set | power set | number of set elements | power set steps)
The programmer went to bed at 12 o'clock in the middle of the night, and the leader angrily scolded: go to bed so early, you are very good at keeping fit
2022-02-14 (394. String decoding)
Wine travel Jianghu War: Ctrip is strong, meituan is strong, and Tiktok is fighting
Smart contract security audit company selection analysis and audit report resources download - domestic article
After reviewing MySQL for a month, I was stunned when the interviewer of Alibaba asked me
Competitive product analysis and writing
Priv app permission exception
Matplotlib -- save graph