3 ms·
Does modern hardware still have this "default" behavior? I could imagine you would have to write a (basic) shader to get any kind of output, whereas back in the
by captainmuon 4y ago
Does modern hardware still have this "default" behavior? I could imagine you would have to write a (basic) shader to get any kind of output, whereas back in the day the 3D accelerator knew how to do Phong shading etc. in hardware.
- flohofwoe 4y agoYou need a vertex- and pixel-shader, but AFAIK even on modern GPUs the vertex attribute interpolation happens as fixed-function feature between the vertex- and pixel-stage (e.g. the vertex shader runs per vertex and outputs different colors for each vertex, and the pixel shader runs per pixel and gets the hardware-interpolated per-pixel color as input).
- Const-me 4y agoModern GPUs don’t know Phong shading, they expect developers to supply a pixel shader for that. However, they still interpolating all these numbers in hardware. For traditional rendering, a vertex shader outputs float4 position and a bunch of other per-vertex attributes which may contain normals, colors, texture coordinates, or anything else. GPU hardware itself only uses the positions. The hardware rasterizes triangles into pixel grid, interpolates the rest of the per-vertex attributes over the triangle, and calls the pixel shader for each pixel covered by the triangle passing the interpolated per-vertex attributes. It’s more complicated in reality: clipping, early depth rejection, pixel shaders need partial derivatives so the pixels are grouped into 2x2 blocks, some GPUs do tiled rendering. But still, on the high level the workflow stayed about the same since shaders arrived in Direct3D 8 in 2001 with GeForce 3. The only major disruption so far is UE5 which uses compute shaders for nanite meshes, instead of the hardware rasterizer.
- datalopers 4y agoIs there a particular book you recommend to approach learning this subject?
- Const-me 4y agoNot quite a book, but if you already know, at least to some extent, some 3D GPU API, I can recommend this series of blog posts: https://fgiesen.wordpress.com/2011/07/09/a-trip-through-the-graphics-pipeline-2011-index/ https://fgiesen.wordpress.com/2011/07/09/a-trip-through-the-...
- n42 4y agoReal-Time Rendering https://smile.amazon.com/Real-Time-Rendering-Fourth-Tomas-Akenine-M%C3%B6ller/dp/1138627003?tag=realtimerenderin https://smile.amazon.com/Real-Time-Rendering-Fourth-Tomas-Ak...
- datalopers 4y agoThanks!