How to Make An Object Visible In The Compositing Tab

Hi,

I’d like to ask if someone has an idea how to make an object visible in the Compositing tab. I can see it in Shading and Layout after I’ve selected it as Background in the Motion Tracking, but not in Compositing. Therefore, I can’t really make any adjustments via nodes to the 3D object (in this case the castle).

As you can see I’ve switched to the nodes in the editor type, but when I go to Layout and add let’s say a Curves node, nothing changes, so I can’t make my way around it. In this case, I’d like to give the castle some color grading, not through the material options, but through Compositing and nodes, and I want to do the same with the shadow maybe with a separate pass (as I see in some tutorials that’s the way it’s done).

I’m not sure if i understand this correctly… but if you add some 3D object then this is only visible in the composition after rendering the scene anew.

You seems to have uses the background image twice here:

  1. in 3D view and
  2. in the composite

for this ?

Also make sure Composite and Viewer node do use the same inputs (you can split a connection with the reroute-node ).

Hi and thanks for dropping a comment.

Here’s a reference to what I wanted to explain: https://youtu.be/Edtax29W7hA?si=qJ_JkTR8wwUWi8N-&t=337

You can see from 5:37, when people get to this point, they do have the object and the background shot in the Compositing. The guy added the Alpha Over, Viewer, and Composite nodes to bring out the background and the 3d model. I already had those nodes though. And I’m just now noticing that there was a bug or something wrong with my Render Layers node, which wasn’t displaying the Foreground collection, where all elements are nested. So I deleted it, added it again and selected the Foreground collection. This time the castle appeared too.

However, there are now 3 other problems :

A) The 3D object/castle isn’t camera tracked in the Compositing section when I play the preview

B) The Shadows of the objects don’t show

C) If I make any adjustment to the object, let’s say with the curves node, the changes don’t get applied in the Layout section. I’m uploading a screen video of all this so it’s more easy to understand.

It sounds like you’re expecting different parts of the interface, which do different things, at different stages of the process, to feed back into each other in ways they aren’t designed to.

The Layout view is your 3D viewport: you’re seeing & navigating your scene, with viewport rendering active, constantly refreshing as you adjust objects & lights. You’re working with 3D.

The Compositor is a post-process: images come in, are modified, and are output. Those images could be something you just rendered, or even the result of a viewport render (if you’re using the viewport compositor), but they could just as easily be 5 jpegs off your hard drive. You’re working with 2D.

A) Since the Compositor needs to work with images, things need to be rendered (turning a full CG scene into a single flat image) before they can be composited. The RenderLayers node is showing you the result of your most recent render. That means if you render frame 25, and then scrub to frame 100, you’re still seeing frame 25, which is what you’re describing as the castle being “not camera tracked.” If you render frame 100, you’ll see the castle’s position as of frame 100, confirming it is tracked. It’s just that the background layer is updating (since it doesn’t need any processing to exist on a different frame, Blender just loads the relevant image for that frame) and the foreground render isn’t (since it doesn’t exist on any other frames, it’s just a cached copy of your most recent render). If you render out your CG, then import it into the compositor as an image instead of a render layer, you’ll get playback just fine, since like your background it’s now just a series of pictures.

B) As mentioned in that video you linked, activating the Shadow Catcher pass moves the shadows from the main RGBA layer to their own layer, which is layered with the background using a Multiply. (This pass also contains more lighting information, including illumination and multicolored shadows, as opposed to the plain gray blobs that show up in RGBA mode.) Here’s a video with a more in-depth look at how it works. The black blobs still show up in viewport renders for preview purposes, which is why you can see them in the viewport, but don’t need to be there in a final render, since they’re over in their own pass. You don’t have that multiplication step set up to bring the shadows into your composite, so you’re not seeing them there.

C) Compositing happens after rendering. You’re rendering the 3D, turning it into a picture, and then applying adjustments to the pixels that make up those images. Those changes don’t magically propagate back into the 3D scene itself, any more than exporting your render to another app and cropping it would change your focal length. Blender has recently added a viewport compositor, which allows you to preview some of the effects that will happen in compositing while still working in your viewport, and might allow you to see your grading changes in this particular case, I’m not sure, I haven’t used it.

3 Likes

Much better explained than i started to write (and didn’t finish) yesterday :sweat_smile:.

