picture home | art | events | music | rack extensions | downloads | pixel blog

omino pixel blog

pixels, motion, and scripting
/\/\/\/\/\/\/\/\

projection_frame.jpg

This is a rendering simulating an image projected onto a simple 3d scene. There’s nothing too exotic about it, except that the projection was done in 2d, in After Effects.

And… here’s a moving sequence of the same scene. With old family movies.

The usual way you’d do this is by rendering a movie, taking it into your 3d program, and projecting it onto a scene through a light source.

For my current project, I needed this effect, but wanted a way to work in After Effects. I did this for workflow reasons: my projection content was all AE authored. But it also turns out to save render time. More than a little.

The trick was to render the scene in 3d as a coordinate-map, in Red and Green. I used Modo, and the projection mode is called “Front Projection”, from a spotlight or camera. I projected a red-green ramp onto the scene.

gradient.png

But we’re going to use the red and green values as a projection function. Changing the shader to use unattenuated (“luminous” @ 1W/steradian in modo) accomplishes this. We’re rendering geometry, not optics.

Then, I wrote a simple Pixel Bender kernel to use the red and green pixel values as coordinates to draw from the source projected image.


// by david van brink / poly@omino.com / 2009
// https://omino.com/pixelblog/
kernel rg_projection
<  namespace : "omino";    vendor : "omino";    version : 1;    
   description : "uses red/green from one image to map another"; >
{
    input image4 src; // Red-green mapping image
    input image4 ref; // image to project
    output pixel4 dst;

    parameter float imageXSize;
    parameter float imageYSize;
    parameter float imageXOffset;
    parameter float imageYOffset;

    void
    evaluatePixel() {
        pixel4 a = sampleLinear(src,outCoord());
        float r = a.r * imageXSize + imageXOffset;
        float g = a.g * imageYSize + imageYOffset;

        dst = sampleLinear(ref,float2(r,g));
    }
}

To test the Pixel Bender kernel, I ran a reference grid through the red-green ramp.

test_grid_gamma.pngtest_grid_no_gamma.pngtest_grid_no_gamma_better_gradient.png

The first one shows gamma correction on the ramp image in After Effects. Under “Interpret Footage”, be sure to turn on “Preserve RGB”.

The second one reveals that Photoshop’s default ramp is some sort of s-shaped modified linear function. Creating a custom gradient with more stops along the way helped get the third, which is Good Enough. I went back and redid the scene with the improved red-green gradient.

gradient_settings.png

And of course, use 32-bit color throughout. 16-bit works ok, too. 8-bit showed definite Squarifying in the projection, though.

To reintroduce the optical nature of the projection, back in After Effects it’s multiplied by a normally rendered image and, because I still think it’s pretty neat idea, an ambient occlusion pass as well.

stage_ambient_occlusion.jpg

stage_grid_projected.jpg

And there you have it! 3d projections done all in 2d.


Download the AE Project

2 comments
human.bin // Sun 2009.08.16 17:115:11 pm

oh my god man!

do you think this thing would work realtime in flash trough pixelbender?

AndrewYY // Tue 2009.09.1 15:343:34 pm

And to think, Maltaannon is selling this exact thing, just with more parameters.

oh, i dont know. what do you think?


david van brink // Sat 2009.04.18 17:04 // {after effects}

AE: Fake Spotlights

Here’s another variation on additive lighting tricks…

This one is a little experiment using After Effects’ spotlights on still images which have been rendered with similarly-located light sources.

Here’s one of the several still images.

And here’s a short movie showin a little more of the procedure, and some results.

oh, i dont know. what do you think?


david van brink // Sat 2009.04.4 10:49 // {houdini}

houdini

Lately been trying 3d apps, looking for my next toy.

tubey.jpg
Quick recap of 3d software that I’ve used or recently tried:

LightWave. Fluent. This app has everything except proper instancing. Crufty bizarro-world interface… and yet, gets the job done. Expressions and scripting available.

modo. Fluent. Smooth as silk. Clean and modern UI. Like lightwave, but from this universe, instead of the Amiga. Still lacks expressions, limited animation, and no whizbangery (no bones, particles, or dynamics). Yet.

Cinema 4D (c4d). Comes so highly recommended. Only tried it for an hour or two. Lovely modern app. I could see getting a lot done with this. Scripting and expressions. The UI is modern and responsive.

Maya. I want to like it, because I’ve seen great stuff come out of it (from people who are by far better artists than I, alas). But I feel the weight of history in it, it remains inscrutable to me. I have an expert friend who is going to sit down with me and give me a good dose of Getting-It. I hope. I love scripting, that won’t be the obstacle.

Houdini. Love at first click.

Most apps aspire to give you a clean well-lighted crafts studio, with the kiln warmed up, the tools spread out before you.

Houdini gives you a fully stocked laboratory, soldering iron (1), screwdriver (1), wirecutters (1), and a high-voltage supply rail. Go!

This means there’s a high fixed overhead to get anything done. But it sure lends itself to quirky algorithmic experiments.

The picture at the top, and the bottom, are relatively trivial Houdini documents with some stacked operators. The bottom one uses random expressions to control the height of the blocks-stacks. (The stars part is straight from a tutorial on the company site.)

star.jpg

oh, i dont know. what do you think?



0.0234s
(c) 2003-2023 omino.com / contact poly@omino.com