GAMES101 Review--Rasterization

GAMES101 Review – Rasterization

definition

Rasterization is the process of converting vector graphics into raster images. During the rasterization process, the computer maps the primitives to pixel positions on the screen and determines the color value of each pixel based on the primitive's geometric properties (such as position, size, shape, etc.) and lighting model and other information. In this way, by calculating and filling each pixel, a visual image is finally formed.

Viewport transformation

Viewport transformation is the process of mapping graphics in the normalized device coordinate system to a specified area on the screen. It includes the steps of mapping graphics coordinates to the screen coordinate system, performing zoom and translation operations, and finally converting the coordinates to pixel coordinates. Through viewport transformation, accurate display and position control of graphics on the screen can be achieved.

Insert image description here
Zoom and pan: According to the size and position of the viewport, the graphics mapped to the screen coordinate system are scaled and panned to adapt to the size and position of the viewport.
transformation matrix

rasterization

Rasterization is the process in computer graphics of converting vector graphics into raster images. It converts geometric shapes such as continuous curves and surfaces of graphics into raster images composed of pixels for display on the screen.

The function of rasterization is to convert vector graphics into raster images so that the graphics can be displayed and processed on the computer screen. Through rasterization, graphics visualization, editing, transformation and rendering operations can be realized.

Here's triangle rasterization: dividing the graphic into a series of triangles, and then interpolating inside each triangle to determine the color value of each pixel, thereby generating a raster image.
Insert image description here

Insert image description here

Insert image description here

Pay attention to blurring first and then sampling, not sampling first and then blurring.
Insert image description here
Rasterization is an important and complex process in computer graphics. Its key points and difficulties are mainly reflected in the following aspects:

  1. Discretization of geometric shapes: The core task of rasterization is to convert continuous geometric shapes into discrete pixel images. This involves how to accurately represent and draw geometric shapes such as curves and surfaces at the pixel level. For example, in triangle rasterization, how to determine the color value of each pixel inside the triangle is an important issue.

  2. Calculation of pixel coverage: During rasterization, it is necessary to determine which pixels are covered by the geometry and how to calculate the color value of each pixel. This involves techniques such as pixel coverage testing, depth testing, color interpolation, etc. to ensure that the resulting raster image is as consistent as possible with the original geometry.

  3. Edge processing and rasterization order: For complex geometric shapes, such as the edges of polygons or curves, the edge processing and rasterization order have an important impact on the final image quality. For example, in scan line rasterization, issues such as edge interpolation, pixel coverage, and blending order need to be considered.

  4. Performance optimization: Rasterization is a computationally intensive process, and performance optimization is an important consideration for real-time rendering and interactive applications. How to improve the efficiency and speed of rasterization through algorithm optimization, parallel computing and other technologies is a challenging problem.

In short, the key points and difficulties of rasterization in computer graphics mainly involve the discretization of geometric shapes, calculation of pixel coverage, edge processing and rasterization order, and performance optimization. Solving these problems requires an in-depth understanding of graphics principles and a combination of optimization algorithms and techniques to achieve a high-quality and efficient rasterization process.

Insert image description here

Sampling problem

  1. sawtooth
  2. moiré pattern
  3. reverse tire

Reasons for aliasing : The signal changes too fast and the sampling frequency is too small.

Filtering and convolution

  1. Filtering
    High-pass filtering and low-pass filtering enhance or suppress specific frequency bands.

  2. Convolution
    As shown below, there is a 3*3 box. Convolution means that for each pixel of the original image, add the colors of itself and the surrounding 8 pixels, and then divide by 9. (Of course this box can have different shapes).

Anti-aliasing technology

  1. Blurring
    turns half orange and half white pixels into either orange or white. The blur operation actually turns it into an intermediate color between white and orange, and the degree of this intermediate color is determined based on the ratio of orange to white in the current pixel. .

  2. MSAA (Multi-Sample Anti-Aliasing):
    MSAA is an anti-aliasing technology based on multi-sampling, which reduces the aliasing effect by oversampling the edges of the image.

The advantage of MSAA is that it can provide better image quality and smoothness, but compared to other anti-aliasing technologies, it requires more computing resources.

Insert image description here

  1. TAA (Temporal Anti-Aliasing):
    TAA is a time-based anti-aliasing technology that reduces the aliasing and aliasing effects of images by interpolating and blending pixel colors between consecutive frames.
    The advantage of TAA is that it can provide better anti-aliasing effects in dynamic scenes and does not require additional hardware support. However, TAA may introduce motion blur and image flickering issues.

  2. FXAA (Fast Approximate Anti-Aliasing):
    FXAA is a fast approximate anti-aliasing technology that reduces the aliasing effect by blurring and edge detection on the image.

Guess you like

Origin blog.csdn.net/m0_51947486/article/details/132098556