当前位置:网站首页>Facet experience -- the development side of dragon game client
Facet experience -- the development side of dragon game client
2022-07-28 17:05:00 【Morita Rinko】
Due to the rendering part of my resume, the interview questions are a little biased towards the rendering direction , For reference only .
1、 How to find the of any vector in a two-dimensional plane x Axis and y Vector in the axial direction
2、 How to judge whether a vertex is inside or outside a triangle .( More than one way )
- Internal angle sum method : Connection point P And the three vertices of the triangle to get three line segments PA,PB and PC, Find the included angle between these three line segments and each side of the triangle ( Use point multiplication to find the angle ), If the sum of all the angles is 180 degree , So a little P In a triangle , Otherwise, it's not in .
- In the same direction : Will point P Connect with a corner , Find the cross product of the vector and the vector formed by the connection of the two corners to get the vector , Calculate the three corners in turn , And follow the same method , Finally, we get three vectors , If the directions of the three vectors are the same, it means that the point P Inside the triangle , On the contrary, as long as the direction of one vector is different from the rest, it is not inside the triangle .
- Barycenter method : We can take an angle of a triangle as the standard , Then the other two corners can be expressed as the angle moves in a certain direction to get . And any point inside the triangle can also be expressed as the movement of the standard point in a certain direction , This direction can be expressed by two triangular sides . So if you click P It can be expressed by this formula P = A + u * (C – A) + v * (B - A) , also u>=0,v>=0,(u+v)<=1, The point of P Inside the triangle , If the condition is not satisfied, it is not inside the triangle .
If u=0,v=0 be P=A;
If u=0,v=1 be P=B;
If u=1,v=0 be P=C;
When u+v=1 when , Express P The point is BC On the edge , So if P The point inside the triangle should u+v<=1
3、 Render pipeline
Three stages : Application stage 、 Geometric stage 、 Grating stage
Application stage :
- Prepare the scene data , Do coarse-grained removal
- Set the state of rendering
- call drawcall
Geometric stage :
- Vertex shader : Process input vertex information , Transform to crop space
- Surface subdivision shaders : Subdivide elements
- Geometry shaders : Generate more elements
- tailoring : If it is in the field of view of the camera, it is directly discarded , If there are parts inside and outside the field of vision, you need to cut them to leave visible parts
- Screen mapping : Convert crop space to screen space , The clipping space is [-1,1] In the area , The switch to 2 Dimension screen space .
Grating stage :
- Triangle settings : According to the previous vertex , Calculate the boundary of the triangle
- Triangle traversal : Traverse entities , Calculate which elements are inside the triangle .
- Chip shader : Shading the elements to be rendered
- Slice by slice operation : Change the color 、 Deep buffer 、 Mix and so on .
4、 There are several transformations from model space to clipping space
Model space - World space - Perspective space - Cutting space
5、 If you transform a point from model space to world space
The point in world coordinates is the offset from the origin , We can get the transformation matrix that transforms the origin of world coordinates into the origin of model space in model space , The inverse transformation matrix of this transformation matrix can represent the world space , The origin of model space is obtained by transforming from the origin of world coordinates .
6、 How do shadows work
(1) Put the camera on the light source and rasterize it to get a texture map storing depth information
(2) Rasterize from the position of the real camera , If it is greater than the depth of the texture map at this point , It means that it is in shadow
7、 How to judge whether a linked list has rings
(1) Exhausting : Traversing the linked list , Record the data that is traversed , If there is a repetition, there is a ring
(2) Use a hash table to store : If the traversed data has been stored, there is a ring
(3) Speed pointer : Two pointers point to the header node , A pointer traverses one by one , One pointer traverses two by two , If the value pointed to by the pointer has the same time , Description ring , Otherwise there is no ring .
8、 The geometric meaning of dot multiplication
Get the projection of one vector on another vector , Indicates the closeness of two vectors , The larger the value, the closer it is , The smaller the value, the less similar
边栏推荐
- 海康威视回应'美国禁令'影响:目前所使用的元器件都有备选
- asmlinkage的理解
- Record development issues
- 【深度学习】:《PyTorch入门到项目实战》第四天:从0到1实现logistic回归(附源码)
- Add differential pairs and connections in Ad
- [deep learning]: the second day of pytorch introduction to project practice: realize linear regression from zero (including detailed code)
- Record the processing process of CEPH two RBDS that cannot be deleted
- Probability theory and mathematical statistics Chapter 1
- 【深度学习】:《PyTorch入门到项目实战》第七天之模型评估和选择(上):欠拟合和过拟合(含源码)
- [deep learning]: day 1 of pytorch introduction to project practice: data operation and automatic derivation
猜你喜欢

Do you really understand CMS garbage collector?

Interesting kotlin 0x09:extensions are resolved statically

MySQL安装教程

关于 CMS 垃圾回收器,你真的懂了吗?

Probability theory and mathematical statistics Chapter 1

Re11: read EPM legal judgment prediction via event extraction with constraints

TCP handshake, waving, time wait connection reset and other records

阿里大哥教你如何正确认识关于标准IO缓冲区的问题

飞马D200S无人机与机载激光雷达在大比例尺DEM建设中的应用

Easypoi multi sheet export by template
随机推荐
SUSE CEPH add nodes, reduce nodes, delete OSD disks and other operations – storage6
A total of 13billion flash and 400million MCU were shipped! In depth analysis of the three product lines of Zhaoyi innovation
Android Development - set cache
[deep learning]: day 1 of pytorch introduction to project practice: data operation and automatic derivation
HTAP是有代价的
TCP handshake, waving, time wait connection reset and other records
Alibaba cloud MSE supports go language traffic protection
It is said that NVIDIA has held talks with Softbank and will offer more than US $32billion to acquire arm
SUSE Ceph 增加节点、减少节点、 删除OSD磁盘等操作 – Storage6
Detailed steps for setting up SUSE storage6 environment – win10 + VMware Workstation
Ruoyi集成flyway后启动报错的解决方法
【从零开始学习SLAM】将坐标系变换关系发布到 topic tf
Deep understanding of deepsea and salt deployment tools – storage6
3D modeling tool Archicad 26 newly released
SUSE Ceph 快速部署 – Storage6
Leetcode9. Palindromes
打造自组/安全/可控的LoRa网!Semtech首度回应“工信部新规”影响
Re12: read these3 semantic self segmentation for abstract summary of long legal documents in low
【深度学习】:《PyTorch入门到项目实战》第五天:从0到1实现Softmax回归(含源码)
概率论与数理统计第一章