Cycles: First implementation of shadow catcher
authorSergey Sharybin <sergey.vfx@gmail.com>
Thu, 9 Feb 2017 13:19:01 +0000 (14:19 +0100)
committerSergey Sharybin <sergey.vfx@gmail.com>
Mon, 27 Mar 2017 08:46:03 +0000 (10:46 +0200)
commitd14e39622ae627c1a4329e630715c5197c762493
treed246f7083bcc82236488d5aaec25cb2e735c4145
parent5aaa643947929cf807c349b2b5fe33d4dc669c3d
Cycles: First implementation of shadow catcher

It uses an idea of accumulating all possible light reachable across the
light path (without taking shadow blocked into account) and accumulating
total shaded light across the path. Dividing second figure by first one
seems to be giving good estimate of the shadow.

In fact, to my knowledge, it's something really similar to what is
happening in the denoising branch, so we are aligned here which is good.

The workflow is following:

- Create an object which matches real-life object on which shadow is
  to be catched.

- Create approximate similar material on that object.

  This is needed to make indirect light properly affecting CG objects
  in the scene.

- Mark object as Shadow Catcher in the Object properties.

Ideally, after doing that it will be possible to render the image and
simply alpha-over it on top of real footage.
18 files changed:
intern/cycles/blender/addon/properties.py
intern/cycles/blender/addon/ui.py
intern/cycles/blender/blender_object.cpp
intern/cycles/kernel/bvh/bvh.h
intern/cycles/kernel/bvh/bvh_shadow_all.h
intern/cycles/kernel/bvh/qbvh_shadow_all.h
intern/cycles/kernel/kernel_accumulate.h
intern/cycles/kernel/kernel_emission.h
intern/cycles/kernel/kernel_path.h
intern/cycles/kernel/kernel_path_branched.h
intern/cycles/kernel/kernel_path_state.h
intern/cycles/kernel/kernel_path_surface.h
intern/cycles/kernel/kernel_shader.h
intern/cycles/kernel/kernel_shadow.h
intern/cycles/kernel/kernel_types.h
intern/cycles/kernel/split/kernel_indirect_background.h
intern/cycles/render/object.cpp
intern/cycles/render/object.h