2007-06-14

Doing BIG renders in max 9



I have received several questions on how to make very very high res renders in 3ds max with mental ray.

When you do this, there is a memory issue (worse on 32 bits) which makes some tiles turn black, and you get poor results. mental ray actually renders the image fine, but the individual image tiles get lost due to memory being full when sent over to max.

To help you solve this issue, I wrote this very simple script (Warning: I am not a MaxScript expert, this may cause your computer to catch fire and your wife to move to Iowa, use at your own risk) that allows you to split a render into "tiles".

You simply run the script, and a dialog pops up asking you how many "tiles" you want to break the image into. Pretty simple and self-explanatory. The render is broken into pieces, and saved as separate files, which you then can assemble in, say, Photoshop or similar.

There is one important point, though;

If you are using final gathering in the scene, you must do this from a saved final gather map, or you may get artifacts in the joints between the pieces.

In theory, I could add this to the script, but since I am no MaxScript expert (see above) and since I am not made out of time... I didn't.

To do this yourself:

1. Temporarily reduce the resolution of your render to something that renders withouth memory issues.
2. Turn on FG and tell it to write to file.
3. Set your min/max sampling temporarily to 1/64 and 1/64 for a really fast render (FG quality will not be affected by this!)
4. Render.
5. Set back original sampling (and resolution).
6. Set the FG map to "Read Only"
7. Run the script to do your "split render".

Hope this helps anyone stuck in "cannot lender large resolutions" land.



Enjoy.

/Z

Labels: , , ,

25 Comments:

Blogger Glacierise (a.k.a. Hristo Velev) said...

Nice one, MasterZ. Will use it on some billboards :D

Thu Jun 14, 11:30:00 PM CEST  
Blogger Mark said...

do you have a maya version of the script.

I am trying to do 4k on mac mini's and have been beating my head against the screen, wiping off the blood and hitting it again. =\

Wed Jun 20, 01:52:00 AM CEST  
Blogger ivorm said...

Hi,

I am trying to download Zap's script, but the links doesn't work.

Does someone else have a copy of this script. I need it in a hurry!

Thks,
Les

Mon Jun 25, 11:36:00 PM CEST  
Blogger Mark said...

here is the source code for the script that I found MasterZap posted on another forum

copy the script, open notepad, paste and save as a .ms file:

rollout SplitRender "Split Render Tool" width:250 height:100
(
radiobuttons splitcount "Pieces to split render in:" labels:#("1", "4", "9", "16") default:2
spinner width "Total width:" type:#integer range:[0,32000,3000]
spinner height "Total height:" type:#integer range:[0,32000,2400]
spinner overlap "Pixel overlap:" type:#integer

checkbutton show "Show image while rendering" checked:on

edittext filename "File name:" text:"my_filename"
edittext extension "File type:" text:".jpg"

button doRender "Do the render"

on doRender pressed do (
a = splitcount.state
b = splitcount.state * splitcount.state
-- actual render width and height
w = width.value / a
h = height.value / a

bm = bitmap w h
p = overlap.value - 1

for i=0 to b-1 do
(
row = i / a
col = i - floor(row) * a

render renderType:#blowup region:#((w/a)*col,(h/a)*row,w/a*(col+1)+p,(h/a)*(row+1)+p) outputwidth:w outputheight:h outputfile:(filename.text + row as string + col as string + extension.text) vfb:show.checked progressbar:(not show.checked) to:bm
)
unDisplay bm
)
)

-- create the rollout window and add the rollout
if splitRenderFloater != undefined do
(
closerolloutfloater splitRenderFloater
)
SplitRenderFloater = newRolloutFloater "Split Render Tool" 250 225
addRollout SplitRender SplitRenderFloater

Tue Jun 26, 02:02:00 AM CEST  
Blogger Mark said...

here is the forum

http://www.mymentalray.com/forum/showthread.php?p=2840

Tue Jun 26, 02:05:00 AM CEST  
Blogger Master Zap said...

Link should work now, methinks.

/Z

Thu Jun 28, 08:13:00 AM CEST  
Blogger Mark said...

