Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Filmic Tonemapping for Real-time Rendering - Siggraph 2010 Color Course

5,343 views

Published on

Filmic Tonemapping for Real-time Rendering, a presentation from the Siggraph 2010 Course on Color, on a technique developed from film that became very applicable to games with the addition of support for HDR lighting and rendering in graphics cards.

Published in: Engineering
  • Be the first to comment

Filmic Tonemapping for Real-time Rendering - Siggraph 2010 Color Course

  1. 1. SIGGRAPH 2010 Filmic Tonemapping for Real-time Rendering Haarm-Pieter Duiker Duiker Research hpd@duikerresearch.com
  2. 2. Filmic Tonemapping Overview • History of Color in Games • Scene-referred and Output-referred data • Cineon Log • What a filmic curve looks like • Authoring a filmic curve • Further work
  3. 3. SIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game ProductionSIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game Production 4
  4. 4. SIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game ProductionSIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game Production 5
  5. 5. SIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game ProductionSIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game Production 6
  6. 6. SIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game ProductionSIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game Production 7
  7. 7. SIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game ProductionSIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game Production 8
  8. 8. SIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game ProductionSIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game Production 9
  9. 9. SIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game ProductionSIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game Production 10
  10. 10. SIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game ProductionSIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game Production 11
  11. 11. SIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game ProductionSIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game Production HDR data in modern hardware • What problems do modern hardware capabilities bring with them? – Working with HDR data implies Linear color math – Linear data is displayed on non-linear devices • monitors • TV screens 12
  12. 12. SIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game ProductionSIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game Production Review of different color spaces • Some (relatively) new terms – Scene-referred – Output-referred – What? Why does this matter now? • Two main color spaces – Scene-referred Linear – Output-referred sRGB 13
  13. 13. SIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game ProductionSIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game Production 14
  14. 14. SIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game ProductionSIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game Production 15
  15. 15. SIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game ProductionSIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game Production Two phase model of color rendering • Render / Capture linear data • Correct for the display’s characteristics – Get the display to render the intensities of the ‘scene- referred’ data as closely as possible to the original scene 16
  16. 16. SIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game ProductionSIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game Production What does Linear data “look” like? 17
  17. 17. SIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game ProductionSIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game Production 18
  18. 18. SIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game ProductionSIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game Production 19
  19. 19. SIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game ProductionSIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game Production 20
  20. 20. SIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game ProductionSIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game Production 21
  21. 21. SIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game ProductionSIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game Production 22
  22. 22. SIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game Production • High contrast • The dynamic range viewable on screen is small • Integer formats can only represent a fixed dynamic range SIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game Production Issues with Scene-referred Linear data 23
  23. 23. SIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game ProductionSIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game Production Can we do better than sRGB? • How do we make a scene-referred linear render look like film? • Can we add some artistic control to the proces? – What if we want to make our render look like a film stock that doesn’t exist? 25
  24. 24. SIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game ProductionSIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game Production 26
  25. 25. SIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game ProductionSIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game Production 27
  26. 26. SIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game ProductionSIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game Production 28
  27. 27. SIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game ProductionSIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game Production Cineon Log - a new (old) color space • Used in visual effects since circa 1993 • Important properties – Pixel values correspond to negative density • lg = (log10(ln/linReference)/ld*logGamma + logReference)/1023.f • log Density ~= log10(Intensity) ~= Exposure – HDR data in an LDR bit depth • Values greater than 1 map to values less than 1 – Values close to 0 get a lot bits 29
  28. 28. SIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game ProductionSIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game Production Visualizing color spaces 30
  29. 29. SIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game ProductionSIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game Production 31
  30. 30. SIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game ProductionSIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game Production 32
  31. 31. SIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game ProductionSIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game Production 33
  32. 32. SIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game ProductionSIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game Production 34
  33. 33. SIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game ProductionSIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game Production Filmic Tonemapping - Four stages • Render / Capture linear data • Convert from Scene-referred Linear to Log – Match the look of a negative film stock here • Apply a “filmic” tonemap to match a print film stock • Correct for the display’s characteristics 35
  34. 34. SIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game ProductionSIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game Production What does a “filmic” curve look like? • Let’s look at some curves. Notice – Toe – Shoulder – Channel separation – “Linear” range 36
  35. 35. SIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game ProductionSIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game Production A “filmic” curve looks like - Kodak 37
  36. 36. SIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game ProductionSIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game Production A “filmic” curve looks like - Color Sym. 38
  37. 37. SIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game ProductionSIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game Production A “filmic” curve look like - Sony Anim. 39
  38. 38. SIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game ProductionSIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game Production A “filmic” curve looks like - EA / Naughty 40
  39. 39. SIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game ProductionSIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game Production Authoring a LUT - Process breakdown • Screenshot from game • Convert to Cineon Log • Treat in Photoshop / Nuke / Grading suite of choice – Make sure it’s a non-destructive edit (use layers) – Or embed an identity lut • Apply treatment to identity lut image – Can be 1d or 3d 41
  40. 40. SIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game ProductionSIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game Production 42
  41. 41. SIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game ProductionSIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game Production 43
  42. 42. SIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game ProductionSIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game Production 44
  43. 43. SIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game ProductionSIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game Production 45
  44. 44. SIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game ProductionSIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game Production 46
  45. 45. SIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game ProductionSIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game Production 47
  46. 46. SIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game ProductionSIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game Production 48
  47. 47. SIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game ProductionSIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game Production 49
  48. 48. SIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game ProductionSIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game Production 50
  49. 49. SIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game ProductionSIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game Production 51
  50. 50. SIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game ProductionSIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game Production Screenshot from game • Can we use Uncharted here? 52
  51. 51. SIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game ProductionSIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game Production 53
  52. 52. SIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game ProductionSIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game Production Optimized implementation • Three steps of color processing is too expensive • Analytical approximations – Jim Hejl and Richard Burgess-Dawson at EA – John Hable at Naughty Dog 54
  53. 53. SIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game ProductionSIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game Production Analytical Approximations • Linear all the way to sRGB-corrected – Requires fitting parameters to authored lut • Different approximations 55
  54. 54. SIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game ProductionSIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game Production Approximation 1 56 float4 ps_main( float2 texCoord : TEXCOORD0 ) : COLOR { float3 texColor = tex2D(Texture0, texCoord ); float3 x = max(0,texColor-0.004); float3 retColor = (x*(6.2*x+.5))/(x*(6.2*x+1.7)+0.06); return float4(retColor,1); }
  55. 55. SIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game ProductionSIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game Production Approximation 2 57 float A = 0.15; float B = 0.50; float C = 0.10; float D = 0.20; float E = 0.02; float F = 0.30; float W = 11.2; float3 Uncharted2Tonemap(float3 x) { return ((x*(A*x+C*B)+D*E)/(x*(A*x+B)+D*F))-E/F; } float4 ps_main( float2 texCoord : TEXCOORD0 ) : COLOR { float3 texColor = tex2D(Texture0, texCoord ); float ExposureBias = 2.0f; float3 curr = ExposureBias*Uncharted2Tonemap(texColor); float3 whiteScale = 1.0f/Uncharted2Tonemap(W); float3 color = curr*whiteScale;
  56. 56. SIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game ProductionSIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game Production Is a 1d Filmic tonemap good enough? • Effects not accounted for by a 1d lut – Color cross-talk – Saturation – Gamut-mapping 58
  57. 57. SIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game ProductionSIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game Production Emulating an actual film stock • Authoring a lut can be artistic or emulation driven – Is emulation what your game needs? – You can combine the two 59
  58. 58. SIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game ProductionSIGGRAPH 2010 Course: Color Enhancement and Rendering in Film and Game Production Thanks • Naty Hoffman • John Hable • Jim Hejl • Kim Libreri • George Borshukov • Course contributors 60

×