Sunday, May 15, 2011

Depth of field + pixelation = pixel depth?

Or depth of pixel?

Been toying with this idea of a lens-effect that would somehow pixelate based on the relative focus levels in a shot. So, what's in focus has a high-pixel density, and what's out of focus is heavily pixelated, with some kind of progression between completely in and out of focus. The progression itself seems like the trickiest part.

If, say, you had a flat landscape extending to the horizon, with a part of the midground in focus and the rest out, the progressively-large pixels (moving away from the midground), could be alligned horizontally with no need for breaks. Almost like little bricks shrinking with perspective.

The problem would be, I suppose, if your focal-gradient (my own BS term there) wasn't in line with the horizontal or vertical. Suddenly the boundaries of different pixel-density would make jagged lines that wouldn't necessarily fit together.

This made me think one could get around this if one we able to cordon off areas on an image at a given level of pixelation with a matching grid. i.e. if a level-of-focus is at 16 pixels per square inch, then it's boundaries are all "snapped" along little 1/4" square steps. From there, you could make an adjoining area with a higher pixel-density fit squarely into the 1/4" area by making it's density, say, 64 pixels per square inch, so that they density seamlessly steps up by a factor of 4 across the boundary and everything still fits. The issue is who does the cordoning. Better left to a 3D engine programmer and some tricky rendering.

Leads to interesting questions though. What happens when a single leaf, out of focus, is drifting in front of an in-focus surface. Should this hypothetical lens/renderer render this leaf at 1/4 the pixel-density of its background, and let those pixels break the "grid" of the backdrop? Or maybe it should all snap-to? If it all snaps to the pixel grid you've established, I feel the sense that the leaf isn't just a smudge on the backdrop might be lost, but if you used transparency somehow, and broke the leaf from the backdrop's grid, it might all work out.

All gibbering aside, I futzed around briefly. Winged it on the changes in density, and areas of focus, using a couple layers.

Prototype #1:

No comments:

Post a Comment