Compositing problem with image background

Hello Blender community,

I tried the Blenderguru tutorial about using a picture as background and inserting an object in the scene.

Everything works ok but if I use anti-aliasing on the ID mask nodes I get a white strip around the object.


If I don’t use anti_aliasing it looks really ugly and pixelated.


My compositing set-up is as follow


Help appreciated

and the test blend…

Attachments

empty_room_suzanne.blend (1.22 MB)

Using ID mask to achieve this is not very useful. It is much easier and nicer to do it this way:

Make three render layers:

  1. BG scene layers enabled, object layer not visible but not excluded (BG with shadows)
  2. BG scele layers enabled, object layer not visible and excluded (BG without shadows)
  3. object layer visible, BG scene layers not visible but not excluded (object only, but with shading from BG)
  • divide the BG with object and BG without object (this is already there)
  • multiply the photo with the result of previous division (remove the ID Mask from fac input)
  • render object into its own render layer separately from BG scene
  • alphaOver the object over the shaded photo


Thanks so much kesonmis, that works perfectly ! Adds a render layer but the result is as expected !