tutorials |
render region
Have you ever gone through a 13 hour HDRI render just to discover that one of the objects in your scene is floating 1 cm above the ground? Or that the whole image would be better off if you simply deleted it? Or that the texture/shader is completely wrong? In cases like these, when you face the task of changing one parameter and then re-render the whole scene again, you tend to age quite rapidly. Well, there are some workarounds and I will show you one in this tutorial. What we're gonna do is set up our scene so that we will only render a specific region of our image and thus reduce render time dramatically.

Here's our final image after the first render -- four spheres and two colours, grey and red. The scene only took about 10 minutes to render, but for the sake of this tutorial let's say it took 3 hours. Now we discover that we don't want the front most sphere to be red at all, we want it to have the same colour as the other spheres. We could of course change the texture and re-render the whole image, which would take another 3 hours. Or we could change the texture, delete all the other spheres and render, but since the red sphere is reflected on the big one's surface, that wouldn't be a good solution.


Plane transferred to the Camera

Here's what we'll do instead. Start by creating a Plane and set the segments to 40 x 40. Make the Plane editable by hitting C on your keyboard and then orient it to face your Camera by going to Functions > Transfer... and there type the name of your camera. Also select "Rotation" to get it to align itself properly. If you now select the editor camera and press H on your keyboard (to frame the complete scene) you'll notice that the plane is indeed parallel to your camera (see image above). But we want it to face the camera so rotate the Plane on the X-axis (make sure that you use "Object Coordination System", i.e. that you're rotating along the object's axis and not the world axis!). Rotate it on the X-axis and then move it on the Y-axis (still using the object's own axis) just a little bit from the camera like in the image below. The plane must cover the whole scene so alternate between your main camera and the editor camera to get it right.


Plane rotated and moved


OK, so now we have our plane set up properly, covering the whole scene. It's sufficiently subdivided for our purpose so activate X-rays (Display > X-Ray) and switch to your main camera -- it's time to delete some polygons.


With X-Rays activated, select these polygons and delete them

The X-Rays allows us to see through the selected object, in this case the polygonal Plane, and it also makes it easier for us to decide what polygons we need to delete. Now, we wanted the red sphere to render since we're gonna change the texture on that one and we want the reflection on the big sphere to render as well. The other two spheres will be OK as they are. Select the appropriate polygons covering the area you need to change and delete them. The hole will be the only region to render while the rest will be black.


The Render Tag in XL 7

Now assign a completely black material to the Plane. Just create a new material and uncheck all the channels and you have a material that's' as black as it gets. Next we're gonna assign a Render Tag (Compositing Tag in XL 8) to the Plane to make sure that it doesn't render any unwanted reflections, blocking any light and so on. Select the Plane in the Object Manager and assign a Render Tag (File > New Tag... > Render Tag...). What we want from this tag is to make sure that the plane is rendered completely black but otherwise not affecting our scene, so uncheck everything but "Seen by Camera". The Plane will thus be excluded for shadows, from HDR, from GI, radiosity, caustics -- you name it.

Now change the colour on the sphere and hit Render. Since we're blocking out all but the things we've changed the scene will render in a fraction of the time and only render the region we want it to. When it's done it's simply a matter of some quick compositing in Photoshop to get the image we want, using the rendered region as an alpha mask.


The rendered region


The final composite

There are many advantages to this method. First of all, the speed. Instead of re-rendering the whole image you render regions and thus cut the render time dramatically. Second, since the plane won't render you can move points and cut polys as much as you like without worrying about triangulation. For example, when I did my image Alvedon I discovered that the wooden texture I used on the table object was all wrong. I had done some small test renders but in the end it came out absolutely horrible in some places. Add to that a render time of about 15 hours due to transparency and radiosity and you can imagine my joy when I discovered my mistake.


The failed wooden texture is hardly visible in this size, but believe me, in 1280 x 1024 it is

What to do? I used the render region method outlined in this tutorial. The only thing that actually needed to be re-rendered was the table object with the new texture and the transparent parts interfering with this texture.


The modified rendered image with the black plane

I created a Plane, I oriented it to face the main camera, I subdived it, made it editable and then deleted and moved points. I tried to follow the shape of the objects and one thing to keep in mind when doing this is: don't be afraid to use the Knife Tool. The plane will always render completely black to serve as an alpha mask in Photoshop, so all those triangles and overlapping polygons won't be visible. When all was done I rendered again and this time it only took about 5 hours. Some tweaking in Photoshop and I was back on track :)

Addendum: A way of eliminating some of the steps above is to somewhere on your HD store a "Postrender-file" with a polygonal plane already in it. The clever thing is that you have a Point to Camera/Target Expression attached to the plane. That way you will always have a polygon plane easily at your hands (and if you're using XL 8.x you can store it in your Object Library). Thanks to Patrick Schad for tis tip!

Addendum 2: Andy Warwick has created an Object Library file with a nifty little XPresso going on in it. When you load the object you will get a plane with all relevant materials and compositing tags already attached. This plane has a little XPresso tag attached so you can quickly parent it to a camera. Simply select the Object, drag a camera into the User Data and the XPresso calculates a position just in front of it and places the Plane there; then subdivide to taste. You can download the file for either Cinema 4d XL 8.2 or Cinema 4d XL 8.5.

Thanks Andy!

 
copyright