Explain how a modern real-time rendering pipeline draws a frame, and where the common performance costs are.
What the interviewer wants to hear
- CPU prepares visible objects: culling, sorting, draw calls
- GPU vertex stage transforms vertices to screen space
- Rasterisation and pixel/fragment shading
- Forward vs deferred shading for lighting
- Post-processing, shadows and transparency
- Costs: draw calls, overdraw, shader complexity, bandwidth
Model answer
On the CPU side, the engine first decides what is visible using frustum and occlusion culling, picks LODs, sorts objects by material and transparency, and submits draw calls to the GPU. On the GPU, the vertex shader transforms each vertex from object space to screen space. The rasteriser turns triangles into pixels, and the pixel or fragment shader computes their colour using textures and lighting. In a deferred renderer, the scene first writes surface data to a G-buffer and lighting is computed later per pixel, which handles many lights well; forward rendering lights each object directly and handles transparency and MSAA more easily. Shadows are extra passes, and post-processing like bloom and tone mapping runs at the end. Common costs are too many draw calls, overdraw from transparency, complex shaders, high resolution and memory bandwidth.
Can you answer it under time pressure?
Take a timed hard round and get scored on every answer.
More hard Game Developer questions
- How would you design the networking for a fast-paced online multiplayer shooter?
- Design a flexible ability and buff system for an RPG with hundreds of skills.
- How do you manage memory in a large game that ships on consoles with fixed memory?
- How would you reduce cheating in an online game?
- The game averages 60 FPS but players complain about hitches every few seconds. How do you find and fix them?
- How would you build a replay system that lets players rewatch a match, and what makes it hard?
- How would you architect world streaming for a large open-world game?
- How do you use multiple CPU cores in a game without race conditions and with real speed-ups?
- How would you design the backend for an online game with matchmaking and dedicated servers?