2. vertex shader
Vertex shader is a program executed on the GPU of the video card. It replaces transformation and lighting in the fixed function pipeline (fixed function pipeline) phase (this is not correct, because the vertex coloring tool can be simulated by direct3d Runtime (direct3d runtime) in software, if the hardware does not support the vertex coloring tool ). Figure 2.1 shows the part replaced by the vertex shader in the pipeline.
Fig 2.1
Since the vertex shader is a custom program we write (in HLSL), we have gained great freedom in terms of graphic effects. We are no longer limited by the direct3d fixed illumination algorithm. In addition, the application's ability to manipulate vertex locations is also diverse, such as fabric simulation, point size manipulation of particle systems, and vertex mixing/deformation. In addition, our vertex data structure is more free and can contain more data in a programmable pipeline than in a fixed functional pipeline.
As the announcement in the author's group says, "taking a photo is not about your proficiency in the camera, but about your grasp of art ." The previous introduction gives readers a certain understanding of the preparation and use of the coloring tool, next we will focus on how to use the shader to achieve more advanced rendering.