Composite Boolean Operations Using the Node Editor

cb_result.jpgI can’t get enough of the Node Editor. Today, we present a setup which will mix object materials based on boolean intersections. It’s even got real math, too :)

Alex Fraser [email protected]> wrote:

Hi,

I’m not sure if this has been done before, but I’ve written about a way to perform boolean operations in the compositor using the wonderful z-buffer. The article is available at http://phatcore.com/projects/Composite_Boolean.php

It’s a bit of a heavy read, and not much of a tutorial, but Blender users may gain something from seeing the node setup and playing with the scene.

Cheers,
Alex

Twitter



Please support us

  • http://advanced-lemon.blogspot.com/ epat

    Z-Buffer node setups are pretty powerful things! There’s been a lot of complicated node setups around recently based on the Z-Buffer…
    ~epat. :)

  • http://advanced-lemon.blogspot.com/ epat

    Whoops – did I say Z-Buffer node? Well you know what I meant lol ;)
    ~epat. :)

  • cekuhnen

    hey

    few programs did booleans during render time.

    Pixes3d and Real3D for example an others.

    Pixels3d also had Fusion which was blending
    the sharp edges together like a rendertime bevel
    and fillet.

  • kram1032

    OMG!!!!
    That’s amazing!!!
    you know, what that would be great for?

    With this technique, you also could cut two scenes :D – that would make a great worm hole!
    The only thing, you need to add, for a real looking worm hole, is the distortion ^^
    It would look like this: http://strlen.com/gfxengine/fisheyequake/compare.html at FoV 720°
    but limited to the size of the sphere :D
    Any idea, how to add that, to this test? :)
    The next thing would be, you’d need to overblend the two (disorted) light situations :D
    the lights of both scenes would need to intersect!
    Then, you’d have sort of a REAL worm hole :D

  • kram1032

    If you make it correct, you might even get the animated space jump :D

  • kram1032

    oh…. and this might also ignore meshes, that aren’ placed inside the boolean sphere, in the 2nd scene.

    One way, to get more objects, might be a high IoR (far higher than 3, though :S ) sphere, that’s exactly at the same spot of the boolean sphere, so that you get the whole scene, refracted. – That still doesn’t work for the light transport between the two scenes, though…

  • kram1032

    one last thing for today :) (sorry for quad-posting :S)
    If you turn off all the passes, for the two boolean layers, except Z-depth and alpha, you should save lots of time :) (especially, if your boolean object is very high-poly and complex ;))

  • PaladinOfKaos

    The included .blend file will _not_ work in versions prior to 2.45, due to this bug: “Change the logic in the math node to require only one input, not two. This allows for an image to be processed with a value.” Basically, it would convert anything of the form ” OP ” to a single-pixel output. This is fixed in 2.45.

    If you want to make it work in earlier versions, just switch the math node to a mix node set to subtract, set the factor to “1.0″ and subtract the value from pure-white (i.e 1). Then use the color output of that node where the output of the subtract node was.

  • http://www.bchynds.com BrianH

    I think you broke his bandwidth. http://phatcore.com/ won’t load.

  • http://phatcore.com Alex Fraser

    @cekuhnen: Thanks, interesting to know that.

    @kram1032: Yeah! Actually the reason I developed this was to do a 3D wipe effect, but I was only going to wipe to black. Your idea of adding distortion is great.

    @PaladinOfKaos: Ah, thanks for that. I think the Z Combine nodes suffer from the same problem, even in 2.45. Another work around is to connect the SolidWhitePixmap group to the subtract node.

    @BrianH: I think the site is still up. Maybe it was just overloaded. If there are more problems I’ll move the article somewhere else, maybe to the forums. Thanks for the warning!

  • http://www.daydreamgfx.com/ Chris

    Hey, wow… Phatcore did the ABC2 idents here in Australia… I wonder if he used blender to do it?

  • Arek Bal

    ehh… but still… nodes are unsuited for animation. There is no way to cut some node from chain in between frames. Hmm, does anybody got ideas?

    But I like this idea. :)

  • Kitsu

    Actually I created a node setup that “deactivates” node chains based on current frame. Search blenderartists for a post about composite and sin/sine.

    Cool looking effect, I’m sure I can find some uses for it too :)

  • kram1032

    new animation idea, when I read animation :)

    what about a moving (animated) boolean cutter mesh? for example, an exploding sphere – first, you have a nice world…
    Then, a meteor (or something) is crashing on the planet.
    THEN, the explosion causes the world to change, rapidly (animated boolean sphere – maybe even works with motion blur :D dunno^^)

    Or, you have a plane, moving from left to right, changing the setting in an animated 3D-cut :D
    Or…..
    Actually, with some creativity, the possibilities are unlimited :D

    I’ve no idea, if that’s fast enough, for games, but you also could make such a “ran away from something dangerous, behind you” – game, by using a plane, that will change the appearance of the background, where the plane passed, and you need to take an unseen show-jumping (is that correct? O.o I meant a “parcours”)

    …there might be simple techniques for that, though… :)

  • kram1032

    @Alex Fraser: I just looked through your page :)
    Your other idea, that non-spherical-eye-tracking is also great :D
    I wonder, why noone can answer to that problem…
    I mean, I can’t, for sure – I didn’t learn python, at all, but there should be *anyone*, knowing, what’s going on…

  • kram1032

    I forgot to post the link^^ http://phatcore.com/projects/Track_And_Transform.php
    Damn, again a triple post :(
    Actually, it’s just a single + a double post. There was quite some time between the first and the other two.

  • http://phatcore.com Alex Fraser

    @Chris: I did one ident for ABC2 at school, but the software we were using was Maya. Don’t worry, Blender was pimped.

    @Arek Bal : Kitsu’s method sounds interesting! Also you can render a set of frames to be combined later in the sequencer. It’s not automatic, but it’s not that much work either.

    @kram1032: Love these cutting ideas. Have fun with it!
    About Track and Transform, apparently the transformation it creates is unsupported by Blender (forum thread updated). I wish it could support any transform, but that’s that. It’s still possible with a script that changes the geometry, and maybe even with simple parenting. If I have a need for it I’ll investigate more.

  • http://phatcore.com Alex Fraser

    @Chris: I still don’t know whether the ident ever actually got screened. Have you seen it on TV?

  • kram1032

    hum, just got an idea, of how to simulate the light transport (at least in one direction)…
    wouldn’t entirely work, though, at current possibilities, I guess…
    It’s like environment mapping, but not for reflections, but for (HDR) light situations with the map, set to “emit” :D

    Would be a lot easier, if that could be done with raytracing, though, obviously.

    If you’d do that multiple times, you’d also get the bi-directional light transport effect, as with environment mapping and multiple reflections :)

  • http://www.rgbk.org Bmud

    WOW