any word if there is a maya version in the works????

Fri Jun 29, 09:51:00 PM CEST  
Blogger Mark said...

MasterZ, is there any possibility to get a maya version?????????????????????????????????????????????????

Thu Jul 12, 02:36:00 AM CEST  
Blogger Jomar said...

Thank you for this very helpfull tip! Congrats! :)

Jomar Machado

Tue Jul 24, 08:02:00 PM CEST  
Blogger mak 21 said...

I have tried the script in 3dsmax 9 and 3dsmax 8
It works, but I have a small problem.
The images are not saved.
I have tried in various ways, but at the end of the render
the windows of image are automatically closed
and I don't have any lifesaving run to use in the script
You as you do?
Thanks

Sun Jul 29, 03:57:00 PM CEST  
Blogger mak 21 said...

Now i can save the rendering
All ok !

Tue Jul 31, 03:01:00 PM CEST  
Blogger devendra said...

this script worked well with me also in max9 but where does it saves the file?

Sun Aug 12, 02:18:00 PM CEST  
Blogger devendra said...

I got it, its saves to default max folder for screen shots!!

Mon Aug 13, 10:34:00 AM CEST  
Blogger Paul said...

I am a Max/Mental Ray newbie and I've been having this problem! Thanks so much for the help, I can't wait to try out the script.

Thu Aug 16, 04:49:00 PM CEST  
Blogger Oğuz Birgoren said...

Thank you Zap.. How come such a Very Very handy tool/script like this cannot be a standard tool regarding the 32bit incapabilities. You're a life saver. You know you can sell this though :D..

Sat Oct 06, 12:59:00 PM CEST  
Blogger James said...

I have read these comments and still cannot find the folder where the images are saved... please help! Thx in advance...

Thu Nov 15, 11:38:00 PM CET  
Blogger ronWu said...

Hello Zap

Thank you for the script but I had a hard time to find where it puts the outcome -

this is the place where I found it.

C:\Documents and Settings\rwu\Mijn documenten(my documents)\3dsmax\sceneassets\images

Mon Nov 19, 01:12:00 PM CET  
Blogger James said...

I finally found those images... I had to search my harddrive for all .jpegs and they turned out to be in a folder on my desktop called newfolder2... weird, but at least I konw where they are going now!

Thx for the great script!

Wed Nov 21, 11:12:00 PM CET  
Blogger Jonathan said...

Does this script work with a render farm? I am looking for a way to split up a huge image over a farm. I use the split scan lines option, but I still get blank buckets back, so I am looking for a way to ease the memory use or something.

Thu Aug 21, 07:02:00 PM CEST  
Blogger izgubljeni23 said...

Nice script, however I have a problem with it. The tiles that I get don't match up nicely. I position them correctly on the center but then I see edges at the sides where the two tiles meet. Any workaround?

Tue Nov 18, 11:06:00 PM CET  
Blogger izgubljeni23 said...

NVM I figured it out, there's some bug in maxscript or your script.

Fri Nov 28, 12:38:00 AM CET  
Blogger Rocky said...

Hello, is there anyone who can tell me scripts related to Revit and Max Design 2009, which automate and optimize the revit model in Max.

Wed Dec 24, 04:34:00 PM CET  
Blogger Thomas said...

Hi!
The script really is useful, great work. However I get no overlap to the image tiles, if I write, say 10pixels, the image tiles do not change size.
As the previous poster I also have situations where tiles do not meet exactly, but the overlap will cure that I think.

/Thomas

Tue Feb 24, 08:36:00 AM CET  
Blogger David Le Cardinal said...

Nice Tip and works great!

small question: does the script put the tiles together when it's rendered? or do I have to get them in Photoshop (I did it, but I don't want do it everytimes :) )

If not, I learn Maxscript to do it :) :D

Fri Apr 24, 09:19:00 PM CEST  
Blogger Pyro777 said...

Is there a way to create a rendering larger than 32,000 px wide?....say 36,000


Thanks,

Dean

Wed May 13, 07:18:00 PM CEST  

Post a Comment

Links to this post:

Create a Link

<< Home