Hi and thank you for the thorough comment, I really appreciate it! It stems other questions though, as I still can’t figure some stuff out:

A) So every time I want to add a new element that would actually be in the scene (in this case the desert shot), after I add it into the Scene collection I should go to “Render Image” and wait for Blender to process it and add it as flat pixels to the desert footage, is that correct? Which tab preview would Blender use to export the final result then - the desert shot + the 3d object (the castle) and its shadows?

B) I actually tried to test render animation using the first 20 frames, but the 3d object (the castle) didn’t show, there was only the original desert video I used as background. Shouldn’t the castle be there too once I’ve rendered an Image and it appeared in the Compositing tab?

C) From what I understood, in order to be able to tweak only the shadow, I need to duplicate the Render Layers node, which contains information about the 3d object, and connect the Shadow Catcher pass to a Multiply node. I’ve now done the exact same setup of the nodes as from the tutorial in the Compositing editor, including that Mix node, but still I had no proper result. I thought maybe I need to select the Ground plane which is the Shadow Catcher and hit Render Image to be able to include it to the Compositing tab as a shadow, but that didn’t work either.

D) In the tutorial, the guy went to the Rendering tab and was able to load his 3d character + the shadows in Slot 1 and in Slot 2 he had only the shadows and was able to switch from one slot to the other, but I can’t do that. In one slot I have only the castle again without the shadows, and on the other slot I have only the shadow (which doesn’t look correct). Is this step necessary to be able to bring the shadows in the Compositing tab separately?


A) I think you’re overcomplicating it for yourself. Compositing is a step in the image-making process, and it happens after rendering, the same way lighting happens before rendering, or texturing happens after modeling. In a standard workflow, you’d work on your scene until it looked the way you wanted, then render it, then take those rendered images and composite them in your app of choice. The fact that Blender has a compositing toolset built in doesn’t change that order of operations: work on a scene, then render it, then composite it.

If you were working in two separate files, I think this’d be more intuitive—if you were compositing and decided you want to change something about the render, it’d be clear you needed to go reopen your scene file, make a change, re-render it, and then bring those image files into your compositing project. But when those two steps are happening inside the same project, and Blender automatically propagates the most recent rendered frame into the Render Layers node, it’s easier to get muddled.

In fact, as a general rule, I recommend people do compositing as a second step, even if they’re staying in Blender for comp—rendering first and then bringing the rendered EXR sequence back into Blender to comp it. Makes it easy to change color/glow/effect settings without having to recommit to an entire costly re-render, and is definitely something you want as your scene gets more complex: once you’re juggling 25 elements, it’s great to only have to re-render the two that need changing. In your case where all you’re doing is layering your CG over a background, you’re probably okay, but it’s something to keep in mind.

And, we can now think about it logically: rendering happens first, followed by compositing—so the output that will be saved by Blender is the composite, since that’s the furthest-along stage in the process.

B) Do you still have those Foreground/Background layers set up? Maybe the background is just the footage, and that’s what ended up being output?

C) Your Multiply isn’t connected to anything. It can help to think of a node graph like a flow chart. Data starts in one place, and moves through the connections, passing from one node to another and being modified, or combined with other streams of data, until it eventually arrives at the output. The output of your composite is, unsurprisingly, the Composite node: whatever’s upstream of that is the result that will be saved out at the end. In that setup, your shadow is being multiplied against the background, but then the result of that operation goes nowhere: it’s just being thrown away. Meanwhile, your castle render is going directly to the composite, bypassing everything else you have set up. And, you have “Use Nodes” unticked, so none of your compositing nodes are even being used at all.

(Also, you don’t need to duplicate the node, since the Shadow Catcher output is right there on the first one. You can, if you need to use one of those inputs somewhere far away and don’t want a long noodle stretching across your whole node graph, but for two things right next to each other like that you can just pull an Image out of the Image output and a Shadow Catcher out of the Shadow Catcher output.)

And when you render an image, you’ve rendered an image. The objects you have selected don’t individually render themselves, again I think you’re overcomplicating it for yourself—hitting “render” isn’t some magical process that informs Blender you’d like to activate this object for initiation into the secret club. It just… renders the image. If an object wasn’t there last time you rendered, and is there now, it’ll appear, but just because that’s what happens when you render: the camera films the scene, and you get a render.

