

We can subtract the values of a mask to another, using the Math node with Subtract option, which we add with Add > Converter > Mathįor which we select the "Subtract" option instead of "Add" and we get the mask Using the output of the alpha port that provides a mask, which represents the objects present in light color and the transparent background in black We start the rendering and in the Compositor we visualize In our case, however, the plane is invisible, so if we add the Viewer node with Add > Output The mask would look like this, in which we can see: the illuminated part of the cube (1), the illuminated planes (2-3), the shadowed part of the cube (4), the shadow of the cube on the plane (5), the background (6)

If our scene had two visible orthogonal planes as a background The Shadow Pass creates a mask: the illuminated parts of the scene are light in color, those corresponding to the shadows and the background (without illuminated elements) are black. Now select the "Cube scene" in the drop-down menu and activate, in the "View Layer Properties" tab, the Shadow Pass which allows you to collect information on the shadows that we will need to work on a specific area of the cube These two nodes represent what is rendered in the two scenes, the one with the cube and the one containing only the shadow. We add another node "Render Layers", using the command in the menu Add > Input > Render Layers, and in its drop-down menu select "Shadow scene" Two nodes immediately appear: "Render Layers" (with the scene already set to "Cube Scene") and the "Composite" node, which represents everything that will appear in the final rendering. Select the "Compositing" workspace and activate the "Use Nodes" option

In the Outliner we activate all the options for visibility Now we remove the plane from the first scene, hiding it during rendering: select the "Cube scene" from the drop-down menu In the "Shadow scene" we have to delete the cube, but we want it to continue casting the shadow on the plane, so we don't delete it, but we hide it from the camera: we select the cube and, in the "Object Properties" tab, in the Visibility panel > Ray Visibility uncheck the "Camera" option Let's rename the second scene as "Shadow scene" Now click on the button on the right to create a new scene, the one that must contain only the shadow on the plane,Īnd choose as option "Full Copy", to copy all the objects from the first to the second sceneĪnd a copy of all objects from the first to the second scene will be created Then in the text box, top right, we rename the current scene (which will contain only the cube) as "Cube scene"

In this method we will use the "scene", to separate the cube from its shadow on the plane and organize their management in a simpler way. We will now try to lighten the two "shadows", independently of each other, using the Compositor, in order to limit the number of renderings to be made in case we want to modify the intensity several times to better adapt it to a photo.Ĭhange shadow intensity using scenes in the Compositor: We start the rendering and we get the object with only its shadowĪs you can see, in the figure there are two types of "shaded areas": the part of the cube not exposed to light (1) and the shadow that is projected on the plane, now invisible, (2) We eliminate the background of the rendered image by checking the "Transparent" option in the "Render Properties" tab > Film To hide the plane, but not the shadow of the cube, we select it and in the Object Properties tab of the Properties Window, in the Visibility subpanel, we set the option "Shadow Catcher" (that is, we consider it only as a "shadow catcher") We press the F12 key to create the rendered image We raise the cube and create under a plane, we place the camera, set Cycles as rendering engine, in the Render Properties tab of the Properties Window, and 500 Samples for the Render This can be especially useful when we want to add a 3D object on a pre-existing photo, to better adapt the shadow to the light and objects present in the image, without having to render the scene with each change.Īs an example of a model to be used for photo insertion, let's create a simple cube with its shadow: let's start from the default scene and give the cube color #95A6FF, in the "Material Properties" tab of the Properties Window
#Colorblender how to#
In this tutorial for Blender (updated to version 2.9) we see how to change the color and how to darken/ lighten the shadow of an object in the Blender Compositor.
