Render massive images

I was looking at a way of rendering massive images (for say a billboard or signage on the side of a truck or van), but blender just dies with anything too big (Im guessing it doesn’t have enough ram). So I was thinking that the best way would be to render each part of the image, and stitch them together in another program (or do this using nodes I guess).

Before there were tiles in cycles, a few people had made scripts to do this, but they seem broken now and crash blender. Are there any scripts that work as at 2.69 (or that work in the 2.70RC)? How does anyone output a massive file (Im aiming at 63540 x 26640 as a test)?

Im guessing there must be a way, as blender would be used for something that needs to be printed large!

Borrow the concept of frame stitching from photography? I’m sure it’s quite possible to animate the position of the camera. It’s still going to take some work to figure out how far to move the camera around and adjust angles for this method. (Images from real cameras have the problem of barrel distortion and need some software tricks to compensate when compositing such images.) If somebody gets such details worked out, it’s not going to be any harder than rendering an animation. (Since that’s what you’d be doing, and then stitching those animation frames into a larger image.)

BTW, 3600 frames of 1059x444px is something Blender can easily handle without choking. (Making a grid 60 across and 60 down.) Like I said, trick is setting up the camera and moving it to make them seamless.

I believe that is nearly the same resolution that Weta used to rendered Smaug on the side of an Air New Zealand 777. Do you really need that much resolution, over 200 DPI, for a billboard or truck?

I think you can animate camera shift to move it in frame and get multiple images that you can stitch together, but it would help if you could script something to do the math for you.

jedfrechette, Probably not, but it should still be possible. Putting an image on the edge of a plane is also very low res because anyone who sees it will be a fair way away. For a billboard or truck people will be up close. Either way, even a large sign at the entrance to a music festival is going to be rendered in a way larger res than blender seems to be able to handle. Especially if the content is complex and there are a lot of textures etc that already hog the ram. I think this feature would make it easy to render anything larger than full HD by splitting it into parts (so it doesn’t have to hold the entire image in the ram)

pauljs and Craig Jones, This method would not work (unless all objects were exactly the same distance from the camera). The distance away from the camera that you line everything up would be fine, but anything closer would have parts between cameras cut out and anything further away there would be an overlap.

I will try show you the lasy way:

-----------/--------/-------
----------/--------/--------
----------/-------/---------
---------/-------/----------
--------/ ------/-----------
-------/-------/------------
–cam 1 - cam 2---------

If my asci art worked, you will see how the lines closer have some cut out, the back line would have an overlap?

I was talking about the Shift settings in the Lens panel under the Camera settings. This doesn’t distort since it is not a multiple camera, it is a shift internally in the camera. I used it to make posters by rendering different shifts and then putting them together in photoshop. Look through the camera and then adjust X value in Shift, and see what I mean.

That sounds cool, didn’t realise you could do that. I will check this out once I get home and on my computer. Thanks

or what you could do is set up a python script to change the border x/y min/max settings and render it that way (with render cropped on that is)… that way you dont have to worry about lens’ messing up or shifting the position or anything like that.

Would that still render all tiles? Because if so, the entire frame would still have to b in the ram.

No, if you enable the ‘crop’ function it will crop the image, and only render that section of the image.

cut it up into 16 images, 4 horizontally, 4 vertically… 1/16th of the image will be stored in ram at a time.

Ofcourse you will have to stitch these back together with a program like photoshop / gimp… we do it atm for images around 30k wide 15k high.

Awesome, thats what im looking for :slight_smile:

No, you don’t. :slight_smile:

Talk to the companies who actually make the stuff for billboards and trucks. They’ll provide you with a booklet of specifications. The pixel-size and the entire printing process is very, very different from what you’ll see on your computer monitor.

Choose the company now who will work with you to put this image on the object or sign, and get from them their authoritative requirements, before you start creating the image. You will need to know not only about the resolution but also the color space. They should be able to tell you how to set Photoshop, and/or a color-profile for your computer and monitor, so that you can accurately predict what the finished look will be. Yes, they can “re-map” almost any image that you provide them, but the results might or might not be as satisfactory. Bottom line: don’t guess. Engage them now, and do what they advise.

Depending on your hardware, etc, you might (as described above) wind up rendering in pages. Blender can do this, as you see, but let the printing-company guide you even on this point.

I once did a mural on a Quadra 950, so it can be done, and come out looking extremely good, even with limited gear! :slight_smile: But, when starting on the project, I presumed that I already knew … but I asked first … and I was totally wrong. “Whew! That was close!”

As I said, this isnt even for a particular project. I mean it may even be something that I want to render off video in full hd, but have a lot of resources used in even a small render and want to break it up into 192x108 bits or something.

