How to mask a render with isolated objs with alpha in an image?



So I need to tell Blender: render what’s on the 2nd image, BUT do NOT waste precious time rendering where the other 4 donuts in the 1st image will show (once I overlap them). In another words, I need to use the 1st image with alpha as a mask to NOT render on the 2nd image. Once done then I can use this nodes setup to merge them:

I need to do this just to reduce the workload on my old computer. Otherwise it has proven to be too much to handle at once :frowning: Of course, the actual rendering I’m aiming for is much larger than this little images here.

I am hoping that by not needing to render where those front donuts will appear might just be enough not to freeze in the process.

If you optimize out the donuts, how do you plan to have their reflection in the glass?

What you can do is set the “mask layer” flag on the donuts (render layers panel), that will at least render the donuts using a holdout shader for the first hit. That will save you a some render of time, but you still have to load the donut mesh.

Mmm, good point! I hadn’t realized about doing without the reflection on the glass http://forums.cgsociety.org/images/smilies/rolleyes.gif
About that, I suppose I could just render the glass twice, once per layer.

About your suggestion, assuming I understand it, it seems that would bring me back to where I am, which is to render image num 2 without blocking/masking the area where the donuts in image 1 are (about a quarter of the image real estate). However if I didn’t get it please re-explain.

Shouldn’t I be making use of the ID Mask node, somehow?

ID mask won’t help with what you’re doing, it just lets you cut things out after they’re rendered. If you set the donuts to a mask layer on img2, you will avoid the part you don’t need, which is evaluating the directly visible portion of the donuts. All the other steps in rendering this scene still need to be performed for the result you want, so you really can’t cut them.

Mmmm, I wasn’t expecting to reach the end of the line so soon! :frowning:
Ok, so then, do you have any suggestions on how I can render an image above 2k pixels wide in a way that it won’t crash my pc. I thought the only general solution was to do it in parts, one at the time. Then stitch them in GIMP.
I suppose I could “border-render” it one section at a time, but it would not be exactly the most elegant way.

Splitting up by render layers works well if you can break the scene down into several parts that are complex, but don’t effect each other. Like a foreground garden and a complicated temple behind it: http://www.blenderguru.com/articles/how-to-render-a-complex-scene-without-crashing/

Your scene doesn’t really fit that bill, it’s kind of all one thing. If your computer can’t handle it, yeah, your only real option is to render in pieces. I’m curious why you’re having issues at 2k though? Do you only have 2-4GB of memory?

Is this what you’re trying to do?


As already mentioned, you have to render the donut twice to get the proper reflections, though you could reduce any subsurfs on the donuts for the reflection pass. This example uses render layers to accomplish the various elements. This method is more or less how you start a composite on real footage.

Thanks for sharing benu.
The main objective I have with this is to lighten up the workload just so my computer can get this render done. I thought maybe if I were to do “separate” passes (one at a time) and then put them together after getting each pass done… But the problem with this, as I just learned, is that even when requesting Blender to separate the passes, still it doesn’t mean it won’t do the whole work at once anyway! :frowning: Now, if there were to be a way to tell Blender: ONLY do the Shadow pass now, then ONLY do the AO pass now, etc until done THEN, this would be doable. I hope you see what I mean.

JDL

Btw, about that error I encountered before… that is the reason why now I’m rendering with CPU. But other than the inherent reasons for this to be slower, for some additional reasons it seems to be worse than dragging, chocking on the attempt to render even what I border-selected (about 25% of the whole image).

However after rendering one donut at a time I found the culprit!
It’s a donut with a “sculpted” glaze. With more than 2 million faces! Hence even when trying to render it alone it would bring my AMD Phantom II 2.6 Ghz with 8 Gb ram to its knees, slower than a turtle! Needless to say, I had to do without it.

Your approach of rendering a separate pass for the doughnuts makes a lot of sense on low end hardware. To get the reflections, you can also have a pass of upside-down doughnuts, and then tweak the transparency. This eliminates the need for ray-traced reflections (big render times) and its success depends on whether you have lighting which would give away the fakery.