In focus pixels will be quickly rejected by Hi Zĭraw undersample pass at higher Z value, fine at small Z valueRequires an explicit copy afterwards to re-fillAdvances in Real-Time Rendering in Games You can then draw the plane at Z depth of 0.001f Hi Z cullingWhen downsampling the premultipliedCoC buffer output the computed CoC as depth Instead, default to big CoC and reject based on the sampled texelCoCExtra method to stop bleeding artifacts and can sharpen up smooth gradientsAdvances in Real-Time Rendering in Games Typical blurs default the filter kernel to the CoC of pixel However pixel shaders are designed to gather they can’t scatter the results Pseudo Scatter filterProper bokeh should have its blur scattered to its neighbours Iterative RefinementPass 5Pass 1Pass 2Pass 3++Pass 4Advances in Real-Time Rendering in Games Multiple passes fill in the under-samplingĭual iteration blur needs a total of 5 passes with a total of 8 half blurs.Advances in Real-Time Rendering in Games Iterative RefinementBecause we have equal weighted blurs can use iterative refinement on the blurring
PLUS We can improve furtherAdvances in Real-Time Rendering in Games Hexagonal BokehAdvances in Real-Time Rendering in GamesĢ Passes (3 resolves) with a total of 4 blursīUT each blur only needs half the taps therefore same #tapsīUT each tap contributes equally unlike Gaussian so need less taps for a given aesthetic filter kernel width!
Hexagonal blurs – Pass reduction 2Pass 2Pass 1++Advances in Real-Time Rendering in Games Hexagonal Blurs – Pass Reduction 1Pass 1Pass 2Pass 1 Upĝown LeftPass 2 Down Left + Down Right + Down Right+Advances in Real-Time Rendering in Games
Need to reduce passes12First PassSecond Pass3Advances in Real-Time Rendering in Games Hexagonal Blurs – Pass ReductionHexagonal blur using a separable filterīut 7 passes and 6 blurs is not competitive 3 shapes x 2 blurs + 1 combine12First PassSecond Pass3Advances in Real-Time Rendering in Games Hexagonal BlursDecompose a hexagon into 3 rhombiĮach rhombi can be computed via separable blurħ Passes in total. Other separable blursGaussian, Box and Skewed BoxAdvances in Real-Time Rendering in Games Skewed BoxAdvances in Real-Time Rendering in Games Gaussian blurs can be made separable O(N) real world bokehArbitrary blurs in image space are O(N^2) Limited kernel size before texture tap explosionĬryEngine3 DX11 and Unreal Engine 3 Samaritan demoAdvances in Real-Time Rendering in Games Pre Multiplied CoCFor 16-bit source pre multiply the CoC by the colourĮnsure CoC always has a small number so colour can always be recoveredAdvances in Real-Time Rendering in Games Real World Bokeh – PentagonalPhoto Courtesy of MohsinHasan 2011Advances in Real-Time Rendering in GamesĬircle of Confusion CalculationCalc per pixel CoC from real world camera parametersĬoC is a simple MADD on the raw Z Depth CoC = abs(z * CoCScale + CoCBias) CoCScale = (A * focallength * focalplane * (zfar - znear)) / ((focalplane - focallength) * znear * zfar) CoCBias = (A * focallength * (znear - focalplane )) / ((focalplane * focallength) * znear)Advances in Real-Time Rendering in Games Real World Bokeh - DiscPhoto Courtesy of MohsinHasan 2011Advances in Real-Time Rendering in Games Separable BokehDepth-of-FieldAdvances in Real-Time Rendering in Games More InfoLots of FB2 papers on DICE websiteĪlso see Alex Ferrier’s talk on “1000 points of light” Tues, 2pm, East Building, Ballroom A/BAdvances in Real-Time Rendering in Games Powers Battlefield 3 and Need For Speed: The RunAdvances in Real-Time Rendering in Games MotivationsFrostbite 2 is DICE’s Next-Generation Engine for Current Generation Platforms Q&AAdvances in Real-Time Rendering in Games
Temporally-Stable Screen-Space Ambient Occlusion
More Performance!Five Rendering Ideas from Battlefield 3 and Need For Speed: The RunJohn White (NFS)Colin Barré-Brisebois (BF3)Advances in Real-Time Rendering in Games Five Rendering Ideas from Battlefield 3 & Need For Speed: The Run