pouët.net

Go to bottom

Bokeh DOF

category: code [glöplog]
whatever bayimg is - it does not work here.
added on the 2011-09-07 06:16:59 by las las
psonice: just work in linear colour space with proper hdr range and it just works out..
added on the 2011-09-07 10:49:35 by smash smash
xernobyl: thinking about it some more, i'm kind of half right, half wrong. The dark areas can't spread/blur as I said, but in practice it doesn't matter. The light areas spread out into the dark areas, but at the same time because the light there is spread out the brightness is reduced - which darkens the area around the hole in your picture, so it's the same effect in the end. Confusing, but it's good to figure these things out and understand them :)

Las: right click + open in new tab works for me, but it's still a broken image in the thread for some reason.

smash: yep. Also, you've just put me in a bad mood by mentioning colorspaces ;) I don't know what it's like on windows, but on mac they seem to be ingrained pretty much everywhere, and give me no end of headaches. That and pre-multiplied alpha. Such simple things, yet they seem to keep popping up where i'm not expecting them and fucking stuff up ;(
added on the 2011-09-07 11:34:28 by psonice psonice
Hmm, why does the OS matter? :) I just render to a 16 bit target, enable SRGB for the right texture reads, and tone map / gamma at the end.
added on the 2011-09-07 11:41:46 by smash smash
Once you're into pure opengl, its probably the same. But image loading, core image, and particularly video (which I do a lot of lately, combined with opengl) can be a bit of a nightmare. In the last demo I did, the noise overlay (which was important for a few scenes) totally disappeared in the party version because I got the colorspace wrong somewhere. And loading a LUT or normal map and forgetting the colorspace can really fuck you over, so can pre-multiplied alpha if it's stored in an RGBA image. Some of the stuff I've done with video can be ruined if you let the video capture APIs apply the colorspace transform before passing you the image.

It's a minor thing really, but it's one of those minor things that can cause some unexpected result somewhere that takes ages to track down so it's fucking annoying when it catches you out :)
added on the 2011-09-07 12:15:52 by psonice psonice
I try to keep everything linear in fp buffers until the final srgb pass.
added on the 2011-09-07 15:08:49 by xernobyl xernobyl
I try to keep everything linear in fp buffers until the final srgb pass.
added on the 2011-09-07 15:09:05 by xernobyl xernobyl
psonice: well, all your texture inputs into opengl should be in gamma2.2 space if they're LDR; linear space isnt really good for 8 bit per channel images.
So you should be fine using any source you like as long as you gamma unconvert the right textures in opengl and dont apply colourspace conversions elsewhere.
added on the 2011-09-07 15:14:01 by smash smash
I try to keep everything linear in fp buffers until the final srgb pass.
added on the 2011-09-07 15:14:11 by kusma kusma
smash: linear space isnt really good for 8 bit per channel COLOR images. For other images (like normal maps etc) it's perfectly fine.
added on the 2011-09-07 15:15:49 by kusma kusma
im pretty sure thats that he meant. You don't want more resolution on the negative side.
added on the 2011-09-07 15:24:34 by xernobyl xernobyl
You don't want your lighting shifting to one corner with a normal map too :) (Which is what happened to me recently - NOT useful when you don't realise it's a colorspace issue, and you're trying to write a normal map generator and assume the bug is at that end!)

Also, I'm not sure that there's a gamma2.2 space on osx. There's device native (GPU) space, linear, and display native. Plus a bunch more for special cases, greyscale etc. Plus more for input formats.

I guess it's the mac's background in photoshop + design, but it really is everywhere. It's brilliant if you're working on one (there's even a built-in display calibration tool in the display prefs) but it gets annoying when you're coding. (Until you try modifying the colour tables in realtime, that can be fun ;)
added on the 2011-09-07 15:39:48 by psonice psonice
Oh, I'm sure it's what he MEANT - it's just not what he SAID :)
added on the 2011-09-07 15:39:56 by kusma kusma
A little update in case you're interested...

BB Image

Volumetric Occlusion (not that you can see it) + Depth of Field + Hypnoglow + FXAA

The black parts are simply empty and the error propagates (divzero, infinity...).
added on the 2011-09-10 19:44:50 by xernobyl xernobyl
Still running >60fps at 1600x900 on my AMD 4000 and something laptop.
added on the 2011-09-10 19:45:29 by xernobyl xernobyl
I discuss cheap ways to compute lens blurring here: http://yehar.com/blog/?p=1495
added on the 2011-10-12 12:25:18 by yehar yehar
Wow. You make something simple give me nightmares.
added on the 2011-10-12 14:40:20 by xernobyl xernobyl
That's pretty interesting yehar. As far as I can tell, the IIR and summed-table approaches don't really lend themselves to a GPU implementation, or am I missing something?
added on the 2011-10-12 16:17:17 by revival revival
yehar: cool work indeed :)
added on the 2011-10-12 16:37:52 by kusma kusma
BB Image
added on the 2011-10-12 17:16:10 by Gargaj Gargaj
The hexagonal blur technique was published at Siggraph '11 and your intro is from Kindergarden '10. I demand that you publish the blueprints for your time machine!
added on the 2011-10-12 17:29:39 by revival revival
He's just rendering particles with the size of the COC. Of course I could be write and I could be raytracing all that with magic. But I'm not.
added on the 2011-10-12 20:58:43 by xernobyl xernobyl
Revival: Recursive Gaussian blur uses IIR filters, and they have been implemented on GPU's, so IIR filters should be possible. On the same notion, summed area tables should be possible as they are in principle calculated by IIR filters.
added on the 2011-10-13 01:40:58 by yehar yehar
xrl: nope.
added on the 2011-10-13 01:51:15 by Gargaj Gargaj
stop with your ugly-ass shit.
added on the 2011-10-13 01:54:59 by kusma kusma

login

Go to top