tag:blogger.com,1999:blog-3064325214589649535.post7811281686315249737..comments2024-03-28T06:52:15.545+01:00Comments on Joost's Dev Blog: Depth of field blur: the Swiss army knife that improved even the framerate of AwesomenautsJoost van Dongenhttp://www.blogger.com/profile/00569566310604620045noreply@blogger.comBlogger11125tag:blogger.com,1999:blog-3064325214589649535.post-25084782513106728102012-09-24T17:42:45.155+02:002012-09-24T17:42:45.155+02:00I am a new amateur photographer, and Blog articles...I am a new amateur photographer, and Blog articles like these help me to improve my photography.<br />thanks<br />http://photographyguide99.blogspot.in/2012/09/depth-of-field.html<br />nshttps://www.blogger.com/profile/07041110740987079371noreply@blogger.comtag:blogger.com,1999:blog-3064325214589649535.post-55037615157486527272012-04-10T09:22:43.383+02:002012-04-10T09:22:43.383+02:00That still sounds very much like what I did with P...That still sounds very much like what I did with Proun, which also doesn't have seperable blur and doesn't have any gaussian falloff in the blur. I think the main thing keeping Proun from having this effect is that my HDRI only goes to something like 1.4 there and to get those really bright disks, I think I would need to go to 10 or something like that.<br /><br />@Lewis Saunders:<br />Colour spaces are something I should look into more, someone else also recently told me they are really important for getting a good look. I am still kind of struggling with how that would make the art pipeline very complex if I would want sRGB textures. I guess it would be easier to use sRGB just for the post effects. :)Joost van Dongenhttps://www.blogger.com/profile/00569566310604620045noreply@blogger.comtag:blogger.com,1999:blog-3064325214589649535.post-19998922522592045532012-04-10T00:20:47.704+02:002012-04-10T00:20:47.704+02:00When I said "lens blur" I specifically h...When I said "lens blur" I specifically had Photoshop's Lens Blur in mind. (Which, as implemented, is a disaster in terms of runtime, but that's besides the point.) I'm not quite sure what it does. In general, I just mean more high-quality-photography/cinema-like depth of field. One might use the term bokeh in this context.<br />Without having made careful study of it, here are some of my impressions.<br /><br />Part of the look seems to involve a non-spherical kernel and in particular a non-separable kernel. (In the sense that your current blur *is* separated into an X pass and a Y pass.) Pentagons and hexagons seem common.<br /><br />Part of it seems to be a really big kernel.<br /><br />The effect is most visible on small bright picture elements, because this shows the shape of the kernel. However, even on images where it doesn't quite stand out in this way, I would say there's a difference in feel between Photoshop's Lens Blur and, say, its Gaussian Blur. I guess your Kind-of-square blur might actually be closer to the Lens Blur one already.<br />Hey, maybe you could try rotating your samples by, say, 30 degrees. Who says the sample directions need to be axis aligned, yes? Just perpendicular. Or for a diamond-shaped effect maybe not even perpendicular... (Maybe I'm missing a technical detail here.) Could have in interesting look.<br /><br />Without careful inspection, it seems to me that with Lens Blur, light bleeds into dark more than the other way around.Thamashttps://www.blogger.com/profile/17766605868066955395noreply@blogger.comtag:blogger.com,1999:blog-3064325214589649535.post-1565107014330998462012-04-09T23:58:49.857+02:002012-04-09T23:58:49.857+02:00Yes - you really start to see highlights blooming ...Yes - you really start to see highlights blooming only when you have HDR images with pixel values over 1.0. Doing the blurring in a photometrically linear colourspace helps too - blurring in a normal gamma-corrected image tends to make the dark areas "grow" more than they would in reality.<br /><br />For a lens blur you'd use a more defined filter kernel as well, like a disk or hexagon rather than a soft gaussian blob.<br /><br />Love the look of Proun!Lewis Saundershttp://lewissaunders.comnoreply@blogger.comtag:blogger.com,1999:blog-3064325214589649535.post-51078670076119144182012-04-09T23:03:52.724+02:002012-04-09T23:03:52.724+02:00You are absolutely right, this fog could be done i...You are absolutely right, this fog could be done in a much more efficient way, for example using multi-texturing and applying the fog gradient directly to the objects instead of rendering fog as a separate object. However, that would require creating new tools for it, since the artists created hundreds or even thousands of background objects and they want complete control over what fog goes where at what depth and with which texture.<br /><br />I looked into what they were doing and it turned out the tools required to both make that work well for them and give me efficient rendering were too much work to make. Especially since depth of field blur fixed it so easily anyway. :)Joost van Dongenhttps://www.blogger.com/profile/00569566310604620045noreply@blogger.comtag:blogger.com,1999:blog-3064325214589649535.post-57123543879382003772012-04-09T22:59:31.107+02:002012-04-09T22:59:31.107+02:00Indeed, that boils down to the numbers you mention...Indeed, that boils down to the numbers you mention. The subtle differences you mention would probably be an improvement, but one that is so subtle that it is totally invisible. I played around with the values a bit and I chose these numbers have exactly the right amount of blur that I wanted.<br /><br />When you say "lens blur", you mean Bokeh, right? What is the common method of making that? Someone explained it to me recently and the explanation was exactly what I was already doing in Proun, yet I don't see cool Bokeh effects in Proun. Is the trick that lens blur only gives a useful effect when combined with extreme HDRI?Joost van Dongenhttps://www.blogger.com/profile/00569566310604620045noreply@blogger.comtag:blogger.com,1999:blog-3064325214589649535.post-13996936454318733112012-04-09T22:55:48.134+02:002012-04-09T22:55:48.134+02:00It feels wrong to me that there is so much overdra...It feels wrong to me that there is so much overdraw just for 2D fog effects. The artists may be authoring in a dozen discrete fog planes, but surely it should be feasible to combine those into fewer passes - surely all you're doing is lerping to a constant colour known at asset creation time, right?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-3064325214589649535.post-43353271130413487252012-04-09T22:05:28.284+02:002012-04-09T22:05:28.284+02:00That is, you effectively weigh the nine texels inv...That is, you effectively weigh the nine texels involved as (.85, .85, .95, .95, 1., .95, .95, .85, .85)?<br /><br />To do so, you sample exactly halfway between the texels? I guess it wouldn't be worth it with these subtle weights, but would I be correct in assuming that you can differently weigh the two-texels-with-one-sample by shifting the texcoord closer to one or the other?<br /><br />Why do you use a separate sample to get precisely the centre texel? For symmetry of the kernel? You could adjust the weights accordingly. Or you could not care that your blur translates by half a texel. But I guess a tenth sample isn't much of an improvement over nine anyway.<br /><br />In any case, depth of field for the win. Next time make a cool lens blur...Thamashttps://www.blogger.com/profile/17766605868066955395noreply@blogger.comtag:blogger.com,1999:blog-3064325214589649535.post-38012272997707079632012-04-09T20:16:12.432+02:002012-04-09T20:16:12.432+02:00It is a two-pass blur: first I do a vertical blur,...It is a two-pass blur: first I do a vertical blur, then a horizontal blur, in total resulting in a real 2D blur.<br /><br />A single blur pass is done by simply taking a couple of samples and getting a weighted average. The weights are not gaussian: I played around with the values a bit until it looked best for our game. The biggest blur takes five samples per pass and the weights are 0.85, 0.95, 1, 0.95, 0.85.<br /><br />To get extra samples with half the performance cost, I enable bilinear filtering and take the samples exactly in between two pixels. This way the filtering effectually gives me two samples in a single read from the texture. So the five samples I mentioned above really blur using 9 pixels from the rendertexture (the centre sample is at the centre of a pixel).Joost van Dongenhttps://www.blogger.com/profile/00569566310604620045noreply@blogger.comtag:blogger.com,1999:blog-3064325214589649535.post-52322751931819279072012-04-09T19:55:22.754+02:002012-04-09T19:55:22.754+02:00What blur algorithm are you using?What blur algorithm are you using?Jamesnoreply@blogger.comtag:blogger.com,1999:blog-3064325214589649535.post-68627454465740221652012-04-09T19:30:34.183+02:002012-04-09T19:30:34.183+02:00Simple concept with a huge effect. Thanks for sha...Simple concept with a huge effect. Thanks for sharing!<br />Found on Hacker NewsAnonymousnoreply@blogger.com