4.2 Points And Vectors(点和向量):
direction+direction=direction
direction-direction=direction
point+direction=point
point-point=direction
point+point=nonsense
5.2.1 Optimizing Dynamic Memory Allocation(动态内存管理)
Keep heap allocations to a minimum,and never allocate from the heap within a tight loop
5.2.1.1 Stack-Based Allocators
7.The Game Loop And Real-Time Simulation(游戏循环和实时模拟)
10.1 Foundations of Depth-Buffered Triangle Rasterization(深度缓存的三角面光栅化)
光栅化
(Rasterization)是把顶点数据转换为片元的过程,具有将图转化为一个个栅格组成的图象的作用,特点是每个元素对应帧缓冲区中的一像素。
Opaque: 不透明
Transparent: 透明
Translucent: 半透明
实时渲染选用三角面作为基本面片的原因:
1.Simplest type of polygon
少于三个点无法成面
2.A triangle is always planar
三角面的点一定处于同一平面
3.Triangle always remain triangles
哪怕在透视投影等情况下三角面仍然是三角面
4.Triangle rasterization
所有商业显卡都是基于三角面片光栅化设计
固定面片的数量会导致离近时轮廓显出块状,这一问题可以用细分算法解决
Fixed tessellation(镶嵌,小方格) can cause an object's silhouette(轮廓) edges to look blocky, especially when the object is close to the camera. Subdivision surfaces can achieve this ideal——surfaces can be tessellated based on distance from the camera, so that every triangle is less than one pixel in size.
Level of detail(LOD)
用链表存储相机不同远近层次所需要的不同的面片数量
Game developers often attempt to approximate this ideal of uniform triangle-to-pixel density by creating a chain of alternate versions of each triangle mesh, each known as a level of detail(LOD).
As the object moves farther away from the camera,the engine switches form LOD0 to LOD1 to LOD2 and so on. This allows the rendering engine to spend the majority of its time transforming and lighting the vertices of the objects that are closest to the camera.
相关阅读