Work Around for More Efficient Rendering Needed

Hey guys, thanks in advance for any insight you may be able to provide. Here is my conundrum:
I have to render a multitude of scenes in Cycles in which the material of one object in the scene will change. However I want to save time by not having to render the entire scene over again every time I have to change materials.
Here is a simplified example of what I have to do:


So the main cube (white) needs to be completely static in every iteration of the render, but the “band” (green) around it has to change materials with each new render of the scene to blue, red, gold, or any other material.
Ideally I’d like to be able to only have to re-render the “band” with a new material each time and somehow replace the band in the picture above so it looks as if the Cube and the Band were rendered together on the same layer. I’ve tried to do this in the compositor with mix nodes (set on scene) combining an image of the main cube and the render result of the Band on its own layer, but I can’t seem to make it work. I keep running into transparency issues for some reason.



Thanks again for any insight you might have in regards to achieving the desired effect.

You can put each object on its own layer and then use the layer mask options to not render parts of an object hidden by another
https://www.blender.org/manual/render/post_process/layers.html

Attachments

mask_layer.blend (92.1 KB)

Thanks for the response Richard, unfortunately that’s exactly what I was doing the problem that I can’t get around is making the “Band” Layer think that the cube is still there when I render it alone after a material change. The method you showed works excellently until I have to change materials. Here is what I mean:

This is with both render layers active, as you can see it works great.



But then, not unsurprisingly I run into problems when I disable the layer with the main cube because the mask no longer makes the band think that the main cube is there.


The purpose of me disabling the first layer however is so that when I change the material of the band for the next render I don’t have to re-render all of the geometry in the first layer because everything on that layer can stay the exact same. The cube is just a simple representation of what I would actually have on layer one, in reality it would be an object with much more geometry that takes a long time to render. So I need a way to make the Band think that the cube is still blocking it without having to re-render the geometry of the cube, or I need a way to combine an image of The main cube from layer one with render layer 2 (the band) in a way that creates the same visual effect I would get if I rendered both layers.

Thanks for the response Richard, unfortunately that’s exactly what I was doing the problem that I can’t get around is making the “Band” Layer think that the cube is still there when I render it alone after a material change. The method you showed works excellently until I have to change materials. Here is what I mean:

This is with both render layers active, as you can see it works great.
[ATTACH=CONFIG]446604[/ATTACH]
But then, not unsurprisingly I run into problems when I disable the layer with the main cube because the mask no longer makes the band think that the main cube is there.
[ATTACH=CONFIG]446605[/ATTACH]

The purpose of me disabling the first layer however is so that when I change the material of the band for the next render I don’t have to re-render all of the geometry in the first layer because everything on that layer can stay the exact same. The cube is just a simple representation of what I would actually have on layer one, in reality it would be an object with much more geometry that takes a long time to render. So I need a way to make the Band think that the cube is still blocking it without having to re-render the geometry of the cube, or I need a way to combine an image of The main cube from layer one with render layer 2 (the band) in a way that creates the same visual effect I would get if I rendered both layers.

Both objects need to be on separate scene layers. Your second screenshot shows only 1 scene layer active ! The render therefore does not know the cube is there to use as a mask.

In the file I supplied just turn off the render layer set up for the cube so it only renders the outer ring.
Render the cube render layer as an image and use that as the node input in place of the render layer node

Good news I just figured it out:

1.So you have to have both layers set up then you have to Deactivate the cube layer once you create an image of it.

2.Then in order to stop that translucent effect from occurring you must select both of the layers in the 3D view. This way the band still believes the cube is there, and as far as I can tell the system doesn’t render any of the geometry from the layer with the cube correct me if that’s wrong.

3.Then you can change the material of the band as many times as you want and just hit F12, and viola.

Thanks for all of the help I think this is what you were trying to get across to me but I was missing the step where you have to leave the cube layer selected, but disable it in the scene menu. Thanks for your time it is much appreciated.