Another thing I was also thinking was if it was something interactive online kind of like google maps. ( like http://www.gigapixelperu.com/Welcome.html), I think something like this would come in extremely handy :slight_smile:

I found this code by accident (the pre-cursor to the Monster Tile Renderer - that addon doesn’t work in 2.69) looking for a script that would work to do just exactly what you’re looking to do.

import bpy   
# tile rendering 0.1   
# Dealga McArdle (zeffii) 2011-July 8.

  
# fill in how many tiles you want, must be non zero.   
n = 2 # n tiles wide (x)   
m = 2 # m tiles high (y)   
percentage_of_current = 300  
total_tiles = n*m   
location = "/ /"  
filename = "MyRender"  
filetype = "png"  
  
  
name_list = []   
for j in range(m):   
    for i in range(n):   
        name_list.append(str(i+1)+"_"+str(j+1))   
  
border_list = []   
wslice = 1/n   
hslice = 1/m   
  
# use border and crop   
bpy.context.scene.render.use_border = True  
bpy.context.scene.render.use_crop_to_border = True  
  
# set resolution percentage   
bpy.context.scene.render.resolution_percentage = percentage_of_current   
  
for cell in name_list:   
    wdiv, hdiv = cell.split("_")   
    bmin_x = float((int(wdiv)-1)*wslice)   
    bmax_x = float(int(wdiv)*wslice)   
    bmin_y = 1.0 - (float(int(hdiv)*hslice))   
    bmax_y = 1.0 - (float((int(hdiv)-1)*hslice))   
           
    str_borders = ("bmin_x="+str(bmin_x),   
                   "bmax_x="+str(bmax_x),   
                   "bmin_y="+str(bmin_y),   
                   "bmax_y="+str(bmax_y))   
                      
    border_list.append((cell,str_borders))   
  
    # set border for this tile   
    bpy.context.scene.render.border_min_x = bmin_x   
    bpy.context.scene.render.border_max_x = bmax_x   
    bpy.context.scene.render.border_min_y = bmin_y   
    bpy.context.scene.render.border_max_y = bmax_y    
       
    bpy.ops.render.render()   
    RR = "Render Result"  
    bpy.data.images[RR].save_render(location+filename+"_"+cell+"."+filetype)   
    print("rendered", cell)

This does work but it renders the tiles chronologically and I’ve been trying for a few hours to just work on it to see if I could get it to just render specific tiles so I don’t have my old computer running all day and all night. I’m not smart at Python scripting but this is a launching point since that code does work in 2.69.

LOL, I actually found that script 10mins before you posted, and was mucking around with it :slight_smile: It seems to work fine, just need to change a few settings.

fill in how many tiles you want, must be non zero.

n = 2 # n tiles wide (x)
m = 2 # m tiles high (y)
percentage_of_current = 300
total_tiles = n*m
location = “/ /”
filename = “MyRender”
filetype = “png”

-The n and m are just the number of tiles across and high that you want you want (how many sections do you want to split the frame into)

-percentage_of_current is just how big you want it rendered. So at the moment if your scene was set to 100x100px, this will render at 300%(so 3 times the size), making it 300x300px. I am currently doing a test where I put tiles n and m at 10, and then this value at 1000 (10x the original). Should mean that each tile will average about the same amount of time (with reduced ram usage) than the original, but it will be 10 times as big.

-location is where the images will be saved. So in windows, I used location = “D:/temp/rend_out/” and that saved the images in D drive > temp > rend out.

-filename is just the name of the output files, so with these settings, there will be MyRender_1_1.png, MyRender_2_2.png etc

-filetype is just what it sounds like, I changed mine to jpeg from png.

To run the script, simply open a text editor panel (lower left of every panel are the options), create new text file and paste this code in there. Edit the settings as required, and in the text menu, choose run script. At this point, it will say blender is not responding, but if you look in the output folder, it will start putting rendered files in there.

I suggest you start with something small (like 1920x1080) and set the percent to 100 (so you are not rendering anything huge), and just tile it to 2x2. That way you can see that its running.

Once output, the files are filename_xloc_yloc.png, where filename is specified as above, xloc is the number of places across and yloc is the number of places down. So MyRender_1_1.png would be the image for the top left. MyRender_2_3.png would be the image second across and third down. Just piece them all back together in photoshop…

Any questions?

My own test with Cycles on an image 2000 x 3008 with a 150% with 20 x 20 (400 tiles) took my comp and hour just to render 10 stills (1000 samples) from row 1 and by my calculations would take like 40 hours to complete :eek: not good for me.

There has to be some kind of code that can be added to it to tell it to just render out a specific tile that way I can render out a few tiles here and there without having to try to do it all at once. Or unless there’s another script out there that you can input the border size and crop it then move on to the next area. I don’t know I’m just rambling at this point :stuck_out_tongue:

Well thats easy, dont use the script:

  1. Go to the camera view
  2. press ctrl+b
  3. choose the area you want to render
  4. in the render settings, choose “crop” under Dimensions
  5. hit F12 to render (you will need to save this file somewhere like a normal render)

If you want to render the entire frame again, go to the camera view and with ctrl+alt+b, it will remove this option.

When you run this script Im not sure if you have to choose the crop option or not, I just realised I already had it on.

That work for you?

It might work though there will be some overlapping I’m sure. If I could draw it to a specific size in a specific location that would give me more control but I’m not even sure if it could function like that.

I’m going to see if I can’t try a few things and look around some more. This has definitely got my gears spinning. Thanks :slight_smile:

No worries, do what I said before, but instead of using the mouse to choose the border, use:

import bpy

bpy.context.scene.render.border_min_x = .25
bpy.context.scene.render.border_max_x = .75
bpy.context.scene.render.border_min_y = .25
bpy.context.scene.render.border_max_y = .75

and run that script. Muck around with the values (0-1) and when the red box is in the correct place, just render like before.

That good?

That’s working for me. I put comments into the python console telling me exactly what each line does. Definitely not hard to figure out Thank you!