Archive for November 28th, 2007

28
Nov

cubeField

Some screenshots from something I’ve been tinkering with for a while, which I finally got working last night.

The input is the iSight cam on my laptop. The heights of the blocks are scaled according to brightness samples taken with the new Image Pixel patch, at gridpoints on the input image.

Aliasing is much less obvious when the effect is ‘live’. Having said that, I may still investigate ’supersampling’ (ie rendering to an image at a higher resolution, then scaling it back down for display), to smooth out the edges a little.

cubeField qcFX 01

cubeField qcFX 01

cubeField qcFX 03

cubeField qcFX 04

28
Nov

zoomDistort Variation

I’ve been tweaking the zoomDistort code, and have added seperate zooming for the Red, Green and Blue channels.

The zoom kernel code is very similar to the zoomRGB FX, with a couple of extra lines added to handle the brightness values from the input image.

/*
Zoom kernel courtesy of Vidvox
http://vidvox.net/phpBB2/viewtopic.php?t=1785&sid=1c5efa0005881bf0dc59f84b3498a7ed
*/

kernel vec4 tb_zoomDistort_RGB(sampler Image, sampler Distortion, vec2 Center, float Level, float DistLevel)
{
vec2 loc;
vec2 modifiedCenter;
Center.x = Center.x / 2.0;
Center.y = Center.y / 2.0;

vec4 pix = sample(Distortion, samplerCoord(Distortion));

float zoomR = Level + (pix.r * DistLevel);
float zoomG = Level + (pix.g * DistLevel);
float zoomB = Level + (pix.b * DistLevel);

loc = destCoord();
loc = samplerTransform(Image, loc);

modifiedCenter = samplerTransform(Image, Center);

vec2 locR = (loc - modifiedCenter) * (1.0 / zoomR) + modifiedCenter;
vec2 locG = (loc - modifiedCenter) * (1.0 / zoomG) + modifiedCenter;
vec2 locB = (loc - modifiedCenter) * (1.0 / zoomB) + modifiedCenter;

vec4 pix;
pix.r = sample(Image, locR).r;
pix.g = sample(Image, locG).g;
pix.b = sample(Image, locB).b;
pix.a = 1.0;

return pix;
}

Currently, the controls are a bit, well, uncontrollable. I’ll have to work out some sensible scaling for them at some point (maybe with some exponential sliders).

zoomDistort RGB 01

zoomDistort RGB 02




 

November 2007
M T W T F S S
    Dec »
 1234
567891011
12131415161718
19202122232425
2627282930  

Categories

Links

Blog Stats

  • 28,388 hits