# Composite 3d objects behind foreground footage?

**URL:** <https://blenderartists.org/t/composite-3d-objects-behind-foreground-footage/557613>\
**Category:** Compositing and Post Processing\
**Created:** [November 22, 2012, 3:15pm UTC](https://blenderartists.org/t/composite-3d-objects-behind-foreground-footage/557613 "2012-11-22T15:15:55Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![Xilith117](https://blenderartists.org/user_avatar/blenderartists.org/xilith117/32/578528_2.png) [@Xilith117](https://blenderartists.org/u/Xilith117)\
**Post date:** [November 22, 2012, 3:15pm UTC](https://blenderartists.org/t/composite-3d-objects-behind-foreground-footage/557613/1 "2012-11-22T15:15:55Z")

</div>

Hi everyone,  
I have been trying to make this composite scene work for weeks now. I have camera tracked some footage of some treebranches with a plain white background (similar to this image [http://fashionfrugals.files.wordpress.com/2011/02/branches-of-white-stock.jpg](http://fashionfrugals.files.wordpress.com/2011/02/branches-of-white-stock.jpg)) and I want to composite a 3d spaceship Behind those branches, with the same sky in the background. I know it can be done but i just cant quite arrange the nodes in such a way to do it. Any tips would help, any examples would be wonderful.

Thanks, Xilith

---

<div class="post-metadata">

**Author:** ![JamesNZ](https://blenderartists.org/user_avatar/blenderartists.org/jamesnz/32/17741_2.png) [@JamesNZ](https://blenderartists.org/u/JamesNZ)\
**Post date:** [November 22, 2012, 4:25pm UTC](https://blenderartists.org/t/composite-3d-objects-behind-foreground-footage/557613/2 "2012-11-22T16:25:32Z")

</div>

Easiest way is to pull a key for the sky background and use it as factor to place the the spaceship over the footage and behind the trees.

Example:

 ![http://i45.tinypic.com/b52x5d.png](http://i45.tinypic.com/b52x5d.png)

---

<div class="post-metadata">

**Author:** ![Xilith117](https://blenderartists.org/user_avatar/blenderartists.org/xilith117/32/578528_2.png) [@Xilith117](https://blenderartists.org/u/Xilith117)\
**Post date:** [November 22, 2012, 8:12pm UTC](https://blenderartists.org/t/composite-3d-objects-behind-foreground-footage/557613/3 "2012-11-22T20:12:22Z")

</div>

I cant seem to get a good key. What is that node you used? also, how do i make the video of the branches the background too? Thanks so much for the help so far.

 ![](https://blenderartists.org/uploads/default/original/3X/5/e/5eb480ca872a886239045bad6ab629ab5b6d9850.PNG)  
 Blend file if that helps:[https://dl.dropbox.com/u/75454566/shiphelp.blend](https://dl.dropbox.com/u/75454566/shiphelp.blend)

---

<div class="post-metadata">

**Author:** ![3pointEdit](https://blenderartists.org/user_avatar/blenderartists.org/3pointedit/32/2482_2.png) [@3pointEdit](https://blenderartists.org/u/3pointEdit)\
**Post date:** [November 23, 2012, 12:33am UTC](https://blenderartists.org/t/composite-3d-objects-behind-foreground-footage/557613/4 "2012-11-23T00:33:57Z")

</div>

I think that you need a Luma key not a chroma keyer. The chroma keyer uses poor quality samples from the color portion of the image (note the weird blocks), while the luma values tend not to be so heavily compressed. Try ckicking various sample values around near the branches.

---

<div class="post-metadata">

**Author:** ![blendercomp](https://blenderartists.org/letter_avatar_proxy/v4/letter/b/dbc845/32.png) [@blendercomp](https://blenderartists.org/u/blendercomp)\
**Post date:** [November 23, 2012, 3:51am UTC](https://blenderartists.org/t/composite-3d-objects-behind-foreground-footage/557613/5 "2012-11-23T03:51:48Z")

</div>

You’ve not included your movie (or a still) in the blend file you shared so it’s hard to tell.  
From the looks of it, luma is the way to go or in the worst case you can combine the mates from both luma and color.  
If you post a still from your movie file you’ll get more detailed help.

---

<div class="post-metadata">

**Author:** ![Xilith117](https://blenderartists.org/user_avatar/blenderartists.org/xilith117/32/578528_2.png) [@Xilith117](https://blenderartists.org/u/Xilith117)\
**Post date:** [November 23, 2012, 2:02pm UTC](https://blenderartists.org/t/composite-3d-objects-behind-foreground-footage/557613/6 "2012-11-23T14:02:16Z")

</div>

I apologize, It didn’t even occur to me that you wouldn’t have the video. Here it is: [https://dl.dropbox.com/u/75454566/20121028133114.mpg](https://dl.dropbox.com/u/75454566/20121028133114.mpg)

In the meantime, I will mess around with the luminance key.

---

<div class="post-metadata">

**Author:** ![dancerchris](https://blenderartists.org/letter_avatar_proxy/v4/letter/d/90ced4/32.png) [@dancerchris](https://blenderartists.org/u/dancerchris)\
**Post date:** [November 24, 2012, 12:32pm UTC](https://blenderartists.org/t/composite-3d-objects-behind-foreground-footage/557613/7 "2012-11-24T12:32:20Z")

</div>

I concur with 3pointedit: use luma key to pull a mask but before you do that adjust the contrast using rgb curves (or anything else) to fine tune the key.

---

<div class="post-metadata">

**Author:** ![Xilith117](https://blenderartists.org/user_avatar/blenderartists.org/xilith117/32/578528_2.png) [@Xilith117](https://blenderartists.org/u/Xilith117)\
**Post date:** [November 24, 2012, 3:12pm UTC](https://blenderartists.org/t/composite-3d-objects-behind-foreground-footage/557613/8 "2012-11-24T15:12:35Z")

</div>

not working yet but i’m still trying…

---

<div class="post-metadata">

**Author:** ![blendercomp](https://blenderartists.org/letter_avatar_proxy/v4/letter/b/dbc845/32.png) [@blendercomp](https://blenderartists.org/u/blendercomp)\
**Post date:** [November 24, 2012, 5:46pm UTC](https://blenderartists.org/t/composite-3d-objects-behind-foreground-footage/557613/9 "2012-11-24T17:46:10Z")

</div>

Something like this?

 ![](https://blenderartists.org/uploads/default/original/3X/b/8/b8e5e3cc06bcf5228b7eb5c54e9306e76f0ac73c.jpg)

---

<div class="post-metadata">

**Author:** ![Xilith117](https://blenderartists.org/user_avatar/blenderartists.org/xilith117/32/578528_2.png) [@Xilith117](https://blenderartists.org/u/Xilith117)\
**Post date:** [November 25, 2012, 12:43pm UTC](https://blenderartists.org/t/composite-3d-objects-behind-foreground-footage/557613/10 "2012-11-25T12:43:06Z")

</div>

FANTASTIC! Thanks so much! I do have a question though. I understand what “image” and “Alpha” are for but what is “Fac” ?

---

<div class="post-metadata">

**Author:** ![blendercomp](https://blenderartists.org/letter_avatar_proxy/v4/letter/b/dbc845/32.png) [@blendercomp](https://blenderartists.org/u/blendercomp)\
**Post date:** [November 25, 2012, 2:13pm UTC](https://blenderartists.org/t/composite-3d-objects-behind-foreground-footage/557613/11 "2012-11-25T14:13:43Z")

</div>

You’re welcome.

Fac stands for “factor” value. It will determine the extent to which the underlying operation is affected by some other uh…yeah, factor! 🙂  
So when say you’re mixing two image sources using an add blending mode, you’re adding the pixel values of the first image to the pixel values of the second. The factor value will allow you to determine how the addition operation will be performed, ranging from 0 to 1 (i.e. .50 means 50% mix etc).  
Hope this makes sense.

Btw, you’re experiencing problems with compositing this is because the footage is interlaced, low res, low quality, and somewhat blurry. In principle pulling a matte from such sources should be nice and easy.

---

<div class="post-metadata">

**Author:** ![Xilith117](https://blenderartists.org/user_avatar/blenderartists.org/xilith117/32/578528_2.png) [@Xilith117](https://blenderartists.org/u/Xilith117)\
**Post date:** [November 25, 2012, 3:20pm UTC](https://blenderartists.org/t/composite-3d-objects-behind-foreground-footage/557613/12 "2012-11-25T15:20:27Z")

</div>

I think i understand the concept but i need to play around with it to understand better. What about “z” ?

I was playing around, trying to get little lights on the ship (i was trying for some glare/flare type effects but i can live with just glow) and I got the blend file below with the nodes arranged as they are below but i seem to have removed the alpha channel which makes it impossible to “alphaover” the two layers again…help? Thanks so much.☹

Blend File:[https://dl.dropbox.com/u/75454566/shiphelp2.blend](https://dl.dropbox.com/u/75454566/shiphelp2.blend)

Screenshot of nodes:

 ![](https://blenderartists.org/uploads/default/original/4X/1/1/0/110a04a84886522e5bac163ae80727f858bb8cb0.png)  

P.s. I had higher quality footage but because of the format it wouldnt work with camera tracking AT ALL. I suppose i could stick it in for the nodes though eh?

---

<div class="post-metadata">

**Author:** ![blendercomp](https://blenderartists.org/letter_avatar_proxy/v4/letter/b/dbc845/32.png) [@blendercomp](https://blenderartists.org/u/blendercomp)\
**Post date:** [November 26, 2012, 6:41am UTC](https://blenderartists.org/t/composite-3d-objects-behind-foreground-footage/557613/13 "2012-11-26T06:41:06Z")

</div>

> [@Xilith117](#):
>
> I think i understand the concept but i need to play around with it to understand better. What about “z” ?

what about it?

> I was playing around, trying to get little lights on the ship (i was trying for some glare/flare type effects but i can live with just glow) and I got the blend file below with the nodes arranged as they are below but i seem to have removed the alpha channel which makes it impossible to “alphaover” the two layers again…help? Thanks so much.☹

I’m kinda busy right now so I can only give you instructions.  
Glow is a camera effect, so put the parts of the spaceship you want to show as glowing in their own render layers (or use the index pass). Then bring them into the compositor and apply glow (or whatever else, it doesn’t really matter) and add the result on top of the existing composition. The glow should be added to the final result. Alpha over would not work in this case.  
If you don’t figure it out I’ll try it in the evening.

> P.s. I had higher quality footage but because of the format it wouldnt work with camera tracking AT ALL. I suppose i could stick it in for the nodes though eh?

Higher quality ddin’t track?! Interesting. Dunno much about tracking (yet) but I’d expect the opposite.  
Maybe you could start another thread and request specific help about tracking your video.

---

<div class="post-metadata">

**Author:** ![Xilith117](https://blenderartists.org/user_avatar/blenderartists.org/xilith117/32/578528_2.png) [@Xilith117](https://blenderartists.org/u/Xilith117)\
**Post date:** [November 26, 2012, 7:14am UTC](https://blenderartists.org/t/composite-3d-objects-behind-foreground-footage/557613/14 "2012-11-26T07:14:09Z")

</div>

> what about it?

What does it do? how do we use it?

I will try putting the glowing parts on a new renderlayer. Thank you so much for spending so much time to try to help a noob (who is still a noob after 3 1/2 years of using blender)🙂

---

<div class="post-metadata">

**Author:** ![3pointEdit](https://blenderartists.org/user_avatar/blenderartists.org/3pointedit/32/2482_2.png) [@3pointEdit](https://blenderartists.org/u/3pointEdit)\
**Post date:** [November 26, 2012, 2:25pm UTC](https://blenderartists.org/t/composite-3d-objects-behind-foreground-footage/557613/15 "2012-11-26T14:25:47Z")

</div>

z data (depth) is available for Blender generated geometry but doesnt help with keying the real images as they dont have z recorded.

---

<div class="post-metadata">

**Author:** ![Xilith117](https://blenderartists.org/user_avatar/blenderartists.org/xilith117/32/578528_2.png) [@Xilith117](https://blenderartists.org/u/Xilith117)\
**Post date:** [November 26, 2012, 4:15pm UTC](https://blenderartists.org/t/composite-3d-objects-behind-foreground-footage/557613/16 "2012-11-26T16:15:06Z")

</div>

Thank you.

hmmmmm…this is tricky.
