TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

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

111 点作者 exch大约 13 年前

3 条评论

daenz大约 13 年前
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 未加载
janzer大约 13 年前
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>
timmorgan大约 13 年前
Pet peeve, It's "farther."
评论 #3817419 未加载
评论 #3817300 未加载