Blender: Frame Splitting for Faster (Re)Rendering

Post your XNALara tutorials here!

Moderators: Runa, Dazzy

Porter
Online
User avatar
Posts: 3511
Joined: Mon Nov 26, 2012 12:13 pm
Location: Cyberspace
Custom Rank: Skynet Status

Blender: Frame Splitting for Faster (Re)Rendering

Postby ProtocolX27 » Fri May 27, 2016 10:58 am

Blender: Frame Splitting for Faster (Re)Rendering

So you have that perfect render in mind and your heart sinks when you realize its going to take 12 hours to complete. Or, maybe have your render almost done and then discover a flaw that will require a complete reset to get your render done. Perhaps you start your render and have to leave, but don't want your computer to explode while unattended.

If you've experienced any of the above or other time related frustrations, this tutorial is for you. Your needs and mileage may vary, but the principle is learning how to get Blender to break your image into chunks so that you can work on it in intervals or even separate the workload across machines.

By default in a Windows environment, Blender has no ability to pause rendering on a single frame. Blender has an awesome built it functionality to divide work across machines on a network, but even this feature will only dispatch whole frames to different machines.

How can we resolve this? The idea is to take a larger image and split it into smaller pieces and then instruct Blender to treat each one of those smaller pieces as a frame so we have more control over how many frames render or so that multiple machines can reduce overall time by on a chunk of the big picture.

There is more than one way to do this. So far, this is the quickest setup I've found to work through experimentation. This will involve using an Orthographic camera, so that each camera view does not have fish eye warping. It also may not be practical if you try to break down each frame of an overall animation into smaller pieces. This is intended for single picture renders.

Advantages
    Ability to 'pause' or break a single frame into chunks
    Ability review a single section of a render beyond the initial Blender tile order settings
    Ability to break a single frame into chunks for utilizing Network Render capabilities which normally only submit jobs one frame at a time.

Disadvantages
    Loss of Perspective Camera
    Can be clunky to setup shift values
    Can require trial and error to position camera more effectively

Requirements
    Basic Blender know-how to move add/move a camera and navigate interface
    Basic math and loose algebra concepts for calculating camera positions

Lets Get Started!

I've created this amazing high quality scene to work from :lol: I just wanted to make sure it was something wide enough to simulate something that has content to fill up a frame.

Image

Next, setup a camera and position it roughly where you'd like.

Image

Determine your resolution. In this example we will break our view into 9 pieces. You can split it however you want, but you will have to do the proper conversion for camera positions later. My preference is 1920 x 1080. I render that at 200% to achieve 4K resolution, but 100% is sufficient for example. 1920x1080 has a nice clean value to divide by 3. Which gives us 640x360. Notice our camera sizing appears the same.

ImageImageImage

Now we want to switch our camera. The default is Perspective.

Image

We want to switch it to Orthographic. This defaults to 6 which is close to our original view. Lets change this to 2 since 6 / 3 = 2 to be consistent. This is the area that may require some trial and error to get the desired look. If you scale this value, you'll want to double check to make sure that 3 cameras side be side would still achieve the full view that you want.

Image

Next we setup on our Timeline. I have a window for this at the bottom. Since we are breaking our frame into 9 tiles, I created 9 frames. Starting at 1, ending at 9.

Image

Now we've reached the annoying part, the math. We need to come up with some numbers to tell Blender how to position or 'shift' the camera in each of our frames. Our selected resolution is 1920 x 1080 or 640 x 360, either way the ratio is the same... 16:9 We need to take the small number and divide by the big one. 9 / 16 = .5625

We have two values that we need to work with, a wide value (1) and a narrow value (.5625). We will use those to position the camera in multiple places around the initial camera. Mentioned algebra because our center camera position has X,Y coordinates of (0,0) We will use our wide and narrow values determine position.

Let's go back to our Camera tab. My personal preference is to make the Camera tile in an outward spiral similar how Blender's 'Center' tiling works. You can do this in whatever order you want, just make sure to add one pair of position coordinates to each frame of animation as I will explain.

Our center camera will be at X: 0, Y: 0 for Frame 1. Position 2: will be at X: 0, Y: .563, above the original (Blender only allows 3 digits here) Since our height is our narrow value the changes to the Y value will either be 0, .563 or -.563. Our wide value will apply to X as 0, 1, or -1.

A) Change the Timeline to the next frame, B ) Change the X,Y values, Hit 'I' or right click and select 'Insert Keyframe'

Image

We are going to repeat steps A & B for each pair of camera values. After the keyframe is inserted our Timeline should now have a yellow dash indicating there was a change. (This image is misleading since I already updated Frame 1 before taking this one)

Image

Frame 3 I positioned the camera to the right of the center one. Use steps A & B

Image

Frame 4 Camera positioned under the original

Image

Frame 5 Camera positioned to the left

Image

Frame 6 Camera positioned in the upper right corner.

Image

At this point, hopefully you can see the pattern and finish the rest until all 9 frames have a different camera position adjacent to the original. Your final result should hopefully look like this.

Image

Here's a basic grid of the values for this 9 frame/camera position example.

(-Wide, Narrow) (0, Narrow) (Wide, Narrow)
(-Wide, 0) (0, 0) (Wide,0)
(-Wide,-Narrow) (0, -Narrow) (Wide,-Narrow)

Again, you can use as many positions and frames as you want, just do the resolution math & positions accordingly. If you still want use a 16:9 resolution and just switch to portrait vs landscape, you can use the grid of values and then just swap the wide & narrow info. This is all that basic algebra stuff.

That's it! We're ready to render. Instead of F12 / clicking the Render button, we'll now click the Animation button. You can control which frames will render in the Frame Range boxes. You can do all at once, a single frame, or get crazy with it. All frames will output to your specificied path.

Image

Note: If you are still in a single computer render environment your render speed will be the same as doing everything at once. The time advantage comes from having more flexibility and not having to re-render an entire scene if something goes wrong.

Once you're render is done the last step is to put the pieces together in your photo editor of choice, Photoshop, GIMP, etc. I already have a template setup with guides so that I can snap all of the pieces together. It is also included in the attachment.

Image

Presto! Amazing Render! :lol:

Image

Even if assembling the tiles takes a few minutes hopefully that's still less than the hours you could save by using multiple machines or preventing render resets.

Best of Luck! I really hope this helps everyone as much as it has me for future projects. Feel free to let me know if I missed anything.
You do not have the required permissions to view the files attached to this post.
Image

Return to Tutorials

Who is online

Users browsing this forum: No registered users and 1 guest