D) Render slots are just a way to cache multiple variations of a render—if you want to compare multiple shader settings, or decide whether a light looks better blue or green. In that video, they’re just saving their new render (with the Shadow Catcher pass activated) to a second slot, so they can toggle back to the saved older one and show the difference: it’s just for illustrative purposes within the tutorial, not relevant to anything you actually need to do.

Thank you for bearing with my dumb ass. Understanding technicalities has never been my strongest suit, plus nobody explains this stuff in Youtube beginner courses. I think however, that things are getting much clearer to me, and there are only 1 or 2 things left to solve.

A) Got it, thanks! I think I’ll be using the background footage for tracking purposes and then I’ll render only the camera-tracked version of everything CG I create in Blender, as you suggest in EXR format. I would normally use AE for compositing, since I have some experience with it.

B) Don’t know what was the cause, but this got solved after I rearranged the nodes we discussed in point C)

C) I think I fixed the exact set up for this as I managed to have the shadow show up along with the castle in the Compositing tab, plus I also removed the 2nd Render Layers node for the shadow catcher, according to your recommendation. I rearranged the nodes to plug into the Alpha Over node, which in turn would be plugged in both the Viewer and Composite nodes. Now, after a test animation render, I see both the castle and its shadow as part of the new video. I have yet to learn about some types of nodes, how and why they’re being connected to certain others.

The only problem that remains now is that when I add a Curves node to the line of the Shadow Catcher pass to raise the red color just a bit for the shadows to be a little more in accordance with the sand, the shadow itself doesn’t change, instead the background shot of the desert changes colors, as if I have added the Curves node to the Movie Clip - Alpha Node connection. What is the final setting I need to tweak to be able to make adjustments to every element separately?

Also, another small question - are rendered images stored somewhere on my device (I’ve read in the web that they’re stored in the same place as you’ve defined in the Output settings, but I don’t get anything there) or is image rendering only internally for Blender to update the information between different stages?

Thank you once again for everything!

Well, first off, I just want to point out you’re reducing red in that screenshot—I know you’re probably aware and just happened to have taken the screenshot after fiddling with the values, but just want to make sure!

And there isn’t really a “final setting” to adjust, that setup right there should do what you’re hoping. The one potential pitfall is that the Shadow Catcher can be tricky to color-correct, since it contains such a wide range of values, and it’s easy to start breaking things. The pass is built to be used with Multiply, so most of the image is white (1.0): this will have no effect, since 1 • x = x. Then some areas are dark (<1): these will become shadows. Other areas are overbright (>1): these will brighten the underlying image, accounting for stuff like bounce light and illumination from emissive objects. This is one of the big improvements the Shadow Catcher got in its recent upgrade, meaning it now captures basically every kind of “light influence” from the CG on the background, instead of just colorless shadows. But that means it’s easy to start breaking things with color correction, since anything that moves white away from white will affect the whole image (since it’s going to be multiplied, and if 1.0 isn’t 1.0 anymore, it’ll start to affect pixels that were supposed to pass through), and things like gamma can have unexpected results, since we tend to be used to their behavior only in the 0-1 range: a gamma down will make shadows darker, but will also make overbrights brighter, since gamma is a power function, and (0.5)² = 0.25, but (2)² = 4. Same thing with curves: the curve in RGB Curves actually extends past 1, so whatever you do to the 0-1 values visible in the interface will happen in reverse outside that range (Although the Extend Horizontal / Extend Extrapolated options in the node allow you to change that behavior.)

But all of that should be moot, since I can’t see why your Shadow Catcher would have any values over 1? You’ve got a light and some objects casting shadows, I’d expect your Shadow Catcher to be pretty much just shadow values (i.e. <1), so your setup should be affecting just the shadows—I’m not sure why you’re getting that result. For a naïve fix, you could try just clamping the shadow pass before you do any adjustments to it (or set the Curves node to Extend Horizontal), but if that is what’s going on, it suggests there might be something else going on with your scene. If you open up an Image Editor window and choose 'Viewer Node" in the dropdown, you’ll see whatever’s plugged into your Viewer, but with the ability to sample the pixel values by right-click-dragging over the image (they’ll show up at the bottom), and you can verify if your values outside the shadow area are 1, as they should be, or something higher.

And yes, images rendered with Render Image don’t go anywhere, it’s only when you Render Animation that they start saving to the specified Output location. if you do want them to save every time, you can add a File Output node in the Compositor, which will run every time the node graph is executed (e.g. every time a new render runs through the Compositor), but note that that means every time—I’ve accidentally saved over something I wanted to keep a few too many times by running a test render and forgetting I had a FileOutput active!

