r/GraphicsProgramming • u/GreenFire317 • Oct 02 '22
Question GPU Testing and Rendering
Whats the difference? Why does it take minutes to render a picture, but a video game can render 60 pictures a second?
Also, what makes a GPU stress test "hard"? Is it the amount of objects in scene, the quantity of light sources and shadows, colors of objects/lights, is it textures? What makes one render stress test harder/better?
7
Upvotes
7
u/ShakaUVM Oct 02 '22
If you're talking about minutes per render, you're talking high quality ray tracing, where you send out an excessive number of rays from every pixel on the screen and let them bounce around and refract through the level, often creating more rays in the process. You can let this run for a really really long time if you want high graphical fidelity.
In a video game, most games use rasterization and not raytracing (though with RTX cores this is changing). Rasterization involves taking all the triangles in the scene and putting each of their pixels in and output buffer, and doing this once for each triangle (with nearer triangles appearing over triangles further away). Computing the color of each pixel (or subpixel fragment) for each point in a triangle can be expensive, so game engines use a loooot of tricks to eliminate as many triangles as possible, such as by not drawing triangles facing away, reducing the triangle count of distant objects, not drawing triangles that are not visible, etc.
Games are not fast by accident. I once dropped a new building we'd just had an artist model make for our arcade game and the fps dropped from 60 to like 4. We didn't release like that obviously. Keeping the frame rate up is a mindset that permeates game dev from top to bottom.