Skip to content

Physically Based Renderer

You'll build a real-time renderer with metallic-roughness materials, image-based lighting, normal maps and shadows, holding sixty frames a second inside a per-frame budget you measured on the GPU.

About

Physically based rendering is the material model behind nearly every modern game and film: a metallic value, a roughness value, a base color and a normal map, lit by a microfacet model and an environment that lights things from every direction. Getting it right means HDR, tone mapping, gamma, the Cook-Torrance BRDF with GGX, and three precomputed textures for the environment light. Getting it fast means GPU timer queries and a budget per pass, because sixty frames a second is 16.6 milliseconds and the GPU will happily spend all of it on one mistake. This is a season of evenings and weekends.

At a glance

Per requirement
50 XP
Completion bonus
600 XP
Requirements
7
Takes
A season
Skill level
Advanced (years of practice)
Cost
Free
Supplies
Nothing special
Where
At home
Other people
On your own
Locked for now
Earn two more Rare badges in Graphics Programming to open this one. Log in to see how far along you are.

Requirements

  1. 1
    Render in HDR and tone map to the screen, with gamma handled once. Render to a floating point target, then apply a tone mapping curve (ACES or Reinhard) and the sRGB conversion in one final pass. Show a bright light that no longer clips to flat white. Take a screenshot of the same scene with and without tone mapping. Photo
  2. 2
    Light a grid of spheres with the Cook-Torrance BRDF, roughness across and metallic down. Draw seven by seven spheres, from rough to smooth left to right and from dielectric to metal top to bottom, which is the standard check that the model is right. Take a screenshot of the grid lit by a few point lights. Photo
  3. 3
    Add image-based lighting from an HDR environment map. Convolve the environment into an irradiance map for diffuse, a prefiltered mip chain for specular by roughness, and a BRDF lookup texture. Free HDRIs are on Poly Haven. Take a screenshot of the sphere grid reflecting the environment, with the rough spheres blurry and the smooth ones sharp. Photo
  4. 4
    Load a glTF model with normal, metallic-roughness and base color textures. The Khronos sample models (Damaged Helmet, Flight Helmet, Water Bottle) are free and are what everyone tests on. Compute tangents if the file doesn't carry them. Take a screenshot of the model next to the reference viewer's render of the same file. Photo
  5. 5
    Add shadows from the sun and put a camera path through a full scene. Use shadow mapping with filtered edges, on a scene like Sponza or a collection of the sample models. Film twenty seconds of a camera moving through it. Video
  6. 6
    Measure every pass with GPU timer queries and show a frame under 16.6 milliseconds. Print the milliseconds for the shadow pass, the main pass and the post pass on screen, measured on the GPU rather than the CPU. Name the GPU you ran it on, since a laptop and a desktop are different budgets. Take a screenshot with the timings visible and the total under budget. Photo
  7. 7
    Write a post on the one thing that cost the most frame time and how you got it back. Keep it under a thousand words, with before and after numbers. Post the text or a screenshot of it. Photo