Appearance

Rasterization

byml2024-08-26GAMES101

屏幕

  • 屏幕是一个由像素构成的二维数组
  • 数组的大小成为分辨率 resolution
  • 屏幕是典型的光栅成像设备 Raster
  • Raster == screen in German
    • Rasterize == drawing onto the screen
  • Pixcel (FYI, picture element 的缩写)

屏幕空间

  • 左下角是原点,向右是 x,向上是 y
  • 每个像素对应一个整数坐标,从 (0,0)(width1,height1)
  • 每个像素 (x,y) 的中心是 (x+0.5,y+0.5)
  • 屏幕覆盖了 (0,0)(width,height) 的区域

Canonical Cube to Screen

  • 与标准矩形的 z 无关
  • xy 平面 [1,1]2 缩放到 [0,width]×[0,height]
  • 要将中心从 (0,0) 移动到 (width2,height2) 由以上要求,可以得到视口变换矩阵:
Mviewpoint=[width200width20height20height200100001]

Antialiasing(反走样,抗锯齿)

采样的问题:

  • Jaggies 锯齿
  • Moire 摩尔纹
  • Wagon wheel effect 车轮效应