Yes, I changed the values of the Curves node so that it could clearly show the result is not what I expected, but I took it back to normal after the screenshot.

Thank you for explaining the Shadow Catcher’s functionality with the Multiply. I think I got your point to a great extent.

I see that clamping is something related to regulating the intensity of light bouncing off the surface. I thought there is a node about this that I would put between the Shadow Catcher pass and the Mix/Multiply node? I don’t have such a node though, plus I can’t find any information on how to add this

I tried the other fix you suggested - leaving the curves node where it is, but changed it to Extend Horizontal. As a result only the shadows closest to the castle (which are a bit darker) got colorized if I pump the red curve up. However, the Extend Horizontal mode makes the whole picture darker, I guess clipping the brighter parts is what it does, thus allowing the curve colorization to show. I can bring back the brightness and whites by reducing the input value from 1, but as the shadows pop out and the background video get brighter, the colorization of the shadow near the castle disappears again. It’s like either one or the other type of situation.

About the Image Editor - I went into it and loaded the background clip, but I can’t see anywhere a dropdown menu that contains Viewer Node. I can however, click the RMB and drag and I can see values that include the brightness, hue and saturation of the background clip.

I see that clamping is something related to regulating the intensity of light bouncing off the surface.

Oh, well, sort of—clamping means preventing values from being able to go past a certain point. If you clamp a bunch of values between 0 and 10 to be <= 5, any values above 5 will turn into 5. Blender does have light clamping settings in the render properties, and yes, those limit the brightness that bounce paths are allowed to have, but I was talking about clamping the shadow pass—that is, applying clamping to the values of the pass itself inside the compositor. A lot of nodes will clamp their output—a Curves set to Extend Horizontal, as mentioned, or a Mix node with Clamp turned on: if you set the factor to 0, nothing’s mixed, so clamping is the only thing it’s doing. Again, though, in a scene-referred workflow like Blender’s (one in which values over 1 are not only normal but expected), you generally only want to clamp values in certain circumstances where you’re very sure what you’re doing, and you shouldn’t need to anyway here, since, as mentioned, I feel like you should only have shadow values, and if you don’t, it suggests there are other issues with your scene.

If your curve was set to Extrapolate, I guess I could maybe imagine how that darkening could happen, since your curve goes above the top of the screen in the middle, so by the time it gets back to the other edge, it’s got a downward slope, so the curve past 1 would be extrapolated downwards, so any values above 1 would become <1, which could darken the image. But your curve isn’t set to extrapolate, and you should have no values over 1 anyway! So it makes me think there’s something very wrong with your light setup, that’s getting reflected in the Shadow Catcher? Would you be willing to share your blend file? I can only troubleshoot via essay for so long.

I can’t see anywhere a dropdown menu that contains Viewer Node

Right here:

Of course, I’ve packed everything I think is necessary to load the project. Here’s a link: https://we.tl/t-ZTiaOSMzCU

Regarding the light, I turned off the light object and loaded an hdri image (that’s close to the light of the original clip) in the World settings, and I guess its the origin of the light that makes the castle cast the shadow, no?

Okay, yep, as I suspected, your Shadow Catcher pass has some really weird values: way too high in the white areas, and well above 1 even in the areas that should be shadows! That’s what was causing the unexpected behavior you were seeing.


After some fiddling, it seems to be the result of your Exposure value in the render properties! Resetting it restored the Shadow Catcher to normal ranges.


I never use that value anyway, now I guess I have a reason to—didn’t know it could mess up shadow catchers like that! Not sure how it got changed, I guess you were messing with the look of your scene? I noticed your Exposure in Color Management was also adjusted. Although since that one was exposing down, and your Film exposure was exposing up, you sort of had a two-steps-forward-two-steps-back thing going on!

Hey, thanks for locating the problem! Yes, I was looking for exposure settings to change it, because the picture of the background footage looked darker than it should be. I also wanted to brighten up the 3d model at some point, so I figured I should adjust any exposure setting I find. I guess the appropriate way for this would be to add an exposure node between the movie clip and the mix node.

Thank you for spending all this time to help me with the case and help me learn new stuff that would allow me to work more correctly the next time! I really appreciate it! :v: