20120107 - Games vs Film Part 2
Working from the
Filtering In PRMan
that Brian Karis posted in the comments of the last post,
recommendations for film rendering lower bounds,
0.25 Shading Rate
: Or on average 4 object space shaded samples per pixel.
Seems like this 2x2 super-sample sample rate intuitively makes sense
as providing the resolution to transition between 2 texture resolution levels without something similar to mip-mapping.
One can see on the first or left shot that lower shading rates start to miss samples on the diagonal,
The 4xSS looks great, and the 2xSS (0.5 shading rate) already looks quite good. Would be interesting to see what the minimum bound on shading rate would be if using mipmap filtering on texture space shading results. Could 2.333xSS (2xSS with mipmaping) be good enough for games? Also might be able to do pure 2xSS with some manual filtering to simulate the mip transition.8 Pixel Samples
: This translates to 8x8 super-sampling on visibility. Without stochastic sampling, this would provide exactly 8 different shades as an edge transitions between exact pixel centers if a poor pixel sized box filter was used during filtering. Or alternatively one could think of this as only 3-bit precision on sub-texel position on GPU filtering (without any magnification). Which in the context of texture space shading would suggest an upper bound of a 8192x8192 source texture with a 32-bit position (13-bits for texel, 3-bits for sub-texel position). Magnification cases clearly would either require more bits of sub-texel position, or trade bits for noise and use stochastic sampling. For comparison with typical GPU real-time rendering, 4xMSAA provides 4 shades as an edge transitions between exact pixel centers, but poor quality on some diagonals.Smooth Shading Interpolation
: GPU MSAA with the standard resolve filter would represent non-smooth shading, as samples on a triangle edge all have the same value. With PRMan those visibility samples can be a "filtered after shading" sample.
Mitchell 4.0 Pixel Filter
The Image Magick docs
has some great comparisons (look at the bottom of that page)
which show the difference in quality from various filters for down-sampling (copied the images below).
Mitchell provides a negative lobe which increases sharpness without having extra lobes like a full sync filter which would add ringing.
A cubic filter in contrast has no negative lobes and thus looses some sharpness.
The 4.0 in "Mitchell 4.0" means that the filter kernel width is +/-2 output pixels in size. With 8x8 pixel samples this kernel is 32x32 samples in size. Mitchell 4.0's center positive lobe is around 2 pixels in size. Again this is completely intuitive in that pixel size details will show aliasing in sub-pixel motion. This large filter kernel is a core component of why CG has no aliasing (and looks less sharp) compared to games.