当前位置:网站首页>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
边栏推荐
- Square root of X
- Redraw and reflow
- [set theory] set concept and relationship (true subset | empty set | complete set | power set | number of set elements | power set steps)
- Two drawing interfaces - 1 Matlab style interface
- [set theory] binary relation (example of binary relation on a | binary relation on a)
- x Problem B
- Xrandr modifier la résolution et le taux de rafraîchissement
- Priv-app permission异常
- Pyqt control part (II)
- [文献阅读] Sparsity in Deep Learning: Pruning and growth for efficient inference and training in NN
猜你喜欢
[dynamic programming] subsequence problem
Youdao cloud notes
[fxcg] market analysis today
使用BENCHMARKSQL工具对KingbaseES执行测试时报错funcs sh file not found
有道云笔记
X-ray normal based contour rendering
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
Five elements of user experience
2022 chemical automation control instrument examination summary and chemical automation control instrument certificate examination
[free completion] development of course guidance platform (source code +lunwen)
随机推荐
Writing skills of multi plate rotation strategy -- strategy writing learning materials
Youdao cloud notes
RSRS指标择时及大小盘轮动
[nlp] - brief introduction to the latest work of spark neural network
使用BENCHMARKSQL工具对KingbaseES预热数据时执行:select sys_prewarm(‘NDX_OORDER_2 ‘)报错
Redraw and reflow
FFMpeg filter
Drf--- quick start 01
Crazy scientist
2022-02-14 (394. String decoding)
540. Single element in ordered array
xrandr修改分辨率與刷新率
[literature reading] sparse in deep learning: practicing and growth for effective information and training in NN
Pdf editing tool movavi pdfchef 2022 direct download
[set theory] set concept and relationship (set family | set family examples | multiple sets)
[fairseq] error: typeerror:_ broadcast_ coalesced(): incompatible function arguments
C primre plus Chapter 10 question 6 inverted array
[free completion] development of course guidance platform (source code +lunwen)
金仓数据库KingbaseES 插件kdb_date_function
IPhone x forgot the boot password