|
|
|
|
|
by dragontamer
1194 days ago
|
|
So "classic" rendering, as per DirectX9 (and earlier) is Vertex Shader -> Hardware stuff -> Pixel Shader -> more Hardware stuff -> Screen. (Of course we're in DirectX12U these days, but stuff from 15 years ago are easier to understand, so lets stick with DX9 for this post) The "hardware stuff" is automatic and hard coded. Modern pipelines added more steps / complications (Geometry shaders, Tesselators, etc. etc.), but the Vertex Shader / Pixel Shader steps have remained key to modern graphics since the early 00s. ------------- "Vertex Shader" is a program run on every vertex at the start of the pipeline. This is commonly used to implement wind-effects (ex: moving your vertex left-and-right randomly to simulate wind), among other kinds of effects. You literally move the vertex from its original position to a new one, in a fully customizable way. "Pixel Shader" is a program run on every pixel after the vertexes were figured out (and redundant ones removed). Its one of the last steps as the GPU is calculating the final color of that particular pixel. Normal mapping is just one example of the many kinds of techniques implemented in the Pixel Shading step. ------------- So "Pixel Shaders" are the kinds of programs that "compute a hologram on a flat surface". And its the job of a video game programmer to write pixel shaders to create the many effects you see in video games. Similarly, Vertex Shaders are the many kinds of programs (wind and other effects) that move vertices around at the start of the pipeline. |
|