Advertisement

You're blocking ads, which pay for BlenderNation. Read about other ways to support us.

Composite Boolean Operations Using the Node Editor

20

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 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

About the Author

Avatar image for Bart Veldhuizen
Bart Veldhuizen

I have a LONG history with Blender - I wrote some of the earliest Blender tutorials, worked for Not a Number and helped run the crowdfunding campaign that open sourced Blender (the first one on the internet!). I founded BlenderNation in 2006 and have been editing it every single day since then ;-) I also run the Blender Artists forum and I'm Head of Community at Sketchfab.

20 Comments

  1. 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. :)

  2. 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.

  3. 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

  4. 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...

  5. 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 ;))

  6. 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.

  7. @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!

  8. 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. :)

  9. 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 :)

  10. 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... :)

  11. @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...

  12. @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.

  13. 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 :)

Leave A Reply

To add a profile picture to your message, register your email address with Gravatar.com. To protect your email address, create an account on BlenderNation and log in when posting a message.

Advertisement

×