6
$\begingroup$

I'm currently working on an online configurator with 3D preview. The kind of tool you often see for cars.

I need to render hundreds materials for small portion of image which are not rectangular.

Is there a way to speed up render ?

Solutions I see so far :

  • give an image to be used as a mask, it would be usefull as a greyscale that define the number of samples we want, I fear this option does not exists and require to tweak the source code
  • mask areas that does not require rendering with a 3D object on front of camera that use some kind of "black hole" matter that will be blazing fast to render, but I don't know how to create this matter.

Do you see any other ways to achieve this ?

$\endgroup$
1
  • 1
    $\begingroup$ for the black hole material use a Houldout shader. Adaptive sampling will be added to Blender in near future, there are some test builds having this on graphicall.org $\endgroup$ Commented May 19, 2016 at 13:50

3 Answers 3

2
$\begingroup$

Yes, a Holdout shader is what you're looking for. I frequently use this technique when I want to re-render part of a scene and composite it into a previous version.

Your second idea of a mesh in front of the camera is exactly what I do. You can put a plane in front of the camera and make a hole in it whatever shape you need. Give the plane a Holdout shader, and everything behind it will be totally ignored. It'll only render what you can see though the hole. The hole can be any shape you want.

$\endgroup$
5
  • $\begingroup$ Thanks. Do you have a tip to make a hole with the right shape when it is a complex object? $\endgroup$
    – bokan
    Commented May 20, 2016 at 6:26
  • $\begingroup$ The way I've done it is adding a "Track to" constraint to the plane so that its z-axis always points at the camera. Then, align the plane so that it's parallel with the frustum. From there, you can go into the camera view and edit the mesh pretty easily, especially if you change the 3D manipulator to "View" instead of "Local" or "Global." $\endgroup$
    – Matt
    Commented May 20, 2016 at 13:08
  • $\begingroup$ Now, that having been said if you're trying to mask out everything but one object, then render layers really is your best option. If you turn on "transparent" in the Film section of the render settings and make sure you're using a file type that supports and alpha channel, then any part of the background (anything that's not an actual object) will be rendered transparent. This is MUCH easier than trying to build a mask that is the same shape as a particular object. $\endgroup$
    – Matt
    Commented May 20, 2016 at 13:11
  • $\begingroup$ But will it render reflect of other objects ? $\endgroup$
    – bokan
    Commented May 20, 2016 at 13:39
  • $\begingroup$ Oh... it wouldn't with render layers I don't think :-/ What you CAN do, though, is turn off camera visibility for everything else in your scene. I'll do up another answer for that technique... $\endgroup$
    – Matt
    Commented May 20, 2016 at 13:44
1
$\begingroup$

Have you looked into render layers?

They allow you to separate you image into independently rendered parts that can use other objects as masks.

You could create a render layer with only the objects that need rendering, possibly use other scene layers as mask to occlude parts that are hidden and don't need re-rendering and save some time and resources.

Although Blender will still render a full resolution image it will skip transparent areas ad in theory generally decrease render times considerably

Maybe look into some tutorials perhaps.

$\endgroup$
1
0
$\begingroup$

Another option is to make all other objects invisible to the camera. Turn off the camera check mark in the Object tab:

enter image description here

This will make the object show up everywhere except the camera. It will be visible in reflections, transparency, and everything else, it just won't actually be visible in the final render. It'd be a bit tedious, but turn off that check box for all the objects you don't want to see (even the ground) and it'll render transparent. BUT you'll still see the effects of all those invisible objects, as if they were casting light, or giving reflections, or whatever.

Pro-tip: you could animate the "camera" check box to only be off for only one frame. That way, you don't have to keep turning it on and off, you just have to go to the one frame where it's turned off.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .