当前位置:网站首页>Triangular rasterization
Triangular rasterization
2022-07-03 04:30:00 【Big 1234 grass】
List of articles
The following sources :GAMES101- Introduction to modern computer graphics - Yan Lingqi ---- Draw graphic information on the display device .
Matrix transformation from regular cube to screen
Before , We use perspective projection , Put a platform ( Field of vision ) Project to the center of the origin , Side length is 2 The cube of ( Regular cube ) in : The camera changes AND Orthographic projection AND Perspective projection
Let's go on , How to display it on the screen ?
Let's first look at the regular cube -z The direction of the x-y Plane , Change the same size as the screen through the matrix (width Is the width of the screen ,height For the height of the screen ).
M v i e w p o r t = ( w i d t h 2 0 0 w i d t h 2 0 h e i g h t 2 0 h e i g h t 2 0 0 1 0 0 0 0 1 ) M_{viewport} = \begin{pmatrix} \frac{width}{2}&0&0&\frac{width}{2} \\ 0&\frac{height}{2}&0&\frac{height}{2} \\ 0&0&1&0 \\ 0&0&0&1 \end{pmatrix} Mviewport=⎝⎜⎜⎛2width00002height0000102width2height01⎠⎟⎟⎞
z The coordinates remain the same , As depth information . How to deal with in-depth information —— To ensure that the objects in front can block the objects behind , I don't know for the time being .
Rasterize
Computer Graphics, abbreviation CG . The input is the description of the virtual scene , Usually an array of polygons , Each polygon consists of three vertices , Each vertex includes three-dimensional coordinates 、 UVW Map 、rgb Color, etc. . The output is an image , That is, a two-dimensional pixel array .Computer Graphics Our ultimate goal is to create unreal visual perception , The key word is “ unreal ” and “ create ”, Such as 3D Special effects ;
Computer Vision, abbreviation CV. The input is an image or image sequence , Usually from the camera 、 Camera or video file . The output is the understanding of the real world corresponding to the image sequence , Such as face detection 、 License plate recognition .Computer Vision Our ultimate goal is to imitate the human eye and brain's understanding of the real things we see , The key word is “ real ” and “ understand ”, Such as face recognition ;
An image can be seen as consisting of many triangles , Each vertex of the triangle contains position information (x-y-z) And color information (red-green-blue).
How do these points form disjoint triangles , I don't know for the time being .
The reason for using triangles as basic geometry : Triangles are the most basic shape elements , Other shapes can consist of triangles ; You can judge whether a point is inside the triangle , Enter as shown below ,AB and AP Cross product direction of == BC and BP Cross product direction of == CA and CP Cross product direction of .
Next , We consider drawing a triangle on the screen . When all triangles are drawn completely , That is to get a complete graph .
The intuitive approach is , Traverse the pixels in the range . When the pixel appears in the triangle , Namely coloring .
Anti aliasing
Self reference video :Antialiasing
During my undergraduate course, I took 《 Signals and systems 》, But I forgot all about it . The general logic in the video may be , In sampling ( Traverse whether the pixels are in the triangle ) front , Blur first . Blur processing is to pass the picture through a low-pass filter , Remove the high-frequency part , To reduce the overlap of frequency domain in the sampling process , So as to achieve the purpose of anti aliasing .
Implementation of low-pass filter , Is the average adjacent pixels .
MSAA The method is , Divide a pixel into smaller parts .
边栏推荐
- How to use kotlin to improve productivity: kotlin tips
- [set theory] binary relationship (binary relationship notation | binary relationship from a to B | number of binary relationships | example of binary relationship)
- PostgreSQL database high availability Patroni source code learning - etcd class
- [dynamic programming] subsequence problem
- Auman Galaxy new year of the tiger appreciation meeting was held in Beijing - won the double certification of "intelligent safety" and "efficient performance" of China Automotive Research Institute
- Bugku CTF daily question baby_ flag. txt
- Introduction of pointer variables in function parameters
- Integration of Android high-frequency interview questions (including reference answers)
- 使用BENCHMARKSQL工具对KingbaseES执行测试时报错funcs sh file not found
- Jincang KFS data bidirectional synchronization scenario deployment
猜你喜欢
[fxcg] market analysis today
Use the benchmarksql tool to perform a data prompt on kingbases. The jdbc driver cannot be found
JS realizes lazy loading of pictures
Internationalization and localization, dark mode and dark mode in compose
[literature reading] sparse in deep learning: practicing and growth for effective information and training in NN
使用BENCHMARKSQL工具对KingbaseES执行测试时报错funcs sh file not found
Dismantle a 100000 yuan BYD "Yuan". Come and see what components are in it.
JVM原理简介
使用BENCHMARKSQL工具对kingbaseES执行灌数据提示无法找到JDBC driver
Jincang KFS data bidirectional synchronization scenario deployment
随机推荐
The latest activation free version of Omni toolbox
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
2022-02-12 (338. Bit count)
2022-02-13 (347. Top k high frequency elements)
2022 chemical automation control instrument examination summary and chemical automation control instrument certificate examination
Know that Chuangyu cloud monitoring - scanv Max update: Ecology OA unauthorized server request forgery and other two vulnerabilities can be detected
FISCO bcos zero knowledge proof Fiat Shamir instance source code
Mongodb slow query optimization analysis strategy
Basic use of continuous integration server Jenkins
JS realizes lazy loading of pictures
Ffmpeg mix
拆一辆十万元的比亚迪“元”,快来看看里面的有哪些元器件。
[fairseq] error: typeerror:_ broadcast_ coalesced(): incompatible function arguments
Arthas watch grabs a field / attribute of the input parameter
2022 electrician (Advanced) examination papers and electrician (Advanced) examination skills
Writing skills of multi plate rotation strategy -- strategy writing learning materials
[untitled] 2022 safety production supervisor examination question bank and simulated safety production supervisor examination questions
Two points -leetcode-540 A single element in an ordered array
[Chongqing Guangdong education] reference materials for design and a better life of Zhongyuan Institute of science and technology
Data Lake three swordsmen -- comparative analysis of delta, Hudi and iceberg