TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Depth of field blur: the Swiss army knife that improved the framerate

111 pointsby exchabout 13 years ago

3 comments

daenzabout 13 years ago
Downsampling images before a blur seems to be a pretty standard technique to get more perceived bang (blur) for your buck. If you don't downsample the image too far, the blur adequately covers any artifacts the downsampling (and re-scaling) would have. The result is, an N radius blur can be stretched a lot farther, because the downsampling (and re-scaling) itself adds an blur of its own.<p>This performance optimization doesn't really work for variable-width blurs (like depth of field) on 3d scenes though, because some parts of your image need to be crisp, while others blurred. Downsampling the entire image would lose resolution on the crisp parts.<p>3d depth of field blurs are actually pretty interesting though. They're variable width, which is just another way of saying that each pixel on the final image might be blurrier or less blurry than another pixel. Implementing this kind of variable blurring is a tough task, and typically done by scaling up or scaling down a disk of random sampling coordinates for each pixel. When the disk of coordinates is large, the sampling coordinates sample further from the pixel its centered on, so the resulting pixel has a bigger blur. When the sampling disk is small, the surrounding coordinates are closer to the center pixel, creating a smaller blur. The size of this sampling disk is controlled by the depth of the pixel from the near and far focus planes of the virtual camera.<p>I've glossed over a lot (like the artifacts that can result from 3d DoF), but Nvidia's GPU gems has a great article on the subject <a href="http://http.developer.nvidia.com/GPUGems3/gpugems3_ch28.html" rel="nofollow">http://http.developer.nvidia.com/GPUGems3/gpugems3_ch28.html</a>
评论 #3818387 未加载
评论 #3818371 未加载
janzerabout 13 years ago
My first thought on reading is this is essentially (at least in spirit) mipmapping[1] applied to his 2D (2.5D?) engine.<p>1. <a href="http://en.wikipedia.org/wiki/Mipmap" rel="nofollow">http://en.wikipedia.org/wiki/Mipmap</a>
timmorganabout 13 years ago
Pet peeve, It's "farther."
评论 #3817419 未加载
评论 #3817300 未加载